Title: [243435] trunk
Revision
243435
Author
[email protected]
Date
2019-03-25 03:30:55 -0700 (Mon, 25 Mar 2019)

Log Message

Reflect HTMLLinkElement.as according to the spec
https://bugs.webkit.org/show_bug.cgi?id=196189

Patch by Rob Buis <[email protected]> on 2019-03-25
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Update improved test result and import reflected-as-value.html.

* web-platform-tests/html/dom/reflection-metadata-expected.txt:
* web-platform-tests/preload/reflected-as-value-expected.txt: Added.
* web-platform-tests/preload/reflected-as-value.html: Added.

Source/WebCore:

The 'as' attribute is an enumerated attribute [1] and should
reflect using a finite set of keywords, so lowercase the as getter
to match the defined set of destinations [2].

Test: imported/w3c/web-platform-tests/preload/reflected-as-value.html

[1] https://html.spec.whatwg.org/#enumerated-attribute
[2] https://fetch.spec.whatwg.org/#concept-request-destination

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::as const):

LayoutTests:

Update improved test result.

* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243434 => 243435)


--- trunk/LayoutTests/ChangeLog	2019-03-25 09:11:58 UTC (rev 243434)
+++ trunk/LayoutTests/ChangeLog	2019-03-25 10:30:55 UTC (rev 243435)
@@ -1,3 +1,14 @@
+2019-03-25  Rob Buis  <[email protected]>
+
+        Reflect HTMLLinkElement.as according to the spec
+        https://bugs.webkit.org/show_bug.cgi?id=196189
+
+        Reviewed by Youenn Fablet.
+
+        Update improved test result.
+
+        * platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt:
+
 2019-03-25  Gyuyoung Kim  <[email protected]>
 
         Remove NavigatorContentUtils in WebCore/Modules

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (243434 => 243435)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-03-25 09:11:58 UTC (rev 243434)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-03-25 10:30:55 UTC (rev 243435)
@@ -1,3 +1,16 @@
+2019-03-25  Rob Buis  <[email protected]>
+
+        Reflect HTMLLinkElement.as according to the spec
+        https://bugs.webkit.org/show_bug.cgi?id=196189
+
+        Reviewed by Youenn Fablet.
+
+        Update improved test result and import reflected-as-value.html.
+
+        * web-platform-tests/html/dom/reflection-metadata-expected.txt:
+        * web-platform-tests/preload/reflected-as-value-expected.txt: Added.
+        * web-platform-tests/preload/reflected-as-value.html: Added.
+
 2019-03-25  Manuel Rego Casasnovas  <[email protected]>
 
         [css-grid] Fix grid container baseline alignment for orthogonal items

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt (243434 => 243435)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt	2019-03-25 09:11:58 UTC (rev 243434)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt	2019-03-25 10:30:55 UTC (rev 243435)
@@ -1184,12 +1184,12 @@
 PASS link.as: setAttribute() to "xfetch" 
 PASS link.as: setAttribute() to "fetch\0" 
 PASS link.as: setAttribute() to "etch" 
-FAIL link.as: setAttribute() to "FETCH" assert_equals: IDL get expected "fetch" but got "FETCH"
+PASS link.as: setAttribute() to "FETCH" 
 PASS link.as: setAttribute() to "audio" 
 PASS link.as: setAttribute() to "xaudio" 
 PASS link.as: setAttribute() to "audio\0" 
 PASS link.as: setAttribute() to "udio" 
-FAIL link.as: setAttribute() to "AUDIO" assert_equals: IDL get expected "audio" but got "AUDIO"
+PASS link.as: setAttribute() to "AUDIO" 
 FAIL link.as: setAttribute() to "document" assert_equals: IDL get expected "document" but got ""
 PASS link.as: setAttribute() to "xdocument" 
 PASS link.as: setAttribute() to "document\0" 
@@ -1204,12 +1204,12 @@
 PASS link.as: setAttribute() to "xfont" 
 PASS link.as: setAttribute() to "font\0" 
 PASS link.as: setAttribute() to "ont" 
-FAIL link.as: setAttribute() to "FONT" assert_equals: IDL get expected "font" but got "FONT"
+PASS link.as: setAttribute() to "FONT" 
 PASS link.as: setAttribute() to "image" 
 PASS link.as: setAttribute() to "ximage" 
 PASS link.as: setAttribute() to "image\0" 
 PASS link.as: setAttribute() to "mage" 
