WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch, v2
bug-236187-20220206030017.patch (text/plain), 4.73 KB, created by
Nikolas Zimmermann
on 2022-02-06 03:00:18 PST
(
hide
)
Description:
Patch, v2
Filename:
MIME Type:
Creator:
Nikolas Zimmermann
Created:
2022-02-06 03:00:18 PST
Size:
4.73 KB
patch
obsolete
>Subversion Revision: 289165 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8caf3e920a67580689d24368ca321d7e7e26b730..e0328feca64cb4e39bb48f182be786ceff86d0ad 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,32 @@ >+2022-02-06 Nikolas Zimmermann <nzimmermann@igalia.com> >+ >+ [LBSE] Apply position / size to SVG layers >+ https://bugs.webkit.org/show_bug.cgi?id=236187 >+ >+ Teach RenderLayer::updateLayerPosition() about RenderSVGModelObject >+ derived renderers that create layers. Grab size and position information >+ from the SVG render tree, just as done for CSS boxes in the render tree. >+ >+ To minimize the RenderLayer changes, and most importantly to let SVG >+ look like a regular CSS object from the outside a compatibility layer >+ is exposed offering methods such as 'frameRectEquivalent()', >+ 'visualOverflowRectEquivalent()' and offers utility methods such as >+ 'applyTopLeftLocationOffsetEquivalent(localPoint)'. The terminology >+ stems from CSS and is usually not present in SVG -- however to simplify >+ the RenderLayer implementation and emphazise the analogy between >+ RenderBox and RenderSVGModelObject the utility methods help a lot. >+ >+ SVG no longer looks special and one doesn't need to think hard what >+ the best matching equivalent to a 'visualOverflowRect' in SVG, or >+ if coordinate system origins are identical or not, etc. >+ >+ Covered by existing tests, no change in behaviour. >+ >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::recursiveUpdateLayerPositions): >+ (WebCore::RenderLayer::updateLayerPosition): >+ (WebCore::RenderLayer::calculateClipRects const): >+ > 2022-02-03 Nikolas Zimmermann <nzimmermann@igalia.com> > > [LBSE] Handle RenderSVGShape in SVGRenderSupport::applyStrokeStyleToContext() >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index 77a8a27812925a5a4672c65df98cf7adb296fde7..b339596e615e6d055e9aa1c6f818b46e8999da2b 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -106,7 +106,11 @@ > #include "RenderMultiColumnFlow.h" > #include "RenderReplica.h" > #include "RenderSVGForeignObject.h" >+#include "RenderSVGInline.h" >+#include "RenderSVGModelObject.h" > #include "RenderSVGResourceClipper.h" >+#include "RenderSVGRoot.h" >+#include "RenderSVGText.h" > #include "RenderScrollbar.h" > #include "RenderScrollbarPart.h" > #include "RenderTableCell.h" >@@ -1059,6 +1063,17 @@ void RenderLayer::recursiveUpdateLayerPositions(RenderGeometryMap* geometryMap, > } > } > >+#if ENABLE(LAYER_BASED_SVG_ENGINE) >+ if (renderer().isSVGLayerAwareRenderer() && renderer().document().settings().layerBasedSVGEngineEnabled()) { >+ if (!is<RenderSVGRoot>(renderer())) >+ ASSERT(!renderer().isFixedPositioned()); >+ >+ // Only the outermost <svg> and / <foreignObject> are potentially scrollable. >+ if (is<RenderSVGModelObject>(renderer()) || is<RenderSVGText>(renderer()) || is<RenderSVGInline>(renderer())) >+ ASSERT(!m_scrollableArea); >+ } >+#endif >+ > if (isComposited()) > backing()->updateAfterLayout(flags.contains(ContainingClippingLayerChangedSize), flags.contains(NeedsFullRepaintInBacking)); > >@@ -1678,6 +1693,19 @@ bool RenderLayer::updateLayerPosition(OptionSet<UpdateLayerPositionsFlag>* flags > } > > box->applyTopLeftLocationOffset(localPoint); >+#if ENABLE(LAYER_BASED_SVG_ENGINE) >+ } else if (is<RenderSVGModelObject>(renderer())) { >+ auto& svgRenderer = downcast<RenderSVGModelObject>(renderer()); >+ auto newSize = enclosingIntRect(svgRenderer.frameRectEquivalent()).size(); >+ if (newSize != size()) { >+ if (flags && renderer().hasNonVisibleOverflow()) >+ flags->add(ContainingClippingLayerChangedSize); >+ >+ setSize(newSize); >+ } >+ >+ svgRenderer.applyTopLeftLocationOffsetEquivalent(localPoint); >+#endif > } > > if (!renderer().isOutOfFlowPositioned()) { >@@ -4811,6 +4839,10 @@ LayoutRect RenderLayer::localBoundingBox(OptionSet<CalculateLayerBoundsFlag> fla > LayoutRect result; > if (renderer().isInline() && is<RenderInline>(renderer())) > result = downcast<RenderInline>(renderer()).linesVisualOverflowBoundingBox(); >+#if ENABLE(LAYER_BASED_SVG_ENGINE) >+ else if (is<RenderSVGModelObject>(renderer())) >+ result = downcast<RenderSVGModelObject>(renderer()).visualOverflowRectEquivalent(); >+#endif > else if (is<RenderTableRow>(renderer())) { > auto& tableRow = downcast<RenderTableRow>(renderer()); > // Our bounding box is just the union of all of our cells' border/overflow rects.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
rbuis
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 236187
:
451012
| 451031