Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LBSE] Fix transform support for SVG <text> elements #5534

Conversation

nikolaszimmermann
Copy link
Contributor

@nikolaszimmermann nikolaszimmermann commented Oct 19, 2022

0c33f22

[LBSE] Fix transform support for SVG <text> elements
https://bugs.webkit.org/show_bug.cgi?id=245508

Reviewed by Rob Buis.

RenderSVGBlock::referenceBoxRect() was missing (affecting RenderSVGText), thus the
refeferenceBoxRect() for a RenderSVGText renderer was computed according to CSS rules,
see RenderBox::referenceBoxRect(), and not according to the SVG rules, implemented in
RenderLayerModelObject::referenceBoxRect() -- fix that.

This also uncovered a LBSE specific isssue with SMIL <animateMotion> - they were
post- instead of pre-multiplied, fix that as well, while I'm at it.

Covered by numerous existing tests that now function properly in LBSE.

* LayoutTests/platform/mac-monterey-wk2-lbse-text/TestExpectations:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/W3C-SVG-1.1/types-basicDOM-01-b-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/batik/text/smallFonts-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/batik/text/textFeatures-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/SVGPoint-matrixTransform-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/append-text-node-to-tspan-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/font-size-below-point-five-2-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/modify-text-node-in-tspan-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/remove-text-node-from-tspan-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/remove-tspan-from-text-expected.txt:
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::applySVGTransform const):
(WebCore::RenderLayerModelObject::updateHasSVGTransformFlags):
* Source/WebCore/rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::referenceBoxRect const):
* Source/WebCore/rendering/svg/RenderSVGBlock.h:
* Source/WebCore/rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::applyTransform const):
* Source/WebCore/rendering/svg/RenderSVGText.h:
* Source/WebCore/svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::toClipPath):
* Source/WebCore/svg/SVGGraphicsElement.h:
(WebCore::SVGGraphicsElement::hasTransformRelatedAttributes const):
* Source/WebCore/svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::toClipPath):

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

d38a030

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-debug βœ… πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk1
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch-sim βœ… πŸ§ͺ mac-wk2-stress

@nikolaszimmermann nikolaszimmermann self-assigned this Oct 19, 2022
@nikolaszimmermann nikolaszimmermann added SVG For bugs in the SVG implementation. WebKit Local Build labels Oct 19, 2022
Copy link
Contributor

@rwlbuis rwlbuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@nikolaszimmermann nikolaszimmermann added the merge-queue Applied to send a pull request to merge-queue label Oct 20, 2022
https://bugs.webkit.org/show_bug.cgi?id=245508

Reviewed by Rob Buis.

RenderSVGBlock::referenceBoxRect() was missing (affecting RenderSVGText), thus the
refeferenceBoxRect() for a RenderSVGText renderer was computed according to CSS rules,
see RenderBox::referenceBoxRect(), and not according to the SVG rules, implemented in
RenderLayerModelObject::referenceBoxRect() -- fix that.

This also uncovered a LBSE specific isssue with SMIL <animateMotion> - they were
post- instead of pre-multiplied, fix that as well, while I'm at it.

Covered by numerous existing tests that now function properly in LBSE.

* LayoutTests/platform/mac-monterey-wk2-lbse-text/TestExpectations:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/W3C-SVG-1.1/types-basicDOM-01-b-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/batik/text/smallFonts-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/batik/text/textFeatures-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/custom/SVGPoint-matrixTransform-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/append-text-node-to-tspan-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/font-size-below-point-five-2-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/modify-text-node-in-tspan-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/remove-text-node-from-tspan-expected.txt:
* LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/text/remove-tspan-from-text-expected.txt:
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::applySVGTransform const):
(WebCore::RenderLayerModelObject::updateHasSVGTransformFlags):
* Source/WebCore/rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::referenceBoxRect const):
* Source/WebCore/rendering/svg/RenderSVGBlock.h:
* Source/WebCore/rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::applyTransform const):
* Source/WebCore/rendering/svg/RenderSVGText.h:
* Source/WebCore/svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::toClipPath):
* Source/WebCore/svg/SVGGraphicsElement.h:
(WebCore::SVGGraphicsElement::hasTransformRelatedAttributes const):
* Source/WebCore/svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::toClipPath):

Canonical link: https://commits.webkit.org/255801@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/LBSE-Fix-transform-support-for-SVG-text-elements branch from d38a030 to 0c33f22 Compare October 20, 2022 21:07
@webkit-commit-queue
Copy link
Collaborator

Committed 255801@main (0c33f22): https://commits.webkit.org/255801@main

Reviewed commits have been landed. Closing PR #5534 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit 0c33f22 into WebKit:main Oct 20, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 20, 2022
@nikolaszimmermann nikolaszimmermann deleted the eng/LBSE-Fix-transform-support-for-SVG-text-elements branch November 17, 2022 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SVG For bugs in the SVG implementation.
Projects
None yet
4 participants