Title: [280047] trunk
Revision
280047
Author
[email protected]
Date
2021-07-19 14:35:43 -0700 (Mon, 19 Jul 2021)

Log Message

HTMLImageElement.decoding should reflect the decoding content attribute, limited to only known values
https://bugs.webkit.org/show_bug.cgi?id=228081

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT test now that more checks are passing.

* web-platform-tests/html/dom/reflection-embedded-expected.txt:

Source/WebCore:

HTMLImageElement.decoding should reflect the decoding content attribute, limited to only known values.
We were missing the *limited to only known values* logic:
- https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decoding

This aligns our behavior with Firefox and Chrome.

No new tests, rebaselined existing test.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setDecoding):
(WebCore::HTMLImageElement::decoding const):
* html/HTMLImageElement.h:
* html/HTMLImageElement.idl:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (280046 => 280047)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-07-19 21:33:16 UTC (rev 280046)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-07-19 21:35:43 UTC (rev 280047)
@@ -1,5 +1,16 @@
 2021-07-19  Chris Dumez  <[email protected]>
 
+        HTMLImageElement.decoding should reflect the decoding content attribute, limited to only known values
+        https://bugs.webkit.org/show_bug.cgi?id=228081
+
+        Reviewed by Alex Christensen.
+
+        Rebaseline WPT test now that more checks are passing.
+
+        * web-platform-tests/html/dom/reflection-embedded-expected.txt:
+
+2021-07-19  Chris Dumez  <[email protected]>
+
         FetchResponse.formData() should not reject promise if the body is null and the MIME Type is "application/x-www-form-urlencoded"
         https://bugs.webkit.org/show_bug.cgi?id=228085
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt (280046 => 280047)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt	2021-07-19 21:33:16 UTC (rev 280046)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt	2021-07-19 21:35:43 UTC (rev 280047)
@@ -1093,75 +1093,75 @@
 PASS img.referrerPolicy: IDL set to "UNSAFE-URL"
 PASS img.referrerPolicy: IDL set to "unſafe-url"
 PASS img.decoding: typeof IDL attribute
-FAIL img.decoding: IDL get with DOM attribute unset assert_equals: expected "auto" but got ""
-FAIL img.decoding: setAttribute() to "" assert_equals: IDL get expected "auto" but got ""
-FAIL img.decoding: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " assert_equals: IDL get expected "auto" but got " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo "
-FAIL img.decoding: setAttribute() to undefined assert_equals: IDL get expected "auto" but got "undefined"
-FAIL img.decoding: setAttribute() to 7 assert_equals: IDL get expected "auto" but got "7"
-FAIL img.decoding: setAttribute() to 1.5 assert_equals: IDL get expected "auto" but got "1.5"
-FAIL img.decoding: setAttribute() to "5%" assert_equals: IDL get expected "auto" but got "5%"
-FAIL img.decoding: setAttribute() to "+100" assert_equals: IDL get expected "auto" but got "+100"
-FAIL img.decoding: setAttribute() to ".5" assert_equals: IDL get expected "auto" but got ".5"
-FAIL img.decoding: setAttribute() to true assert_equals: IDL get expected "auto" but got "true"
-FAIL img.decoding: setAttribute() to false assert_equals: IDL get expected "auto" but got "false"
-FAIL img.decoding: setAttribute() to object "[object Object]" assert_equals: IDL get expected "auto" but got "[object Object]"
-FAIL img.decoding: setAttribute() to NaN assert_equals: IDL get expected "auto" but got "NaN"
-FAIL img.decoding: setAttribute() to Infinity assert_equals: IDL get expected "auto" but got "Infinity"
-FAIL img.decoding: setAttribute() to -Infinity assert_equals: IDL get expected "auto" but got "-Infinity"
-FAIL img.decoding: setAttribute() to "\0" assert_equals: IDL get expected "auto" but got "\0"
-FAIL img.decoding: setAttribute() to null assert_equals: IDL get expected "auto" but got "null"
-FAIL img.decoding: setAttribute() to object "test-toString" assert_equals: IDL get expected "auto" but got "test-toString"
-FAIL img.decoding: setAttribute() to object "test-valueOf" assert_equals: IDL get expected "auto" but got "test-valueOf"
+PASS img.decoding: IDL get with DOM attribute unset
+PASS img.decoding: setAttribute() to ""
+PASS img.decoding: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo "
+PASS img.decoding: setAttribute() to undefined
+PASS img.decoding: setAttribute() to 7
+PASS img.decoding: setAttribute() to 1.5
+PASS img.decoding: setAttribute() to "5%"
+PASS img.decoding: setAttribute() to "+100"
+PASS img.decoding: setAttribute() to ".5"
+PASS img.decoding: setAttribute() to true
+PASS img.decoding: setAttribute() to false
+PASS img.decoding: setAttribute() to object "[object Object]"
+PASS img.decoding: setAttribute() to NaN
+PASS img.decoding: setAttribute() to Infinity
+PASS img.decoding: setAttribute() to -Infinity
+PASS img.decoding: setAttribute() to "\0"
+PASS img.decoding: setAttribute() to null
+PASS img.decoding: setAttribute() to object "test-toString"
+PASS img.decoding: setAttribute() to object "test-valueOf"
 PASS img.decoding: setAttribute() to "async"
