Changeset 279680 in webkit
- Timestamp:
- Jul 7, 2021, 3:45:11 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r279669 r279680 1 2021-07-07 Alex Christensen <achristensen@webkit.org> 2 3 URL host setter should pass host to URLParser instead of trying to encode it itself 4 https://bugs.webkit.org/show_bug.cgi?id=227749 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/url/url-setters-a-area.window-expected.txt: 9 * web-platform-tests/url/url-setters.any-expected.txt: 10 * web-platform-tests/url/url-setters.any.worker-expected.txt: 11 1 12 2021-07-07 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-a-area.window-expected.txt
r279666 r279680 133 133 PASS <a>: Setting <sc://x/>.host = '@' 134 134 PASS <area>: Setting <sc://x/>.host = '@' 135 FAIL <a>: Setting <sc://x/>.host = 'ß' assert_equals: expected "sc://%C3%9F/" but got "sc://xn--zca/" 136 FAIL <area>: Setting <sc://x/>.host = 'ß' assert_equals: expected "sc://%C3%9F/" but got "sc://xn--zca/" 135 PASS <a>: Setting <sc://x/>.host = 'ß' 136 PASS <area>: Setting <sc://x/>.host = 'ß' 137 137 PASS <a>: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing 138 138 PASS <area>: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters.any-expected.txt
r279666 r279680 67 67 PASS URL: Setting <sc://x/>.host = '?' 68 68 PASS URL: Setting <sc://x/>.host = '@' 69 FAIL URL: Setting <sc://x/>.host = 'ß' assert_equals: expected "sc://%C3%9F/" but got "sc://xn--zca/" 69 PASS URL: Setting <sc://x/>.host = 'ß' 70 70 PASS URL: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing 71 71 PASS URL: Setting <mailto:me@example.net>.host = 'example.com' Cannot-be-a-base means no host -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters.any.worker-expected.txt
r279666 r279680 67 67 PASS URL: Setting <sc://x/>.host = '?' 68 68 PASS URL: Setting <sc://x/>.host = '@' 69 FAIL URL: Setting <sc://x/>.host = 'ß' assert_equals: expected "sc://%C3%9F/" but got "sc://xn--zca/" 69 PASS URL: Setting <sc://x/>.host = 'ß' 70 70 PASS URL: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing 71 71 PASS URL: Setting <mailto:me@example.net>.host = 'example.com' Cannot-be-a-base means no host -
trunk/Source/WTF/ChangeLog
r279662 r279680 1 2021-07-07 Alex Christensen <achristensen@webkit.org> 2 3 URL host setter should pass host to URLParser instead of trying to encode it itself 4 https://bugs.webkit.org/show_bug.cgi?id=227749 5 6 Reviewed by Chris Dumez. 7 8 For non-special schemes, the host is percent-encoded instead of punycode-encoded. 9 Allowing the URL parser to handle all input directly does the right thing for non-special schemes. 10 11 * wtf/URL.cpp: 12 (WTF::URL::setHost): 13 (WTF::URL::setHostAndPort): 14 1 15 2021-07-07 Alex Christensen <achristensen@webkit.org> 2 16 -
trunk/Source/WTF/wtf/URL.cpp
r279662 r279680 461 461 462 462 Vector<UChar, 512> encodedHostName; 463 if ( !appendEncodedHostname(encodedHostName, newHost))463 if (hasSpecialScheme() && !appendEncodedHostname(encodedHostName, newHost)) 464 464 return; 465 465 … … 468 468 StringView(m_string).left(hostStart()), 469 469 slashSlashNeeded ? "//" : "", 470 StringView(encodedHostName.data(), encodedHostName.size()),470 hasSpecialScheme() ? StringView(encodedHostName.data(), encodedHostName.size()) : newHost, 471 471 StringView(m_string).substring(m_hostEnd) 472 472 )); … … 514 514 515 515 Vector<UChar, 512> encodedHostName; 516 if ( !appendEncodedHostname(encodedHostName, hostName))516 if (hasSpecialScheme() && !appendEncodedHostname(encodedHostName, hostName)) 517 517 return; 518 518 … … 521 521 StringView(m_string).left(hostStart()), 522 522 slashSlashNeeded ? "//" : "", 523 StringView(encodedHostName.data(), encodedHostName.size()),523 hasSpecialScheme() ? StringView(encodedHostName.data(), encodedHostName.size()) : hostName, 524 524 portString.isEmpty() ? "" : ":", 525 525 portString,
Note:
See TracChangeset
for help on using the changeset viewer.