Title: [168030] branches/safari-537.76-branch

Diff

Modified: branches/safari-537.76-branch/Source/WebCore/ChangeLog (168029 => 168030)


--- branches/safari-537.76-branch/Source/WebCore/ChangeLog	2014-04-30 17:26:45 UTC (rev 168029)
+++ branches/safari-537.76-branch/Source/WebCore/ChangeLog	2014-04-30 17:30:15 UTC (rev 168030)
@@ -1,5 +1,10 @@
 2014-04-30  Lucas Forschler  <lforsch...@apple.com>
 
+    Rollout r168020.
+    This causes build failures on Lion/ML.  
+
+2014-04-30  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r166049
 
     2014-03-21  Andreas Kling  <akl...@apple.com>

Modified: branches/safari-537.76-branch/Source/WebCore/WebCore.exp.in (168029 => 168030)


--- branches/safari-537.76-branch/Source/WebCore/WebCore.exp.in	2014-04-30 17:26:45 UTC (rev 168029)
+++ branches/safari-537.76-branch/Source/WebCore/WebCore.exp.in	2014-04-30 17:30:15 UTC (rev 168030)
@@ -767,7 +767,7 @@
 __ZN7WebCore23MutableStylePropertySetD1Ev
 __ZN7WebCore23SynchronousLoaderClient24platformBadResponseErrorEv
 __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0ENS2_15CrashOnOverflowEEE
-__ZN7WebCore23dataForURLComponentTypeEP5NSURL18CFURLComponentType
+__ZN7WebCore23dataForURLComponentTypeEP5NSURLl
 __ZN7WebCore23decodeHostNameWithRangeEP8NSString8_NSRange
 __ZN7WebCore23encodeHostNameWithRangeEP8NSString8_NSRange
 __ZN7WebCore23getHostnamesWithCookiesERKNS_21NetworkStorageSessionERN3WTF7HashSetINS3_6StringENS3_10StringHashENS3_10HashTraitsIS5_EEEE
@@ -828,7 +828,7 @@
 __ZN7WebCore3macERKNS_10CredentialE
 __ZN7WebCore3macERKNS_23AuthenticationChallengeE
 __ZN7WebCore40restrictMinimumScaleFactorToViewportSizeERNS_18ViewportAttributesENS_7IntSizeEf
-__ZN7WebCore42URLByTruncatingOneCharacterBeforeComponentEP5NSURL18CFURLComponentType
+__ZN7WebCore42URLByTruncatingOneCharacterBeforeComponentEP5NSURLl
 __ZN7WebCore47attributedStringByStrippingAttachmentCharactersEP18NSAttributedString
 __ZN7WebCore4Font11setCodePathENS0_8CodePathE
 __ZN7WebCore4Font18shouldUseSmoothingEv

Modified: branches/safari-537.76-branch/Source/WebCore/platform/mac/WebCoreNSURLExtras.h (168029 => 168030)


--- branches/safari-537.76-branch/Source/WebCore/platform/mac/WebCoreNSURLExtras.h	2014-04-30 17:26:45 UTC (rev 168029)
+++ branches/safari-537.76-branch/Source/WebCore/platform/mac/WebCoreNSURLExtras.h	2014-04-30 17:30:15 UTC (rev 168030)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2007, 2012, 2014 Apple, Inc. All rights reserved.
+ * Copyright (C) 2005, 2007, 2012 Apple, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,13 +26,20 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <objc/objc.h>
+
+#ifdef __OBJC__
 @class NSString;
 @class NSURL;
+#else
+OBJC_CLASS(NSString);
+OBJC_CLASS(NSURL);
+#endif
 
 namespace WebCore {
 
 NSString *userVisibleString(NSURL *);
-NSURL *URLWithUserTypedString(NSString *, NSURL *baseURL);
+NSURL *URLWithUserTypedString(NSString *, NSURL *);
 NSURL *URLByRemovingUserInfo(NSURL *);
 BOOL hostNameNeedsDecodingWithRange(NSString *, NSRange);
 BOOL hostNameNeedsEncodingWithRange(NSString *, NSRange);
@@ -40,10 +47,10 @@
 NSString *encodeHostNameWithRange(NSString *, NSRange);
 NSString *decodeHostName(NSString *);
 NSString *encodeHostName(NSString *);
-NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *, CFURLComponentType);
+NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *, CFIndex);
 NSURL *URLWithData(NSData *, NSURL *baseURL);
 NSData *originalURLData(NSURL *);