-FAIL img.decoding: setAttribute() to "xasync" assert_equals: IDL get expected "auto" but got "xasync"
-FAIL img.decoding: setAttribute() to "async\0" assert_equals: IDL get expected "auto" but got "async\0"
-FAIL img.decoding: setAttribute() to "ASYNC" assert_equals: IDL get expected "async" but got "ASYNC"
-FAIL img.decoding: setAttribute() to "aſync" assert_equals: IDL get expected "auto" but got "aſync"
+PASS img.decoding: setAttribute() to "xasync"
+PASS img.decoding: setAttribute() to "async\0"
+PASS img.decoding: setAttribute() to "ASYNC"
+PASS img.decoding: setAttribute() to "aſync"
 PASS img.decoding: setAttribute() to "sync"
-FAIL img.decoding: setAttribute() to "xsync" assert_equals: IDL get expected "auto" but got "xsync"
-FAIL img.decoding: setAttribute() to "sync\0" assert_equals: IDL get expected "auto" but got "sync\0"
-FAIL img.decoding: setAttribute() to "ync" assert_equals: IDL get expected "auto" but got "ync"
-FAIL img.decoding: setAttribute() to "SYNC" assert_equals: IDL get expected "sync" but got "SYNC"
-FAIL img.decoding: setAttribute() to "ſync" assert_equals: IDL get expected "auto" but got "ſync"
+PASS img.decoding: setAttribute() to "xsync"
+PASS img.decoding: setAttribute() to "sync\0"
+PASS img.decoding: setAttribute() to "ync"
+PASS img.decoding: setAttribute() to "SYNC"
+PASS img.decoding: setAttribute() to "ſync"
 PASS img.decoding: setAttribute() to "auto"
