Changeset 252998 in webkit
- Timestamp:
- Dec 2, 2019 10:56:49 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r252990 r252998 1 2019-12-02 Alex Christensen <achristensen@webkit.org> 2 3 Incorrect association of the URL object with the value port 4 https://bugs.webkit.org/show_bug.cgi?id=204414 5 6 Reviewed by Sam Weinig. 7 8 * fast/dom/DOMURL/set-href-attribute-port-expected.txt: 9 * fast/dom/DOMURL/set-href-attribute-port.html: 10 * fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt: 11 * fast/dom/HTMLAnchorElement/set-href-attribute-port.html: 12 1 13 2019-12-02 Truitt Savell <tsavell@apple.com> 2 14 -
trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-port-expected.txt
r163208 r252998 13 13 PASS a.href is 'https://www.mydomain.com:4/path/testurl.html?key=value' 14 14 Set port to null 15 PASS a.href is 'https://www.mydomain.com :0/path/testurl.html?key=value'15 PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value' 16 16 Set port to empty string 17 PASS a.href is 'https://www.mydomain.com :0/path/testurl.html?key=value'17 PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value' 18 18 Set port to undefined 19 PASS a.href is 'https://www.mydomain.com :0/path/testurl.html?key=value'19 PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value' 20 20 Set port to URL with foo: protocol 21 21 PASS a.href is 'foo://bar:50/' -
trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-port.html
r163208 r252998 37 37 a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; 38 38 a.port = null; 39 shouldBe("a.href", "'https://www.mydomain.com :0/path/testurl.html?key=value'");39 shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); 40 40 41 41 // Firefox 3.5.2 does not accept the port if it is null. … … 43 43 a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; 44 44 a.port = ""; 45 shouldBe("a.href", "'https://www.mydomain.com :0/path/testurl.html?key=value'");45 shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); 46 46 47 47 debug("Set port to undefined"); 48 48 a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; 49 49 a.port = undefined; 50 shouldBe("a.href", "'https://www.mydomain.com :0/path/testurl.html?key=value'");50 shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); 51 51 52 52 // Firefox 3.5.2 does not allow setting the port on a URL with protocol foo: . -
trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt
r50784 r252998 13 13 PASS a.href is 'https://www.mydomain.com:4/path/testurl.html?key=value' 14 14 Set port to null 15 PASS a.href is 'https://www.mydomain.com :0/path/testurl.html?key=value'15 PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value' 16 16 Set port to empty string 17 PASS a.href is 'https://www.mydomain.com :0/path/testurl.html?key=value'17 PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value' 18 18 Set port to undefined 19 PASS a.href is 'https://www.mydomain.com :0/path/testurl.html?key=value'19 PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value' 20 20 Set port to URL with foo: protocol 21 21 PASS a.href is 'foo://bar:50/' -
trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port.html
r217390 r252998 35 35 a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; 36 36 a.port = null; 37 shouldBe("a.href", "'https://www.mydomain.com :0/path/testurl.html?key=value'");37 shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); 38 38 39 39 // Firefox 3.5.2 does not accept the port if it is null. … … 41 41 a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; 42 42 a.port = ""; 43 shouldBe("a.href", "'https://www.mydomain.com :0/path/testurl.html?key=value'");43 shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); 44 44 45 45 debug("Set port to undefined"); 46 46 a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; 47 47 a.port = undefined; 48 shouldBe("a.href", "'https://www.mydomain.com :0/path/testurl.html?key=value'");48 shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); 49 49 50 50 // Firefox 3.5.2 does not allow setting the port on a URL with protocol foo: . -
trunk/LayoutTests/imported/w3c/ChangeLog
r252983 r252998 1 2019-12-02 Alex Christensen <achristensen@webkit.org> 2 3 Incorrect association of the URL object with the value port 4 https://bugs.webkit.org/show_bug.cgi?id=204414 5 6 Reviewed by Sam Weinig. 7 8 * web-platform-tests/url/url-setters-expected.txt: 9 1 10 2019-12-02 Simon Fraser <simon.fraser@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt
r251422 r252998 424 424 PASS <a>: Setting <http://example.net>.port = '8080' 425 425 PASS <area>: Setting <http://example.net>.port = '8080' 426 FAIL URL: Setting <http://example.net:8080>.port = '' Port number is removed if empty is the new value assert_equals: expected "http://example.net/" but got "http://example.net:0/" 427 FAIL <a>: Setting <http://example.net:8080>.port = '' Port number is removed if empty is the new value assert_equals: expected "http://example.net/" but got "http://example.net:0/" 428 FAIL <area>: Setting <http://example.net:8080>.port = '' Port number is removed if empty is the new value assert_equals: expected "http://example.net/" but got "http://example.net:0/" 426 PASS URL: Setting <http://example.net:8080>.port = '' Port number is removed if empty is the new value 427 PASS <a>: Setting <http://example.net:8080>.port = '' Port number is removed if empty is the new value 428 PASS <area>: Setting <http://example.net:8080>.port = '' Port number is removed if empty is the new value 429 429 PASS URL: Setting <http://example.net:8080>.port = '80' Default port number is removed 430 430 PASS <a>: Setting <http://example.net:8080>.port = '80' Default port number is removed -
trunk/Source/WebCore/ChangeLog
r252992 r252998 1 2019-12-02 Alex Christensen <achristensen@webkit.org> 2 3 Incorrect association of the URL object with the value port 4 https://bugs.webkit.org/show_bug.cgi?id=204414 5 6 Reviewed by Sam Weinig. 7 8 Setting a port should clear the port if it's not a numerical value. 9 We now match the behavior of Chrome, Firefox, and the URL specification. 10 Covered by a newly passing WPT! 11 12 * html/URLUtils.h: 13 (WebCore::URLUtils<T>::setPort): 14 1 15 2019-11-30 Dean Jackson <dino@apple.com> 2 16 -
trunk/Source/WebCore/html/URLUtils.h
r246490 r252998 233 233 return; 234 234 235 // http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes 236 // specifically goes against RFC 3986 (p3.2) and 237 // requires setting the port to "0" if it is set to empty string. 238 // FIXME: http://url.spec.whatwg.org/ doesn't appear to require this; test what browsers do 239 unsigned port = value.toUInt(); 240 if (WTF::isDefaultPortForProtocol(port, url.protocol())) 235 bool success = true; 236 unsigned port = value.toUInt(&success); 237 if (!success || WTF::isDefaultPortForProtocol(port, url.protocol())) 241 238 url.removePort(); 242 239 else
Note: See TracChangeset
for help on using the changeset viewer.