-FAIL link.as: setAttribute() to "IMAGE" assert_equals: IDL get expected "image" but got "IMAGE"
+PASS link.as: setAttribute() to "IMAGE" 
 FAIL link.as: setAttribute() to "manifest" assert_equals: IDL get expected "manifest" but got ""
 PASS link.as: setAttribute() to "xmanifest" 
 PASS link.as: setAttribute() to "manifest\0" 
@@ -1229,7 +1229,7 @@
 PASS link.as: setAttribute() to "xscript" 
 PASS link.as: setAttribute() to "script\0" 
 PASS link.as: setAttribute() to "cript" 
-FAIL link.as: setAttribute() to "SCRIPT" assert_equals: IDL get expected "script" but got "SCRIPT"
+PASS link.as: setAttribute() to "SCRIPT" 
 FAIL link.as: setAttribute() to "sharedworker" assert_equals: IDL get expected "sharedworker" but got ""
 PASS link.as: setAttribute() to "xsharedworker" 
 PASS link.as: setAttribute() to "sharedworker\0" 
@@ -1240,18 +1240,18 @@
 PASS link.as: setAttribute() to "xstyle" 
 PASS link.as: setAttribute() to "style\0" 
 PASS link.as: setAttribute() to "tyle" 
-FAIL link.as: setAttribute() to "STYLE" assert_equals: IDL get expected "style" but got "STYLE"
+PASS link.as: setAttribute() to "STYLE" 
 PASS link.as: setAttribute() to "track" 
 PASS link.as: setAttribute() to "xtrack" 
 PASS link.as: setAttribute() to "track\0" 
 PASS link.as: setAttribute() to "rack" 
-FAIL link.as: setAttribute() to "TRACK" assert_equals: IDL get expected "track" but got "TRACK"
+PASS link.as: setAttribute() to "TRACK" 
 PASS link.as: setAttribute() to "tracK" 
 PASS link.as: setAttribute() to "video" 
 PASS link.as: setAttribute() to "xvideo" 
 PASS link.as: setAttribute() to "video\0" 
 PASS link.as: setAttribute() to "ideo" 
-FAIL link.as: setAttribute() to "VIDEO" assert_equals: IDL get expected "video" but got "VIDEO"
+PASS link.as: setAttribute() to "VIDEO" 
 FAIL link.as: setAttribute() to "worker" assert_equals: IDL get expected "worker" but got ""
 PASS link.as: setAttribute() to "xworker" 
 PASS link.as: setAttribute() to "worker\0" 
@@ -1282,12 +1282,12 @@
 PASS link.as: IDL set to "xfetch" 
 PASS link.as: IDL set to "fetch\0" 
 PASS link.as: IDL set to "etch" 
-FAIL link.as: IDL set to "FETCH" assert_equals: IDL get expected "fetch" but got "FETCH"
+PASS link.as: IDL set to "FETCH" 
 PASS link.as: IDL set to "audio" 
 PASS link.as: IDL set to "xaudio" 
 PASS link.as: IDL set to "audio\0" 
 PASS link.as: IDL set to "udio" 
-FAIL link.as: IDL set to "AUDIO" assert_equals: IDL get expected "audio" but got "AUDIO"
+PASS link.as: IDL set to "AUDIO" 
 FAIL link.as: IDL set to "document" assert_equals: IDL get expected "document" but got ""
 PASS link.as: IDL set to "xdocument" 
 PASS link.as: IDL set to "document\0" 
@@ -1302,12 +1302,12 @@
 PASS link.as: IDL set to "xfont" 
 PASS link.as: IDL set to "font\0" 
 PASS link.as: IDL set to "ont" 
-FAIL link.as: IDL set to "FONT" assert_equals: IDL get expected "font" but got "FONT"
+PASS link.as: IDL set to "FONT" 
 PASS link.as: IDL set to "image" 
 PASS link.as: IDL set to "ximage" 
 PASS link.as: IDL set to "image\0" 
 PASS link.as: IDL set to "mage" 
-FAIL link.as: IDL set to "IMAGE" assert_equals: IDL get expected "image" but got "IMAGE"
+PASS link.as: IDL set to "IMAGE" 
 FAIL link.as: IDL set to "manifest" assert_equals: IDL get expected "manifest" but got ""
 PASS link.as: IDL set to "xmanifest" 
 PASS link.as: IDL set to "manifest\0" 