-FAIL img.decoding: setAttribute() to "xauto" assert_equals: IDL get expected "auto" but got "xauto"
-FAIL img.decoding: setAttribute() to "auto\0" assert_equals: IDL get expected "auto" but got "auto\0"
-FAIL img.decoding: setAttribute() to "uto" assert_equals: IDL get expected "auto" but got "uto"
-FAIL img.decoding: setAttribute() to "AUTO" assert_equals: IDL get expected "auto" but got "AUTO"
-FAIL img.decoding: IDL set to "" assert_equals: IDL get expected "auto" but got ""
-FAIL img.decoding: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " assert_equals: IDL get expected "auto" but got " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo "
-FAIL img.decoding: IDL set to undefined assert_equals: IDL get expected "auto" but got "undefined"
-FAIL img.decoding: IDL set to 7 assert_equals: IDL get expected "auto" but got "7"
-FAIL img.decoding: IDL set to 1.5 assert_equals: IDL get expected "auto" but got "1.5"
-FAIL img.decoding: IDL set to "5%" assert_equals: IDL get expected "auto" but got "5%"
-FAIL img.decoding: IDL set to "+100" assert_equals: IDL get expected "auto" but got "+100"
-FAIL img.decoding: IDL set to ".5" assert_equals: IDL get expected "auto" but got ".5"
-FAIL img.decoding: IDL set to true assert_equals: IDL get expected "auto" but got "true"
-FAIL img.decoding: IDL set to false assert_equals: IDL get expected "auto" but got "false"
-FAIL img.decoding: IDL set to object "[object Object]" assert_equals: IDL get expected "auto" but got "[object Object]"
-FAIL img.decoding: IDL set to NaN assert_equals: IDL get expected "auto" but got "NaN"
-FAIL img.decoding: IDL set to Infinity assert_equals: IDL get expected "auto" but got "Infinity"
-FAIL img.decoding: IDL set to -Infinity assert_equals: IDL get expected "auto" but got "-Infinity"
-FAIL img.decoding: IDL set to "\0" assert_equals: IDL get expected "auto" but got "\0"
-FAIL img.decoding: IDL set to null assert_equals: IDL get expected "auto" but got "null"
-FAIL img.decoding: IDL set to object "test-toString" assert_equals: IDL get expected "auto" but got "test-toString"
-FAIL img.decoding: IDL set to object "test-valueOf" assert_equals: IDL get expected "auto" but got "test-valueOf"
+PASS img.decoding: setAttribute() to "xauto"
+PASS img.decoding: setAttribute() to "auto\0"
+PASS img.decoding: setAttribute() to "uto"
+PASS img.decoding: setAttribute() to "AUTO"
+PASS img.decoding: IDL set to ""
+PASS img.decoding: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo "
+PASS img.decoding: IDL set to undefined
+PASS img.decoding: IDL set to 7
+PASS img.decoding: IDL set to 1.5
+PASS img.decoding: IDL set to "5%"
+PASS img.decoding: IDL set to "+100"
+PASS img.decoding: IDL set to ".5"
+PASS img.decoding: IDL set to true
+PASS img.decoding: IDL set to false
+PASS img.decoding: IDL set to object "[object Object]"
+PASS img.decoding: IDL set to NaN
+PASS img.decoding: IDL set to Infinity
+PASS img.decoding: IDL set to -Infinity
+PASS img.decoding: IDL set to "\0"
+PASS img.decoding: IDL set to null
+PASS img.decoding: IDL set to object "test-toString"
+PASS img.decoding: IDL set to object "test-valueOf"
 PASS img.decoding: IDL set to "async"
-FAIL img.decoding: IDL set to "xasync" assert_equals: IDL get expected "auto" but got "xasync"
-FAIL img.decoding: IDL set to "async\0" assert_equals: IDL get expected "auto" but got "async\0"
-FAIL img.decoding: IDL set to "ASYNC" assert_equals: IDL get expected "async" but got "ASYNC"
-FAIL img.decoding: IDL set to "aſync" assert_equals: IDL get expected "auto" but got "aſync"
+PASS img.decoding: IDL set to "xasync"
+PASS img.decoding: IDL set to "async\0"
+PASS img.decoding: IDL set to "ASYNC"
+PASS img.decoding: IDL set to "aſync"
 PASS img.decoding: IDL set to "sync"
-FAIL img.decoding: IDL set to "xsync" assert_equals: IDL get expected "auto" but got "xsync"
-FAIL img.decoding: IDL set to "sync\0" assert_equals: IDL get expected "auto" but got "sync\0"
-FAIL img.decoding: IDL set to "ync" assert_equals: IDL get expected "auto" but got "ync"
-FAIL img.decoding: IDL set to "SYNC" assert_equals: IDL get expected "sync" but got "SYNC"
-FAIL img.decoding: IDL set to "ſync" assert_equals: IDL get expected "auto" but got "ſync"
+PASS img.decoding: IDL set to "xsync"
+PASS img.decoding: IDL set to "sync\0"
+PASS img.decoding: IDL set to "ync"
+PASS img.decoding: IDL set to "SYNC"
+PASS img.decoding: IDL set to "ſync"
 PASS img.decoding: IDL set to "auto"
