[webkit-changes] [WebKit/WebKit] e9c7df: [LBSE] Enforce presence of a RenderSVGViewportCont...
Nikolas Zimmermann
noreply at github.com
Sat Nov 12 07:58:32 PST 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e9c7dfad5a10d4706ea2fa2bdbc50e9d736186dd
https://github.com/WebKit/WebKit/commit/e9c7dfad5a10d4706ea2fa2bdbc50e9d736186dd
Author: Nikolas Zimmermann <nzimmermann at igalia.com>
Date: 2022-11-12 (Sat, 12 Nov 2022)
Changed paths:
M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/W3C-SVG-1.1/struct-frag-01-t-expected.txt
M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/svg-root-background-expected.txt
M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/hixie/intrinsic/003-expected.txt
M Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
M Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp
M Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h
Log Message:
-----------
[LBSE] Enforce presence of a RenderSVGViewportContainer, even if the <svg> has no children
https://bugs.webkit.org/show_bug.cgi?id=247669
Reviewed by Rob Buis.
The anonymous RenderSVGViewportContainer, enclosing all descendants of the outermost
<svg> element, is usually created when the first child is supposed to be added to
the <svg> element. This logic fails, if there is no descendant.
However zooming/panning/viewBox coordinate transformations are applied to the
RenderSVGViewportContainer, not the RenderSVGRoot. For rendering/hit-testing there
is no issue, since no content is rendered/testable. But it does matter for getCTM(),
getScreenCTM() etc. since they just walk the render tree -- the asence of a
RenderSVGViewportContainer will mean that viewBox transformations aren't included
in the resulting matrices -- fix that.
This patch is a pre-requisite for implementing getCTM() / getScreenCTM() in LBSE.
Covered by existing tests, that need a rebaseline for a few cases that failed to create
a RenderSVGViewportContainer before.
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/W3C-SVG-1.1/struct-frag-01-t-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/svg-root-background-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/hixie/intrinsic/003-expected.txt:
* Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::updateAfterDescendants):
* Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::attach):
(WebCore::RenderTreeBuilder::SVG::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::SVG::createViewportContainer):
(WebCore::RenderTreeBuilder::SVG::updateAfterDescendants):
* Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h:
Canonical link: https://commits.webkit.org/256604@main
More information about the webkit-changes
mailing list