Diff
Modified: trunk/LayoutTests/ChangeLog (261211 => 261212)
--- trunk/LayoutTests/ChangeLog 2020-05-06 03:53:56 UTC (rev 261211)
+++ trunk/LayoutTests/ChangeLog 2020-05-06 04:37:43 UTC (rev 261212)
@@ -1,3 +1,17 @@
+2020-05-05 Rob Buis <[email protected]>
+
+ Fix setting host on URL when no port is specified
+ https://bugs.webkit.org/show_bug.cgi?id=211453
+
+ Reviewed by Darin Adler.
+
+ Update improved test expectations.
+
+ * fast/dom/DOMURL/set-href-attribute-host-expected.txt:
+ * fast/dom/DOMURL/set-href-attribute-host.html:
+ * fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt:
+ * fast/dom/HTMLAnchorElement/set-href-attribute-host.html:
+
2020-05-05 Simon Fraser <[email protected]>
Minor EventHandler and test cleanup
Modified: trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-host-expected.txt (261211 => 261212)
--- trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-host-expected.txt 2020-05-06 03:53:56 UTC (rev 261211)
+++ trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-host-expected.txt 2020-05-06 04:37:43 UTC (rev 261212)
@@ -18,13 +18,13 @@
Colon without port number
PASS a.href is 'https://www.otherdomain.com:0/path/'
Set host to null
-PASS a.href is 'https://null/path/'
+PASS a.href is 'https://null:8080/path/'
Set host to empty string
PASS a.href is 'https://www.mydomain.com:8080/path/'
Set host to URL with file: protocol
PASS a.href is 'file://mydomain.com/path/'
Set host containing slashes in it
-PASS a.href is 'https://www.otherdom/ain.com/path/'
+PASS a.href is 'https://www.otherdom/ain.com:8080/path/'
Set host that starts with ':'
PASS a.href is 'https://domain.com:8080/path/'
Set host to URL containing username and ..
Modified: trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-host.html (261211 => 261212)
--- trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-host.html 2020-05-06 03:53:56 UTC (rev 261211)
+++ trunk/LayoutTests/fast/dom/DOMURL/set-href-attribute-host.html 2020-05-06 04:37:43 UTC (rev 261212)
@@ -57,7 +57,7 @@
debug("Set host to null");
a.href = ""
a.host = null;
-shouldBe("a.href", "'https://null/path/'");
+shouldBe("a.href", "'https://null:8080/path/'");
// Both IE8 and Firefox 3.5.2 allow setting the host to empty string, which they shouldn't, per
// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
@@ -78,7 +78,7 @@
try {
a.href = ""
a.host = "www.other\dom/ain.com";
-shouldBe("a.href", "'https://www.otherdom/ain.com/path/'");
+shouldBe("a.href", "'https://www.otherdom/ain.com:8080/path/'");
} catch(e) {
debug("Exception: " + e.description);
}
Modified: trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt (261211 => 261212)
--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt 2020-05-06 03:53:56 UTC (rev 261211)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt 2020-05-06 04:37:43 UTC (rev 261212)
@@ -18,13 +18,13 @@
Colon without port number
PASS a.href is 'https://www.otherdomain.com:0/path/'
Set host to null
-PASS a.href is 'https://null/path/'
+PASS a.href is 'https://null:8080/path/'
Set host to empty string
PASS a.href is 'https://www.mydomain.com:8080/path/'
Set host to URL with file: protocol
PASS a.href is 'file://mydomain.com/path/'
Set host containing slashes in it
-PASS a.href is 'https://www.otherdom/ain.com/path/'
+PASS a.href is 'https://www.otherdom/ain.com:8080/path/'
Set host that starts with ':'
PASS a.href is 'https://domain.com:8080/path/'
Set host to URL containing username and ..
Modified: trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html (261211 => 261212)
--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html 2020-05-06 03:53:56 UTC (rev 261211)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html 2020-05-06 04:37:43 UTC (rev 261212)
@@ -55,7 +55,7 @@
debug("Set host to null");
a.href = ""
a.host = null;
-shouldBe("a.href", "'https://null/path/'");
+shouldBe("a.href", "'https://null:8080/path/'");
// Both IE8 and Firefox 3.5.2 allow setting the host to empty string, which they shouldn't, per
// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes .
@@ -76,7 +76,7 @@
try {
a.href = ""
a.host = "www.other\dom/ain.com";
-shouldBe("a.href", "'https://www.otherdom/ain.com/path/'");
+shouldBe("a.href", "'https://www.otherdom/ain.com:8080/path/'");
} catch(e) {
debug("Exception: " + e.description);
}
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (261211 => 261212)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-05-06 03:53:56 UTC (rev 261211)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-05-06 04:37:43 UTC (rev 261212)
@@ -1,3 +1,14 @@
+2020-05-05 Rob Buis <[email protected]>
+
+ Fix setting host on URL when no port is specified
+ https://bugs.webkit.org/show_bug.cgi?id=211453
+
+ Reviewed by Darin Adler.
+
+ Update improved test expectations.
+
+ * web-platform-tests/url/url-setters-expected.txt:
+
2020-05-05 Myles C. Maxfield <[email protected]>
Update two svg tests from WPT
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt (261211 => 261212)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt 2020-05-06 03:53:56 UTC (rev 261211)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt 2020-05-06 04:37:43 UTC (rev 261212)
@@ -213,9 +213,9 @@
PASS URL: Setting <http://example.net>.host = 'example.com:8080'
PASS <a>: Setting <http://example.net>.host = 'example.com:8080'
PASS <area>: Setting <http://example.net>.host = 'example.com:8080'
-FAIL URL: Setting <http://example.net:8080>.host = 'example.com' Port number is unchanged if not specified in the new value assert_equals: expected "http://example.com:8080/" but got "http://example.com/"
-FAIL <a>: Setting <http://example.net:8080>.host = 'example.com' Port number is unchanged if not specified in the new value assert_equals: expected "http://example.com:8080/" but got "http://example.com/"
-FAIL <area>: Setting <http://example.net:8080>.host = 'example.com' Port number is unchanged if not specified in the new value assert_equals: expected "http://example.com:8080/" but got "http://example.com/"
+PASS URL: Setting <http://example.net:8080>.host = 'example.com' Port number is unchanged if not specified in the new value
+PASS <a>: Setting <http://example.net:8080>.host = 'example.com' Port number is unchanged if not specified in the new value
+PASS <area>: Setting <http://example.net:8080>.host = 'example.com' Port number is unchanged if not specified in the new value
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/"
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/"
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/"
Modified: trunk/Source/WebCore/ChangeLog (261211 => 261212)
--- trunk/Source/WebCore/ChangeLog 2020-05-06 03:53:56 UTC (rev 261211)
+++ trunk/Source/WebCore/ChangeLog 2020-05-06 04:37:43 UTC (rev 261212)
@@ -1,3 +1,17 @@
+2020-05-05 Rob Buis <[email protected]>
+
+ Fix setting host on URL when no port is specified
+ https://bugs.webkit.org/show_bug.cgi?id=211453
+
+ Reviewed by Darin Adler.
+
+ Behavior matches Firefox and Chrome.
+
+ Test: web-platform-tests/url/url-setters.html
+
+ * html/URLDecomposition.cpp:
+ (WebCore::URLDecomposition::setHost):
+
2020-05-05 Simon Fraser <[email protected]>
Minor EventHandler and test cleanup
Modified: trunk/Source/WebCore/html/URLDecomposition.cpp (261211 => 261212)
--- trunk/Source/WebCore/html/URLDecomposition.cpp 2020-05-06 03:53:56 UTC (rev 261211)
+++ trunk/Source/WebCore/html/URLDecomposition.cpp 2020-05-06 04:37:43 UTC (rev 261212)
@@ -107,7 +107,7 @@
return;
if (separator == notFound)
- fullURL.setHostAndPort(value);
+ fullURL.setHost(value);
else {
unsigned portLength = countASCIIDigits(value.substring(separator + 1));
if (!portLength) {