-FAIL img.decoding: IDL set to "xauto" assert_equals: IDL get expected "auto" but got "xauto"
-FAIL img.decoding: IDL set to "auto\0" assert_equals: IDL get expected "auto" but got "auto\0"
-FAIL img.decoding: IDL set to "uto" assert_equals: IDL get expected "auto" but got "uto"
-FAIL img.decoding: IDL set to "AUTO" assert_equals: IDL get expected "auto" but got "AUTO"
+PASS img.decoding: IDL set to "xauto"
+PASS img.decoding: IDL set to "auto\0"
+PASS img.decoding: IDL set to "uto"
+PASS img.decoding: IDL set to "AUTO"
 PASS img.name: typeof IDL attribute
 PASS img.name: IDL get with DOM attribute unset
 PASS img.name: setAttribute() to ""

Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt (280046 => 280047)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt	2021-07-19 21:33:16 UTC (rev 280046)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt	2021-07-19 21:35:43 UTC (rev 280047)
@@ -1093,75 +1093,75 @@
 PASS img.referrerPolicy: IDL set to "UNSAFE-URL"
 PASS img.referrerPolicy: IDL set to "unſafe-url"
 PASS img.decoding: typeof IDL attribute
-FAIL img.decoding: IDL get with DOM attribute unset assert_equals: expected "auto" but got ""
-FAIL img.decoding: setAttribute() to "" assert_equals: IDL get expected "auto" but got ""
-FAIL img.decoding: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " assert_equals: IDL get expected "auto" but got " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo "
-FAIL img.decoding: setAttribute() to undefined assert_equals: IDL get expected "auto" but got "undefined"
-FAIL img.decoding: setAttribute() to 7 assert_equals: IDL get expected "auto" but got "7"
-FAIL img.decoding: setAttribute() to 1.5 assert_equals: IDL get expected "auto" but got "1.5"
-FAIL img.decoding: setAttribute() to "5%" assert_equals: IDL get expected "auto" but got "5%"
-FAIL img.decoding: setAttribute() to "+100" assert_equals: IDL get expected "auto" but got "+100"
-FAIL img.decoding: setAttribute() to ".5" assert_equals: IDL get expected "auto" but got ".5"
-FAIL img.decoding: setAttribute() to true assert_equals: IDL get expected "auto" but got "true"
-FAIL img.decoding: setAttribute() to false assert_equals: IDL get expected "auto" but got "false"
-FAIL img.decoding: setAttribute() to object "[object Object]" assert_equals: IDL get expected "auto" but got "[object Object]"
-FAIL img.decoding: setAttribute() to NaN assert_equals: IDL get expected "auto" but got "NaN"
-FAIL img.decoding: setAttribute() to Infinity assert_equals: IDL get expected "auto" but got "Infinity"
-FAIL img.decoding: setAttribute() to -Infinity assert_equals: IDL get expected "auto" but got "-Infinity"
-FAIL img.decoding: setAttribute() to "\0" assert_equals: IDL get expected "auto" but got "\0"
-FAIL img.decoding: setAttribute() to null assert_equals: IDL get expected "auto" but got "null"
-FAIL img.decoding: setAttribute() to object "test-toString" assert_equals: IDL get expected "auto" but got "test-toString"
-FAIL img.decoding: setAttribute() to object "test-valueOf" assert_equals: IDL get expected "auto" but got "test-valueOf"
+PASS img.decoding: IDL get with DOM attribute unset
+PASS img.decoding: setAttribute() to ""
+PASS img.decoding: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo "
+PASS img.decoding: setAttribute() to undefined
+PASS img.decoding: setAttribute() to 7
+PASS img.decoding: setAttribute() to 1.5
+PASS img.decoding: setAttribute() to "5%"
+PASS img.decoding: setAttribute() to "+100"
+PASS img.decoding: setAttribute() to ".5"
+PASS img.decoding: setAttribute() to true
+PASS img.decoding: setAttribute() to false
+PASS img.decoding: setAttribute() to object "[object Object]"
+PASS img.decoding: setAttribute() to NaN
+PASS img.decoding: setAttribute() to Infinity
+PASS img.decoding: setAttribute() to -Infinity
+PASS img.decoding: setAttribute() to "\0"
+PASS img.decoding: setAttribute() to null
+PASS img.decoding: setAttribute() to object "test-toString"
+PASS img.decoding: setAttribute() to object "test-valueOf"
 PASS img.decoding: setAttribute() to "async"
-FAIL img.decoding: setAttribute() to "xasync" assert_equals: IDL get expected "auto" but got "xasync"
-FAIL img.decoding: setAttribute() to "async\0" assert_equals: IDL get expected "auto" but got "async\0"
-FAIL img.decoding: setAttribute() to "ASYNC" assert_equals: IDL get expected "async" but got "ASYNC"
-FAIL img.decoding: setAttribute() to "aſync" assert_equals: IDL get expected "auto" but got "aſync"
+PASS img.decoding: setAttribute() to "xasync"
+PASS img.decoding: setAttribute() to "async\0"
+PASS img.decoding: setAttribute() to "ASYNC"
+PASS img.decoding: setAttribute() to "aſync"
 PASS img.decoding: setAttribute() to "sync"
-FAIL img.decoding: setAttribute() to "xsync" assert_equals: IDL get expected "auto" but got "xsync"
-FAIL img.decoding: setAttribute() to "sync\0" assert_equals: IDL get expected "auto" but got "sync\0"
-FAIL img.decoding: setAttribute() to "ync" assert_equals: IDL get expected "auto" but got "ync"
-FAIL img.decoding: setAttribute() to "SYNC" assert_equals: IDL get expected "sync" but got "SYNC"
-FAIL img.decoding: setAttribute() to "ſync" assert_equals: IDL get expected "auto" but got "ſync"
+PASS img.decoding: setAttribute() to "xsync"
+PASS img.decoding: setAttribute() to "sync\0"
+PASS img.decoding: setAttribute() to "ync"
+PASS img.decoding: setAttribute() to "SYNC"
+PASS img.decoding: setAttribute() to "ſync"
 PASS img.decoding: setAttribute() to "auto"
-FAIL img.decoding: setAttribute() to "xauto" assert_equals: IDL get expected "auto" but got "xauto"
-FAIL img.decoding: setAttribute() to "auto\0" assert_equals: IDL get expected "auto" but got "auto\0"
-FAIL img.decoding: setAttribute() to "uto" assert_equals: IDL get expected "auto" but got "uto"
-FAIL img.decoding: setAttribute() to "AUTO" assert_equals: IDL get expected "auto" but got "AUTO"
-FAIL img.decoding: IDL set to "" assert_equals: IDL get expected "auto" but got ""
-FAIL img.decoding: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " assert_equals: IDL get expected "auto" but got " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo "
-FAIL img.decoding: IDL set to undefined assert_equals: IDL get expected "auto" but got "undefined"
-FAIL img.decoding: IDL set to 7 assert_equals: IDL get expected "auto" but got "7"
-FAIL img.decoding: IDL set to 1.5 assert_equals: IDL get expected "auto" but got "1.5"
-FAIL img.decoding: IDL set to "5%" assert_equals: IDL get expected "auto" but got "5%"
-FAIL img.decoding: IDL set to "+100" assert_equals: IDL get expected "auto" but got "+100"
-FAIL img.decoding: IDL set to ".5" assert_equals: IDL get expected "auto" but got ".5"
-FAIL img.decoding: IDL set to true assert_equals: IDL get expected "auto" but got "true"
-FAIL img.decoding: IDL set to false assert_equals: IDL get expected "auto" but got "false"
-FAIL img.decoding: IDL set to object "[object Object]" assert_equals: IDL get expected "auto" but got "[object Object]"
-FAIL img.decoding: IDL set to NaN assert_equals: IDL get expected "auto" but got "NaN"
-FAIL img.decoding: IDL set to Infinity assert_equals: IDL get expected "auto" but got "Infinity"
-FAIL img.decoding: IDL set to -Infinity assert_equals: IDL get expected "auto" but got "-Infinity"
-FAIL img.decoding: IDL set to "\0" assert_equals: IDL get expected "auto" but got "\0"
-FAIL img.decoding: IDL set to null assert_equals: IDL get expected "auto" but got "null"
-FAIL img.decoding: IDL set to object "test-toString" assert_equals: IDL get expected "auto" but got "test-toString"
-FAIL img.decoding: IDL set to object "test-valueOf" assert_equals: IDL get expected "auto" but got "test-valueOf"
+PASS img.decoding: setAttribute() to "xauto"
+PASS img.decoding: setAttribute() to "auto\0"
+PASS img.decoding: setAttribute() to "uto"
+PASS img.decoding: setAttribute() to "AUTO"
+PASS img.decoding: IDL set to ""
+PASS img.decoding: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo "
+PASS img.decoding: IDL set to undefined
+PASS img.decoding: IDL set to 7
+PASS img.decoding: IDL set to 1.5
+PASS img.decoding: IDL set to "5%"
+PASS img.decoding: IDL set to "+100"
+PASS img.decoding: IDL set to ".5"
+PASS img.decoding: IDL set to true
+PASS img.decoding: IDL set to false
+PASS img.decoding: IDL set to object "[object Object]"
+PASS img.decoding: IDL set to NaN
+PASS img.decoding: IDL set to Infinity
+PASS img.decoding: IDL set to -Infinity
+PASS img.decoding: IDL set to "\0"
+PASS img.decoding: IDL set to null
+PASS img.decoding: IDL set to object "test-toString"
+PASS img.decoding: IDL set to object "test-valueOf"
 PASS img.decoding: IDL set to "async"
