Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement HTMLImageElement decode #31269

Merged
merged 23 commits into from
Jun 13, 2024

Conversation

Taym95
Copy link
Contributor

@Taym95 Taym95 commented Feb 6, 2024


  • There are tests for these changes

@Taym95 Taym95 marked this pull request as draft February 6, 2024 09:13
@Taym95 Taym95 closed this Feb 9, 2024
@Taym95 Taym95 reopened this Feb 23, 2024
@mrobinson mrobinson added the T-linux-wpt-2020 Do a try run of the WPT label Feb 29, 2024
@github-actions github-actions bot removed the T-linux-wpt-2020 Do a try run of the WPT label Feb 29, 2024
Copy link

🔨 Triggering try run (#8093180833) for Linux WPT layout-2020

Copy link

Test results for linux-wpt-layout-2020 from try job (#8093180833):

Flaky unexpected result (16)
  • TIMEOUT [expected PASS] /_mozilla/css/transition_calc_implicit.html (#17417)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • CRASH [expected OK] /_webgl/conformance2/sync/sync-webgl-specific.html (#26315)
  • TIMEOUT [expected PASS] /css/css-color/animation/opacity-animation-ending-correctly-001.html (#29215)
  • OK /css/cssom-view/MediaQueryList-addListener-handleEvent.html (#24571)
    • PASS [expected FAIL] subtest: looks up handleEvent method on every event dispatch
  • OK /css/cssom-view/MediaQueryList-addListener-removeListener.html (#24569)
    • PASS [expected FAIL] subtest: listeners are called correct number of times
  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • FAIL [expected PASS] subtest: Check execution order from nested timeout assert_equals: Expected nested setTimeout to run second expected true but got false
    • FAIL [expected PASS] subtest: Check execution order on load handler assert_equals: Expected onload to run first expected false but got true
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html (#20768)
    • FAIL [expected PASS] subtest: Tests that a fragment navigation in the unload handler will not block the initial navigation assert_equals: expected "" but got "#fragment"
  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • PASS [expected FAIL] subtest: text/plain: backslash in name (formdata event)
  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • TIMEOUT [expected PASS] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document Test timed out
  • TIMEOUT /resource-timing/nested-context-navigations-iframe.html (#24311)
    • TIMEOUT [expected PASS] subtest: Test that cross-site iframe navigations are not observable by the parent, even after history navigations by the parent Test timed out
    • NOTRUN [expected PASS] subtest: Test that iframe navigations are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that crossorigin iframe navigations are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that cross-site iframe navigations are not observable by the parent
    • NOTRUN [expected TIMEOUT] subtest: Test that iframe refreshes are not observable by the parent
  • TIMEOUT [expected OK] /webmessaging/with-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
  • TIMEOUT [expected OK] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • TIMEOUT [expected PASS] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe Test timed out
Stable unexpected results that are known to be intermittent (18)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '400' should prefer '351 398' over '501 550' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '430' should prefer '501 550' over '502 560' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '500' over '450 460' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '450 460' over '400' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '400' over '350 399' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-stretch: '100%' should prefer '100%' over '110% 120%' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'normal' should prefer 'oblique 10deg 40deg' over 'oblique 20deg 30deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'normal' should prefer 'oblique 20deg 30deg' over 'oblique -50deg -20deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'italic' should prefer 'oblique 40deg 50deg' over 'oblique 5deg 10deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'italic' should prefer 'oblique 5deg' over 'normal' assert_equals: Unexpected font on test element expected 487 but got 532
    • And 3 more unexpected results...
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • TIMEOUT [expected FAIL] subtest: sec-fetch-site - Not sent to non-trustworthy same-site destination, no attributes Test timed out
    • NOTRUN [expected FAIL] subtest: sec-fetch-site - Not sent to non-trustworthy cross-site destination, no attributes
    • NOTRUN [expected TIMEOUT] subtest: sec-fetch-mode - Not sent to non-trustworthy same-origin destination, no attributes
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • PASS [expected FAIL] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank'
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-referrer.window.html (#29081)
    • PASS [expected TIMEOUT] subtest: no-referrer referrer policy used to create the starting page
  • OK /html/browsers/history/the-history-interface/traverse_the_history_3.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted assert_array_equals: Pages opened during history navigation expected property 1 to be 3 but got 2 (expected array [6, 3] got [6, 2])
  • OK [expected TIMEOUT] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • FAIL [expected TIMEOUT] subtest: Host element with delegatesFocus should support autofocus promise_test: Unhandled rejection with value: object "TypeError: host.attachShadow is not a function"
    • FAIL [expected NOTRUN] subtest: Host element with delegatesFocus including no focusable descendants should be skipped promise_test: Unhandled rejection with value: object "TypeError: host.attachShadow is not a function"
    • FAIL [expected NOTRUN] subtest: Area element should support autofocus promise_test: Unhandled rejection with value: object "TypeError: w.document.querySelector(...) is null"
  • TIMEOUT [expected OK] /html/semantics/embedded-content/media-elements/track/track-element/no-cuechange-before-play.html (#31014)
    • TIMEOUT [expected FAIL] subtest: Ensure that the 'cuechange' event is not fired before video playback has begun. Test timed out
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
    • TIMEOUT [expected FAIL] subtest: Check that popups from a sandboxed iframe escape the sandbox if
      allow-popups-to-escape-sandbox is used Test timed out
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
  • OK [expected ERROR] /html/semantics/embedded-content/the-img-element/decode/image-decode-image-document.html (#26298)
    • PASS [expected TIMEOUT] subtest: HTMLImageElement.prototype.decode(), image document tests. Decode from iframe with image document, succeeds (img not loaded)
  • OK /html/semantics/embedded-content/the-img-element/non-active-document.html (#21544)
    • PASS [expected FAIL] subtest: DOMParser
    • PASS [expected FAIL] subtest: createHTMLDocument
    • PASS [expected FAIL] subtest: <template>
  • ERROR /resource-timing/content-type-parsing.html (#29131)
    • TIMEOUT [expected FAIL] subtest: mime-type 16 : text/html;charset=�gbk Test timed out
    • NOTRUN [expected TIMEOUT] subtest: mime-type 17 : text/html;charset= gbk
  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_equals: expected 30605824 but got 30606080
  • OK [expected TIMEOUT] /webmessaging/with-ports/017.html (#24486)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, about:blank
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
  • OK [expected ERROR] /workers/baseurl/alpha/import-in-moduleworker.html (#21315)
  • ERROR [expected OK] /workers/constructors/Worker/Worker-constructor.html (#22991)
Stable unexpected results (7)
  • OK /_webgl/conformance2/renderbuffers/framebuffer-object-attachment.html
    • FAIL [expected PASS] subtest: WebGL test Fix out-of-tree builds #2: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. assert_true: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. expected true got false
    • FAIL [expected PASS] subtest: WebGL test Updated a cast in rust-mozjs #6: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. assert_true: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. expected true got false
    • FAIL [expected PASS] subtest: WebGL test Allow cairo to be placed anywhere or build it in-tree #7: gl.getParameter(gl.DEPTH_BITS) >= 16 should be true. Was false. assert_true: gl.getParameter(gl.DEPTH_BITS) >= 16 should be true. Was false. expected true got false
    • FAIL [expected PASS] subtest: WebGL test Fixed an html-parsing crash caused by refactor #10: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. assert_true: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. expected true got false
    • FAIL [expected PASS] subtest: WebGL test Implemented a parser for a subset of css. #11: gl.getParameter(gl.DEPTH_BITS) >= 16 should be true. Was false. assert_true: gl.getParameter(gl.DEPTH_BITS) >= 16 should be true. Was false. expected true got false
    • FAIL [expected PASS] subtest: WebGL test Added explicit casts from ints to machine types #12: gl.getParameter(gl.STENCIL_BITS) >= 8 should be true. Was false. assert_true: gl.getParameter(gl.STENCIL_BITS) >= 8 should be true. Was false. expected true got false
    • FAIL [expected PASS] subtest: WebGL test Added css selector matching and now render specified background colors #16: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. assert_true: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. expected true got false
    • FAIL [expected PASS] subtest: WebGL test Fix borrowck errors and erros in layout positioning #17: gl.getParameter(gl.DEPTH_BITS) >= 16 should be true. Was false. assert_true: gl.getParameter(gl.DEPTH_BITS) >= 16 should be true. Was false. expected true got false
    • FAIL [expected PASS] subtest: WebGL test build fails on ubuntu 12.04 "I need autoconf 2.13" #21: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. assert_true: gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16 should be true. Was false. expected true got false
    • FAIL [expected PASS] subtest: WebGL test Fail to build on Mac OS X 10.7 #22: gl.getParameter(gl.DEPTH_BITS) >= 16 should be true. Was false. assert_true: gl.getParameter(gl.DEPTH_BITS) >= 16 should be true. Was false. expected true got false
    • And 9 more unexpected results...
  • OK /html/dom/idlharness.https.html?include=HTML.*
    • PASS [expected FAIL] subtest: HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type
    • PASS [expected FAIL] subtest: HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes.html
    • TIMEOUT [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode. Test timed out
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode; following good png decode succeeds.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode; following good svg decode succeeds.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode; following bad decode fails.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes to the same path succeed.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following good decode succeeds.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following bad decode fails.
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode-picture.html
    • TIMEOUT [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Image with PNG source decodes with undefined. Test timed out
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Image with multiple sources decodes with undefined.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Image with PNG data URL source decodes with undefined.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Image with SVG source decodes with undefined.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Non-existent source fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Corrupt image in src fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Image without srcset fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Multiple decodes for images with src succeed.
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode-with-quick-attach.html
    • TIMEOUT [expected FAIL] subtest: HTMLImageElement.prototype.decode(), attach to DOM before promise resolves. Test timed out
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode.html
    • TIMEOUT [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image with PNG src decodes with undefined. Test timed out
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image with PNG data URL src decodes with undefined.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image with SVG src decodes with undefined.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Non-existent src fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Inactive document fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Adopted active image into inactive document fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Adopted inactive image into active document succeeds.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Corrupt image in src fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image without src/srcset fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Multiple decodes for images with src succeed.
    • And 4 more unexpected results...
  • TIMEOUT [expected OK] /resource-timing/body-size-cross-origin.https.html
    • TIMEOUT [expected FAIL] subtest: Retrieving a same-origin resource without Timing-Allow-Origin should expose body size Test timed out
    • NOTRUN [expected FAIL] subtest: Retrieving a same-origin resource with Timing-Allow-Origin should expose body size
    • NOTRUN [expected FAIL] subtest: Retrieving a no-cors resource without Timing-Allow-Origin should not expose body size
    • NOTRUN [expected FAIL] subtest: Retrieving a no-cors resource with Timing-Allow-Origin should not expose body size
    • NOTRUN [expected FAIL] subtest: Retrieving a cors resource without Timing-Allow-Origin should expose body size
    • NOTRUN [expected FAIL] subtest: Retrieving a cors resource with Timing-Allow-Origin should expose body size

Copy link

⚠️ Try run (#8093180833) failed.

@servo-wpt-sync
Copy link
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@Taym95 Taym95 marked this pull request as ready for review March 1, 2024 10:42
@mrobinson
Copy link
Member

@Taym95 Do you mind taking a look at the failing tests? It seems that this change introduces some failure and timeouts.

@Taym95
Copy link
Contributor Author

Taym95 commented Mar 1, 2024

@Taym95 Do you mind taking a look at the failing tests? It seems that this change introduces some failure and timeouts.

I pushed another commit after last Try run, maybe we should trigger it again? but I will do it my fork

@mrobinson mrobinson added the T-linux-wpt-2020 Do a try run of the WPT label Mar 1, 2024
@github-actions github-actions bot removed the T-linux-wpt-2020 Do a try run of the WPT label Mar 1, 2024
Copy link

github-actions bot commented Mar 1, 2024

🔨 Triggering try run (#8111488522) for Linux WPT

Copy link

github-actions bot commented Mar 1, 2024

Test results for linux-wpt-layout-2020 from try job (#8111488522):

Flaky unexpected result (18)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • PASS [expected FAIL] subtest: Matching font-weight: '500' should prefer '501 550' over '502 560'
    • PASS [expected FAIL] subtest: Matching font-weight: '501' should prefer '503 520' over '500'
    • PASS [expected FAIL] subtest: Matching font-weight: '501' should prefer '500' over '450 460'
    • PASS [expected FAIL] subtest: Matching font-weight: '399' should prefer '500 501' over '502 510'
    • PASS [expected FAIL] subtest: Matching font-stretch: '90%' should prefer '90% 100%' over '50% 80%'
    • PASS [expected FAIL] subtest: Matching font-stretch: '90%' should prefer '110% 140%' over '120% 130%'
    • PASS [expected FAIL] subtest: Matching font-style: 'normal' should prefer 'normal' over 'oblique 0deg'
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique -21deg' should prefer 'oblique 0deg' over 'oblique 30deg 60deg'
  • OK /css/cssom-view/MediaQueryList-addListener-handleEvent.html (#24571)
    • FAIL [expected PASS] subtest: looks up handleEvent method on every event dispatch assert_equals: expected 2 but got 1
  • OK /css/cssom-view/MediaQueryList-addListener-removeListener.html (#24569)
    • PASS [expected FAIL] subtest: listeners are called correct number of times
  • TIMEOUT [expected PASS] /css/filter-effects/feimage-reference-foreign-object-crash.html
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • FAIL [expected PASS] subtest: load event does not fire on window.open('about:blank') assert_unreached: load should not be fired Reached unreachable code
  • TIMEOUT /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-no-beforeunload.window.html (#29055)
    • TIMEOUT [expected FAIL] subtest: Navigating an opened window with an iframe via location.href to a javascript: URL must not fire beforeunload on the iframe: undefined completion Test timed out
    • NOTRUN [expected PASS] subtest: Navigating an iframe via location.href to a javascript: URL must not fire beforeunload: string completion
    • NOTRUN [expected PASS] subtest: Navigating an iframe via src="" to a javascript: URL after insertion must not fire beforeunload: string completion
    • NOTRUN [expected TIMEOUT] subtest: Navigating an opened window via location.href to a javascript: URL must not fire beforeunload: string completion
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • PASS [expected FAIL] subtest: Cross-origin navigation started from unload handler must be ignored
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
  • CRASH [expected OK] /html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-closeable.html
  • OK /html/browsers/history/the-history-interface/traverse_the_history_4.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • FAIL [expected PASS] /html/semantics/embedded-content/the-img-element/image-loading-lazy-slow.html (#30684)
  • OK /html/semantics/forms/historical.html (#28568)
    • PASS [expected FAIL] subtest: <input name=isindex> should not be supported
  • OK [expected ERROR] /html/semantics/scripting-1/the-script-element/defer-script/async-script.html?reload (#29054)
  • TIMEOUT /resource-timing/test_resource_timing.html (#25720)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img)
  • TIMEOUT [expected OK] /wasm/jsapi/functions/entry.html (#27087)
    • TIMEOUT [expected FAIL] subtest: Start function Test timed out
  • OK [expected TIMEOUT] /webmessaging/with-ports/017.html (#24486)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, about:blank
  • OK [expected TIMEOUT] /webmessaging/without-ports/017.html (#24486)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, about:blank
Stable unexpected results that are known to be intermittent (15)
  • FAIL [expected PASS] /_mozilla/css/dirty_viewport.html (#13731)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/cssom-view/matchMedia.html (#31428)
    • PASS [expected FAIL] subtest: iframe.matchMedia("(min-width: 150px)") matches
  • OK /css/cssom-view/scroll-behavior-smooth-navigation.html (#29564)
    • FAIL [expected PASS] subtest: Smooth scrolling while doing history navigation. assert_not_equals: Shouldn't be scrolled back to top yet. got disallowed value 0
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • FAIL [expected TIMEOUT] subtest: sec-fetch-site - Not sent to non-trustworthy same-site destination, no attributes promise_test: Unhandled rejection with value: object "Error: Failed to query for recorded headers."
    • FAIL [expected NOTRUN] subtest: sec-fetch-site - Not sent to non-trustworthy cross-site destination, no attributes promise_test: Unhandled rejection with value: object "Error: Failed to query for recorded headers."
    • TIMEOUT [expected NOTRUN] subtest: sec-fetch-mode - Not sent to non-trustworthy same-origin destination, no attributes Test timed out
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • TIMEOUT [expected OK] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/no-cuechange-before-play.html (#31014)
    • FAIL [expected TIMEOUT] subtest: Ensure that the 'cuechange' event is not fired before video playback has begun. assert_true: Not expecting event, but got canplaythrough event expected true got false
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if
      allow-popups-to-escape-sandbox is used assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if
      allow-popups-to-escape-sandbox is used assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html (#24057)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if
      allow-popups-to-escape-sandbox is used assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • TIMEOUT [expected ERROR] /html/semantics/embedded-content/the-img-element/decode/image-decode-image-document.html (#26298)
  • OK /workers/WorkerGlobalScope-close.html (#23064)
    • FAIL [expected PASS] subtest: Test sending a message after closing. assert_not_equals: got disallowed value "pong"
Stable unexpected results (4)
  • OK /html/dom/idlharness.https.html?include=HTML.*
    • PASS [expected FAIL] subtest: HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type
    • PASS [expected FAIL] subtest: HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes.html
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode; following bad decode fails.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following bad decode fails.
  • OK /html/semantics/embedded-content/the-img-element/decode/image-decode-picture.html
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Non-existent source fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Corrupt image in src fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Image without srcset fails decode.
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode.html
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Non-existent src fails decode.
    • TIMEOUT [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Inactive document fails decode. Test timed out
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Adopted active image into inactive document fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Adopted inactive image into active document succeeds.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Corrupt image in src fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image without src/srcset fails decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Multiple decodes for images with src succeed.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image with PNG srcset decodes with undefined.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image with SVG srcset decodes with undefined.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Non-existent srcset fails decode.
    • And 1 more unexpected results...

Copy link

github-actions bot commented Mar 1, 2024

⚠️ Try run (#8111488522) failed.

Copy link
Member

@gterzian gterzian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start! Some pointers for the next step. Note that this is actually simpler than what I wrote in the initial issue...

components/script/dom/htmlimageelement.rs Outdated Show resolved Hide resolved
components/script/dom/htmlimageelement.rs Outdated Show resolved Hide resolved
components/script/dom/htmlimageelement.rs Outdated Show resolved Hide resolved
@mrobinson
Copy link
Member

@Taym95 Any updates on this one? Is there some way that I can help you get this ready for review again?

@Taym95
Copy link
Contributor Author

Taym95 commented Apr 28, 2024

@Taym95 Any updates on this one? Is there some way that I can help you get this ready for review again?

Sorry, @mrobinson, I was busy in previous weeks. I will continue working on this this week.

@Taym95 Taym95 force-pushed the Implement-HTMLImageElement-decode branch 2 times, most recently from c1df1b6 to d3f2d8b Compare June 2, 2024 20:20
@Taym95
Copy link
Contributor Author

Taym95 commented Jun 3, 2024

@Taym95 Any updates on this one? Is there some way that I can help you get this ready for review again?

@mrobinson Can you run wpt on this PR? I ran it on my fork, and a lot of tests are passing now. Thanks!

@mrobinson mrobinson added T-linux-wpt-2013 Do a try run of the WPT (legacy layout) T-linux-wpt-2020 Do a try run of the WPT labels Jun 3, 2024
@github-actions github-actions bot removed T-linux-wpt-2013 Do a try run of the WPT (legacy layout) T-linux-wpt-2020 Do a try run of the WPT labels Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

🔨 Triggering try run (#9348660545) for Linux WPT

Copy link

github-actions bot commented Jun 3, 2024

Test results for linux-wpt-layout-2013 from try job (#9348660545):

Flaky unexpected result (7)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • PASS [expected FAIL] subtest: Check execution order on load handler
    • PASS [expected FAIL] subtest: Check execution order from nested timeout
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored

      promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
      

  • TIMEOUT [expected OK] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • OK /html/semantics/forms/form-submission-0/multipart-formdata.window.html (#28725)
    • PASS [expected FAIL] subtest: multipart/form-data: 0x00 in name (normal form)
    • PASS [expected FAIL] subtest: multipart/form-data: \r\n in value (normal form)
  • TIMEOUT [expected OK] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • TIMEOUT [expected PASS] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      Test timed out
      

  • OK [expected ERROR] /workers/constructors/Worker/Worker-constructor.html (#22991)
Stable unexpected results that are known to be intermittent (10)
  • OK /_mozilla/mozilla/detached_layout.html (#32343)
    • FAIL [expected PASS] subtest: Detached layout doesn't panic

      uncaught exception: Error: assert_equals: rectangle should be zero-sized expected 0 but got 284
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • FAIL [expected PASS] subtest: Same-origin navigation started from unload handler must be ignored

      assert_equals: expected "?pass" but got "?fail"
      

  • OK /html/browsers/history/the-history-interface/traverse_the_history_4.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted

      assert_array_equals: Pages opened during history navigation expected property 1 to be 5 but got 3 (expected array [6, 5] got [6, 3])
      

  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • TIMEOUT [expected PASS] subtest: Non-HTMLElement should not support autofocus

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus should support autofocus
    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus including no focusable descendants should be skipped
    • NOTRUN [expected FAIL] subtest: Area element should support autofocus
  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
  • TIMEOUT [expected ERROR] /html/semantics/embedded-content/the-img-element/decode/image-decode-image-document.html (#26298)
  • OK /html/webappapis/dynamic-markup-insertion/document-write/module-delayed.html (#27659)
    • PASS [expected FAIL] subtest: async document.write in a module
  • TIMEOUT /resource-timing/test_resource_timing.html (#25720)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img)
  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img)
  • OK /workers/WorkerGlobalScope-close.html (#23064)
    • FAIL [expected PASS] subtest: Test sending a message after closing.

      assert_not_equals: got disallowed value "pong"
      

Stable unexpected results (4)
  • OK /html/dom/idlharness.https.html?include=HTML.*
    • PASS [expected FAIL] subtest: HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type
    • PASS [expected FAIL] subtest: HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes.html
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode.
    • TIMEOUT [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode; following bad decode fails.

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes to the same path succeed.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following good decode succeeds.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following bad decode fails.
  • OK /html/semantics/embedded-content/the-img-element/decode/image-decode-picture.html
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Non-existent source fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Corrupt image in src fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Image without srcset fails decode.
  • OK /html/semantics/embedded-content/the-img-element/decode/image-decode.html
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Non-existent src fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Inactive document fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Adopted active image into inactive document fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Corrupt image in src fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image without src/srcset fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Non-existent srcset fails decode.

Copy link

github-actions bot commented Jun 3, 2024

Test results for linux-wpt-layout-2020 from try job (#9348660545):

Flaky unexpected result (14)
  • FAIL [expected PASS] /_mozilla/css/dirty_viewport.html (#13731)
  • FAIL [expected PASS] /css/css-values/vh_not_refreshing_on_chrome.html (#23385, #15570)
  • TIMEOUT /fetch/api/basic/keepalive.any.html (#29536)
    • TIMEOUT [expected PASS] subtest: [keepalive] simple GET request on 'load' [no payload]; setting up

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: [keepalive] simple GET request on 'pagehide' [no payload]; setting up
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored

      promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • OK /html/browsers/history/the-history-interface/traverse_the_history_3.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • TIMEOUT [expected PASS] /html/canvas/element/manual/drawing-text-to-the-canvas/canvas.2d.disconnected-font-size-math.html (#30063)
  • TIMEOUT [expected OK] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/autofocus-dialog.html (#29087)
    • TIMEOUT [expected FAIL] subtest: &lt;dialog&gt;-contained autofocus element gets focused when the dialog is shown

      Test timed out
      

  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
  • CRASH [expected PASS] /html/semantics/embedded-content/the-img-element/image-loading-lazy-subframe-detached-crash.html (#31572)
  • OK /html/semantics/forms/form-submission-0/multipart-formdata.window.html (#28725)
    • PASS [expected FAIL] subtest: multipart/form-data: \r\n in value (formdata event)
    • PASS [expected FAIL] subtest: multipart/form-data: double quote in value (formdata event)
  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • PASS [expected FAIL] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document
  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img)

      assert_equals: expected 10539264 but got 10539776
      

Stable unexpected results that are known to be intermittent (10)
  • TIMEOUT [expected OK] /css/css-transitions/disconnected-element-001.html (#32275)
    • TIMEOUT [expected PASS] subtest: Transitions are canceled when an element is re-parented to the same node

      Test timed out
      

  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • TIMEOUT [expected PASS] subtest: background-image sec-fetch-site - HTTPS downgrade (header not sent)

      Test timed out
      

  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.https.sub.html (#30111)
    • FAIL [expected NOTRUN] subtest: sec-fetch-site - Same site, no attributes

      promise_test: Unhandled rejection with value: object "Error: Failed to query for recorded headers."
      

    • TIMEOUT [expected NOTRUN] subtest: sec-fetch-site - Same-Origin -&gt; Cross-Site -&gt; Same-Origin redirect, no attributes

      Test timed out
      

  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • FAIL [expected PASS] subtest: sec-fetch-site - Not sent to non-trustworthy same-origin destination, no attributes

      promise_test: Unhandled rejection with value: object "Error: Failed to query for recorded headers."
      

  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • TIMEOUT [expected FAIL] subtest: Navigating to a different document with link click

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: Navigating to a different document with form submission
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • TIMEOUT /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
    • TIMEOUT [expected FAIL] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      Test timed out
      

  • OK /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html (#24057)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
  • TIMEOUT [expected ERROR] /html/semantics/embedded-content/the-img-element/decode/image-decode-image-document.html (#26298)
Stable unexpected results (4)
  • OK /html/dom/idlharness.https.html?include=HTML.*
    • PASS [expected FAIL] subtest: HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type
    • PASS [expected FAIL] subtest: HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes.html
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode.
    • TIMEOUT [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode; following bad decode fails.

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes to the same path succeed.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following good decode succeeds.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following bad decode fails.
  • OK /html/semantics/embedded-content/the-img-element/decode/image-decode-picture.html
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Non-existent source fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Corrupt image in src fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Image without srcset fails decode.
  • OK /html/semantics/embedded-content/the-img-element/decode/image-decode.html
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Non-existent src fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Inactive document fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Adopted active image into inactive document fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Corrupt image in src fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image without src/srcset fails decode.
    • PASS [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Non-existent srcset fails decode.

…ilable

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
@Taym95
Copy link
Contributor Author

Taym95 commented Jun 10, 2024

TIMEOUT [expected PASS] subtest: HTMLImageElement.prototype.decode(), basic tests. Image without src/srcset fails decode.

The problem here is that if no src is set, the update_the_image_data step will not run, so the promise will never resolve(we are currently piggybacking on that worflow to deal with trying to fetch the image).

But, I think we should run update_the_image_data also when the element is created, per the spec:

the user agent must synchronously update the image data of the img element, with the restart animation flag set if so stated, whenever that element is created or has experienced relevant mutations

source: https://html.spec.whatwg.org/multipage/#when-to-obtain-images

So I would say let's run update_the_image_data when the element is created at

Another thing is that I just saw that abort_request sometimes also sets the request to completely available, so we should resolve in that case I think.

Thanks, I addressed these remarks

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Copy link
Member

@gterzian gterzian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, one last thing I'd like to check.

for promise in self.image_decode_promises.borrow().iter() {
promise.resolve_native(&());
}
self.image_decode_promises.borrow_mut().clear();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it not be better to just do a drain(...) above?

Copy link
Contributor Author

@Taym95 Taym95 Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use drain(..) from the doc I saw:

  /// // A full range clears the vector, like `clear()` does
 /// v.drain(..);
/// assert_eq!(v, &[]);

@@ -1345,6 +1397,9 @@ pub enum ImageElementMicrotask {
elem: DomRoot<HTMLImageElement>,
generation: u32,
},
DecodeTask {
elem: DomRoot<HTMLImageElement>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing I thought about: there is currently a race condition between when the microtask runs, and the "in parallel" stuff described at 2.2. For example if the request becomes broken, we will reject all promises, including the one for which the micro task hasn't run yet.

I'm not sure this is actually a problem, but we may as well be consitent with the spec and:

  1. In Decode, not store the promise on pending_, but rather store it here in the task.
  2. change react_to_decode_image_sync_steps as described above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved storing promise in task and tests are okey

if !document.is_fully_active() ||
matches!(self.current_request.borrow().state, State::Broken)
{
self.reject_image_decode_promises();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here, as per the comment below, let's only reject the promise associated with the task, and remove the resolve logic below. Instead, if the promise is not rejected, we should store it on pending_, and resolve/reject it later as the request state changes.

I'm going to run the wpt tests before this change, and after, just to see if this makes a difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the resolve logic but it broke lot of tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will just run the tests once to see, but probably we should then keep it. I guess its a kind of race condition in the spec, between the microtask and the parallel steps.

@gterzian gterzian added the T-linux-wpt-2020 Do a try run of the WPT label Jun 11, 2024
@github-actions github-actions bot removed the T-linux-wpt-2020 Do a try run of the WPT label Jun 11, 2024
Copy link

🔨 Triggering try run (#9464494120) for Linux WPT

Copy link

Test results for linux-wpt-layout-2020 from try job (#9464494120):

Flaky unexpected result (10)
  • TIMEOUT [expected OK] /css/css-transitions/disconnected-element-001.html (#32275)
    • TIMEOUT [expected PASS] subtest: Transitions are canceled when an element is re-parented to the same node

      Test timed out
      

  • TIMEOUT /fetch/api/basic/keepalive.any.html (#29536)
    • TIMEOUT [expected PASS] subtest: [keepalive] simple GET request on 'load' [no payload]; setting up

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: [keepalive] simple GET request on 'pagehide' [no payload]; setting up
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • PASS [expected FAIL] subtest: sec-fetch-site - Not sent to non-trustworthy same-origin destination, no attributes
  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • FAIL [expected PASS] subtest: Check execution order from nested timeout

      assert_equals: Expected nested setTimeout to run second expected true but got false
      

    • FAIL [expected PASS] subtest: Check execution order on load handler

      assert_equals: Expected onload to run first expected false but got true
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • FAIL [expected PASS] subtest: aElement.click() before the load event must NOT replace

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?thereplacement" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html?pipe=sub(none)&amp;code=%0A%20%20%20%20const%20a%20%3D%20document.createElement(%22a%22)%3B%0A%20%20%20%20a.href%20%3D%20%22%2Fcommon%2Fblank.html%3Fthereplacement%22%3B%0A%20%20%20%20document.currentScript.before(a)%3B%0A%20%20%20%20a.click()%3B%0A%20%20"
      

  • OK [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • PASS [expected FAIL] subtest: text/plain: 0x00 in filename (formdata event)
  • OK /html/semantics/forms/form-submission-0/urlencoded2.window.html (#28687)
    • PASS [expected FAIL] subtest: application/x-www-form-urlencoded: \n in value (normal form)
  • OK [expected ERROR] /workers/constructors/Worker/Worker-constructor.html (#22991)
Stable unexpected results that are known to be intermittent (15)
  • FAIL [expected PASS] /_mozilla/css/dirty_viewport.html (#13731)
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-style: 'oblique 20deg' should prefer 'oblique 10deg' over 'italic'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

  • FAIL [expected PASS] /css/css-sizing/dynamic-available-size-iframe.html (#31559)
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.https.sub.html (#30111)
    • FAIL [expected NOTRUN] subtest: sec-fetch-site - Same site, no attributes

      promise_test: Unhandled rejection with value: object "Error: Failed to query for recorded headers."
      

    • TIMEOUT [expected NOTRUN] subtest: sec-fetch-site - Same-Origin -&gt; Cross-Site -&gt; Same-Origin redirect, no attributes

      Test timed out
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • PASS [expected FAIL] subtest: Navigating to a different document with link click
  • OK [expected CRASH] /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/autofocus-dialog.html (#29087)
    • TIMEOUT [expected FAIL] subtest: &lt;dialog&gt;-contained autofocus element gets focused when the dialog is shown

      Test timed out
      

  • CRASH [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-cross-site.tentative.sub.window.html (#31754)
    • FAIL [expected TIMEOUT] subtest: A cross-site unsandboxed iframe navigation consumes user activation and disallows top-level navigation.

      promise_test: Unhandled rejection with value: object "TypeError: element.scrollIntoView is not a function"
      

  • OK /html/semantics/forms/historical.html (#28568)
    • PASS [expected FAIL] subtest: &lt;input name=isindex&gt; should not be supported
  • OK /html/syntax/parsing/DOMContentLoaded-defer.html (#21550)
    • FAIL [expected PASS] subtest: The end: DOMContentLoaded and defer scripts

      assert_false: DOMContentLoaded should not have fired before executing a task queued from a defer script expected false got true
      

  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img)

      assert_equals: expected 6899456 but got 6899200
      

  • TIMEOUT [expected OK] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • TIMEOUT [expected PASS] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      Test timed out
      

Copy link

✨ Try run (#9464494120) succeeded.

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
@gterzian gterzian added the T-linux-wpt-2020 Do a try run of the WPT label Jun 11, 2024
@github-actions github-actions bot removed the T-linux-wpt-2020 Do a try run of the WPT label Jun 11, 2024
Copy link

🔨 Triggering try run (#9470224661) for Linux WPT

Copy link

Test results for linux-wpt-layout-2020 from try job (#9470224661):

Flaky unexpected result (14)
  • CRASH [expected PASS] /_webgl/conformance/glsl/bugs/long-expressions-should-not-crash.html (#19221)
  • TIMEOUT [expected OK] /css/css-transitions/disconnected-element-001.html (#32275)
    • TIMEOUT [expected PASS] subtest: Transitions are canceled when an element is re-parented to the same node

      Test timed out
      

  • OK /css/css-values/cap-invalidation.html
    • FAIL [expected PASS] subtest: CSS Values and Units Test: cap invalidation

      uncaught exception: Error: assert_not_equals: expect the capital height of Ahem and sans-serif to be different got disallowed value 371.3333333333333
      

  • OK /css/cssom-view/MediaQueryList-change-event-matches-value.html (#27973)
    • FAIL [expected PASS] subtest: MediaQueryList.changed is correct for all lists in the document even during a change event handler

      assert_equals: Should've fired the change event in both MediaQueryLists expected 2 but got 0
      

  • OK /css/cssom-view/MediaQueryListEvent.html (#25275)
    • FAIL [expected PASS] subtest: argument of addListener

      assert_true: expected true got false
      

  • TIMEOUT [expected OK] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • TIMEOUT [expected PASS] subtest: [keepalive][iframe][load] mixed content redirect; setting up

      Test timed out
      

  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • PASS [expected FAIL] subtest: sec-fetch-site - Not sent to non-trustworthy same-origin destination, no attributes
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • PASS [expected FAIL] subtest: Navigating to a different document with form submission
  • OK /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html (#28066)
    • FAIL [expected PASS] subtest: 0041 set in href="" targeting a frame and clicked

      assert_equals: expected "A" but got ""
      

    • FAIL [expected PASS] subtest: 0080 00FF set in href="" targeting a frame and clicked

      assert_equals: expected "�ÿ" but got ""
      

    • FAIL [expected PASS] subtest: 0080 00FF 0100 set in href="" targeting a frame and clicked

      assert_equals: expected "�ÿĀ" but got ""
      

    • FAIL [expected PASS] subtest: D83D DE0D set in href="" targeting a frame and clicked

      assert_equals: expected "😍" but got ""
      

    • FAIL [expected PASS] subtest: DE0D 0041 set in href="" targeting a frame and clicked

      assert_equals: expected "\ufffdA" but got ""
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • CRASH [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
  • OK [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • OK /html/semantics/forms/form-submission-0/multipart-formdata.window.html (#28725)
    • PASS [expected FAIL] subtest: multipart/form-data: 0x00 in value (normal form)
Stable unexpected results that are known to be intermittent (9)
  • FAIL [expected PASS] /_mozilla/css/dirty_viewport.html (#13731)
  • FAIL [expected PASS] /_mozilla/css/iframe/hide_and_show.html (#15265)
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '400' should prefer '400' over '450 460'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • FAIL [expected PASS] subtest: Matching font-style: 'oblique -10deg' should prefer 'oblique -10deg' over 'oblique -5deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.https.sub.html (#30111)
    • TIMEOUT [expected FAIL] subtest: sec-fetch-site - Cross-site, no attributes

      Test timed out
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored

      promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
      

  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/autofocus-dialog.html (#29087)
    • TIMEOUT [expected FAIL] subtest: &lt;dialog&gt;-contained autofocus element gets focused when the dialog is shown

      Test timed out
      

  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-cross-site.tentative.sub.window.html (#31754)
    • FAIL [expected TIMEOUT] subtest: A cross-site unsandboxed iframe navigation consumes user activation and disallows top-level navigation.

      promise_test: Unhandled rejection with value: object "TypeError: element.scrollIntoView is not a function"
      

  • TIMEOUT [expected OK] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • TIMEOUT [expected PASS] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      Test timed out
      

Stable unexpected results (3)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes.html
    • TIMEOUT [expected PASS] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes to the same path succeed.

      Test timed out
      

    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following good decode succeeds.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following bad decode fails.
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode-picture.html
    • TIMEOUT [expected PASS] subtest: HTMLImageElement.prototype.decode(), picture tests. Image with multiple sources decodes with undefined.

      Test timed out
      

    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), picture tests. Image with PNG data URL source decodes with undefined.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), picture tests. Image with SVG source decodes with undefined.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), picture tests. Non-existent source fails decode.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), picture tests. Corrupt image in src fails decode.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), picture tests. Image without srcset fails decode.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), picture tests. Multiple decodes for images with src succeed.
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-img-element/decode/image-decode.html
    • TIMEOUT [expected PASS] subtest: HTMLImageElement.prototype.decode(), basic tests. Adopted inactive image into active document succeeds.

      Test timed out
      

    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), basic tests. Corrupt image in src fails decode.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), basic tests. Image without src/srcset fails decode.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), basic tests. Multiple decodes for images with src succeed.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), basic tests. Image with PNG srcset decodes with undefined.
    • NOTRUN [expected FAIL] subtest: HTMLImageElement.prototype.decode(), basic tests. Image with SVG srcset decodes with undefined.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), basic tests. Non-existent srcset fails decode.
    • NOTRUN [expected PASS] subtest: HTMLImageElement.prototype.decode(), basic tests. Multiple decodes for images with srcset succeed.

Copy link

⚠️ Try run (#9470224661) failed.

Copy link
Member

@gterzian gterzian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, one comment and lets undo the last commit please.

@@ -1173,7 +1173,11 @@ impl HTMLImageElement {
}

// Step 2 for <https://html.spec.whatwg.org/multipage/#dom-img-decode>
fn react_to_decode_image_sync_steps(&self) {
fn react_to_decode_image_sync_steps(&self, promise: Rc<Promise>) {
self.image_decode_promises
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I meant is that we should only resolve or reject this particular promise here, and if neither happens, at the end of the function store it into this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@gterzian
Copy link
Member

Note also there is a discussion ongoing about the potential race condition I mentioned, at whatwg/html#4217.

@servo-wpt-sync
Copy link
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

Copy link
Member

@gterzian gterzian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

&document.global(),
DOMErrorName::EncodingError,
));
} else if matches!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I would add a comment that this does not follow the spec, but it is discussed at whatwg/html#4217

…ailable

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
@servo-wpt-sync
Copy link
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@gterzian gterzian added this pull request to the merge queue Jun 13, 2024
@gterzian
Copy link
Member

Thank you, great work! @Taym95

Merged via the queue into servo:main with commit 1d048f4 Jun 13, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement HTMLImageElement decode
4 participants