-NSData *dataForURLComponentType(NSURL *, CFURLComponentType);
+NSData *dataForURLComponentType(NSURL *, CFIndex);
 BOOL isUserVisibleURL(NSString *);
     
 } // namespace WebCore

Modified: branches/safari-537.76-branch/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm (168029 => 168030)


--- branches/safari-537.76-branch/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm	2014-04-30 17:26:45 UTC (rev 168029)
+++ branches/safari-537.76-branch/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm	2014-04-30 17:30:15 UTC (rev 168030)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2007, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -50,95 +50,48 @@
 
 namespace WebCore {
 
-static BOOL isLookalikeCharacter(UChar32 charCode)
+static inline BOOL isLookalikeCharacter(int charCode)
 {
     // This function treats the following as unsafe, lookalike characters:
-    // any non-printable character, any character considered as whitespace,
+    // any non-printable character, any character considered as whitespace that isn't already converted to a space by ICU, 
     // any ignorable character, and emoji characters related to locks.
     
-    // We also considered the characters in Mozilla's blacklist <http://kb.mozillazine.org/Network.IDN.blacklist_chars>.
-
-    // Some of the characters here will never appear once ICU has encoded.
-    // For example, ICU transforms most spaces into an ASCII space and most
-    // slashes into an ASCII solidus. But one of the two callers uses this
-    // on characters that have not been processed by ICU, so they are needed here.
+    // We also considered the characters in Mozilla's blacklist (http://kb.mozillazine.org/Network.IDN.blacklist_chars), 
+    // and included all of these characters that ICU can encode.
     
     if (!u_isprint(charCode) || u_isUWhiteSpace(charCode) || u_hasBinaryProperty(charCode, UCHAR_DEFAULT_IGNORABLE_CODE_POINT))
         return YES;
     
     switch (charCode) {
-        case 0x00BC: /* VULGAR FRACTION ONE QUARTER */
-        case 0x00BD: /* VULGAR FRACTION ONE HALF */
-        case 0x00BE: /* VULGAR FRACTION THREE QUARTERS */
         case 0x00ED: /* LATIN SMALL LETTER I WITH ACUTE */
         case 0x01C3: /* LATIN LETTER RETROFLEX CLICK */
         case 0x0251: /* LATIN SMALL LETTER ALPHA */
         case 0x0261: /* LATIN SMALL LETTER SCRIPT G */
-        case 0x02D0: /* MODIFIER LETTER TRIANGULAR COLON */
         case 0x0335: /* COMBINING SHORT STROKE OVERLAY */
         case 0x0337: /* COMBINING SHORT SOLIDUS OVERLAY */
         case 0x0338: /* COMBINING LONG SOLIDUS OVERLAY */
-        case 0x0589: /* ARMENIAN FULL STOP */
         case 0x05B4: /* HEBREW POINT HIRIQ */
         case 0x05BC: /* HEBREW POINT DAGESH OR MAPIQ */
         case 0x05C3: /* HEBREW PUNCTUATION SOF PASUQ */
         case 0x05F4: /* HEBREW PUNCTUATION GERSHAYIM */
-        case 0x0609: /* ARABIC-INDIC PER MILLE SIGN */
-        case 0x060A: /* ARABIC-INDIC PER TEN THOUSAND SIGN */
         case 0x0660: /* ARABIC INDIC DIGIT ZERO */
-        case 0x066A: /* ARABIC PERCENT SIGN */
         case 0x06D4: /* ARABIC FULL STOP */
         case 0x06F0: /* EXTENDED ARABIC INDIC DIGIT ZERO */
-        case 0x0701: /* SYRIAC SUPRALINEAR FULL STOP */
-        case 0x0702: /* SYRIAC SUBLINEAR FULL STOP */
-        case 0x0703: /* SYRIAC SUPRALINEAR COLON */
-        case 0x0704: /* SYRIAC SUBLINEAR COLON */
-        case 0x1735: /* PHILIPPINE SINGLE PUNCTUATION */
-        case 0x2024: /* ONE DOT LEADER */
         case 0x2027: /* HYPHENATION POINT */
         case 0x2039: /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */
         case 0x203A: /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */
-        case 0x2041: /* CARET INSERTION POINT */
         case 0x2044: /* FRACTION SLASH */
-        case 0x2052: /* COMMERCIAL MINUS SIGN */
-        case 0x2153: /* VULGAR FRACTION ONE THIRD */
-        case 0x2154: /* VULGAR FRACTION TWO THIRDS */
-        case 0x2155: /* VULGAR FRACTION ONE FIFTH */
-        case 0x2156: /* VULGAR FRACTION TWO FIFTHS */
-        case 0x2157: /* VULGAR FRACTION THREE FIFTHS */
-        case 0x2158: /* VULGAR FRACTION FOUR FIFTHS */
-        case 0x2159: /* VULGAR FRACTION ONE SIXTH */
-        case 0x215A: /* VULGAR FRACTION FIVE SIXTHS */
-        case 0x215B: /* VULGAR FRACTION ONE EIGHT */
-        case 0x215C: /* VULGAR FRACTION THREE EIGHTHS */
-        case 0x215D: /* VULGAR FRACTION FIVE EIGHTHS */
-        case 0x215E: /* VULGAR FRACTION SEVEN EIGHTHS */
-        case 0x215F: /* FRACTION NUMERATOR ONE */
         case 0x2215: /* DIVISION SLASH */
         case 0x2216: /* SET MINUS */
-        case 0x2236: /* RATIO */
         case 0x233F: /* APL FUNCTIONAL SYMBOL SLASH BAR */
         case 0x23AE: /* INTEGRAL EXTENSION */
         case 0x244A: /* OCR DOUBLE BACKSLASH */
         case 0x2571: /* BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT */
         case 0x2572: /* BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT */
-        case 0x29F6: /* SOLIDUS WITH OVERBAR */
         case 0x29F8: /* BIG SOLIDUS */
+        case 0x29f6: /* SOLIDUS WITH OVERBAR */
         case 0x2AFB: /* TRIPLE SOLIDUS BINARY RELATION */
         case 0x2AFD: /* DOUBLE SOLIDUS OPERATOR */
-        case 0x2FF0: /* IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT */
-        case 0x2FF1: /* IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO BELOW */
-        case 0x2FF2: /* IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO MIDDLE AND RIGHT */
-        case 0x2FF3: /* IDEOGRAPHIC DESCRIPTION CHARACTER ABOVE TO MIDDLE AND BELOW */
-        case 0x2FF4: /* IDEOGRAPHIC DESCRIPTION CHARACTER FULL SURROUND */
-        case 0x2FF5: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM ABOVE */
-        case 0x2FF6: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM BELOW */
-        case 0x2FF7: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LEFT */
-        case 0x2FF8: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM UPPER LEFT */
-        case 0x2FF9: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM UPPER RIGHT */
-        case 0x2FFA: /* IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LOWER LEFT */
-        case 0x2FFB: /* IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID */
-        case 0x3002: /* IDEOGRAPHIC FULL STOP */
         case 0x3008: /* LEFT ANGLE BRACKET */
         case 0x3014: /* LEFT TORTOISE SHELL BRACKET */
         case 0x3015: /* RIGHT TORTOISE SHELL BRACKET */
@@ -146,21 +99,12 @@
         case 0x3035: /* VERTICAL KANA REPEAT MARK LOWER HALF */
         case 0x321D: /* PARENTHESIZED KOREAN CHARACTER OJEON */
         case 0x321E: /* PARENTHESIZED KOREAN CHARACTER O HU */
-        case 0x33AE: /* SQUARE RAD OVER S */
-        case 0x33AF: /* SQUARE RAD OVER S SQUARED */
-        case 0x33C6: /* SQUARE C OVER KG */
         case 0x33DF: /* SQUARE A OVER M */
-        case 0xA789: /* MODIFIER LETTER COLON */
         case 0xFE14: /* PRESENTATION FORM FOR VERTICAL SEMICOLON */
         case 0xFE15: /* PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK */
         case 0xFE3F: /* PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET */
         case 0xFE5D: /* SMALL LEFT TORTOISE SHELL BRACKET */
         case 0xFE5E: /* SMALL RIGHT TORTOISE SHELL BRACKET */
-        case 0xFF0E: /* FULLWIDTH FULL STOP */
-        case 0xFF0F: /* FULL WIDTH SOLIDUS */
-        case 0xFF61: /* HALFWIDTH IDEOGRAPHIC FULL STOP */
-        case 0xFFFC: /* OBJECT REPLACEMENT CHARACTER */
-        case 0xFFFD: /* REPLACEMENT CHARACTER */
         case 0x1F50F: /* LOCK WITH INK PEN */
         case 0x1F510: /* CLOSED LOCK WITH KEY */
         case 0x1F511: /* KEY */
@@ -567,12 +511,12 @@
     return trimmed;
 }
 
-NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *URL, CFURLComponentType component)
+NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *URL, CFIndex component)
 {
     if (!URL)
         return nil;
     
-    CFRange fragRg = CFURLGetByteRangeForComponent((CFURLRef)URL, component, NULL);
+    CFRange fragRg = CFURLGetByteRangeForComponent((CFURLRef)URL, static_cast<CFURLComponentType>(component), NULL);
     if (fragRg.location == kCFNotFound)
         return URL;
     
@@ -624,7 +568,7 @@
         if (!result)
             result = HardAutorelease(CFURLCreateAbsoluteURLWithBytes(NULL, bytes, length, kCFStringEncodingISOLatin1, (CFURLRef)baseURL, YES));
     } else
