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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Taym95
Copy link
Contributor

@Taym95 Taym95 commented Feb 6, 2024


  • There are tests for these changes

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
@Taym95 Taym95 marked this pull request as draft February 6, 2024 09:13
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
@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.

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.

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
@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...

@@ -913,6 +917,53 @@ impl HTMLImageElement {
}
}

/// Step 2-2.2 of <https://html.spec.whatwg.org/multipage/#dom-img-decode>
Copy link
Member

Choose a reason for hiding this comment

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

Let's call this "The microtask part of decode(). With the link on the second line.

};

// Step 2.2
if document.is_fully_active() || !available {
Copy link
Member

Choose a reason for hiding this comment

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

I would say let's follow the spec more closely, and first return the error if not fully active or not available.

ref elem,
ref promise,
} => {
elem.decode_image_data_sync(promise);
Copy link
Member

Choose a reason for hiding this comment

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

So, here we need to break this into two parts:

  1. Step 2.1, which run immediately in the microtask.
  2. Step 2.2, which runs "in parallel".

For 2, we need to integrate with the extisting async worflow with the image cache that is setup within react_to_environment_changes_sync_steps and which continues here.

I think this is best done by simply adding some state to the image element, so that a pending decoding can be noted and later continued. See for inspiration what is done with pending_request.

This is actually simpler than I thought, because you don't need to do anything special with the image cache: just keep the decode promise, and then inside process_image_response_for_environment_change, do the steps in 2.2(except the actual decoding, which happens in the image cache).

@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.

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