Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7d9d2b24cc14a3246f0e777d7e791892ed6e89c4
      
https://github.com/WebKit/WebKit/commit/7d9d2b24cc14a3246f0e777d7e791892ed6e89c4
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/decode/image-decode-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-svg.tentative-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/decode/image-decode-with-quick-attach-expected.txt
    M LayoutTests/platform/mac/TestExpectations
    M Source/WebCore/loader/ImageLoader.cpp

  Log Message:
  -----------
  HTMLImageElement.decode() resolves spuriously after adoption, src change, or 
cached-image race
https://bugs.webkit.org/show_bug.cgi?id=315733
rdar://178118012

Reviewed by Said Abou-Hallawa and Chris Dumez.

If ImageLoader is loading a new image or if the HTMLImageElement is moved
to another document, reject all the pending DecodePromises.

Calling the parameterless ImageLoader::decode() also has to be enqueued as
a microtask, per the HTML spec for HTMLImageElement.decode() [1].

[1] https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode

* LayoutTests/TestExpectations: Unskip skipped test cases (since they were 
hanging before)
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/decode/image-decode-expected.txt:
 Progression
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-svg.tentative-expected.txt:
 Progressions
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/decode/image-decode-with-quick-attach-expected.txt:
 Ditto
* LayoutTests/platform/mac/TestExpectations: Unskip skipped test case (because 
it was flaky earlier)
* Source/WebCore/loader/ImageLoader.cpp:
(WebCore::ImageLoader::didUpdateCachedImage):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::decode):
(WebCore::ImageLoader::elementDidMoveToNewDocument):

Canonical link: https://commits.webkit.org/314536@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to