-        result = [NSURL URLWithString:@""];
+            result = [NSURL URLWithString:@""];
                 
     return result;
 }
@@ -676,7 +620,7 @@
 
 #define completeURL (CFURLComponentType)-1
 
-NSData *dataForURLComponentType(NSURL *URL, CFURLComponentType componentType)
+NSData *dataForURLComponentType(NSURL *URL, CFIndex componentType)
 {
     static int URLComponentTypeBufferLength = 2048;
     
@@ -692,7 +636,7 @@
     
     CFRange range;
     if (componentType != completeURL) {
-        range = CFURLGetByteRangeForComponent((CFURLRef)URL, componentType, NULL);
+        range = CFURLGetByteRangeForComponent((CFURLRef)URL, static_cast<CFURLComponentType>(componentType), NULL);
         if (range.location == kCFNotFound)
             return nil;
     } else {
@@ -833,7 +777,7 @@
     const unsigned char *before = static_cast<const unsigned char*>([data bytes]);
     int length = [data length];
     
-    bool mayNeedHostNameDecoding = false;
+    bool needsHostNameDecoding = false;
     
     const unsigned char *p = before;
     int bufferLength = (length * 3) + 1;
@@ -858,8 +802,8 @@
             *q++ = c;
             
             // Check for "xn--" in an efficient, non-case-sensitive, way.
-            if (c == '-' && i >= 3 && !mayNeedHostNameDecoding && (q[-4] | 0x20) == 'x' && (q[-3] | 0x20) == 'n' && q[-2] == '-')
-                mayNeedHostNameDecoding = true;
+            if (c == '-' && i >= 3 && !needsHostNameDecoding && (q[-4] | 0x20) == 'x' && (q[-3] | 0x20) == 'n' && q[-2] == '-')
+                needsHostNameDecoding = true;
         }
     }
     *q = '\0';
