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] Add support for 'foreignObject' elements #3664
[LBSE] Add support for 'foreignObject' elements #3664
Conversation
This depends on PR #3532. |
EWS run on previous version of this PR (hash 4a35780) |
4a35780
to
406e515
Compare
PR #3532 was merged, this is ready to review now. |
EWS run on previous version of this PR (hash 406e515) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the image patch, this is easier to review with two separate patches.
@@ -114,8 +119,7 @@ bool SVGForeignObjectElement::rendererIsNeeded(const RenderStyle& style) | |||
// parentOrShadowHostElement() instead. | |||
RefPtr ancestor = parentElement(); | |||
while (ancestor && ancestor->isSVGElement()) { | |||
// FIXME: [LBSE] Upstream foreignObject support. | |||
if (ancestor->renderer() && ancestor->renderer()->isLegacySVGHiddenContainer()) | |||
if (ancestor->renderer() && (ancestor->renderer()->isSVGHiddenContainer() || ancestor->renderer()->isLegacySVGHiddenContainer())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My as well introduce a isSVGHiddenContainerOrLegacySVGHiddenContainer method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, however it would only be this place using it -- I only introduced these helpers so far if there is more than one callsite that needs it.
Never mind, still learning github... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
406e515
to
ab9dc4c
Compare
https://bugs.webkit.org/show_bug.cgi?id=243498 Reviewed by Rob Buis. Rename RenderSVGForeignObject -> LegacyRenderSVGForeignObject. Re-introduce RenderSVGForeignObject for LBSE. This marks the finish of the renderer conversion: all non-resource related renderers have both a legacy and LBSE Renderer class now: <foreignObject> was the last missing element in LBSE. Covered by existing svg/foreignObject tests, which all pass now in LBSE (except three that depends on clipping / masking / filters). * LayoutTests/platform/mac-monterey-wk2-lbse-text/TestExpectations: * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/background-render-phase-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/body-background-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/clip-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/disallowed-svg-nodes-as-direct-children-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/fO-display-none-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/fO-display-none-with-relative-pos-content-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/fO-parent-display-changes-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/fO-parent-display-none-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/fO-parent-display-none-with-relative-pos-content-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/fO-parent-of-parent-display-none-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/fO-parent-of-parent-display-none-with-relative-pos-content-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/filter-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/mask-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/multiple-foreign-objects-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/no-crash-with-svg-content-in-html-document-expected.png: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/no-crash-with-svg-content-in-html-document-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/svg-document-as-direct-child-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/svg-document-in-html-document-expected.png: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/svg-document-in-html-document-expected.txt: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/text-tref-02-b-expected.png: Added. * LayoutTests/platform/mac-monterey-wk2-lbse-text/svg/foreignObject/text-tref-02-b-expected.txt: Added. * LayoutTests/platform/mac/svg/foreignObject/fO-parent-display-changes-expected.txt: * LayoutTests/svg/foreignObject/fO-parent-display-changes.svg: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/accessibility/AccessibilitySVGElement.cpp: (WebCore::AccessibilitySVGElement::determineAccessibilityRole): * Source/WebCore/rendering/RenderElement.cpp: (WebCore::RenderElement::didAttachChild): (WebCore::RenderElement::layerCreationAllowedForSubtree const): * Source/WebCore/rendering/RenderElement.h: (WebCore::RenderElement::canContainFixedPositionObjects const): (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const): * Source/WebCore/rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateAncestorDependentState): (WebCore::RenderLayer::paintForegroundForFragments): * Source/WebCore/rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::shouldPaintSVGRenderer const): * Source/WebCore/rendering/RenderLayerModelObject.h: * Source/WebCore/rendering/RenderObject.h: (WebCore::RenderObject::isLegacySVGForeignObject const): (WebCore::RenderObject::isSVGForeignObjectOrLegacySVGForeignObject const): * Source/WebCore/rendering/svg/LegacyRenderSVGForeignObject.cpp: Copied from Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp. (WebCore::LegacyRenderSVGForeignObject::LegacyRenderSVGForeignObject): (WebCore::LegacyRenderSVGForeignObject::foreignObjectElement const): (WebCore::LegacyRenderSVGForeignObject::paint): (WebCore::LegacyRenderSVGForeignObject::localToParentTransform const): (WebCore::LegacyRenderSVGForeignObject::updateLogicalWidth): (WebCore::LegacyRenderSVGForeignObject::computeLogicalHeight const): (WebCore::LegacyRenderSVGForeignObject::layout): (WebCore::LegacyRenderSVGForeignObject::nodeAtFloatPoint): * Source/WebCore/rendering/svg/LegacyRenderSVGForeignObject.h: Copied from Source/WebCore/rendering/svg/RenderSVGForeignObject.h. * Source/WebCore/rendering/svg/LegacyRenderSVGModelObject.h: * Source/WebCore/rendering/svg/RenderSVGBlock.cpp: (WebCore::RenderSVGBlock::updateFromStyle): (WebCore::RenderSVGBlock::mapLocalToContainer const): (WebCore::RenderSVGBlock::pushMappingToContainer const): * Source/WebCore/rendering/svg/RenderSVGBlock.h: * Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp: (WebCore::RenderSVGForeignObject::paint): (WebCore::RenderSVGForeignObject::updateLogicalWidth): (WebCore::RenderSVGForeignObject::computeLogicalHeight const): (WebCore::RenderSVGForeignObject::layout): (WebCore::RenderSVGForeignObject::overflowClipRect const): (WebCore::RenderSVGForeignObject::updateFromStyle): (WebCore::RenderSVGForeignObject::applyTransform const): (WebCore::RenderSVGForeignObject::localToParentTransform const): Deleted. (WebCore::RenderSVGForeignObject::nodeAtFloatPoint): Deleted. * Source/WebCore/rendering/svg/RenderSVGForeignObject.h: * Source/WebCore/rendering/svg/RenderSVGModelObject.h: * Source/WebCore/rendering/svg/RenderSVGRoot.cpp: * Source/WebCore/rendering/svg/SVGContainerLayout.cpp: * Source/WebCore/svg/SVGElement.cpp: (WebCore::createSVGLayerAwareElementSet): * Source/WebCore/svg/SVGForeignObjectElement.cpp: (WebCore::SVGForeignObjectElement::createElementRenderer): (WebCore::SVGForeignObjectElement::rendererIsNeeded): Canonical link: https://commits.webkit.org/253816@main
ab9dc4c
to
5956331
Compare
Committed 253816@main (5956331): https://commits.webkit.org/253816@main Reviewed commits have been landed. Closing PR #3664 and removing active labels. |
5956331
ab9dc4c
π wpeπ mac-debugπ gtkπ§ͺ ios-wk2π§ͺ gtk-wk2π§ͺ api-iosπ§ͺ api-macπ§ͺ api-gtkπ§ͺ mac-wk1π§ͺ mac-wk2π§ͺ mac-AS-debug-wk2π§ͺ mac-wk2-stress