Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[LBSE] Outermost <svg> elements are not device-pixel aligned
https://bugs.webkit.org/show_bug.cgi?id=244966 Reviewed by Rob Buis. RenderLayer::paintLayerByApplingTransform() already contains all the code necessary to place outer <svg> elements on device-pixel aligned boundaries. The subpixelOffset is applied as transformation once for the outermost <svg> and thus to all descendants, since the outermost <svg> establishes a stacking context. The subpixelOffset is not relevant below RenderSVGRoot, since the rest of the SVG render tree is not applying device-pixel alignment. This fixes a few rendering differences between LBSE / legacy, as indicated by the LBSE specific expected.png removal. Add two new tests covering inline SVG positioning non non-integer coordinates, probing the sub-pixel / device-pixel alignment is done correctly. A follow-up patch will revisit this topic, considering also composited elements, testing their behaviour with respect to sub-pixel positioning + SVG + overflow + 3D transforms... * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/absolute-sized-svg-in-xhtml-expected.png: Removed. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/createImageElement2-expected.png: Removed. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/embedding-external-svgs-expected.png: Removed. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/image-parent-translation-expected.png: Removed. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/junk-data-expected.png: Removed. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/path-bad-data-expected.png: Removed. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/rootmost-svg-xy-attrs-expected.png: * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/hixie/error/012-expected.png: Removed. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/transforms/animated-path-inside-transformed-html-expected.png: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/transforms/svg-css-transforms-expected.png: Removed. * LayoutTests/svg/compositing/outermost-svg-with-border-padding.html: Allow 1px more difference (seen by ews-mac-debug-wk2). * LayoutTests/svg/in-html/inline-svg-non-integer-position-display-block-expected.html: Added. * LayoutTests/svg/in-html/inline-svg-non-integer-position-display-block.html: Added. * LayoutTests/svg/in-html/inline-svg-non-integer-position-display-inline-expected.html: Added. * LayoutTests/svg/in-html/inline-svg-non-integer-position-display-inline.html: Added. * Source/WebCore/rendering/RenderLayerBacking.cpp: (WebCore::snappedGraphicsLayer): (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::adjustOverflowControlsPositionRelativeToAncestor): (WebCore::RenderLayerBacking::updateMaskingLayerGeometry): (WebCore::RenderLayerBacking::updateContentsRects): (WebCore::RenderLayerBacking::updateClippingStackLayerGeometry): (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): * Source/WebCore/rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::paintingAffectedByExternalOffset const): (WebCore::RenderSVGRoot::updateFromStyle): * Source/WebCore/rendering/svg/RenderSVGRoot.h: Canonical link: https://commits.webkit.org/254558@main
- Loading branch information
1 parent
65202ec
commit de2323d7e2c84bdeb40158ec03bf6130ed7584e6
Showing
17 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
.box { | ||
display: block; | ||
position: relative; | ||
top: 0px; | ||
left: 0px; | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
} | ||
</style> | ||
<body> | ||
<h1>Enforce non-integer SVG location</h1> | ||
<div class="box"></div> | ||
<h1>Effect of overflow</h1> | ||
<div class="box"></div> | ||
<h1>With transformation</h1> | ||
<div class="box"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<h1>Enforce non-integer SVG location</h1> | ||
<svg width="100" height="100" style="overflow: visible; display: block;"> | ||
<rect x="0" y="0" width="100" height="100" fill="green"/> | ||
</svg> | ||
<h1>Effect of overflow</h1> | ||
<svg width="100" height="100" style="overflow: hidden; display: block;"> | ||
<rect x="0" y="0" width="100" height="100" fill="green"/> | ||
</svg> | ||
<h1>With transformation</h1> | ||
<svg width="50" height="50" style="overflow: visible; transform: scale(2); transform-origin: 0 0; display: block;"> | ||
<rect x="0" y="0" width="50" height="50" fill="green"/> | ||
</svg> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
.box { | ||
display: inline-block; | ||
position: relative; | ||
top: 0px; | ||
left: 0px; | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
} | ||
</style> | ||
<body> | ||
<h1>Enforce non-integer SVG location</h1> | ||
<div class="box"></div> | ||
<h1>Effect of overflow</h1> | ||
<div class="box"></div> | ||
<h1>With transformation</h1> | ||
<div class="box"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<h1>Enforce non-integer SVG location</h1> | ||
<svg width="100" height="100" style="overflow: visible; display: inline;"> | ||
<rect x="0" y="0" width="100" height="100" fill="green"/> | ||
</svg> | ||
<h1>Effect of overflow</h1> | ||
<svg width="100" height="100" style="overflow: hidden; display: inline;"> | ||
<rect x="0" y="0" width="100" height="100" fill="green"/> | ||
</svg> | ||
<h1>With transformation</h1> | ||
<svg width="50" height="50" style="overflow: visible; transform: scale(2); transform-origin: 0 0; display: inline;"> | ||
<rect x="0" y="0" width="50" height="50" fill="green"/> | ||
</svg> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters