Changeset 23963 in webkit


Ignore:
Timestamp:
Jul 3, 2007 4:16:02 PM (17 years ago)
Author:
adele
Message:

LayoutTests:

Reviewed by Darin.

Test for: <rdar://problem/5292988> domain names shouldn't contain ignorable characters

  • fast/encoding/idn-security-expected.txt: Added.
  • fast/encoding/idn-security.html: Added.
  • win/Skipped: Blocked by <rdar://problem/5301954>.

WebKit:

Reviewed by Darin.

Fix for: <rdar://problem/5292988> domain names shouldn't contain ignorable characters

  • Misc/WebNSURLExtras.m: (isLookalikeCharacter): Renamed. Also excludes any non-printable character, any character considered as whitespace that isn't already converted to a space by ICU, any ignorable character, and any character excluded in Mozilla's blacklist: http://kb.mozillazine.org/Network.IDN.blacklist_chars (allCharactersInIDNScriptWhiteList):

WebKitTools:

Reviewed by Darin.

Extended DumpRenderTree to test encoding and decoding host names.

  • DumpRenderTree/DumpRenderTree.m: (+[LayoutTestController isSelectorExcludedFromWebScript:]): Added cases for encodeHostName and decodeHostName. (+[LayoutTestController webScriptNameForSelector:]): ditto. (-[LayoutTestController decodeHostName:]): Added. (-[LayoutTestController encodeHostName:]): Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r23960 r23963  
     12007-07-03  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        Test for: <rdar://problem/5292988> domain names shouldn't contain ignorable characters
     6
     7        * fast/encoding/idn-security-expected.txt: Added.
     8        * fast/encoding/idn-security.html: Added.
     9        * win/Skipped: Blocked by <rdar://problem/5301954>.
     10
    1112007-07-03  Sam Weinig  <sam@webkit.org>
    212
  • trunk/LayoutTests/win/Skipped

    r23941 r23963  
    648648# Crash in CMM8Bit3ChanNoConvEncoder::InnerDoEncode
    649649fast/css/contentDivWithChildren.html
     650
     651# Need to add functionality to DumpRenderTree to test IDN <rdar://problem/5301954>
     652fast/encoding/idn-security.html
  • trunk/WebKit/ChangeLog

    r23957 r23963  
     12007-07-03  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        Fix for: <rdar://problem/5292988> domain names shouldn't contain ignorable characters
     6
     7        * Misc/WebNSURLExtras.m:
     8        (isLookalikeCharacter): Renamed.  Also excludes any non-printable character,
     9         any character considered as whitespace that isn't already converted to a space by ICU, any ignorable character,
     10         and any character excluded in Mozilla's blacklist: http://kb.mozillazine.org/Network.IDN.blacklist_chars
     11        (allCharactersInIDNScriptWhiteList):
     12
    1132007-07-03  Darin Adler  <darin@apple.com>
    214
  • trunk/WebKit/Misc/WebNSURLExtras.m

    r23747 r23963  
    5757static uint32_t IDNScriptWhiteList[(USCRIPT_CODE_LIMIT + 31) / 32];
    5858
    59 static inline BOOL isSlashOrPeriodLookalike(int charCode)
     59static inline BOOL isLookalikeCharacter(int charCode)
    6060{
    6161// FIXME: Move this code down into WebCore so it can be shared with other platforms.
    62 /*
    63     There are a few characters that look like they should belong in this list,
    64     but the IDN functions in ICU convert them to the plain ASCII equivalent
    65    
    66     Fullwidth Solidus   0xFF0F
    67     One Dot Leader      0x2024
    68     Small Full Stop     0xFE52
    69     Fullwidth Full Stop 0xFF0E
    70 */
     62
     63// This function treats the following as unsafe, lookalike characters:
     64// any non-printable character, any character considered as whitespace that isn't already converted to a space by ICU,
     65// any ignorable character, and any character excluded in Mozilla's blacklist: http://kb.mozillazine.org/Network.IDN.blacklist_chars
     66
     67    if (!u_isprint(charCode) || u_isUWhiteSpace(charCode) || u_hasBinaryProperty(charCode, UCHAR_DEFAULT_IGNORABLE_CODE_POINT))
     68        return YES;
     69
    7170    switch (charCode) {
    72         case 0x2215: /* Division Slash */
    73         case 0x2044: /* Fraction Slash */
    74         case 0x2571: /* Box Drawings Light Diagonal Upper Right To Lower Left */
    75         case 0x0337: /* Combining Short Solidus Overlay */
    76         case 0x0338: /* Combining Long Solidus Overlay */
    77         case 0x29F8: /* Big Solidus */
    78         case 0x0660: /* Arabic Indic Digit Zero */
    79         case 0x06F0: /* Extended Arabic Indic Digit Zero */
    80         case 0x05B4: /* Hebrew Point Hiriq */
    81         case 0x05BC: /* Hebrew Point Dagesh Or Mapiq */
     71        case 0x01C3: /* LATIN LETTER RETROFLEX CLICK */
     72        case 0x0337: /* COMBINING SHORT SOLIDUS OVERLAY */
     73        case 0x0338: /* COMBINING LONG SOLIDUS OVERLAY */
     74        case 0x05B4: /* HEBREW POINT HIRIQ */
     75        case 0x05BC: /* HEBREW POINT DAGESH OR MAPIQ */
     76        case 0x05C3: /* HEBREW PUNCTUATION SOF PASUQ */
     77        case 0x05F4: /* HEBREW PUNCTUATION GERSHAYIM */
     78        case 0x0660: /* ARABIC INDIC DIGIT ZERO */
     79        case 0x06D4: /* ARABIC FULL STOP */
     80        case 0x06F0: /* EXTENDED ARABIC INDIC DIGIT ZERO */
     81        case 0x2027: /* HYPHENATION POINT */
     82        case 0x2039: /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */
     83        case 0x203A: /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */
     84        case 0x2044: /* FRACTION SLASH */
     85        case 0x2215: /* DIVISION SLASH */
     86        case 0x23ae: /* INTEGRAL EXTENSION */
     87        case 0x2571: /* BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT */
     88        case 0x29F8: /* BIG SOLIDUS */
     89        case 0x29f6: /* SOLIDUS WITH OVERBAR */
     90        case 0x2AFB: /* TRIPLE SOLIDUS BINARY RELATION */
     91        case 0x2AFD: /* DOUBLE SOLIDUS OPERATOR */
     92        case 0x3008: /* LEFT ANGLE BRACKET */
     93        case 0x3014: /* LEFT TORTOISE SHELL BRACKET */
     94        case 0x3015: /* RIGHT TORTOISE SHELL BRACKET */
     95        case 0x3033: /* VERTICAL KANA REPEAT MARK UPPER HALF */
     96        case 0x321D: /* PARENTHESIZED KOREAN CHARACTER OJEON */
     97        case 0x321E: /* PARENTHESIZED KOREAN CHARACTER O HU */
     98        case 0x33DF: /* SQUARE A OVER M */
     99        case 0xFE14: /* PRESENTATION FORM FOR VERTICAL SEMICOLON */
     100        case 0xFE15: /* PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK */
     101        case 0xFE3F: /* PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET */
     102        case 0xFE5D: /* SMALL LEFT TORTOISE SHELL BRACKET */
     103        case 0xFE5E: /* SMALL RIGHT TORTOISE SHELL BRACKET */
    82104            return YES;
    83105        default:
     
    307329    applyHostNameFunctionToURLString(string, f, &hostNameRanges);
    308330    if (hostNameRanges == nil) {
     331        printf("failed to apply host name function.  idn encoding will not occur\n");
    309332        return string;
    310333    }
     
    884907        }
    885908
    886         if (isSlashOrPeriodLookalike(c))
     909        if (isLookalikeCharacter(c))
    887910            return NO;
    888911    }
  • trunk/WebKitTools/ChangeLog

    r23961 r23963  
     12007-07-03  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        Extended DumpRenderTree to test encoding and decoding host names.
     6
     7        * DumpRenderTree/DumpRenderTree.m:
     8        (+[LayoutTestController isSelectorExcludedFromWebScript:]): Added cases for encodeHostName and decodeHostName.
     9        (+[LayoutTestController webScriptNameForSelector:]): ditto.
     10        (-[LayoutTestController decodeHostName:]): Added.
     11        (-[LayoutTestController encodeHostName:]): Added.
     12
    1132007-07-03  Sam Weinig  <sam@webkit.org>
    214
  • trunk/WebKitTools/DumpRenderTree/DumpRenderTree.m

    r23961 r23963  
    937937+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
    938938{
    939     if (aSelector == @selector(waitUntilDone)
    940             || aSelector == @selector(notifyDone)
     939    if (0
     940            || aSelector == @selector(accessStoredWebScriptObject)
     941            || aSelector == @selector(addDisallowedURL:)   
     942            || aSelector == @selector(addFileToPasteboardOnDrag)
     943            || aSelector == @selector(clearBackForwardList)
     944            || aSelector == @selector(decodeHostName:)
     945            || aSelector == @selector(display)
    941946            || aSelector == @selector(dumpAsText)
     947            || aSelector == @selector(dumpBackForwardList)
     948            || aSelector == @selector(dumpChildFrameScrollPositions)
    942949            || aSelector == @selector(dumpDOMAsWebArchive)
     950            || aSelector == @selector(dumpEditingCallbacks)
     951            || aSelector == @selector(dumpFrameLoadCallbacks)
     952            || aSelector == @selector(dumpResourceLoadCallbacks)
     953            || aSelector == @selector(dumpSelectionRect)
    943954            || aSelector == @selector(dumpSourceAsWebArchive)
    944955            || aSelector == @selector(dumpTitleChanges)
    945             || aSelector == @selector(dumpBackForwardList)
    946             || aSelector == @selector(dumpChildFrameScrollPositions)
    947             || aSelector == @selector(dumpEditingCallbacks)
    948             || aSelector == @selector(dumpResourceLoadCallbacks)
    949             || aSelector == @selector(dumpFrameLoadCallbacks)
    950             || aSelector == @selector(setWindowIsKey:)
    951             || aSelector == @selector(setMainFrameIsFirstResponder:)
    952             || aSelector == @selector(dumpSelectionRect)
    953             || aSelector == @selector(display)
    954             || aSelector == @selector(testRepaint)
    955             || aSelector == @selector(repaintSweepHorizontally)
     956            || aSelector == @selector(encodeHostName:)
     957            || aSelector == @selector(keepWebHistory)
     958            || aSelector == @selector(notifyDone)
     959            || aSelector == @selector(objCClassNameOf:)
     960            || aSelector == @selector(objCIdentityIsEqual::)
     961            || aSelector == @selector(objCObjectOfClass:)
     962            || aSelector == @selector(objCLongLongRoundTrip:)
     963            || aSelector == @selector(objCUnsignedLongLongRoundTrip:)
    956964            || aSelector == @selector(queueBackNavigation:)
    957965            || aSelector == @selector(queueForwardNavigation:)
     966            || aSelector == @selector(queueLoad:target:)
    958967            || aSelector == @selector(queueReload)
    959968            || aSelector == @selector(queueScript:)
    960             || aSelector == @selector(queueLoad:target:)
    961             || aSelector == @selector(clearBackForwardList)
    962             || aSelector == @selector(keepWebHistory)
     969            || aSelector == @selector(repaintSweepHorizontally)
    963970            || aSelector == @selector(setAcceptsEditing:)
     971            || aSelector == @selector(setCallCloseOnWebViews:)
     972            || aSelector == @selector(setCanOpenWindows)
     973            || aSelector == @selector(setCloseRemainingWindowsWhenComplete:)
     974            || aSelector == @selector(setMainFrameIsFirstResponder:)
    964975            || aSelector == @selector(setTabKeyCyclesThroughElements:)
     976            || aSelector == @selector(setUseDashboardCompatibilityMode:)
     977            || aSelector == @selector(setUserStyleSheetEnabled:)
     978            || aSelector == @selector(setUserStyleSheetLocation:)
     979            || aSelector == @selector(setWindowIsKey:)
    965980            || aSelector == @selector(storeWebScriptObject:)
    966             || aSelector == @selector(accessStoredWebScriptObject)
     981            || aSelector == @selector(testRepaint)
    967982            || aSelector == @selector(testWrapperRoundTripping:)
    968             || aSelector == @selector(setUserStyleSheetLocation:)
    969             || aSelector == @selector(setUserStyleSheetEnabled:)
    970             || aSelector == @selector(objCClassNameOf:)
    971             || aSelector == @selector(objCObjectOfClass:)
    972             || aSelector == @selector(objCIdentityIsEqual::)
    973             || aSelector == @selector(addDisallowedURL:)   
    974             || aSelector == @selector(setCanOpenWindows)
    975             || aSelector == @selector(setCallCloseOnWebViews:)
    976             || aSelector == @selector(setCloseRemainingWindowsWhenComplete:)
    977             || aSelector == @selector(setUseDashboardCompatibilityMode:)
     983            || aSelector == @selector(waitUntilDone)
    978984            || aSelector == @selector(windowCount)
    979             || aSelector == @selector(addFileToPasteboardOnDrag)
    980             || aSelector == @selector(objCLongLongRoundTrip:)
    981             || aSelector == @selector(objCUnsignedLongLongRoundTrip:))
     985        )
    982986        return NO;
    983987    return YES;
     
    10241028    if (aSelector == @selector(setUseDashboardCompatibilityMode:))
    10251029        return @"setUseDashboardCompatiblityMode";
     1030    if (aSelector == @selector(encodeHostName:))
     1031        return @"encodeHostName";
     1032    if (aSelector == @selector(decodeHostName:))
     1033        return @"decodeHostName";   
    10261034    if (aSelector == @selector(objCLongLongRoundTrip:))
    10271035        return @"objCLongLongRoundTrip";
     
    13871395{
    13881396    return a == b;
     1397}
     1398
     1399- (NSString*)decodeHostName:(NSString*)name
     1400{
     1401    return [name _web_decodeHostName];
     1402}
     1403
     1404- (NSString*)encodeHostName:(NSString*)name
     1405{
     1406    return [name _web_encodeHostName];
    13891407}
    13901408
Note: See TracChangeset for help on using the changeset viewer.