@@ -892,8 +836,7 @@
     
     free(after);
     
-    if (mayNeedHostNameDecoding)
-        result = mapHostNames(result, NO);
+    result = mapHostNames(result, !needsHostNameDecoding);
     result = [result precomposedStringWithCanonicalMapping];
     return HardAutorelease(createStringWithEscapedUnsafeCharacters((CFStringRef)result));
 }

Modified: branches/safari-537.76-branch/Tools/ChangeLog (168029 => 168030)


--- branches/safari-537.76-branch/Tools/ChangeLog	2014-04-30 17:26:45 UTC (rev 168029)
+++ branches/safari-537.76-branch/Tools/ChangeLog	2014-04-30 17:30:15 UTC (rev 168030)
@@ -1,5 +1,9 @@
 2014-04-30  Lucas Forschler  <lforsch...@apple.com>
 
+    Rollout r168020
+
+2014-04-30  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r167211
 
     2014-04-13  Darin Adler  <da...@apple.com>

Modified: branches/safari-537.76-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (168029 => 168030)


--- branches/safari-537.76-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2014-04-30 17:26:45 UTC (rev 168029)
+++ branches/safari-537.76-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2014-04-30 17:30:15 UTC (rev 168030)
@@ -114,7 +114,6 @@
 		9331407C17B4419000F083B1 /* DidNotHandleKeyDown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9331407B17B4419000F083B1 /* DidNotHandleKeyDown.cpp */; };
 		9361002914DC95A70061379D /* lots-of-iframes.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9361002814DC957B0061379D /* lots-of-iframes.html */; };
 		939BA91714103412001A01BD /* DeviceScaleFactorOnBack.mm in Sources */ = {isa = PBXBuildFile; fileRef = 939BA91614103412001A01BD /* DeviceScaleFactorOnBack.mm */; };
