Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 195fe2ac4459d89f6a54973fa2bc88c0f973ecf0
https://github.com/WebKit/WebKit/commit/195fe2ac4459d89f6a54973fa2bc88c0f973ecf0
Author: Taher Ali <[email protected]>
Date: 2026-02-12 (Thu, 12 Feb 2026)
Changed paths:
M LayoutTests/interaction-region/svg-luminance-expected.txt
M LayoutTests/platform/glib/TestExpectations
A
LayoutTests/svg/compositing/hidpi-legacy-svg-compositing-sibling-no-shift-expected.html
A
LayoutTests/svg/compositing/hidpi-legacy-svg-compositing-sibling-no-shift.html
M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGRoot.cpp
Log Message:
-----------
Fix repaint shift for legacy SVG when sibling starts compositing animation
https://bugs.webkit.org/show_bug.cgi?id=307471
rdar://126342948
Reviewed by Simon Fraser.
When a sibling element starts a compositing animation (opacity transition),
legacy SVG content could shift by up to 0.5 pixels. This occurred because the
non-composited and composited paint paths used different pixel snapping methods
For ex, a paint offset of 69.515625 would round to 70 in the non-composited
path but snap to 69.5 in the composited path, causing a visible shift when the
SVG's layer became composited due to overlap with the animating sibling.
This fix subpixelizes to use roundPointToDevicePixels, so both (non-composited
and composited)
paths have consistent device snapping.
*
LayoutTests/svg/compositing/hidpi-legacy-svg-compositing-sibling-no-shift-expected.html:
Added.
*
LayoutTests/svg/compositing/hidpi-legacy-svg-compositing-sibling-no-shift.html:
Added.
The container uses awkward padding (9.53px) to create subpixel positioning at 2x
scale, which is necessary to expose the snapping discrepancy. Notably, using
will-change on the overlay does not reproduce the bug. Similarly,
CSS transitions pre-composite elements in anticipation of
animation, which also masks the bug.
To actually trigger the problematic code path, we apply transform: translateZ(0)
after initial layout, forcing a compositing state change at runtime.
The expected file intentionally has no compositing, showing the baseline SVG
position.
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::paintReplaced):
Canonical link: https://commits.webkit.org/307371@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications