Changeset 212249 in webkit
- Timestamp:
- Feb 13, 2017, 2:52:34 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/imported/w3c/ChangeLog ¶
r212202 r212249 1 2017-02-13 Alex Christensen <achristensen@webkit.org> 2 3 Percent should be allowed in non-special URL hosts 4 https://bugs.webkit.org/show_bug.cgi?id=168255 5 6 Reviewed by Tim Horton. 7 8 * web-platform-tests/url/a-element-expected.txt: 9 * web-platform-tests/url/a-element-xhtml-expected.txt: 10 * web-platform-tests/url/url-constructor-expected.txt: 11 1 12 2017-02-11 Youenn Fablet <youennf@gmail.com> 2 13 -
TabularUnified trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt ¶
r212202 r212249 334 334 PASS Parsing: <sc://\0/> against <about:blank> 335 335 PASS Parsing: <sc:// /> against <about:blank> 336 FAIL Parsing: <sc://%/> against <about:blank> assert_equals: protocol expected "sc:" but got ":" 336 PASS Parsing: <sc://%/> against <about:blank> 337 337 PASS Parsing: <sc://@/> against <about:blank> 338 338 PASS Parsing: <sc://te@s:t@/> against <about:blank> … … 419 419 PASS Parsing: <urn:ietf:rfc:2648> against <about:blank> 420 420 PASS Parsing: <tag:joe@example.org,2001:foo/bar> against <about:blank> 421 FAIL Parsing: <non-special://%E2%80%A0/> against <about:blank> assert_equals: protocol expected "non-special:" but got ":" 422 FAIL Parsing: <non-special://H%4fSt/path> against <about:blank> assert_equals: protocol expected "non-special:" but got ":" 421 PASS Parsing: <non-special://%E2%80%A0/> against <about:blank> 422 PASS Parsing: <non-special://H%4fSt/path> against <about:blank> 423 423 PASS Parsing: <non-special://[1:2:0:0:5:0:0:0]/> against <about:blank> 424 424 PASS Parsing: <non-special://[1:2:0:0:0:0:0:3]/> against <about:blank> -
TabularUnified trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt ¶
r212202 r212249 334 334 PASS Parsing: <sc://\0/> against <about:blank> 335 335 PASS Parsing: <sc:// /> against <about:blank> 336 FAIL Parsing: <sc://%/> against <about:blank> assert_equals: protocol expected "sc:" but got ":" 336 PASS Parsing: <sc://%/> against <about:blank> 337 337 PASS Parsing: <sc://@/> against <about:blank> 338 338 PASS Parsing: <sc://te@s:t@/> against <about:blank> … … 419 419 PASS Parsing: <urn:ietf:rfc:2648> against <about:blank> 420 420 PASS Parsing: <tag:joe@example.org,2001:foo/bar> against <about:blank> 421 FAIL Parsing: <non-special://%E2%80%A0/> against <about:blank> assert_equals: protocol expected "non-special:" but got ":" 422 FAIL Parsing: <non-special://H%4fSt/path> against <about:blank> assert_equals: protocol expected "non-special:" but got ":" 421 PASS Parsing: <non-special://%E2%80%A0/> against <about:blank> 422 PASS Parsing: <non-special://H%4fSt/path> against <about:blank> 423 423 PASS Parsing: <non-special://[1:2:0:0:5:0:0:0]/> against <about:blank> 424 424 PASS Parsing: <non-special://[1:2:0:0:0:0:0:3]/> against <about:blank> -
TabularUnified trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt ¶
r212202 r212249 342 342 PASS Parsing: <sc://\0/> against <about:blank> 343 343 PASS Parsing: <sc:// /> against <about:blank> 344 FAIL Parsing: <sc://%/> against <about:blank> Type error 344 PASS Parsing: <sc://%/> against <about:blank> 345 345 PASS Parsing: <sc://@/> against <about:blank> 346 346 PASS Parsing: <sc://te@s:t@/> against <about:blank> … … 441 441 PASS Parsing: <urn:ietf:rfc:2648> against <about:blank> 442 442 PASS Parsing: <tag:joe@example.org,2001:foo/bar> against <about:blank> 443 FAIL Parsing: <non-special://%E2%80%A0/> against <about:blank> Type error 444 FAIL Parsing: <non-special://H%4fSt/path> against <about:blank> Type error 443 PASS Parsing: <non-special://%E2%80%A0/> against <about:blank> 444 PASS Parsing: <non-special://H%4fSt/path> against <about:blank> 445 445 PASS Parsing: <non-special://[1:2:0:0:5:0:0:0]/> against <about:blank> 446 446 PASS Parsing: <non-special://[1:2:0:0:0:0:0:3]/> against <about:blank> -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r212243 r212249 1 2017-02-13 Alex Christensen <achristensen@webkit.org> 2 3 Percent should be allowed in non-special URL hosts 4 https://bugs.webkit.org/show_bug.cgi?id=168255 5 6 Reviewed by Tim Horton. 7 8 In the last few weeks, the spec has consolidated its sets of code points. 9 Now forbidden host code points replace the old invalid host code points with 10 the modification that percents are allowed in non-special hosts because we 11 percent-encode non-ascii code points in non-special hosts. 12 See https://url.spec.whatwg.org/#concept-opaque-host-parser 13 14 Covered by newly passing web platform tests. 15 16 * platform/URLParser.cpp: 17 (WebCore::isC0Control): 18 (WebCore::isInUserInfoEncodeSet): 19 (WebCore::URLParser::hasForbiddenHostCodePoint): 20 (WebCore::URLParser::parseHostAndPort): 21 (WebCore::isInvalidDomainCharacter): Deleted. 22 (WebCore::URLParser::hasInvalidDomainCharacter): Deleted. 23 * platform/URLParser.h: 24 1 25 2017-02-13 Anders Carlsson <andersca@apple.com> 2 26 -
TabularUnified trunk/Source/WebCore/platform/URLParser.cpp ¶
r211638 r212249 147 147 UserInfo = 0x1, 148 148 Default = 0x2, 149 InvalidDomain= 0x4,149 ForbiddenHost = 0x4, 150 150 QueryPercent = 0x8, 151 151 SlashQuestionOrHash = 0x10, 152 152 ValidScheme = 0x20, 153 ForbiddenHost = 0x40,154 153 }; 155 154 156 155 static const uint8_t characterClassTable[256] = { 157 UserInfo | Default | InvalidDomain |QueryPercent | ForbiddenHost, // 0x0156 UserInfo | Default | QueryPercent | ForbiddenHost, // 0x0 158 157 UserInfo | Default | QueryPercent, // 0x1 159 158 UserInfo | Default | QueryPercent, // 0x2 … … 164 163 UserInfo | Default | QueryPercent, // 0x7 165 164 UserInfo | Default | QueryPercent, // 0x8 166 UserInfo | Default | InvalidDomain |QueryPercent | ForbiddenHost, // 0x9167 UserInfo | Default | InvalidDomain |QueryPercent | ForbiddenHost, // 0xA165 UserInfo | Default | QueryPercent | ForbiddenHost, // 0x9 166 UserInfo | Default | QueryPercent | ForbiddenHost, // 0xA 168 167 UserInfo | Default | QueryPercent, // 0xB 169 168 UserInfo | Default | QueryPercent, // 0xC 170 UserInfo | Default | InvalidDomain |QueryPercent | ForbiddenHost, // 0xD169 UserInfo | Default | QueryPercent | ForbiddenHost, // 0xD 171 170 UserInfo | Default | QueryPercent, // 0xE 172 171 UserInfo | Default | QueryPercent, // 0xF … … 187 186 UserInfo | Default | QueryPercent, // 0x1E 188 187 UserInfo | Default | QueryPercent, // 0x1F 189 UserInfo | Default | InvalidDomain |QueryPercent | ForbiddenHost, // ' '188 UserInfo | Default | QueryPercent | ForbiddenHost, // ' ' 190 189 0, // '!' 191 190 UserInfo | Default | QueryPercent, // '"' 192 UserInfo | Default | InvalidDomain |QueryPercent | SlashQuestionOrHash | ForbiddenHost, // '#'191 UserInfo | Default | QueryPercent | SlashQuestionOrHash | ForbiddenHost, // '#' 193 192 0, // '$' 194 InvalidDomain |ForbiddenHost, // '%'193 ForbiddenHost, // '%' 195 194 0, // '&' 196 195 0, // ''' … … 202 201 ValidScheme, // '-' 203 202 ValidScheme, // '.' 204 UserInfo | InvalidDomain |SlashQuestionOrHash | ForbiddenHost, // '/'203 UserInfo | SlashQuestionOrHash | ForbiddenHost, // '/' 205 204 ValidScheme, // '0' 206 205 ValidScheme, // '1' … … 213 212 ValidScheme, // '8' 214 213 ValidScheme, // '9' 215 UserInfo | InvalidDomain |ForbiddenHost, // ':'214 UserInfo | ForbiddenHost, // ':' 216 215 UserInfo, // ';' 217 216 UserInfo | Default | QueryPercent, // '<' 218 217 UserInfo, // '=' 219 218 UserInfo | Default | QueryPercent, // '>' 220 UserInfo | Default | InvalidDomain |SlashQuestionOrHash | ForbiddenHost, // '?'221 UserInfo | InvalidDomain |ForbiddenHost, // '@'219 UserInfo | Default | SlashQuestionOrHash | ForbiddenHost, // '?' 220 UserInfo | ForbiddenHost, // '@' 222 221 ValidScheme, // 'A' 223 222 ValidScheme, // 'B' … … 246 245 ValidScheme, // 'Y' 247 246 ValidScheme, // 'Z' 248 UserInfo | InvalidDomain |ForbiddenHost, // '['249 UserInfo | InvalidDomain |SlashQuestionOrHash | ForbiddenHost, // '\\'250 UserInfo | InvalidDomain |ForbiddenHost, // ']'247 UserInfo | ForbiddenHost, // '[' 248 UserInfo | SlashQuestionOrHash | ForbiddenHost, // '\\' 249 UserInfo | ForbiddenHost, // ']' 251 250 UserInfo, // '^' 252 251 0, // '_' … … 419 418 template<typename CharacterType> ALWAYS_INLINE static bool isInDefaultEncodeSet(CharacterType character) { return character > 0x7E || characterClassTable[character] & Default; } 420 419 template<typename CharacterType> ALWAYS_INLINE static bool isInUserInfoEncodeSet(CharacterType character) { return character > 0x7E || characterClassTable[character] & UserInfo; } 421 template<typename CharacterType> ALWAYS_INLINE static bool isInvalidDomainCharacter(CharacterType character) { return character <= ']' && characterClassTable[character] & InvalidDomain; }422 420 template<typename CharacterType> ALWAYS_INLINE static bool isPercentOrNonASCII(CharacterType character) { return !isASCII(character) || character == '%'; } 423 421 template<typename CharacterType> ALWAYS_INLINE static bool isSlashQuestionOrHash(CharacterType character) { return character <= '\\' && characterClassTable[character] & SlashQuestionOrHash; } … … 2518 2516 } 2519 2517 2520 bool URLParser::has InvalidDomainCharacter(const Vector<LChar, URLParser::defaultInlineBufferSize>& asciiDomain)2518 bool URLParser::hasForbiddenHostCodePoint(const Vector<LChar, URLParser::defaultInlineBufferSize>& asciiDomain) 2521 2519 { 2522 2520 for (size_t i = 0; i < asciiDomain.size(); ++i) { 2523 if (is InvalidDomainCharacter(asciiDomain[i]))2521 if (isForbiddenHostCodePoint(asciiDomain[i])) 2524 2522 return true; 2525 2523 } … … 2615 2613 if (*iterator == ':') 2616 2614 break; 2617 if (UNLIKELY(isForbiddenHostCodePoint(*iterator) ))2615 if (UNLIKELY(isForbiddenHostCodePoint(*iterator) && *iterator != '%')) 2618 2616 return false; 2619 2617 utf8PercentEncode<isInSimpleEncodeSet>(iterator); … … 2634 2632 if (*iterator == ':') 2635 2633 break; 2636 if (is InvalidDomainCharacter(*iterator))2634 if (isForbiddenHostCodePoint(*iterator)) 2637 2635 return false; 2638 2636 } … … 2690 2688 syntaxViolation(hostBegin); 2691 2689 auto asciiDomain = domainToASCII(domain, hostBegin); 2692 if (!asciiDomain || has InvalidDomainCharacter(asciiDomain.value()))2690 if (!asciiDomain || hasForbiddenHostCodePoint(asciiDomain.value())) 2693 2691 return false; 2694 2692 Vector<LChar, defaultInlineBufferSize>& asciiDomainValue = asciiDomain.value(); -
TabularUnified trunk/Source/WebCore/platform/URLParser.h ¶
r211621 r212249 99 99 static Vector<LChar, defaultInlineBufferSize> percentDecode(const LChar*, size_t); 100 100 static std::optional<String> formURLDecode(StringView input); 101 static bool has InvalidDomainCharacter(const Vector<LChar, defaultInlineBufferSize>&);101 static bool hasForbiddenHostCodePoint(const Vector<LChar, defaultInlineBufferSize>&); 102 102 void percentEncodeByte(uint8_t); 103 103 void appendToASCIIBuffer(UChar32); -
TabularUnified trunk/Tools/ChangeLog ¶
r212237 r212249 1 2017-02-13 Alex Christensen <achristensen@webkit.org> 2 3 Percent should be allowed in non-special URL hosts 4 https://bugs.webkit.org/show_bug.cgi?id=168255 5 6 Reviewed by Tim Horton. 7 8 * TestWebKitAPI/Tests/WebCore/URLParser.cpp: 9 (TestWebKitAPI::TEST_F): 10 1 11 2017-02-13 Fujii Hironori <Hironori.Fujii@sony.com> 2 12 -
TabularUnified trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp ¶
r211719 r212249 981 981 {"http", "", "", "f", 10, "/c", "", "", "http://f:010/c"}); 982 982 checkURL("notspecial://HoSt", {"notspecial", "", "", "HoSt", 0, "", "", "", "notspecial://HoSt"}); 983 checkURLDifferences("notspecial://H%6FSt", 984 {"", "", "", "", 0, "", "", "", "notspecial://H%6FSt"}, 985 {"notspecial", "", "", "H%6FSt", 0, "", "", "", "notspecial://H%6FSt"}); 986 checkURLDifferences("notspecial://H%4fSt", 987 {"", "", "", "", 0, "", "", "", "notspecial://H%4fSt"}, 988 {"notspecial", "", "", "H%4fSt", 0, "", "", "", "notspecial://H%4fSt"}); 983 checkURL("notspecial://H%6FSt", {"notspecial", "", "", "H%6FSt", 0, "", "", "", "notspecial://H%6FSt"}); 984 checkURL("notspecial://H%4fSt", {"notspecial", "", "", "H%4fSt", 0, "", "", "", "notspecial://H%4fSt"}); 989 985 checkURLDifferences(utf16String(u"notspecial://H😍ßt"), 990 986 {"notspecial", "", "", "H%F0%9F%98%8D%C3%9Ft", 0, "", "", "", "notspecial://H%F0%9F%98%8D%C3%9Ft"}, … … 1074 1070 {"asdf", "", "", "[0:0:0:0:a:b:c:d]", 0, "", "", "", "asdf://[0:0:0:0:a:b:c:d]"}, TestTabs::No); 1075 1071 shouldFail("a://%:a"); 1076 checkURLDifferences("a://%:/", 1077 {"", "", "", "", 0, "", "", "", "a://%:/"}, 1078 {"a", "", "", "%", 0, "/", "", "", "a://%/"}); 1079 checkURLDifferences("a://%:", 1080 {"", "", "", "", 0, "", "", "", "a://%:"}, 1081 {"a", "", "", "%", 0, "", "", "", "a://%"}); 1082 checkURLDifferences("a://%:1/", 1083 {"", "", "", "", 0, "", "", "", "a://%:1/"}, 1084 {"a", "", "", "%", 1, "/", "", "", "a://%:1/"}); 1072 checkURL("a://%:/", {"a", "", "", "%", 0, "/", "", "", "a://%/"}); 1073 checkURL("a://%:", {"a", "", "", "%", 0, "", "", "", "a://%"}); 1074 checkURL("a://%:1/", {"a", "", "", "%", 1, "/", "", "", "a://%:1/"}); 1085 1075 checkURLDifferences("http://%:", 1086 1076 {"", "", "", "", 0, "", "", "", "http://%:"},
Note:
See TracChangeset
for help on using the changeset viewer.