@@ -1327,7 +1327,7 @@
 PASS link.as: IDL set to "xscript" 
 PASS link.as: IDL set to "script\0" 
 PASS link.as: IDL set to "cript" 
-FAIL link.as: IDL set to "SCRIPT" assert_equals: IDL get expected "script" but got "SCRIPT"
+PASS link.as: IDL set to "SCRIPT" 
 FAIL link.as: IDL set to "sharedworker" assert_equals: IDL get expected "sharedworker" but got ""
 PASS link.as: IDL set to "xsharedworker" 
 PASS link.as: IDL set to "sharedworker\0" 
@@ -1338,18 +1338,18 @@
 PASS link.as: IDL set to "xstyle" 
 PASS link.as: IDL set to "style\0" 
 PASS link.as: IDL set to "tyle" 
-FAIL link.as: IDL set to "STYLE" assert_equals: IDL get expected "style" but got "STYLE"
+PASS link.as: IDL set to "STYLE" 
 PASS link.as: IDL set to "track" 
 PASS link.as: IDL set to "xtrack" 
 PASS link.as: IDL set to "track\0" 
 PASS link.as: IDL set to "rack" 
-FAIL link.as: IDL set to "TRACK" assert_equals: IDL get expected "track" but got "TRACK"
+PASS link.as: IDL set to "TRACK" 
 PASS link.as: IDL set to "tracK" 
 PASS link.as: IDL set to "video" 
 PASS link.as: IDL set to "xvideo" 
 PASS link.as: IDL set to "video\0" 
 PASS link.as: IDL set to "ideo" 
-FAIL link.as: IDL set to "VIDEO" assert_equals: IDL get expected "video" but got "VIDEO"
+PASS link.as: IDL set to "VIDEO" 
 FAIL link.as: IDL set to "worker" assert_equals: IDL get expected "worker" but got ""
 PASS link.as: IDL set to "xworker" 
 PASS link.as: IDL set to "worker\0" 

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/preload/reflected-as-value-expected.txt (0 => 243435)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/preload/reflected-as-value-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/preload/reflected-as-value-expected.txt	2019-03-25 10:30:55 UTC (rev 243435)
@@ -0,0 +1,3 @@
+
+PASS Make sure that the `as` value reflects only known values 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/preload/reflected-as-value.html (0 => 243435)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/preload/reflected-as-value.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/preload/reflected-as-value.html	2019-03-25 10:30:55 UTC (rev 243435)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src=""
+<script src=""
+<script>
+test(function() {
+  var link = document.createElement("link");
+  var values = {
+    "Image": "image",
+    "images": "",
+    "scripT": "script",
+    "style": "style",
+    "": "",
+    "foNt": "font",
+    "foobar": "",
+    "video": "video",
+    "audio": "audio",
+    "track": "track",
+    "fetch": "fetch",
+  };
+  var keys = Object.keys(values);
+  for (var i = 0; i < keys.length; ++i) {
+    link.as = keys[i];
+    assert_true(link.as == values[keys[i]]);
+  }
+}, "Make sure that the `as` value reflects only known values");
+</script>

Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt (243434 => 243435)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt	2019-03-25 09:11:58 UTC (rev 243434)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt	2019-03-25 10:30:55 UTC (rev 243435)
@@ -1184,12 +1184,12 @@
 PASS link.as: setAttribute() to "xfetch" 
 PASS link.as: setAttribute() to "fetch\0" 
 PASS link.as: setAttribute() to "etch" 
-FAIL link.as: setAttribute() to "FETCH" assert_equals: IDL get expected "fetch" but got "FETCH"
+PASS link.as: setAttribute() to "FETCH" 
 PASS link.as: setAttribute() to "audio" 
 PASS link.as: setAttribute() to "xaudio" 
 PASS link.as: setAttribute() to "audio\0" 
 PASS link.as: setAttribute() to "udio" 
-FAIL link.as: setAttribute() to "AUDIO" assert_equals: IDL get expected "audio" but got "AUDIO"
+PASS link.as: setAttribute() to "AUDIO" 
 FAIL link.as: setAttribute() to "document" assert_equals: IDL get expected "document" but got ""
 PASS link.as: setAttribute() to "xdocument" 
 PASS link.as: setAttribute() to "document\0" 
@@ -1204,12 +1204,12 @@
 PASS link.as: setAttribute() to "xfont" 
 PASS link.as: setAttribute() to "font\0" 
 PASS link.as: setAttribute() to "ont" 
-FAIL link.as: setAttribute() to "FONT" assert_equals: IDL get expected "font" but got "FONT"
+PASS link.as: setAttribute() to "FONT" 
 PASS link.as: setAttribute() to "image" 
 PASS link.as: setAttribute() to "ximage" 
 PASS link.as: setAttribute() to "image\0" 
 PASS link.as: setAttribute() to "mage" 
-FAIL link.as: setAttribute() to "IMAGE" assert_equals: IDL get expected "image" but got "IMAGE"
+PASS link.as: setAttribute() to "IMAGE" 
 FAIL link.as: setAttribute() to "manifest" assert_equals: IDL get expected "manifest" but got ""
 PASS link.as: setAttribute() to "xmanifest" 
 PASS link.as: setAttribute() to "manifest\0" 
@@ -1229,7 +1229,7 @@
 PASS link.as: setAttribute() to "xscript" 
 PASS link.as: setAttribute() to "script\0" 
 PASS link.as: setAttribute() to "cript" 
-FAIL link.as: setAttribute() to "SCRIPT" assert_equals: IDL get expected "script" but got "SCRIPT"
+PASS link.as: setAttribute() to "SCRIPT" 
 FAIL link.as: setAttribute() to "sharedworker" assert_equals: IDL get expected "sharedworker" but got ""
 PASS link.as: setAttribute() to "xsharedworker" 
 PASS link.as: setAttribute() to "sharedworker\0" 
@@ -1240,18 +1240,18 @@
 PASS link.as: setAttribute() to "xstyle" 
 PASS link.as: setAttribute() to "style\0" 
 PASS link.as: setAttribute() to "tyle" 
-FAIL link.as: setAttribute() to "STYLE" assert_equals: IDL get expected "style" but got "STYLE"
+PASS link.as: setAttribute() to "STYLE" 
 PASS link.as: setAttribute() to "track" 
 PASS link.as: setAttribute() to "xtrack" 
 PASS link.as: setAttribute() to "track\0" 
 PASS link.as: setAttribute() to "rack" 
-FAIL link.as: setAttribute() to "TRACK" assert_equals: IDL get expected "track" but got "TRACK"
+PASS link.as: setAttribute() to "TRACK" 
 PASS link.as: setAttribute() to "tracK" 
 PASS link.as: setAttribute() to "video" 
 PASS link.as: setAttribute() to "xvideo" 
 PASS link.as: setAttribute() to "video\0" 
 PASS link.as: setAttribute() to "ideo" 
-FAIL link.as: setAttribute() to "VIDEO" assert_equals: IDL get expected "video" but got "VIDEO"
+PASS link.as: setAttribute() to "VIDEO" 
 FAIL link.as: setAttribute() to "worker" assert_equals: IDL get expected "worker" but got ""
 PASS link.as: setAttribute() to "xworker" 
 PASS link.as: setAttribute() to "worker\0" 
@@ -1282,12 +1282,12 @@
 PASS link.as: IDL set to "xfetch" 
 PASS link.as: IDL set to "fetch\0" 
 PASS link.as: IDL set to "etch" 
-FAIL link.as: IDL set to "FETCH" assert_equals: IDL get expected "fetch" but got "FETCH"
+PASS link.as: IDL set to "FETCH" 
 PASS link.as: IDL set to "audio" 
 PASS link.as: IDL set to "xaudio" 
 PASS link.as: IDL set to "audio\0" 
 PASS link.as: IDL set to "udio" 
-FAIL link.as: IDL set to "AUDIO" assert_equals: IDL get expected "audio" but got "AUDIO"
+PASS link.as: IDL set to "AUDIO" 
 FAIL link.as: IDL set to "document" assert_equals: IDL get expected "document" but got ""
 PASS link.as: IDL set to "xdocument" 
 PASS link.as: IDL set to "document\0" 
@@ -1302,12 +1302,12 @@
 PASS link.as: IDL set to "xfont" 
 PASS link.as: IDL set to "font\0" 
 PASS link.as: IDL set to "ont" 
-FAIL link.as: IDL set to "FONT" assert_equals: IDL get expected "font" but got "FONT"
+PASS link.as: IDL set to "FONT" 
 PASS link.as: IDL set to "image" 
 PASS link.as: IDL set to "ximage" 
 PASS link.as: IDL set to "image\0" 
 PASS link.as: IDL set to "mage" 
-FAIL link.as: IDL set to "IMAGE" assert_equals: IDL get expected "image" but got "IMAGE"
+PASS link.as: IDL set to "IMAGE" 
 FAIL link.as: IDL set to "manifest" assert_equals: IDL get expected "manifest" but got ""
 PASS link.as: IDL set to "xmanifest" 
 PASS link.as: IDL set to "manifest\0" 
@@ -1327,7 +1327,7 @@
 PASS link.as: IDL set to "xscript" 
 PASS link.as: IDL set to "script\0" 
 PASS link.as: IDL set to "cript" 
-FAIL link.as: IDL set to "SCRIPT" assert_equals: IDL get expected "script" but got "SCRIPT"
+PASS link.as: IDL set to "SCRIPT" 
 FAIL link.as: IDL set to "sharedworker" assert_equals: IDL get expected "sharedworker" but got ""
 PASS link.as: IDL set to "xsharedworker" 
 PASS link.as: IDL set to "sharedworker\0" 
@@ -1338,18 +1338,18 @@
 PASS link.as: IDL set to "xstyle" 
 PASS link.as: IDL set to "style\0" 
 PASS link.as: IDL set to "tyle" 
-FAIL link.as: IDL set to "STYLE" assert_equals: IDL get expected "style" but got "STYLE"
+PASS link.as: IDL set to "STYLE" 
 PASS link.as: IDL set to "track" 
 PASS link.as: IDL set to "xtrack" 
 PASS link.as: IDL set to "track\0" 
 PASS link.as: IDL set to "rack" 
-FAIL link.as: IDL set to "TRACK" assert_equals: IDL get expected "track" but got "TRACK"
+PASS link.as: IDL set to "TRACK" 
 PASS link.as: IDL set to "tracK" 
 PASS link.as: IDL set to "video" 
 PASS link.as: IDL set to "xvideo" 
 PASS link.as: IDL set to "video\0" 
 PASS link.as: IDL set to "ideo" 
-FAIL link.as: IDL set to "VIDEO" assert_equals: IDL get expected "video" but got "VIDEO"
+PASS link.as: IDL set to "VIDEO" 
 FAIL link.as: IDL set to "worker" assert_equals: IDL get expected "worker" but got ""
 PASS link.as: IDL set to "xworker" 
 PASS link.as: IDL set to "worker\0" 

Modified: trunk/Source/WebCore/ChangeLog (243434 => 243435)


--- trunk/Source/WebCore/ChangeLog	2019-03-25 09:11:58 UTC (rev 243434)
+++ trunk/Source/WebCore/ChangeLog	2019-03-25 10:30:55 UTC (rev 243435)
@@ -1,3 +1,22 @@
+2019-03-25  Rob Buis  <[email protected]>
+
+        Reflect HTMLLinkElement.as according to the spec
+        https://bugs.webkit.org/show_bug.cgi?id=196189
+
+        Reviewed by Youenn Fablet.
+
+        The 'as' attribute is an enumerated attribute [1] and should
+        reflect using a finite set of keywords, so lowercase the as getter
+        to match the defined set of destinations [2].
+
+        Test: imported/w3c/web-platform-tests/preload/reflected-as-value.html
+
+        [1] https://html.spec.whatwg.org/#enumerated-attribute
+        [2] https://fetch.spec.whatwg.org/#concept-request-destination
+
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::as const):
+
 2019-03-25  Gyuyoung Kim  <[email protected]>
 
         Remove NavigatorContentUtils in WebCore/Modules

Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (243434 => 243435)


--- trunk/Source/WebCore/html/HTMLLinkElement.cpp	2019-03-25 09:11:58 UTC (rev 243434)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp	2019-03-25 10:30:55 UTC (rev 243435)
@@ -245,7 +245,7 @@
         || equalLettersIgnoringASCIICase(as, "track")
 #endif
         || equalLettersIgnoringASCIICase(as, "font"))
-        return as;
+        return as.convertToASCIILowercase();
     return String();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to