[webkit-changes] [WebKit/WebKit] de2323: [LBSE] Outermost <svg> elements are not device-pix...

Nikolas Zimmermann noreply at github.com
Fri Sep 16 08:47:12 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: de2323d7e2c84bdeb40158ec03bf6130ed7584e6
      https://github.com/WebKit/WebKit/commit/de2323d7e2c84bdeb40158ec03bf6130ed7584e6
  Author: Nikolas Zimmermann <nzimmermann at igalia.com>
  Date:   2022-09-16 (Fri, 16 Sep 2022)

  Changed paths:
    R LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/absolute-sized-svg-in-xhtml-expected.png
    R LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/createImageElement2-expected.png
    R LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/embedding-external-svgs-expected.png
    R LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/image-parent-translation-expected.png
    R LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/junk-data-expected.png
    R LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/path-bad-data-expected.png
    M LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/rootmost-svg-xy-attrs-expected.png
    R LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/hixie/error/012-expected.png
    A LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/transforms/animated-path-inside-transformed-html-expected.png
    R LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/transforms/svg-css-transforms-expected.png
    M LayoutTests/svg/compositing/outermost-svg-with-border-padding.html
    A LayoutTests/svg/in-html/inline-svg-non-integer-position-display-block-expected.html
    A LayoutTests/svg/in-html/inline-svg-non-integer-position-display-block.html
    A LayoutTests/svg/in-html/inline-svg-non-integer-position-display-inline-expected.html
    A LayoutTests/svg/in-html/inline-svg-non-integer-position-display-inline.html
    M Source/WebCore/rendering/svg/RenderSVGRoot.cpp
    M Source/WebCore/rendering/svg/RenderSVGRoot.h

  Log Message:
  -----------
  [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




More information about the webkit-changes mailing list