-		93A7EB3D18FA63A4009E7670 /* URLExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93A7EB3C18FA63A4009E7670 /* URLExtras.mm */; };
 		93ABA80916DDAB91002DB2FA /* StringHasher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABA80816DDAB91002DB2FA /* StringHasher.cpp */; };
 		93AF4ECE1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4ECD1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp */; };
 		93AF4ED01506F123007FD57E /* lots-of-images.html in Resources */ = {isa = PBXBuildFile; fileRef = 93AF4ECF1506F123007FD57E /* lots-of-images.html */; };
@@ -424,7 +423,6 @@
 		9361002814DC957B0061379D /* lots-of-iframes.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "lots-of-iframes.html"; sourceTree = "<group>"; };
 		939BA91614103412001A01BD /* DeviceScaleFactorOnBack.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeviceScaleFactorOnBack.mm; sourceTree = "<group>"; };
 		93ABA80816DDAB91002DB2FA /* StringHasher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringHasher.cpp; path = WTF/StringHasher.cpp; sourceTree = "<group>"; };
-		93A7EB3C18FA63A4009E7670 /* URLExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = URLExtras.mm; sourceTree = "<group>"; };
 		93AF4ECA1506F035007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFirstVisuallyNonEmptyLayoutForImages.cpp; sourceTree = "<group>"; };
 		93AF4ECD1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp; sourceTree = "<group>"; };
 		93AF4ECF1506F123007FD57E /* lots-of-images.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "lots-of-images.html"; sourceTree = "<group>"; };
@@ -927,7 +925,6 @@
 				3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */,
 				37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */,
 				E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */,
-				93A7EB3C18FA63A4009E7670 /* URLExtras.mm */,
 				51FBBB4C1513D4E900822738 /* WebViewCanPasteURL.mm */,
 				C2EB2DD116CAC7AC009B52EE /* WebViewDidCreateJavaScriptContext.mm */,
 				37E38C33169B7D010084C28C /* WebViewDidRemoveFrameFromHierarchy.mm */,
@@ -1233,7 +1230,6 @@
 				BC3C4C7F14587AA60025FB62 /* WKBrowsingContextGroupTest.mm in Sources */,
 				BC3C4C7214575B6A0025FB62 /* WKBrowsingContextLoadDelegateTest.mm in Sources */,
 				BC901E241492ADCE0074A667 /* WKConnection.cpp in Sources */,
-				93A7EB3D18FA63A4009E7670 /* URLExtras.mm in Sources */,
 				51E93017156B13E1004C99DF /* WKPageGetScaleFactorNotZero.cpp in Sources */,
 				BC7B61AA129A038700D174A4 /* WKPreferences.cpp in Sources */,
 				BC90995E12567BC100083756 /* WKString.cpp in Sources */,

Deleted: branches/safari-537.76-branch/Tools/TestWebKitAPI/Tests/mac/URLExtras.mm (168029 => 168030)


--- branches/safari-537.76-branch/Tools/TestWebKitAPI/Tests/mac/URLExtras.mm	2014-04-30 17:26:45 UTC (rev 168029)
+++ branches/safari-537.76-branch/Tools/TestWebKitAPI/Tests/mac/URLExtras.mm	2014-04-30 17:30:15 UTC (rev 168030)
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-
-#import <WebCore/WebCoreNSURLExtras.h>
-
-namespace TestWebKitAPI {
-
-static NSData *literalAsData(const char* literal)
-{
-    return [NSData dataWithBytes:literal length:strlen(literal)];
-}
-
-static const char* dataAsString(NSData *data)
-{
-    static char buffer[1000];
-    if ([data length] > sizeof(buffer) - 1)
-        return "ERROR";
-    if (memchr([data bytes], 0, [data length]))
-        return "ERROR";
-    memcpy(buffer, [data bytes], [data length]);
-    buffer[[data length]] = '\0';
-    return buffer;
-}
-
-static const char* originalDataAsString(NSURL *URL)
-{
-    return dataAsString(WebCore::originalURLData(URL));
-}
-
-static const char* userVisibleString(NSURL *URL)
-{
-    return [WebCore::userVisibleString(URL) UTF8String];
-}
-
-static NSURL *literalURL(const char* literal)
-{
-    return WebCore::URLWithData(literalAsData(literal), nil);
-}
-
-TEST(WebCore, URLExtras)
-{
-    EXPECT_STREQ("http://site.com", originalDataAsString(literalURL("http://site.com")));
-    EXPECT_STREQ("http://%77ebsite.com", originalDataAsString(literalURL("http://%77ebsite.com")));
-
-    EXPECT_STREQ("http://site.com", userVisibleString(literalURL("http://site.com")));
-    EXPECT_STREQ("http://%77ebsite.com", userVisibleString(literalURL("http://%77ebsite.com")));
-}
-
-TEST(WebCore, URLExtras_DivisionSign)
-{
-    // Selected the division sign as an example of a non-ASCII character that is allowed in host names, since it's a lookalike character.
-
-    // Code path similar to the one used when typing in a URL.
-    EXPECT_STREQ("http://site.xn--comothersite-kjb.org", originalDataAsString(WebCore::URLWithUserTypedString(@"http://site.com\xC3\xB7othersite.org", nil)));
-    EXPECT_STREQ("http://site.com\xC3\xB7othersite.org", userVisibleString(WebCore::URLWithUserTypedString(@"http://site.com\xC3\xB7othersite.org", nil)));
-
-    // Code paths similar to the ones used for URLs found in webpages or HTTP responses.
-    EXPECT_STREQ("http://site.com\xC3\xB7othersite.org", originalDataAsString(literalURL("http://site.com\xC3\xB7othersite.org")));
-    EXPECT_STREQ("http://site.com\xC3\xB7othersite.org", userVisibleString(literalURL("http://site.com\xC3\xB7othersite.org")));
-    EXPECT_STREQ("http://site.com%C3%B7othersite.org", originalDataAsString(literalURL("http://site.com%C3%B7othersite.org")));
-    EXPECT_STREQ("http://site.com\xC3\xB7othersite.org", userVisibleString(literalURL("http://site.com%C3%B7othersite.org")));
-
-    // Separate functions that deal with just a host name on its own.
-    EXPECT_STREQ("site.xn--comothersite-kjb.org", [WebCore::encodeHostName(@"site.com\xC3\xB7othersite.org") UTF8String]);
-    EXPECT_STREQ("site.com\xC3\xB7othersite.org", [WebCore::decodeHostName(@"site.com\xC3\xB7othersite.org") UTF8String]);
-}
-
-TEST(WebCore, URLExtras_Solidus)
-{
-    // Selected full width solidus, which looks like the solidus, which is the character that indicates the end of the host name.
-
-    // Code path similar to the one used when typing in a URL.
-    EXPECT_STREQ("http://site.com/othersite.org", originalDataAsString(WebCore::URLWithUserTypedString(@"http://site.com\xEF\xBC\x8Fothersite.org", nil)));
-    EXPECT_STREQ("http://site.com/othersite.org", userVisibleString(WebCore::URLWithUserTypedString(@"http://site.com\xEF\xBC\x8Fothersite.org", nil)));
-
-    // Code paths similar to the ones used for URLs found in webpages or HTTP responses.
-    EXPECT_STREQ("http://site.com\xEF\xBC\x8Fothersite.org", originalDataAsString(literalURL("http://site.com\xEF\xBC\x8Fothersite.org")));
-    EXPECT_STREQ("http://site.com%EF%BC%8Fothersite.org", userVisibleString(literalURL("http://site.com\xEF\xBC\x8Fothersite.org")));
-    EXPECT_STREQ("http://site.com%EF%BC%8Fothersite.org", originalDataAsString(literalURL("http://site.com%EF%BC%8Fothersite.org")));
-    EXPECT_STREQ("http://site.com%EF%BC%8Fothersite.org", userVisibleString(literalURL("http://site.com%EF%BC%8Fothersite.org")));
-
-    // Separate functions that deal with just a host name on its own.
-    EXPECT_STREQ("site.com/othersite.org", [WebCore::encodeHostName(@"site.com\xEF\xBC\x8Fothersite.org") UTF8String]);
-    EXPECT_STREQ("site.com\xEF\xBC\x8Fothersite.org", [WebCore::decodeHostName(@"site.com\xEF\xBC\x8Fothersite.org") UTF8String]);
-}
-
-TEST(WebCore, URLExtras_Space)
-{
-    // Selected ideographic space, which looks like the ASCII space, which is not allowed unescaped.
-
-    // Code path similar to the one used when typing in a URL.
-    EXPECT_STREQ("http://site.com%20othersite.org", originalDataAsString(WebCore::URLWithUserTypedString(@"http://site.com\xE3\x80\x80othersite.org", nil)));
-    EXPECT_STREQ("http://site.com%20othersite.org", userVisibleString(WebCore::URLWithUserTypedString(@"http://site.com\xE3\x80\x80othersite.org", nil)));
-
-    // Code paths similar to the ones used for URLs found in webpages or HTTP responses.
-    EXPECT_STREQ("http://site.com\xE3\x80\x80othersite.org", originalDataAsString(literalURL("http://site.com\xE3\x80\x80othersite.org")));
-    EXPECT_STREQ("http://site.com%E3%80%80othersite.org", userVisibleString(literalURL("http://site.com\xE3\x80\x80othersite.org")));
-    EXPECT_STREQ("http://site.com%E3%80%80othersite.org", originalDataAsString(literalURL("http://site.com%E3%80%80othersite.org")));
-    EXPECT_STREQ("http://site.com%E3%80%80othersite.org", userVisibleString(literalURL("http://site.com%E3%80%80othersite.org")));
-
-    // Separate functions that deal with just a host name on its own.
-    EXPECT_STREQ("site.com othersite.org", [WebCore::encodeHostName(@"site.com\xE3\x80\x80othersite.org") UTF8String]);
-    EXPECT_STREQ("site.com\xE3\x80\x80othersite.org", [WebCore::decodeHostName(@"site.com\xE3\x80\x80othersite.org") UTF8String]);
-}
-
-} // namespace TestWebKitAPI
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to