Changeset 280047 in webkit


Ignore:
Timestamp:
Jul 19, 2021 2:35:43 PM (12 months ago)
Author:
Chris Dumez
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:

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:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r280046 r280047  
     12021-07-19  Chris Dumez  <cdumez@apple.com>
     2
     3        HTMLImageElement.decoding should reflect the decoding content attribute, limited to only known values
     4        https://bugs.webkit.org/show_bug.cgi?id=228081
     5
     6        Reviewed by Alex Christensen.
     7
     8        Rebaseline WPT test now that more checks are passing.
     9
     10        * web-platform-tests/html/dom/reflection-embedded-expected.txt:
     11
    1122021-07-19  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt

    r269477 r280047  
    10941094PASS img.referrerPolicy: IDL set to "unſafe-url"
    10951095PASS img.decoding: typeof IDL attribute
    1096 FAIL img.decoding: IDL get with DOM attribute unset assert_equals: expected "auto" but got ""
    1097 FAIL img.decoding: setAttribute() to "" assert_equals: IDL get expected "auto" but got ""
    1098 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 "
    1099 FAIL img.decoding: setAttribute() to undefined assert_equals: IDL get expected "auto" but got "undefined"
    1100 FAIL img.decoding: setAttribute() to 7 assert_equals: IDL get expected "auto" but got "7"
    1101 FAIL img.decoding: setAttribute() to 1.5 assert_equals: IDL get expected "auto" but got "1.5"
    1102 FAIL img.decoding: setAttribute() to "5%" assert_equals: IDL get expected "auto" but got "5%"
    1103 FAIL img.decoding: setAttribute() to "+100" assert_equals: IDL get expected "auto" but got "+100"
    1104 FAIL img.decoding: setAttribute() to ".5" assert_equals: IDL get expected "auto" but got ".5"
    1105 FAIL img.decoding: setAttribute() to true assert_equals: IDL get expected "auto" but got "true"
    1106 FAIL img.decoding: setAttribute() to false assert_equals: IDL get expected "auto" but got "false"
    1107 FAIL img.decoding: setAttribute() to object "[object Object]" assert_equals: IDL get expected "auto" but got "[object Object]"
    1108 FAIL img.decoding: setAttribute() to NaN assert_equals: IDL get expected "auto" but got "NaN"
    1109 FAIL img.decoding: setAttribute() to Infinity assert_equals: IDL get expected "auto" but got "Infinity"
    1110 FAIL img.decoding: setAttribute() to -Infinity assert_equals: IDL get expected "auto" but got "-Infinity"
    1111 FAIL img.decoding: setAttribute() to "\0" assert_equals: IDL get expected "auto" but got "\0"
    1112 FAIL img.decoding: setAttribute() to null assert_equals: IDL get expected "auto" but got "null"
    1113 FAIL img.decoding: setAttribute() to object "test-toString" assert_equals: IDL get expected "auto" but got "test-toString"
    1114 FAIL img.decoding: setAttribute() to object "test-valueOf" assert_equals: IDL get expected "auto" but got "test-valueOf"
     1096PASS img.decoding: IDL get with DOM attribute unset
     1097PASS img.decoding: setAttribute() to ""
     1098PASS 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 "
     1099PASS img.decoding: setAttribute() to undefined
     1100PASS img.decoding: setAttribute() to 7
     1101PASS img.decoding: setAttribute() to 1.5
     1102PASS img.decoding: setAttribute() to "5%"
     1103PASS img.decoding: setAttribute() to "+100"
     1104PASS img.decoding: setAttribute() to ".5"
     1105PASS img.decoding: setAttribute() to true
     1106PASS img.decoding: setAttribute() to false
     1107PASS img.decoding: setAttribute() to object "[object Object]"
     1108PASS img.decoding: setAttribute() to NaN
     1109PASS img.decoding: setAttribute() to Infinity
     1110PASS img.decoding: setAttribute() to -Infinity
     1111PASS img.decoding: setAttribute() to "\0"
     1112PASS img.decoding: setAttribute() to null
     1113PASS img.decoding: setAttribute() to object "test-toString"
     1114PASS img.decoding: setAttribute() to object "test-valueOf"
    11151115PASS img.decoding: setAttribute() to "async"
    1116 FAIL img.decoding: setAttribute() to "xasync" assert_equals: IDL get expected "auto" but got "xasync"
    1117 FAIL img.decoding: setAttribute() to "async\0" assert_equals: IDL get expected "auto" but got "async\0"
    1118 FAIL img.decoding: setAttribute() to "ASYNC" assert_equals: IDL get expected "async" but got "ASYNC"
    1119 FAIL img.decoding: setAttribute() to "aſync" assert_equals: IDL get expected "auto" but got "aſync"
     1116PASS img.decoding: setAttribute() to "xasync"
     1117PASS img.decoding: setAttribute() to "async\0"
     1118PASS img.decoding: setAttribute() to "ASYNC"
     1119PASS img.decoding: setAttribute() to "aſync"
    11201120PASS img.decoding: setAttribute() to "sync"
    1121 FAIL img.decoding: setAttribute() to "xsync" assert_equals: IDL get expected "auto" but got "xsync"
    1122 FAIL img.decoding: setAttribute() to "sync\0" assert_equals: IDL get expected "auto" but got "sync\0"
    1123 FAIL img.decoding: setAttribute() to "ync" assert_equals: IDL get expected "auto" but got "ync"
    1124 FAIL img.decoding: setAttribute() to "SYNC" assert_equals: IDL get expected "sync" but got "SYNC"
    1125 FAIL img.decoding: setAttribute() to "ſync" assert_equals: IDL get expected "auto" but got "ſync"
     1121PASS img.decoding: setAttribute() to "xsync"
     1122PASS img.decoding: setAttribute() to "sync\0"
     1123PASS img.decoding: setAttribute() to "ync"
     1124PASS img.decoding: setAttribute() to "SYNC"
     1125PASS img.decoding: setAttribute() to "ſync"
    11261126PASS img.decoding: setAttribute() to "auto"
    1127 FAIL img.decoding: setAttribute() to "xauto" assert_equals: IDL get expected "auto" but got "xauto"
    1128 FAIL img.decoding: setAttribute() to "auto\0" assert_equals: IDL get expected "auto" but got "auto\0"
    1129 FAIL img.decoding: setAttribute() to "uto" assert_equals: IDL get expected "auto" but got "uto"
    1130 FAIL img.decoding: setAttribute() to "AUTO" assert_equals: IDL get expected "auto" but got "AUTO"
    1131 FAIL img.decoding: IDL set to "" assert_equals: IDL get expected "auto" but got ""
    1132 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 "
    1133 FAIL img.decoding: IDL set to undefined assert_equals: IDL get expected "auto" but got "undefined"
    1134 FAIL img.decoding: IDL set to 7 assert_equals: IDL get expected "auto" but got "7"
    1135 FAIL img.decoding: IDL set to 1.5 assert_equals: IDL get expected "auto" but got "1.5"
    1136 FAIL img.decoding: IDL set to "5%" assert_equals: IDL get expected "auto" but got "5%"
    1137 FAIL img.decoding: IDL set to "+100" assert_equals: IDL get expected "auto" but got "+100"
    1138 FAIL img.decoding: IDL set to ".5" assert_equals: IDL get expected "auto" but got ".5"
    1139 FAIL img.decoding: IDL set to true assert_equals: IDL get expected "auto" but got "true"
    1140 FAIL img.decoding: IDL set to false assert_equals: IDL get expected "auto" but got "false"
    1141 FAIL img.decoding: IDL set to object "[object Object]" assert_equals: IDL get expected "auto" but got "[object Object]"
    1142 FAIL img.decoding: IDL set to NaN assert_equals: IDL get expected "auto" but got "NaN"
    1143 FAIL img.decoding: IDL set to Infinity assert_equals: IDL get expected "auto" but got "Infinity"
    1144 FAIL img.decoding: IDL set to -Infinity assert_equals: IDL get expected "auto" but got "-Infinity"
    1145 FAIL img.decoding: IDL set to "\0" assert_equals: IDL get expected "auto" but got "\0"
    1146 FAIL img.decoding: IDL set to null assert_equals: IDL get expected "auto" but got "null"
    1147 FAIL img.decoding: IDL set to object "test-toString" assert_equals: IDL get expected "auto" but got "test-toString"
    1148 FAIL img.decoding: IDL set to object "test-valueOf" assert_equals: IDL get expected "auto" but got "test-valueOf"
     1127PASS img.decoding: setAttribute() to "xauto"
     1128PASS img.decoding: setAttribute() to "auto\0"
     1129PASS img.decoding: setAttribute() to "uto"
     1130PASS img.decoding: setAttribute() to "AUTO"
     1131PASS img.decoding: IDL set to ""
     1132PASS 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 "
     1133PASS img.decoding: IDL set to undefined
     1134PASS img.decoding: IDL set to 7
     1135PASS img.decoding: IDL set to 1.5
     1136PASS img.decoding: IDL set to "5%"
     1137PASS img.decoding: IDL set to "+100"
     1138PASS img.decoding: IDL set to ".5"
     1139PASS img.decoding: IDL set to true
     1140PASS img.decoding: IDL set to false
     1141PASS img.decoding: IDL set to object "[object Object]"
     1142PASS img.decoding: IDL set to NaN
     1143PASS img.decoding: IDL set to Infinity
     1144PASS img.decoding: IDL set to -Infinity
     1145PASS img.decoding: IDL set to "\0"
     1146PASS img.decoding: IDL set to null
     1147PASS img.decoding: IDL set to object "test-toString"
     1148PASS img.decoding: IDL set to object "test-valueOf"
    11491149PASS img.decoding: IDL set to "async"
    1150 FAIL img.decoding: IDL set to "xasync" assert_equals: IDL get expected "auto" but got "xasync"
    1151 FAIL img.decoding: IDL set to "async\0" assert_equals: IDL get expected "auto" but got "async\0"
    1152 FAIL img.decoding: IDL set to "ASYNC" assert_equals: IDL get expected "async" but got "ASYNC"
    1153 FAIL img.decoding: IDL set to "aſync" assert_equals: IDL get expected "auto" but got "aſync"
     1150PASS img.decoding: IDL set to "xasync"
     1151PASS img.decoding: IDL set to "async\0"
     1152PASS img.decoding: IDL set to "ASYNC"
     1153PASS img.decoding: IDL set to "aſync"
    11541154PASS img.decoding: IDL set to "sync"
    1155 FAIL img.decoding: IDL set to "xsync" assert_equals: IDL get expected "auto" but got "xsync"
    1156 FAIL img.decoding: IDL set to "sync\0" assert_equals: IDL get expected "auto" but got "sync\0"
    1157 FAIL img.decoding: IDL set to "ync" assert_equals: IDL get expected "auto" but got "ync"
    1158 FAIL img.decoding: IDL set to "SYNC" assert_equals: IDL get expected "sync" but got "SYNC"
    1159 FAIL img.decoding: IDL set to "ſync" assert_equals: IDL get expected "auto" but got "ſync"
     1155PASS img.decoding: IDL set to "xsync"
     1156PASS img.decoding: IDL set to "sync\0"
     1157PASS img.decoding: IDL set to "ync"
     1158PASS img.decoding: IDL set to "SYNC"
     1159PASS img.decoding: IDL set to "ſync"
    11601160PASS img.decoding: IDL set to "auto"
    1161 FAIL img.decoding: IDL set to "xauto" assert_equals: IDL get expected "auto" but got "xauto"
    1162 FAIL img.decoding: IDL set to "auto\0" assert_equals: IDL get expected "auto" but got "auto\0"
    1163 FAIL img.decoding: IDL set to "uto" assert_equals: IDL get expected "auto" but got "uto"
    1164 FAIL img.decoding: IDL set to "AUTO" assert_equals: IDL get expected "auto" but got "AUTO"
     1161PASS img.decoding: IDL set to "xauto"
     1162PASS img.decoding: IDL set to "auto\0"
     1163PASS img.decoding: IDL set to "uto"
     1164PASS img.decoding: IDL set to "AUTO"
    11651165PASS img.name: typeof IDL attribute
    11661166PASS img.name: IDL get with DOM attribute unset
  • trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt

    r269494 r280047  
    10941094PASS img.referrerPolicy: IDL set to "unſafe-url"
    10951095PASS img.decoding: typeof IDL attribute
    1096 FAIL img.decoding: IDL get with DOM attribute unset assert_equals: expected "auto" but got ""
    1097 FAIL img.decoding: setAttribute() to "" assert_equals: IDL get expected "auto" but got ""
    1098 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 "
    1099 FAIL img.decoding: setAttribute() to undefined assert_equals: IDL get expected "auto" but got "undefined"
    1100 FAIL img.decoding: setAttribute() to 7 assert_equals: IDL get expected "auto" but got "7"
    1101 FAIL img.decoding: setAttribute() to 1.5 assert_equals: IDL get expected "auto" but got "1.5"
    1102 FAIL img.decoding: setAttribute() to "5%" assert_equals: IDL get expected "auto" but got "5%"
    1103 FAIL img.decoding: setAttribute() to "+100" assert_equals: IDL get expected "auto" but got "+100"
    1104 FAIL img.decoding: setAttribute() to ".5" assert_equals: IDL get expected "auto" but got ".5"
    1105 FAIL img.decoding: setAttribute() to true assert_equals: IDL get expected "auto" but got "true"
    1106 FAIL img.decoding: setAttribute() to false assert_equals: IDL get expected "auto" but got "false"
    1107 FAIL img.decoding: setAttribute() to object "[object Object]" assert_equals: IDL get expected "auto" but got "[object Object]"
    1108 FAIL img.decoding: setAttribute() to NaN assert_equals: IDL get expected "auto" but got "NaN"
    1109 FAIL img.decoding: setAttribute() to Infinity assert_equals: IDL get expected "auto" but got "Infinity"
    1110 FAIL img.decoding: setAttribute() to -Infinity assert_equals: IDL get expected "auto" but got "-Infinity"
    1111 FAIL img.decoding: setAttribute() to "\0" assert_equals: IDL get expected "auto" but got "\0"
    1112 FAIL img.decoding: setAttribute() to null assert_equals: IDL get expected "auto" but got "null"
    1113 FAIL img.decoding: setAttribute() to object "test-toString" assert_equals: IDL get expected "auto" but got "test-toString"
    1114 FAIL img.decoding: setAttribute() to object "test-valueOf" assert_equals: IDL get expected "auto" but got "test-valueOf"
     1096PASS img.decoding: IDL get with DOM attribute unset
     1097PASS img.decoding: setAttribute() to ""
     1098PASS 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 "
     1099PASS img.decoding: setAttribute() to undefined
     1100PASS img.decoding: setAttribute() to 7
     1101PASS img.decoding: setAttribute() to 1.5
     1102PASS img.decoding: setAttribute() to "5%"
     1103PASS img.decoding: setAttribute() to "+100"
     1104PASS img.decoding: setAttribute() to ".5"
     1105PASS img.decoding: setAttribute() to true
     1106PASS img.decoding: setAttribute() to false
     1107PASS img.decoding: setAttribute() to object "[object Object]"
     1108PASS img.decoding: setAttribute() to NaN
     1109PASS img.decoding: setAttribute() to Infinity
     1110PASS img.decoding: setAttribute() to -Infinity
     1111PASS img.decoding: setAttribute() to "\0"
     1112PASS img.decoding: setAttribute() to null
     1113PASS img.decoding: setAttribute() to object "test-toString"
     1114PASS img.decoding: setAttribute() to object "test-valueOf"
    11151115PASS img.decoding: setAttribute() to "async"
    1116 FAIL img.decoding: setAttribute() to "xasync" assert_equals: IDL get expected "auto" but got "xasync"
    1117 FAIL img.decoding: setAttribute() to "async\0" assert_equals: IDL get expected "auto" but got "async\0"
    1118 FAIL img.decoding: setAttribute() to "ASYNC" assert_equals: IDL get expected "async" but got "ASYNC"
    1119 FAIL img.decoding: setAttribute() to "aſync" assert_equals: IDL get expected "auto" but got "aſync"
     1116PASS img.decoding: setAttribute() to "xasync"
     1117PASS img.decoding: setAttribute() to "async\0"
     1118PASS img.decoding: setAttribute() to "ASYNC"
     1119PASS img.decoding: setAttribute() to "aſync"
    11201120PASS img.decoding: setAttribute() to "sync"
    1121 FAIL img.decoding: setAttribute() to "xsync" assert_equals: IDL get expected "auto" but got "xsync"
    1122 FAIL img.decoding: setAttribute() to "sync\0" assert_equals: IDL get expected "auto" but got "sync\0"
    1123 FAIL img.decoding: setAttribute() to "ync" assert_equals: IDL get expected "auto" but got "ync"
    1124 FAIL img.decoding: setAttribute() to "SYNC" assert_equals: IDL get expected "sync" but got "SYNC"
    1125 FAIL img.decoding: setAttribute() to "ſync" assert_equals: IDL get expected "auto" but got "ſync"
     1121PASS img.decoding: setAttribute() to "xsync"
     1122PASS img.decoding: setAttribute() to "sync\0"
     1123PASS img.decoding: setAttribute() to "ync"
     1124PASS img.decoding: setAttribute() to "SYNC"
     1125PASS img.decoding: setAttribute() to "ſync"
    11261126PASS img.decoding: setAttribute() to "auto"
    1127 FAIL img.decoding: setAttribute() to "xauto" assert_equals: IDL get expected "auto" but got "xauto"
    1128 FAIL img.decoding: setAttribute() to "auto\0" assert_equals: IDL get expected "auto" but got "auto\0"
    1129 FAIL img.decoding: setAttribute() to "uto" assert_equals: IDL get expected "auto" but got "uto"
    1130 FAIL img.decoding: setAttribute() to "AUTO" assert_equals: IDL get expected "auto" but got "AUTO"
    1131 FAIL img.decoding: IDL set to "" assert_equals: IDL get expected "auto" but got ""
    1132 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 "
    1133 FAIL img.decoding: IDL set to undefined assert_equals: IDL get expected "auto" but got "undefined"
    1134 FAIL img.decoding: IDL set to 7 assert_equals: IDL get expected "auto" but got "7"
    1135 FAIL img.decoding: IDL set to 1.5 assert_equals: IDL get expected "auto" but got "1.5"
    1136 FAIL img.decoding: IDL set to "5%" assert_equals: IDL get expected "auto" but got "5%"
    1137 FAIL img.decoding: IDL set to "+100" assert_equals: IDL get expected "auto" but got "+100"
    1138 FAIL img.decoding: IDL set to ".5" assert_equals: IDL get expected "auto" but got ".5"
    1139 FAIL img.decoding: IDL set to true assert_equals: IDL get expected "auto" but got "true"
    1140 FAIL img.decoding: IDL set to false assert_equals: IDL get expected "auto" but got "false"
    1141 FAIL img.decoding: IDL set to object "[object Object]" assert_equals: IDL get expected "auto" but got "[object Object]"
    1142 FAIL img.decoding: IDL set to NaN assert_equals: IDL get expected "auto" but got "NaN"
    1143 FAIL img.decoding: IDL set to Infinity assert_equals: IDL get expected "auto" but got "Infinity"
    1144 FAIL img.decoding: IDL set to -Infinity assert_equals: IDL get expected "auto" but got "-Infinity"
    1145 FAIL img.decoding: IDL set to "\0" assert_equals: IDL get expected "auto" but got "\0"
    1146 FAIL img.decoding: IDL set to null assert_equals: IDL get expected "auto" but got "null"
    1147 FAIL img.decoding: IDL set to object "test-toString" assert_equals: IDL get expected "auto" but got "test-toString"
    1148 FAIL img.decoding: IDL set to object "test-valueOf" assert_equals: IDL get expected "auto" but got "test-valueOf"
     1127PASS img.decoding: setAttribute() to "xauto"
     1128PASS img.decoding: setAttribute() to "auto\0"
     1129PASS img.decoding: setAttribute() to "uto"
     1130PASS img.decoding: setAttribute() to "AUTO"
     1131PASS img.decoding: IDL set to ""
     1132PASS 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 "
     1133PASS img.decoding: IDL set to undefined
     1134PASS img.decoding: IDL set to 7
     1135PASS img.decoding: IDL set to 1.5
     1136PASS img.decoding: IDL set to "5%"
     1137PASS img.decoding: IDL set to "+100"
     1138PASS img.decoding: IDL set to ".5"
     1139PASS img.decoding: IDL set to true
     1140PASS img.decoding: IDL set to false
     1141PASS img.decoding: IDL set to object "[object Object]"
     1142PASS img.decoding: IDL set to NaN
     1143PASS img.decoding: IDL set to Infinity
     1144PASS img.decoding: IDL set to -Infinity
     1145PASS img.decoding: IDL set to "\0"
     1146PASS img.decoding: IDL set to null
     1147PASS img.decoding: IDL set to object "test-toString"
     1148PASS img.decoding: IDL set to object "test-valueOf"
    11491149PASS img.decoding: IDL set to "async"
    1150 FAIL img.decoding: IDL set to "xasync" assert_equals: IDL get expected "auto" but got "xasync"
    1151 FAIL img.decoding: IDL set to "async\0" assert_equals: IDL get expected "auto" but got "async\0"
    1152 FAIL img.decoding: IDL set to "ASYNC" assert_equals: IDL get expected "async" but got "ASYNC"
    1153 FAIL img.decoding: IDL set to "aſync" assert_equals: IDL get expected "auto" but got "aſync"
     1150PASS img.decoding: IDL set to "xasync"
     1151PASS img.decoding: IDL set to "async\0"
     1152PASS img.decoding: IDL set to "ASYNC"
     1153PASS img.decoding: IDL set to "aſync"
    11541154PASS img.decoding: IDL set to "sync"
    1155 FAIL img.decoding: IDL set to "xsync" assert_equals: IDL get expected "auto" but got "xsync"
    1156 FAIL img.decoding: IDL set to "sync\0" assert_equals: IDL get expected "auto" but got "sync\0"
    1157 FAIL img.decoding: IDL set to "ync" assert_equals: IDL get expected "auto" but got "ync"
    1158 FAIL img.decoding: IDL set to "SYNC" assert_equals: IDL get expected "sync" but got "SYNC"
    1159 FAIL img.decoding: IDL set to "ſync" assert_equals: IDL get expected "auto" but got "ſync"
     1155PASS img.decoding: IDL set to "xsync"
     1156PASS img.decoding: IDL set to "sync\0"
     1157PASS img.decoding: IDL set to "ync"
     1158PASS img.decoding: IDL set to "SYNC"
     1159PASS img.decoding: IDL set to "ſync"
    11601160PASS img.decoding: IDL set to "auto"
    1161 FAIL img.decoding: IDL set to "xauto" assert_equals: IDL get expected "auto" but got "xauto"
    1162 FAIL img.decoding: IDL set to "auto\0" assert_equals: IDL get expected "auto" but got "auto\0"
    1163 FAIL img.decoding: IDL set to "uto" assert_equals: IDL get expected "auto" but got "uto"
    1164 FAIL img.decoding: IDL set to "AUTO" assert_equals: IDL get expected "auto" but got "AUTO"
     1161PASS img.decoding: IDL set to "xauto"
     1162PASS img.decoding: IDL set to "auto\0"
     1163PASS img.decoding: IDL set to "uto"
     1164PASS img.decoding: IDL set to "AUTO"
    11651165PASS img.name: typeof IDL attribute
    11661166PASS img.name: IDL get with DOM attribute unset
  • trunk/Source/WebCore/ChangeLog

    r280046 r280047  
     12021-07-19  Chris Dumez  <cdumez@apple.com>
     2
     3        HTMLImageElement.decoding should reflect the decoding content attribute, limited to only known values
     4        https://bugs.webkit.org/show_bug.cgi?id=228081
     5
     6        Reviewed by Alex Christensen.
     7
     8        HTMLImageElement.decoding should reflect the decoding content attribute, limited to only known values.
     9        We were missing the *limited to only known values* logic:
     10        - https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decoding
     11
     12        This aligns our behavior with Firefox and Chrome.
     13
     14        No new tests, rebaselined existing test.
     15
     16        * html/HTMLImageElement.cpp:
     17        (WebCore::HTMLImageElement::setDecoding):
     18        (WebCore::HTMLImageElement::decoding const):
     19        * html/HTMLImageElement.h:
     20        * html/HTMLImageElement.idl:
     21
    1222021-07-19  Chris Dumez  <cdumez@apple.com>
    223
  • trunk/Source/WebCore/html/HTMLImageElement.cpp

    r279793 r280047  
    634634}
    635635
     636void HTMLImageElement::setDecoding(String&& decodingMode)
     637{
     638    setAttributeWithoutSynchronization(decodingAttr, WTFMove(decodingMode));
     639}
     640
     641String HTMLImageElement::decoding() const
     642{
     643    switch (decodingMode()) {
     644    case DecodingMode::Synchronous:
     645        return "sync"_s;
     646    case DecodingMode::Asynchronous:
     647        return "async"_s;
     648    case DecodingMode::Auto:
     649        break;
     650    }
     651    return "auto"_s;
     652}
     653
    636654DecodingMode HTMLImageElement::decodingMode() const
    637655{
  • trunk/Source/WebCore/html/HTMLImageElement.h

    r279108 r280047  
    9292    WEBCORE_EXPORT bool complete() const;
    9393
     94    void setDecoding(String&&);
     95    String decoding() const;
     96
    9497    DecodingMode decodingMode() const;
    9598   
  • trunk/Source/WebCore/html/HTMLImageElement.idl

    r267935 r280047  
    4141    readonly attribute USVString currentSrc;
    4242    [CEReactions=NotNeeded, EnabledBySetting=ReferrerPolicyAttribute, ImplementedAs=referrerPolicyForBindings] attribute DOMString referrerPolicy;
    43     [CEReactions=NotNeeded, Reflect] attribute DOMString decoding;
     43    [CEReactions=NotNeeded] attribute DOMString decoding;
    4444    [CEReactions, EnabledBySetting=LazyImageLoading, ImplementedAs=loadingForBindings] attribute DOMString loading;
    4545
Note: See TracChangeset for help on using the changeset viewer.