-FAIL img.decoding: IDL set to "xasync" assert_equals: IDL get expected "auto" but got "xasync"
-FAIL img.decoding: IDL set to "async\0" assert_equals: IDL get expected "auto" but got "async\0"
-FAIL img.decoding: IDL set to "ASYNC" assert_equals: IDL get expected "async" but got "ASYNC"
-FAIL img.decoding: IDL set to "aſync" assert_equals: IDL get expected "auto" but got "aſync"
+PASS img.decoding: IDL set to "xasync"
+PASS img.decoding: IDL set to "async\0"
+PASS img.decoding: IDL set to "ASYNC"
+PASS img.decoding: IDL set to "aſync"
 PASS img.decoding: IDL set to "sync"
-FAIL img.decoding: IDL set to "xsync" assert_equals: IDL get expected "auto" but got "xsync"
-FAIL img.decoding: IDL set to "sync\0" assert_equals: IDL get expected "auto" but got "sync\0"
-FAIL img.decoding: IDL set to "ync" assert_equals: IDL get expected "auto" but got "ync"
-FAIL img.decoding: IDL set to "SYNC" assert_equals: IDL get expected "sync" but got "SYNC"
-FAIL img.decoding: IDL set to "ſync" assert_equals: IDL get expected "auto" but got "ſync"
+PASS img.decoding: IDL set to "xsync"
+PASS img.decoding: IDL set to "sync\0"
+PASS img.decoding: IDL set to "ync"
+PASS img.decoding: IDL set to "SYNC"
+PASS img.decoding: IDL set to "ſync"
 PASS img.decoding: IDL set to "auto"
-FAIL img.decoding: IDL set to "xauto" assert_equals: IDL get expected "auto" but got "xauto"
-FAIL img.decoding: IDL set to "auto\0" assert_equals: IDL get expected "auto" but got "auto\0"
-FAIL img.decoding: IDL set to "uto" assert_equals: IDL get expected "auto" but got "uto"
-FAIL img.decoding: IDL set to "AUTO" assert_equals: IDL get expected "auto" but got "AUTO"
+PASS img.decoding: IDL set to "xauto"
+PASS img.decoding: IDL set to "auto\0"
+PASS img.decoding: IDL set to "uto"
+PASS img.decoding: IDL set to "AUTO"
 PASS img.name: typeof IDL attribute
 PASS img.name: IDL get with DOM attribute unset
 PASS img.name: setAttribute() to ""

