[webkit-changes] [WebKit/WebKit] 5c3443: [LBSE] Unify all SVG geometry/transform computatio...

Nikolas Zimmermann noreply at github.com
Fri Nov 18 16:42:01 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5c3443a0ab7a7fdeaeeb20c104da59b55de0e265
      https://github.com/WebKit/WebKit/commit/5c3443a0ab7a7fdeaeeb20c104da59b55de0e265
  Author: Nikolas Zimmermann <nzimmermann at igalia.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M LayoutTests/platform/gtk/svg/zoom/page/zoom-zoom-coords-expected.txt
    M LayoutTests/platform/ios-wk2/svg/custom/getClientRects-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/TestExpectations
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/W3C-SVG-1.1/coords-viewattr-01-b-expected.txt
    A LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/container-opacity-clip-viewBox-expected.png
    A LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getTransformToElement-expected.txt
    A LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getscreenctm-in-mixed-content-expected.txt
    A LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getscreenctm-in-scrollable-div-area-expected.txt
    A LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.txt
    A LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt
    A LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/text-ctm-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/selection-doubleclick-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/text-rescale-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-coords-viewattr-01-b-expected.txt
    A LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-zoom-coords-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-coords-viewattr-01-b-expected.txt
    M LayoutTests/platform/mac/svg/zoom/page/zoom-zoom-coords-expected.txt
    M LayoutTests/svg/custom/getClientRects-expected.txt
    M LayoutTests/svg/zoom/page/zoom-zoom-coords.xhtml
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/rendering/RenderLayerModelObject.cpp
    M Source/WebCore/rendering/RenderLayerModelObject.h
    M Source/WebCore/rendering/svg/RenderSVGBlock.cpp
    M Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
    M Source/WebCore/rendering/svg/RenderSVGRoot.cpp
    M Source/WebCore/rendering/svg/SVGBoundingBoxComputation.cpp
    M Source/WebCore/rendering/svg/SVGLayerTransformComputation.h
    M Source/WebCore/svg/SVGLocatable.cpp
    M Source/WebCore/svg/SVGSVGElement.cpp
    M Source/WebCore/svg/SVGUseElement.cpp

  Log Message:
  -----------
  [LBSE] Unify all SVG geometry/transform computations with CSS
https://bugs.webkit.org/show_bug.cgi?id=247672

Reviewed by Rob Buis.

Consistently use SVGLayerTranformComputation whenever transformations
need to be computed in the SVG render tree, utilizing 'TransformState'
and 'mapLocalToContainer', which were previously extended for SVGs
needs (TransformState::TransformMatrixTracking).

This assures that the very same transformation matrices / code paths
are used for the following items:

- Query SVG CTM (e.g. from JS), via SVGLocatable interface
  getCTM() / getScreenCTM() / (getTransformToElement()).

- Painting layers for SVG renderers
  RenderLayer::paintLayerByApplyingTransform() uses the 4x4 3D aware
  m_transform matrix previously computed in RenderLayer::updateTransform().

- DOM geometry API (getBoundingClientRect / getClientRect / etc.)
...

Covered by existing tests, fixes a bunch of tests in LBSE related to
getCTM & friends. One test - svg/zoom/page/zoom-zoom-coords.xhtml was
wrong in all browsers -- fix that, now legacy fails it and LBSE passes
as all others (no change in behavior for legacy, only the test changed).

* LayoutTests/platform/ios-wk2/svg/custom/getClientRects-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/TestExpectations:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/W3C-SVG-1.1/coords-viewattr-01-b-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/container-opacity-clip-viewBox-expected.png: Added.
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getTransformToElement-expected.txt: Added.
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getscreenctm-in-mixed-content-expected.txt: Added.
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getscreenctm-in-scrollable-div-area-expected.txt: Added.
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.txt: Added.
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt: Added.
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/text-ctm-expected.txt: Added.
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/selection-doubleclick-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/text-rescale-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-coords-viewattr-01-b-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-zoom-coords-expected.txt: Copied from LayoutTests/platform/mac/svg/zoom/page/zoom-zoom-coords-expected.txt.
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-coords-viewattr-01-b-expected.txt:
* LayoutTests/platform/mac/svg/zoom/page/zoom-zoom-coords-expected.txt:
* LayoutTests/svg/custom/getClientRects-expected.txt:
* LayoutTests/svg/zoom/page/zoom-zoom-coords.xhtml:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/Element.cpp:
(WebCore::shouldObtainBoundsFromSVGModel):
(WebCore::shouldObtainBoundsFromBoxModel):
(WebCore::Element::boundsInRootViewSpace):
(WebCore::Element::absoluteEventBounds):
(WebCore::Element::getClientRects):
(WebCore::Element::boundingAbsoluteRectWithoutLayout const):
* Source/WebCore/rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::mapLocalToSVGContainer const):
(WebCore::RenderLayerModelObject::applySVGTransform const):
* Source/WebCore/rendering/RenderLayerModelObject.h:
* Source/WebCore/rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::absoluteRects const):
(WebCore::RenderSVGBlock::absoluteQuads const):
(WebCore::RenderSVGBlock::mapLocalToContainer const):
(WebCore::RenderSVGBlock::offsetFromContainer const):
* Source/WebCore/rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::absoluteRects const):
(WebCore::RenderSVGModelObject::absoluteQuads const):
* Source/WebCore/rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::mapLocalToContainer const):
(WebCore::RenderSVGRoot::absoluteQuads const):
* Source/WebCore/rendering/svg/SVGBoundingBoxComputation.cpp:
(WebCore::SVGBoundingBoxComputation::handleRootOrContainer const):
* Source/WebCore/rendering/svg/SVGLayerTransformComputation.h:
(WebCore::SVGLayerTransformComputation::computeAccumulatedTransform const):
(WebCore::SVGLayerTransformComputation::calculateScreenFontSizeScalingFactor const):
* Source/WebCore/svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::computeCTM):
* Source/WebCore/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::localCoordinateSpaceTransform const):
* Source/WebCore/svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::toClipPath):

Canonical link: https://commits.webkit.org/256862@main




More information about the webkit-changes mailing list