Bug 245416 - [LBSE] Pixel snapping logic is incorrect for SVG, when elements are composited
Summary: [LBSE] Pixel snapping logic is incorrect for SVG, when elements are composited
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nikolas Zimmermann
URL:
Keywords: InRadar
Depends on:
Blocks: 90738
  Show dependency treegraph
 
Reported: 2022-09-20 01:27 PDT by Nikolas Zimmermann
Modified: 2022-09-26 08:52 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolas Zimmermann 2022-09-20 01:27:52 PDT
In bug webkit.org/b/244966 ("[LBSE] Outermost <svg> elements are not device-pixel aligned") the rendering was adapted in such a way that the outermost <svg> element is the only element in the SVG subtree that is pixel snapped, delivering consistent results between e.g. HTML <div> elements and SVG <svg> elements, embedded in a CSS formatting context. The <div> will get pixel snapped upon painting -- the same was enforced for the outermost <svg>, however without propagating/accumulating sub-pixel errors for the descendant layers, since no pixel snapping is applied within the SVG subtree.

When elements are composited another logic is used (RenderLayerBacking), and the device-pixel alignment is applied for all SVG layers -- effectively breaking content. By fixing that, the pixel snapping logic is consistent for all painting modes we have, no matter if the outer <svg> is composited, or any of its descendants.
Comment 1 Nikolas Zimmermann 2022-09-20 02:01:53 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4520
Comment 2 EWS 2022-09-26 08:51:16 PDT
Committed 254863@main (d2c0299eb83a): <https://commits.webkit.org/254863@main>

Reviewed commits have been landed. Closing PR #4520 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-09-26 08:52:21 PDT
<rdar://problem/100412807>