Changeset 264516 in webkit
- Timestamp:
- Jul 17, 2020, 9:38:05 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r264505 r264516 1 2020-07-17 Rob Buis <rbuis@igalia.com> 2 3 Changing URL.host should not override port 4 https://bugs.webkit.org/show_bug.cgi?id=151613 5 6 Reviewed by Alex Christensen. 7 8 Adjust tests to expect the new behavior. 9 10 * fast/dom/DOMURL/set-href-attribute-host-expected.txt: 11 * fast/dom/DOMURL/set-href-attribute-host.html: 12 * fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt: 13 * fast/dom/HTMLAnchorElement/set-href-attribute-host.html: 14 1 15 2020-07-17 Lauro Moura <lmoura@igalia.com> 2 16 -
trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-host-expected.txt
r261212 r264516 15 15 PASS a.href is 'https://www.otherdomain.com:44/path/' 16 16 Leading space in port number 17 PASS a.href is 'https://www.otherdomain.com: 0/path/'17 PASS a.href is 'https://www.otherdomain.com:8080/path/' 18 18 Colon without port number 19 PASS a.href is 'https://www.otherdomain.com: 0/path/'19 PASS a.href is 'https://www.otherdomain.com:8080/path/' 20 20 Set host to null 21 21 PASS a.href is 'https://null:8080/path/' -
trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-host.html
r261212 r264516 47 47 a.href = "https://www.mydomain.com:8080/path/"; 48 48 a.host = "www.otherdomain.com: 443"; 49 shouldBe("a.href", "'https://www.otherdomain.com: 0/path/'");49 shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); 50 50 51 51 // Firefox 3.5.2 removed the port, clearly against the spec . … … 53 53 a.href = "https://www.mydomain.com:8080/path/"; 54 54 a.host = "www.otherdomain.com:"; 55 shouldBe("a.href", "'https://www.otherdomain.com: 0/path/'");55 shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); 56 56 57 57 debug("Set host to null"); -
trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt
r261212 r264516 15 15 PASS a.href is 'https://www.otherdomain.com:44/path/' 16 16 Leading space in port number 17 PASS a.href is 'https://www.otherdomain.com: 0/path/'17 PASS a.href is 'https://www.otherdomain.com:8080/path/' 18 18 Colon without port number 19 PASS a.href is 'https://www.otherdomain.com: 0/path/'19 PASS a.href is 'https://www.otherdomain.com:8080/path/' 20 20 Set host to null 21 21 PASS a.href is 'https://null:8080/path/' -
trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html
r261212 r264516 45 45 a.href = "https://www.mydomain.com:8080/path/"; 46 46 a.host = "www.otherdomain.com: 443"; 47 shouldBe("a.href", "'https://www.otherdomain.com: 0/path/'");47 shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); 48 48 49 49 // Firefox 3.5.2 removed the port, clearly against the spec . … … 51 51 a.href = "https://www.mydomain.com:8080/path/"; 52 52 a.host = "www.otherdomain.com:"; 53 shouldBe("a.href", "'https://www.otherdomain.com: 0/path/'");53 shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); 54 54 55 55 debug("Set host to null"); -
trunk/LayoutTests/imported/w3c/ChangeLog
r264478 r264516 1 2020-07-17 Rob Buis <rbuis@igalia.com> 2 3 Changing URL.host should not override port 4 https://bugs.webkit.org/show_bug.cgi?id=151613 5 6 Reviewed by Alex Christensen. 7 8 Update improved test result. 9 10 * web-platform-tests/url/url-setters-expected.txt: 11 1 12 2020-07-16 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt
r264282 r264516 217 217 PASS <a>: Setting <http://example.net:8080>.host = 'example.com' Port number is unchanged if not specified in the new value 218 218 PASS <area>: Setting <http://example.net:8080>.host = 'example.com' Port number is unchanged if not specified in the new value 219 FAIL URL: Setting <http://example.net:8080>.host = 'example.com:' Port number is unchanged if not specified assert_equals: expected "http://example.com:8080/" but got "http://example.com:0/" 220 FAIL <a>: Setting <http://example.net:8080>.host = 'example.com:' Port number is unchanged if not specified assert_equals: expected "http://example.com:8080/" but got "http://example.com:0/" 221 FAIL <area>: Setting <http://example.net:8080>.host = 'example.com:' Port number is unchanged if not specified assert_equals: expected "http://example.com:8080/" but got "http://example.com:0/" 219 PASS URL: Setting <http://example.net:8080>.host = 'example.com:' Port number is unchanged if not specified 220 PASS <a>: Setting <http://example.net:8080>.host = 'example.com:' Port number is unchanged if not specified 221 PASS <area>: Setting <http://example.net:8080>.host = 'example.com:' Port number is unchanged if not specified 222 222 PASS URL: Setting <http://example.net>.host = '' The empty host is not valid for special schemes 223 223 PASS <a>: Setting <http://example.net>.host = '' The empty host is not valid for special schemes -
trunk/Source/WebCore/ChangeLog
r264515 r264516 1 2020-07-17 Rob Buis <rbuis@igalia.com> 2 3 Changing URL.host should not override port 4 https://bugs.webkit.org/show_bug.cgi?id=151613 5 6 Reviewed by Alex Christensen. 7 8 When setting host, empty/incorrect port strings 9 should not change the existing port [1, 2]. 10 11 Behavior matches Chrome and Firefox. 12 13 [1] https://url.spec.whatwg.org/#host-state Step 2.4 14 [2] https://url.spec.whatwg.org/#port-state Step 2.2 15 16 Test: imported/w3c/web-platform-tests/url/url-setters.html 17 18 * html/URLDecomposition.cpp: 19 (WebCore::URLDecomposition::setHost): 20 1 21 2020-07-17 Truitt Savell <tsavell@apple.com> 2 22 -
trunk/Source/WebCore/html/URLDecomposition.cpp
r264282 r264516 117 117 unsigned portLength = countASCIIDigits(value.substring(separator + 1)); 118 118 if (!portLength) { 119 // http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes 120 // specifically goes against RFC 3986 (p3.2) and 121 // requires setting the port to "0" if it is set to empty string. 122 // FIXME: This seems like something that has since been changed and this rule and code may be obsolete. 123 fullURL.setHostAndPort(makeString(value.substring(0, separator + 1), '0')); 119 fullURL.setHost(value.substring(0, separator)); 124 120 } else { 125 121 auto portNumber = parseUInt16(value.substring(separator + 1, portLength));
Note:
See TracChangeset
for help on using the changeset viewer.