Modified: trunk/Source/WebCore/ChangeLog (280046 => 280047)


--- trunk/Source/WebCore/ChangeLog	2021-07-19 21:33:16 UTC (rev 280046)
+++ trunk/Source/WebCore/ChangeLog	2021-07-19 21:35:43 UTC (rev 280047)
@@ -1,5 +1,26 @@
 2021-07-19  Chris Dumez  <[email protected]>
 
+        HTMLImageElement.decoding should reflect the decoding content attribute, limited to only known values
+        https://bugs.webkit.org/show_bug.cgi?id=228081
+
+        Reviewed by Alex Christensen.
+
+        HTMLImageElement.decoding should reflect the decoding content attribute, limited to only known values.
+        We were missing the *limited to only known values* logic:
+        - https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decoding
+
+        This aligns our behavior with Firefox and Chrome.
+
+        No new tests, rebaselined existing test.
+
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::setDecoding):
+        (WebCore::HTMLImageElement::decoding const):
+        * html/HTMLImageElement.h:
+        * html/HTMLImageElement.idl:
+
+2021-07-19  Chris Dumez  <[email protected]>
+
         FetchResponse.formData() should not reject promise if the body is null and the MIME Type is "application/x-www-form-urlencoded"
         https://bugs.webkit.org/show_bug.cgi?id=228085
 

Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (280046 => 280047)


--- trunk/Source/WebCore/html/HTMLImageElement.cpp	2021-07-19 21:33:16 UTC (rev 280046)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp	2021-07-19 21:35:43 UTC (rev 280047)
@@ -633,6 +633,24 @@
     return m_imageLoader->imageComplete();
 }
 
+void HTMLImageElement::setDecoding(String&& decodingMode)
+{
+    setAttributeWithoutSynchronization(decodingAttr, WTFMove(decodingMode));
+}
+
+String HTMLImageElement::decoding() const
+{
+    switch (decodingMode()) {
+    case DecodingMode::Synchronous:
+        return "sync"_s;
+    case DecodingMode::Asynchronous:
+        return "async"_s;
+    case DecodingMode::Auto:
+        break;
+    }
+    return "auto"_s;
+}
+
 DecodingMode HTMLImageElement::decodingMode() const
 {
     const AtomString& decodingMode = attributeWithoutSynchronization(decodingAttr);

Modified: trunk/Source/WebCore/html/HTMLImageElement.h (280046 => 280047)


--- trunk/Source/WebCore/html/HTMLImageElement.h	2021-07-19 21:33:16 UTC (rev 280046)
+++ trunk/Source/WebCore/html/HTMLImageElement.h	2021-07-19 21:35:43 UTC (rev 280047)
@@ -91,6 +91,9 @@
 
     WEBCORE_EXPORT bool complete() const;
 
+    void setDecoding(String&&);
+    String decoding() const;
+
     DecodingMode decodingMode() const;
     
     WEBCORE_EXPORT void decode(Ref<DeferredPromise>&&);

Modified: trunk/Source/WebCore/html/HTMLImageElement.idl (280046 => 280047)


--- trunk/Source/WebCore/html/HTMLImageElement.idl	2021-07-19 21:33:16 UTC (rev 280046)
+++ trunk/Source/WebCore/html/HTMLImageElement.idl	2021-07-19 21:35:43 UTC (rev 280047)
@@ -40,7 +40,7 @@
     readonly attribute boolean complete;
     readonly attribute USVString currentSrc;
     [CEReactions=NotNeeded, EnabledBySetting=ReferrerPolicyAttribute, ImplementedAs=referrerPolicyForBindings] attribute DOMString referrerPolicy;
-    [CEReactions=NotNeeded, Reflect] attribute DOMString decoding;
+    [CEReactions=NotNeeded] attribute DOMString decoding;
     [CEReactions, EnabledBySetting=LazyImageLoading, ImplementedAs=loadingForBindings] attribute DOMString loading;
 
     Promise<undefined> decode();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to