Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a9623f4e66388a31261fe1e715ffb7fbb7bb8cfa
      
https://github.com/WebKit/WebKit/commit/a9623f4e66388a31261fe1e715ffb7fbb7bb8cfa
  Author: Ryosuke Niwa <[email protected]>
  Date:   2024-01-17 (Wed, 17 Jan 2024)

  Changed paths:
    M Source/WebCore/html/HTMLImageElement.cpp
    M Source/WebCore/loader/ImageLoader.cpp
    M Source/WebCore/loader/ImageLoader.h

  Log Message:
  -----------
  Avoid calling selectImageSource when attribute value didn't change
https://bugs.webkit.org/show_bug.cgi?id=267315

Reviewed by Alex Christensen.

This PR adds a fast path for setting src to the same value in 
HTMLImageElement::attributeChanged.
In this case, we check whether image loading is observable or not (e.g. has a 
service worker),
and it if isn't, we avoid going through the full image loading path and simply 
fire the load event instead.

* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::attributeChanged):
* Source/WebCore/loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElementIgnoringPreviousErrorToSameValue):
* Source/WebCore/loader/ImageLoader.h:

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to