Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0e231f0bf3490ce61283cbac27a1fc9c48865a8d
https://github.com/WebKit/WebKit/commit/0e231f0bf3490ce61283cbac27a1fc9c48865a8d
Author: Ahmad Saleem <[email protected]>
Date: 2026-08-10 (Mon, 10 Aug 2026)
Changed paths:
A LayoutTests/http/tests/svg/svg-fragment-background-repaint-expected.html
A LayoutTests/http/tests/svg/svg-fragment-background-repaint.html
M Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp
Log Message:
-----------
Background image is not repainted when only the URL fragment identifier
changes
https://bugs.webkit.org/show_bug.cgi?id=251424
rdar://105118256
Reviewed by Nikolas Zimmermann.
The memory cache strips the fragment identifier from HTTP URLs, so two
background
images differing only by fragment share one CachedResource.
Style::CachedImage::equals()
returned true whenever the CachedResource pointers matched, ignoring the
fragment.
The fragment is not cosmetic: SVGImage::drawForContainer() applies it to select
the
view to draw, so those two images paint differently. Comparing them equal
propagated
to changeRequiresRepaint(), which then skipped the repaint, leaving the old
image on
screen until something else invalidated the element.
Only take the shared-CachedResource shortcut when the fragments also match.
The test is under http/tests/ because fragments are only stripped for
HTTP-family
URLs; a file:// test cannot reproduce this.
* LayoutTests/http/tests/svg/svg-fragment-background-repaint-expected.html:
Added.
* LayoutTests/http/tests/svg/svg-fragment-background-repaint.html: Added.
* Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp:
(WebCore::Style::CachedImage::equals const):
Canonical link: https://commits.webkit.org/318879@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications