Diff
Modified: trunk/Source/WebCore/ChangeLog (287915 => 287916)
--- trunk/Source/WebCore/ChangeLog 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/ChangeLog 2022-01-12 10:29:01 UTC (rev 287916)
@@ -1,3 +1,72 @@
+2022-01-12 Nikolas Zimmermann <nzimmerm...@igalia.com>
+
+ [LBSE] Rename RenderSVGContainer -> LegacyRenderSVGContainer
+ https://bugs.webkit.org/show_bug.cgi?id=235099
+
+ Reviewed by Rob Buis.
+
+ Following the established procedure: rename RenderSVGContainer -> LegacyRenderSVGContainer.
+ In a follow-up patch RenderSVGContainer will be reintroduced for LBSE, inheriting from
+ RenderSVGModelObject instead of LegacyRenderSVGModelObject.
+
+ Covered by existing tests, no change in behaviour.
+
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isLegacySVGContainer const):
+ (WebCore::RenderObject::isSVGContainer const): Deleted.
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::write):
+ * rendering/svg/LegacyRenderSVGContainer.cpp: Renamed from Source/WebCore/rendering/svg/RenderSVGContainer.cpp.
+ (WebCore::LegacyRenderSVGContainer::LegacyRenderSVGContainer):
+ (WebCore::LegacyRenderSVGContainer::layout):
+ (WebCore::LegacyRenderSVGContainer::selfWillPaint):
+ (WebCore::LegacyRenderSVGContainer::paint):
+ (WebCore::LegacyRenderSVGContainer::addFocusRingRects):
+ (WebCore::LegacyRenderSVGContainer::updateCachedBoundaries):
+ (WebCore::LegacyRenderSVGContainer::nodeAtFloatPoint):
+ * rendering/svg/LegacyRenderSVGContainer.h: Renamed from Source/WebCore/rendering/svg/RenderSVGContainer.h.
+ (WebCore::LegacyRenderSVGContainer::didTransformToRootUpdate):
+ (WebCore::LegacyRenderSVGContainer::isObjectBoundingBoxValid const):
+ (WebCore::LegacyRenderSVGContainer::calculateLocalTransform):
+ (WebCore::LegacyRenderSVGContainer::calcViewport):
+ (WebCore::LegacyRenderSVGContainer::applyViewportClip):
+ (WebCore::LegacyRenderSVGContainer::pointIsInsideViewportClip):
+ (WebCore::LegacyRenderSVGContainer::determineIfLayoutSizeChanged):
+ * rendering/svg/LegacyRenderSVGShape.h:
+ * rendering/svg/RenderSVGHiddenContainer.cpp:
+ (WebCore::RenderSVGHiddenContainer::RenderSVGHiddenContainer):
+ * rendering/svg/RenderSVGHiddenContainer.h:
+ * rendering/svg/RenderSVGResourceMarker.cpp:
+ (WebCore::RenderSVGResourceMarker::layout):
+ (WebCore::RenderSVGResourceMarker::markerBoundaries const):
+ (WebCore::RenderSVGResourceMarker::draw):
+ * rendering/svg/RenderSVGShape.h:
+ * rendering/svg/RenderSVGTransformableContainer.cpp:
+ (WebCore::RenderSVGTransformableContainer::RenderSVGTransformableContainer):
+ (WebCore::RenderSVGTransformableContainer::graphicsElement):
+ * rendering/svg/RenderSVGTransformableContainer.h:
+ * rendering/svg/RenderSVGViewportContainer.cpp:
+ (WebCore::RenderSVGViewportContainer::RenderSVGViewportContainer):
+ (WebCore::RenderSVGViewportContainer::svgSVGElement const):
+ (WebCore::RenderSVGViewportContainer::paint):
+ * rendering/svg/RenderSVGViewportContainer.h:
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::checkForSVGRepaintDuringLayout):
+ (WebCore::updateObjectBoundingBox):
+ * rendering/svg/SVGRenderTreeAsText.cpp:
+ (WebCore::writeSVGContainer):
+ * rendering/svg/SVGRenderTreeAsText.h:
+ * rendering/updating/RenderTreeBuilder.cpp:
+ (WebCore::RenderTreeBuilder::attachInternal):
+ (WebCore::RenderTreeBuilder::detach):
+ * rendering/updating/RenderTreeBuilderSVG.cpp:
+ (WebCore::RenderTreeBuilder::SVG::attach):
+ (WebCore::RenderTreeBuilder::SVG::detach):
+ * rendering/updating/RenderTreeBuilderSVG.h:
+ * svg/SVGPatternElement.cpp:
+
2022-01-12 Youenn Fablet <you...@apple.com>
New service worker API 'FetchEvent.handled' needs to be supported
Modified: trunk/Source/WebCore/Sources.txt (287915 => 287916)
--- trunk/Source/WebCore/Sources.txt 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/Sources.txt 2022-01-12 10:29:01 UTC (rev 287916)
@@ -2466,12 +2466,12 @@
rendering/style/StyleVisualData.cpp
rendering/style/TextSizeAdjustment.cpp
rendering/style/WillChangeData.cpp
+rendering/svg/LegacyRenderSVGContainer.cpp
rendering/svg/LegacyRenderSVGModelObject.cpp
rendering/svg/LegacyRenderSVGRect.cpp
rendering/svg/LegacyRenderSVGRoot.cpp
rendering/svg/LegacyRenderSVGShape.cpp
rendering/svg/RenderSVGBlock.cpp
-rendering/svg/RenderSVGContainer.cpp
rendering/svg/RenderSVGEllipse.cpp
rendering/svg/RenderSVGForeignObject.cpp
rendering/svg/RenderSVGGradientStop.cpp
@@ -2481,6 +2481,7 @@
rendering/svg/RenderSVGInlineText.cpp
rendering/svg/RenderSVGModelObject.cpp
rendering/svg/RenderSVGPath.cpp
+rendering/svg/RenderSVGRect.cpp
rendering/svg/RenderSVGResource.cpp
rendering/svg/RenderSVGResourceClipper.cpp
rendering/svg/RenderSVGResourceContainer.cpp
@@ -2493,7 +2494,6 @@
rendering/svg/RenderSVGResourcePattern.cpp
rendering/svg/RenderSVGResourceRadialGradient.cpp
rendering/svg/RenderSVGResourceSolidColor.cpp
-rendering/svg/RenderSVGRect.cpp
rendering/svg/RenderSVGRoot.cpp
rendering/svg/RenderSVGShape.cpp
rendering/svg/RenderSVGTSpan.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (287915 => 287916)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2022-01-12 10:29:01 UTC (rev 287916)
@@ -1239,7 +1239,7 @@
4358E8811360A31700E4748C /* FEDropShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E87F1360A31700E4748C /* FEDropShadow.h */; settings = {ATTRIBUTES = (Private, ); }; };
4358E8861360A33B00E4748C /* SVGFEDropShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E8831360A33B00E4748C /* SVGFEDropShadowElement.h */; };
436708C112D9CA4B00044234 /* RenderSVGBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 4367088212D9CA4A00044234 /* RenderSVGBlock.h */; };
- 436708C312D9CA4B00044234 /* RenderSVGContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4367088412D9CA4A00044234 /* RenderSVGContainer.h */; };
+ 436708C312D9CA4B00044234 /* LegacyRenderSVGContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4367088412D9CA4A00044234 /* LegacyRenderSVGContainer.h */; };
436708C512D9CA4B00044234 /* RenderSVGGradientStop.h in Headers */ = {isa = PBXBuildFile; fileRef = 4367088612D9CA4A00044234 /* RenderSVGGradientStop.h */; };
436708C712D9CA4B00044234 /* RenderSVGHiddenContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4367088812D9CA4A00044234 /* RenderSVGHiddenContainer.h */; };
436708C912D9CA4B00044234 /* RenderSVGImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 4367088A12D9CA4A00044234 /* RenderSVGImage.h */; };
@@ -8983,8 +8983,8 @@
4358E8841360A33B00E4748C /* SVGFEDropShadowElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SVGFEDropShadowElement.idl; sourceTree = "<group>"; };
4367088112D9CA4A00044234 /* RenderSVGBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGBlock.cpp; sourceTree = "<group>"; };
4367088212D9CA4A00044234 /* RenderSVGBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGBlock.h; sourceTree = "<group>"; };
- 4367088312D9CA4A00044234 /* RenderSVGContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGContainer.cpp; sourceTree = "<group>"; };
- 4367088412D9CA4A00044234 /* RenderSVGContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGContainer.h; sourceTree = "<group>"; };
+ 4367088312D9CA4A00044234 /* LegacyRenderSVGContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyRenderSVGContainer.cpp; sourceTree = "<group>"; };
+ 4367088412D9CA4A00044234 /* LegacyRenderSVGContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyRenderSVGContainer.h; sourceTree = "<group>"; };
4367088512D9CA4A00044234 /* RenderSVGGradientStop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGGradientStop.cpp; sourceTree = "<group>"; };
4367088612D9CA4A00044234 /* RenderSVGGradientStop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGGradientStop.h; sourceTree = "<group>"; };
4367088712D9CA4A00044234 /* RenderSVGHiddenContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGHiddenContainer.cpp; sourceTree = "<group>"; };
@@ -18917,6 +18917,8 @@
088C2F7412390080003D65CE /* svg */ = {
isa = PBXGroup;
children = (
+ 4367088312D9CA4A00044234 /* LegacyRenderSVGContainer.cpp */,
+ 4367088412D9CA4A00044234 /* LegacyRenderSVGContainer.h */,
4367088B12D9CA4A00044234 /* LegacyRenderSVGModelObject.cpp */,
4367088C12D9CA4A00044234 /* LegacyRenderSVGModelObject.h */,
A10BB5821484E3A700B2E87A /* LegacyRenderSVGRect.cpp */,
@@ -18929,8 +18931,6 @@
4367088112D9CA4A00044234 /* RenderSVGBlock.cpp */,
4367088212D9CA4A00044234 /* RenderSVGBlock.h */,
CDF747EA270F6D88008FEEEC /* RenderSVGBlockInlines.h */,
- 4367088312D9CA4A00044234 /* RenderSVGContainer.cpp */,
- 4367088412D9CA4A00044234 /* RenderSVGContainer.h */,
2B42359F15250F6000DBBCD8 /* RenderSVGEllipse.cpp */,
2B4235A015250F6000DBBCD8 /* RenderSVGEllipse.h */,
43C092B912D9E4EE00A989C3 /* RenderSVGForeignObject.cpp */,
@@ -35930,6 +35930,7 @@
F44A5F591FED38F2007F5944 /* LegacyNSPasteboardTypes.h in Headers */,
A185B42A1E8211A100DC9118 /* LegacyPreviewLoader.h in Headers */,
A10DBF4718F92317000D70C6 /* LegacyPreviewLoaderClient.h in Headers */,
+ 436708C312D9CA4B00044234 /* LegacyRenderSVGContainer.h in Headers */,
436708CB12D9CA4B00044234 /* LegacyRenderSVGModelObject.h in Headers */,
A10BB5851484E3A700B2E87A /* LegacyRenderSVGRect.h in Headers */,
436708E512D9CA4B00044234 /* LegacyRenderSVGRoot.h in Headers */,
@@ -36737,7 +36738,6 @@
BC5EB6680E81CB7100B25965 /* RenderStyleConstants.h in Headers */,
436708C112D9CA4B00044234 /* RenderSVGBlock.h in Headers */,
CDF747EB270F6D88008FEEEC /* RenderSVGBlockInlines.h in Headers */,
- 436708C312D9CA4B00044234 /* RenderSVGContainer.h in Headers */,
2B365C841525119E0091D27B /* RenderSVGEllipse.h in Headers */,
43C092BC12D9E4EE00A989C3 /* RenderSVGForeignObject.h in Headers */,
436708C512D9CA4B00044234 /* RenderSVGGradientStop.h in Headers */,
Modified: trunk/Source/WebCore/rendering/RenderObject.h (287915 => 287916)
--- trunk/Source/WebCore/rendering/RenderObject.h 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -329,7 +329,7 @@
virtual bool isRenderSVGBlock() const { return false; };
virtual bool isLegacySVGRoot() const { return false; }
virtual bool isSVGRoot() const { return false; }
- virtual bool isSVGContainer() const { return false; }
+ virtual bool isLegacySVGContainer() const { return false; }
virtual bool isSVGTransformableContainer() const { return false; }
virtual bool isSVGViewportContainer() const { return false; }
virtual bool isSVGGradientStop() const { return false; }
Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -38,6 +38,7 @@
#include "HTMLSpanElement.h"
#include "InlineIteratorTextBox.h"
#include "LegacyInlineTextBox.h"
+#include "LegacyRenderSVGContainer.h"
#include "LegacyRenderSVGRoot.h"
#include "LegacyRenderSVGShape.h"
#include "Logging.h"
@@ -58,7 +59,6 @@
#include "RenderListMarker.h"
#include "RenderQuote.h"
#include "RenderRuby.h"
-#include "RenderSVGContainer.h"
#include "RenderSVGGradientStop.h"
#include "RenderSVGImage.h"
#include "RenderSVGInlineText.h"
@@ -578,8 +578,8 @@
writeSVGResourceContainer(ts, downcast<RenderSVGResourceContainer>(o), behavior);
return;
}
- if (is<RenderSVGContainer>(o)) {
- writeSVGContainer(ts, downcast<RenderSVGContainer>(o), behavior);
+ if (is<LegacyRenderSVGContainer>(o)) {
+ writeSVGContainer(ts, downcast<LegacyRenderSVGContainer>(o), behavior);
return;
}
#if ENABLE(LAYER_BASED_SVG_ENGINE)
Copied: trunk/Source/WebCore/rendering/svg/LegacyRenderSVGContainer.cpp (from rev 287915, trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp) (0 => 287916)
--- trunk/Source/WebCore/rendering/svg/LegacyRenderSVGContainer.cpp (rev 0)
+++ trunk/Source/WebCore/rendering/svg/LegacyRenderSVGContainer.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmerm...@kde.org>
+ * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <b...@kde.org>
+ * Copyright (C) 2007 Eric Seidel <e...@webkit.org>
+ * Copyright (C) 2009 Google, Inc. All rights reserved.
+ * Copyright (C) 2009 Dirk Schulze <k...@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "LegacyRenderSVGContainer.h"
+
+#include "GraphicsContext.h"
+#include "HitTestRequest.h"
+#include "HitTestResult.h"
+#include "LayoutRepainter.h"
+#include "RenderIterator.h"
+#include "RenderSVGResourceFilter.h"
+#include "RenderTreeBuilder.h"
+#include "RenderView.h"
+#include "SVGRenderingContext.h"
+#include "SVGResources.h"
+#include "SVGResourcesCache.h"
+#include <wtf/IsoMallocInlines.h>
+#include <wtf/StackStats.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(LegacyRenderSVGContainer);
+
+LegacyRenderSVGContainer::LegacyRenderSVGContainer(SVGElement& element, RenderStyle&& style)
+ : LegacyRenderSVGModelObject(element, WTFMove(style))
+{
+}
+
+LegacyRenderSVGContainer::~LegacyRenderSVGContainer() = default;
+
+void LegacyRenderSVGContainer::layout()
+{
+ StackStats::LayoutCheckPoint layoutCheckPoint;
+ ASSERT(needsLayout());
+
+ // LegacyRenderSVGRoot disables paint offset cache for the SVG rendering tree.
+ ASSERT(!view().frameView().layoutContext().isPaintOffsetCacheEnabled());
+
+ LayoutRepainter repainter(*this, SVGRenderSupport::checkForSVGRepaintDuringLayout(*this) || selfWillPaint());
+
+ // Allow RenderSVGViewportContainer to update its viewport.
+ calcViewport();
+
+ // Allow RenderSVGTransformableContainer to update its transform.
+ bool updatedTransform = calculateLocalTransform();
+
+ // RenderSVGViewportContainer needs to set the 'layout size changed' flag.
+ determineIfLayoutSizeChanged();
+
+ SVGRenderSupport::layoutChildren(*this, selfNeedsLayout() || SVGRenderSupport::filtersForceContainerLayout(*this));
+
+ // Invalidate all resources of this client if our layout changed.
+ if (everHadLayout() && needsLayout())
+ SVGResourcesCache::clientLayoutChanged(*this);
+
+ // At this point LayoutRepainter already grabbed the old bounds,
+ // recalculate them now so repaintAfterLayout() uses the new bounds.
+ if (m_needsBoundariesUpdate || updatedTransform) {
+ updateCachedBoundaries();
+ m_needsBoundariesUpdate = false;
+
+ // If our bounds changed, notify the parents.
+ LegacyRenderSVGModelObject::setNeedsBoundariesUpdate();
+ }
+
+ repainter.repaintAfterLayout();
+ clearNeedsLayout();
+}
+
+bool LegacyRenderSVGContainer::selfWillPaint()
+{
+ auto* resources = SVGResourcesCache::cachedResourcesForRenderer(*this);
+ return resources && resources->filter();
+}
+
+void LegacyRenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&)
+{
+ if (paintInfo.context().paintingDisabled())
+ return;
+
+ // Spec: groups w/o children still may render filter content.
+ if (!firstChild() && !selfWillPaint())
+ return;
+
+ FloatRect repaintRect = repaintRectInLocalCoordinates();
+ if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(repaintRect, localToParentTransform(), paintInfo))
+ return;
+
+ PaintInfo childPaintInfo(paintInfo);
+ {
+ GraphicsContextStateSaver stateSaver(childPaintInfo.context());
+
+ // Let the RenderSVGViewportContainer subclass clip if necessary
+ applyViewportClip(childPaintInfo);
+
+ childPaintInfo.applyTransform(localToParentTransform());
+
+ SVGRenderingContext renderingContext;
+ bool continueRendering = true;
+ if (childPaintInfo.phase == PaintPhase::Foreground) {
+ renderingContext.prepareToRenderSVGContent(*this, childPaintInfo);
+ continueRendering = renderingContext.isRenderingPrepared();
+ }
+
+ if (continueRendering) {
+ childPaintInfo.updateSubtreePaintRootForChildren(this);
+ for (auto& child : childrenOfType<RenderElement>(*this))
+ child.paint(childPaintInfo, IntPoint());
+ }
+ }
+
+ // FIXME: This really should be drawn from local coordinates, but currently we hack it
+ // to avoid our clip killing our outline rect. Thus we translate our
+ // outline rect into parent coords before drawing.
+ // FIXME: This means our focus ring won't share our rotation like it should.
+ // We should instead disable our clip during PaintPhase::Outline
+ if (paintInfo.phase == PaintPhase::SelfOutline && style().outlineWidth() && style().visibility() == Visibility::Visible) {
+ IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRect));
+ paintOutline(paintInfo, paintRectInParent);
+ }
+}
+
+// addFocusRingRects is called from paintOutline and needs to be in the same coordinates as the paintOuline call
+void LegacyRenderSVGContainer::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&, const RenderLayerModelObject*)
+{
+ LayoutRect paintRectInParent = LayoutRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));
+ if (!paintRectInParent.isEmpty())
+ rects.append(paintRectInParent);
+}
+
+void LegacyRenderSVGContainer::updateCachedBoundaries()
+{
+ SVGRenderSupport::computeContainerBoundingBoxes(*this, m_objectBoundingBox, m_objectBoundingBoxValid, m_strokeBoundingBox, m_repaintBoundingBox);
+ SVGRenderSupport::intersectRepaintRectWithResources(*this, m_repaintBoundingBox);
+}
+
+bool LegacyRenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
+{
+ // Give RenderSVGViewportContainer a chance to apply its viewport clip
+ if (!pointIsInsideViewportClip(pointInParent))
+ return false;
+
+ FloatPoint localPoint = valueOrDefault(localToParentTransform().inverse()).mapPoint(pointInParent);
+
+ if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
+ return false;
+
+ SVGHitTestCycleDetectionScope hitTestScope(*this);
+
+ for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
+ if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction)) {
+ updateHitTestResult(result, LayoutPoint(localPoint));
+ if (result.addNodeToListBasedTestResult(child->node(), request, flooredLayoutPoint(localPoint)) == HitTestProgress::Stop)
+ return true;
+ }
+ }
+
+ // Accessibility wants to return SVG containers, if appropriate.
+ if (request.type() & HitTestRequest::Type::AccessibilityHitTest && m_objectBoundingBox.contains(localPoint)) {
+ updateHitTestResult(result, LayoutPoint(localPoint));
+ if (result.addNodeToListBasedTestResult(nodeForHitTest(), request, flooredLayoutPoint(localPoint)) == HitTestProgress::Stop)
+ return true;
+ }
+
+ // Spec: Only graphical elements can be targeted by the mouse, period.
+ // 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispatched."
+ return false;
+}
+
+}
Copied: trunk/Source/WebCore/rendering/svg/LegacyRenderSVGContainer.h (from rev 287915, trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h) (0 => 287916)
--- trunk/Source/WebCore/rendering/svg/LegacyRenderSVGContainer.h (rev 0)
+++ trunk/Source/WebCore/rendering/svg/LegacyRenderSVGContainer.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmerm...@kde.org>
+ * Copyright (C) 2004, 2005, 2007 Rob Buis <b...@kde.org>
+ * Copyright (C) 2009 Google, Inc. All rights reserved.
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+#include "LegacyRenderSVGModelObject.h"
+
+namespace WebCore {
+
+class SVGElement;
+
+class LegacyRenderSVGContainer : public LegacyRenderSVGModelObject {
+ WTF_MAKE_ISO_ALLOCATED(LegacyRenderSVGContainer);
+public:
+ virtual ~LegacyRenderSVGContainer();
+
+ void paint(PaintInfo&, const LayoutPoint&) override;
+ void setNeedsBoundariesUpdate() final { m_needsBoundariesUpdate = true; }
+ bool needsBoundariesUpdate() final { return m_needsBoundariesUpdate; }
+ virtual bool didTransformToRootUpdate() { return false; }
+ bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; }
+
+protected:
+ LegacyRenderSVGContainer(SVGElement&, RenderStyle&&);
+
+ const char* renderName() const override { return "RenderSVGContainer"; }
+
+ bool canHaveChildren() const final { return true; }
+
+ void layout() override;
+
+ void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) final;
+
+ FloatRect objectBoundingBox() const final { return m_objectBoundingBox; }
+ FloatRect strokeBoundingBox() const final { return m_strokeBoundingBox; }
+ FloatRect repaintRectInLocalCoordinates() const final { return m_repaintBoundingBox; }
+
+ bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction) override;
+
+ // Allow RenderSVGTransformableContainer to hook in at the right time in layout()
+ virtual bool calculateLocalTransform() { return false; }
+
+ // Allow RenderSVGViewportContainer to hook in at the right times in layout(), paint() and nodeAtFloatPoint()
+ virtual void calcViewport() { }
+ virtual void applyViewportClip(PaintInfo&) { }
+ virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/) { return true; }
+
+ virtual void determineIfLayoutSizeChanged() { }
+
+ bool selfWillPaint();
+ void updateCachedBoundaries();
+
+private:
+ bool isLegacySVGContainer() const final { return true; }
+
+ FloatRect m_objectBoundingBox;
+ FloatRect m_strokeBoundingBox;
+ FloatRect m_repaintBoundingBox;
+
+ bool m_objectBoundingBoxValid { false };
+ bool m_needsBoundariesUpdate { true };
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(LegacyRenderSVGContainer, isLegacySVGContainer())
Modified: trunk/Source/WebCore/rendering/svg/LegacyRenderSVGShape.h (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/LegacyRenderSVGShape.h 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/LegacyRenderSVGShape.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -36,7 +36,6 @@
class FloatPoint;
class GraphicsContextStateSaver;
-class RenderSVGContainer;
class RenderSVGPath;
class RenderSVGResource;
class SVGGraphicsElement;
Deleted: trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -1,191 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmerm...@kde.org>
- * Copyright (C) 2004, 2005, 2007, 2008 Rob Buis <b...@kde.org>
- * Copyright (C) 2007 Eric Seidel <e...@webkit.org>
- * Copyright (C) 2009 Google, Inc. All rights reserved.
- * Copyright (C) 2009 Dirk Schulze <k...@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "RenderSVGContainer.h"
-
-#include "GraphicsContext.h"
-#include "HitTestRequest.h"
-#include "HitTestResult.h"
-#include "LayoutRepainter.h"
-#include "RenderIterator.h"
-#include "RenderSVGResourceFilter.h"
-#include "RenderTreeBuilder.h"
-#include "RenderView.h"
-#include "SVGRenderingContext.h"
-#include "SVGResources.h"
-#include "SVGResourcesCache.h"
-#include <wtf/IsoMallocInlines.h>
-#include <wtf/StackStats.h>
-
-namespace WebCore {
-
-WTF_MAKE_ISO_ALLOCATED_IMPL(RenderSVGContainer);
-
-RenderSVGContainer::RenderSVGContainer(SVGElement& element, RenderStyle&& style)
- : LegacyRenderSVGModelObject(element, WTFMove(style))
-{
-}
-
-RenderSVGContainer::~RenderSVGContainer() = default;
-
-void RenderSVGContainer::layout()
-{
- StackStats::LayoutCheckPoint layoutCheckPoint;
- ASSERT(needsLayout());
-
- // LegacyRenderSVGRoot disables paint offset cache for the SVG rendering tree.
- ASSERT(!view().frameView().layoutContext().isPaintOffsetCacheEnabled());
-
- LayoutRepainter repainter(*this, SVGRenderSupport::checkForSVGRepaintDuringLayout(*this) || selfWillPaint());
-
- // Allow RenderSVGViewportContainer to update its viewport.
- calcViewport();
-
- // Allow RenderSVGTransformableContainer to update its transform.
- bool updatedTransform = calculateLocalTransform();
-
- // RenderSVGViewportContainer needs to set the 'layout size changed' flag.
- determineIfLayoutSizeChanged();
-
- SVGRenderSupport::layoutChildren(*this, selfNeedsLayout() || SVGRenderSupport::filtersForceContainerLayout(*this));
-
- // Invalidate all resources of this client if our layout changed.
- if (everHadLayout() && needsLayout())
- SVGResourcesCache::clientLayoutChanged(*this);
-
- // At this point LayoutRepainter already grabbed the old bounds,
- // recalculate them now so repaintAfterLayout() uses the new bounds.
- if (m_needsBoundariesUpdate || updatedTransform) {
- updateCachedBoundaries();
- m_needsBoundariesUpdate = false;
-
- // If our bounds changed, notify the parents.
- LegacyRenderSVGModelObject::setNeedsBoundariesUpdate();
- }
-
- repainter.repaintAfterLayout();
- clearNeedsLayout();
-}
-
-bool RenderSVGContainer::selfWillPaint()
-{
- auto* resources = SVGResourcesCache::cachedResourcesForRenderer(*this);
- return resources && resources->filter();
-}
-
-void RenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&)
-{
- if (paintInfo.context().paintingDisabled())
- return;
-
- // Spec: groups w/o children still may render filter content.
- if (!firstChild() && !selfWillPaint())
- return;
-
- FloatRect repaintRect = repaintRectInLocalCoordinates();
- if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(repaintRect, localToParentTransform(), paintInfo))
- return;
-
- PaintInfo childPaintInfo(paintInfo);
- {
- GraphicsContextStateSaver stateSaver(childPaintInfo.context());
-
- // Let the RenderSVGViewportContainer subclass clip if necessary
- applyViewportClip(childPaintInfo);
-
- childPaintInfo.applyTransform(localToParentTransform());
-
- SVGRenderingContext renderingContext;
- bool continueRendering = true;
- if (childPaintInfo.phase == PaintPhase::Foreground) {
- renderingContext.prepareToRenderSVGContent(*this, childPaintInfo);
- continueRendering = renderingContext.isRenderingPrepared();
- }
-
- if (continueRendering) {
- childPaintInfo.updateSubtreePaintRootForChildren(this);
- for (auto& child : childrenOfType<RenderElement>(*this))
- child.paint(childPaintInfo, IntPoint());
- }
- }
-
- // FIXME: This really should be drawn from local coordinates, but currently we hack it
- // to avoid our clip killing our outline rect. Thus we translate our
- // outline rect into parent coords before drawing.
- // FIXME: This means our focus ring won't share our rotation like it should.
- // We should instead disable our clip during PaintPhase::Outline
- if (paintInfo.phase == PaintPhase::SelfOutline && style().outlineWidth() && style().visibility() == Visibility::Visible) {
- IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRect));
- paintOutline(paintInfo, paintRectInParent);
- }
-}
-
-// addFocusRingRects is called from paintOutline and needs to be in the same coordinates as the paintOuline call
-void RenderSVGContainer::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&, const RenderLayerModelObject*)
-{
- LayoutRect paintRectInParent = LayoutRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));
- if (!paintRectInParent.isEmpty())
- rects.append(paintRectInParent);
-}
-
-void RenderSVGContainer::updateCachedBoundaries()
-{
- SVGRenderSupport::computeContainerBoundingBoxes(*this, m_objectBoundingBox, m_objectBoundingBoxValid, m_strokeBoundingBox, m_repaintBoundingBox);
- SVGRenderSupport::intersectRepaintRectWithResources(*this, m_repaintBoundingBox);
-}
-
-bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
-{
- // Give RenderSVGViewportContainer a chance to apply its viewport clip
- if (!pointIsInsideViewportClip(pointInParent))
- return false;
-
- FloatPoint localPoint = valueOrDefault(localToParentTransform().inverse()).mapPoint(pointInParent);
-
- if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
- return false;
-
- SVGHitTestCycleDetectionScope hitTestScope(*this);
-
- for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
- if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction)) {
- updateHitTestResult(result, LayoutPoint(localPoint));
- if (result.addNodeToListBasedTestResult(child->node(), request, flooredLayoutPoint(localPoint)) == HitTestProgress::Stop)
- return true;
- }
- }
-
- // Accessibility wants to return SVG containers, if appropriate.
- if (request.type() & HitTestRequest::Type::AccessibilityHitTest && m_objectBoundingBox.contains(localPoint)) {
- updateHitTestResult(result, LayoutPoint(localPoint));
- if (result.addNodeToListBasedTestResult(nodeForHitTest(), request, flooredLayoutPoint(localPoint)) == HitTestProgress::Stop)
- return true;
- }
-
- // Spec: Only graphical elements can be targeted by the mouse, period.
- // 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispatched."
- return false;
-}
-
-}
Deleted: trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmerm...@kde.org>
- * Copyright (C) 2004, 2005, 2007 Rob Buis <b...@kde.org>
- * Copyright (C) 2009 Google, Inc. All rights reserved.
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#include "LegacyRenderSVGModelObject.h"
-
-namespace WebCore {
-
-class SVGElement;
-
-class RenderSVGContainer : public LegacyRenderSVGModelObject {
- WTF_MAKE_ISO_ALLOCATED(RenderSVGContainer);
-public:
- virtual ~RenderSVGContainer();
-
- void paint(PaintInfo&, const LayoutPoint&) override;
- void setNeedsBoundariesUpdate() final { m_needsBoundariesUpdate = true; }
- bool needsBoundariesUpdate() final { return m_needsBoundariesUpdate; }
- virtual bool didTransformToRootUpdate() { return false; }
- bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; }
-
-protected:
- RenderSVGContainer(SVGElement&, RenderStyle&&);
-
- const char* renderName() const override { return "RenderSVGContainer"; }
-
- bool canHaveChildren() const final { return true; }
-
- void layout() override;
-
- void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) final;
-
- FloatRect objectBoundingBox() const final { return m_objectBoundingBox; }
- FloatRect strokeBoundingBox() const final { return m_strokeBoundingBox; }
- FloatRect repaintRectInLocalCoordinates() const final { return m_repaintBoundingBox; }
-
- bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction) override;
-
- // Allow RenderSVGTransformableContainer to hook in at the right time in layout()
- virtual bool calculateLocalTransform() { return false; }
-
- // Allow RenderSVGViewportContainer to hook in at the right times in layout(), paint() and nodeAtFloatPoint()
- virtual void calcViewport() { }
- virtual void applyViewportClip(PaintInfo&) { }
- virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/) { return true; }
-
- virtual void determineIfLayoutSizeChanged() { }
-
- bool selfWillPaint();
- void updateCachedBoundaries();
-
-private:
- bool isSVGContainer() const final { return true; }
-
- FloatRect m_objectBoundingBox;
- FloatRect m_strokeBoundingBox;
- FloatRect m_repaintBoundingBox;
-
- bool m_objectBoundingBoxValid { false };
- bool m_needsBoundariesUpdate { true };
-};
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGContainer, isSVGContainer())
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -29,7 +29,7 @@
WTF_MAKE_ISO_ALLOCATED_IMPL(RenderSVGHiddenContainer);
RenderSVGHiddenContainer::RenderSVGHiddenContainer(SVGElement& element, RenderStyle&& style)
- : RenderSVGContainer(element, WTFMove(style))
+ : LegacyRenderSVGContainer(element, WTFMove(style))
{
}
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -19,7 +19,7 @@
#pragma once
-#include "RenderSVGContainer.h"
+#include "LegacyRenderSVGContainer.h"
namespace WebCore {
@@ -27,7 +27,7 @@
// This class is for containers which are never drawn, but do need to support style
// <defs>, <linearGradient>, <radialGradient> are all good examples
-class RenderSVGHiddenContainer : public RenderSVGContainer {
+class RenderSVGHiddenContainer : public LegacyRenderSVGContainer {
WTF_MAKE_ISO_ALLOCATED(RenderSVGHiddenContainer);
public:
RenderSVGHiddenContainer(SVGElement&, RenderStyle&&);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -47,9 +47,9 @@
LegacyRenderSVGRoot::addResourceForClientInvalidation(this);
// RenderSVGHiddenContainer overwrites layout(). We need the
- // layouting of RenderSVGContainer for calculating local
+ // layouting of LegacyRenderSVGContainer for calculating local
// transformations and repaint.
- RenderSVGContainer::layout();
+ LegacyRenderSVGContainer::layout();
}
void RenderSVGResourceMarker::removeAllClientsFromCache(bool markForInvalidation)
@@ -70,7 +70,7 @@
FloatRect RenderSVGResourceMarker::markerBoundaries(const AffineTransform& markerTransformation) const
{
- FloatRect coordinates = RenderSVGContainer::repaintRectInLocalCoordinates();
+ FloatRect coordinates = LegacyRenderSVGContainer::repaintRectInLocalCoordinates();
// Map repaint rect into parent coordinate space, in which the marker boundaries have to be evaluated
coordinates = localToParentTransform().mapRect(coordinates);
@@ -122,7 +122,7 @@
PaintInfo info(paintInfo);
GraphicsContextStateSaver stateSaver(info.context());
info.applyTransform(transform);
- RenderSVGContainer::paint(info, IntPoint());
+ LegacyRenderSVGContainer::paint(info, IntPoint());
}
AffineTransform RenderSVGResourceMarker::markerContentTransformation(const AffineTransform& contentTransformation, const FloatPoint& origin, float strokeWidth) const
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGShape.h (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGShape.h 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGShape.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -40,7 +40,6 @@
class FloatPoint;
class GraphicsContextStateSaver;
-class RenderSVGContainer;
class RenderSVGPath;
class RenderSVGResource;
class SVGGraphicsElement;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -33,7 +33,7 @@
WTF_MAKE_ISO_ALLOCATED_IMPL(RenderSVGTransformableContainer);
RenderSVGTransformableContainer::RenderSVGTransformableContainer(SVGGraphicsElement& element, RenderStyle&& style)
- : RenderSVGContainer(element, WTFMove(style))
+ : LegacyRenderSVGContainer(element, WTFMove(style))
, m_needsTransformUpdate(true)
, m_didTransformToRootUpdate(false)
{
@@ -75,7 +75,7 @@
SVGGraphicsElement& RenderSVGTransformableContainer::graphicsElement()
{
- return downcast<SVGGraphicsElement>(RenderSVGContainer::element());
+ return downcast<SVGGraphicsElement>(LegacyRenderSVGContainer::element());
}
}
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.h (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.h 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -20,13 +20,13 @@
#pragma once
-#include "RenderSVGContainer.h"
+#include "LegacyRenderSVGContainer.h"
namespace WebCore {
class SVGGraphicsElement;
-class RenderSVGTransformableContainer final : public RenderSVGContainer {
+class RenderSVGTransformableContainer final : public LegacyRenderSVGContainer {
WTF_MAKE_ISO_ALLOCATED(RenderSVGTransformableContainer);
public:
RenderSVGTransformableContainer(SVGGraphicsElement&, RenderStyle&&);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -34,7 +34,7 @@
WTF_MAKE_ISO_ALLOCATED_IMPL(RenderSVGViewportContainer);
RenderSVGViewportContainer::RenderSVGViewportContainer(SVGSVGElement& element, RenderStyle&& style)
- : RenderSVGContainer(element, WTFMove(style))
+ : LegacyRenderSVGContainer(element, WTFMove(style))
, m_didTransformToRootUpdate(false)
, m_isLayoutSizeChanged(false)
, m_needsTransformUpdate(true)
@@ -43,7 +43,7 @@
SVGSVGElement& RenderSVGViewportContainer::svgSVGElement() const
{
- return downcast<SVGSVGElement>(RenderSVGContainer::element());
+ return downcast<SVGSVGElement>(LegacyRenderSVGContainer::element());
}
void RenderSVGViewportContainer::determineIfLayoutSizeChanged()
@@ -103,7 +103,7 @@
if (svgSVGElement().hasEmptyViewBox())
return;
- RenderSVGContainer::paint(paintInfo, paintOffset);
+ LegacyRenderSVGContainer::paint(paintInfo, paintOffset);
}
}
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGViewportContainer.h (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/RenderSVGViewportContainer.h 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGViewportContainer.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -22,13 +22,13 @@
#pragma once
-#include "RenderSVGContainer.h"
+#include "LegacyRenderSVGContainer.h"
namespace WebCore {
// This is used for non-root <svg> elements and <marker> elements, neither of which are SVGTransformable
-// thus we inherit from RenderSVGContainer instead of RenderSVGTransformableContainer
-class RenderSVGViewportContainer final : public RenderSVGContainer {
+// thus we inherit from LegacyRenderSVGContainer instead of RenderSVGTransformableContainer
+class RenderSVGViewportContainer final : public LegacyRenderSVGContainer {
WTF_MAKE_ISO_ALLOCATED(RenderSVGViewportContainer);
public:
RenderSVGViewportContainer(SVGSVGElement&, RenderStyle&&);
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -126,13 +126,13 @@
// When a parent container is transformed in SVG, all children will be painted automatically
// so we are able to skip redundant repaint checks.
auto parent = renderer.parent();
- return !(is<RenderSVGContainer>(parent) && downcast<RenderSVGContainer>(*parent).didTransformToRootUpdate());
+ return !(is<LegacyRenderSVGContainer>(parent) && downcast<LegacyRenderSVGContainer>(*parent).didTransformToRootUpdate());
}
// Update a bounding box taking into account the validity of the other bounding box.
static inline void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, const RenderObject* other, FloatRect otherBoundingBox)
{
- bool otherValid = is<RenderSVGContainer>(*other) ? downcast<RenderSVGContainer>(*other).isObjectBoundingBoxValid() : true;
+ bool otherValid = is<LegacyRenderSVGContainer>(*other) ? downcast<LegacyRenderSVGContainer>(*other).isObjectBoundingBoxValid() : true;
if (!otherValid)
return;
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -537,7 +537,7 @@
writeChildren(ts, resource, behavior);
}
-void writeSVGContainer(TextStream& ts, const RenderSVGContainer& container, OptionSet<RenderAsTextFlag> behavior)
+void writeSVGContainer(TextStream& ts, const LegacyRenderSVGContainer& container, OptionSet<RenderAsTextFlag> behavior)
{
// Currently RenderSVGResourceFilterPrimitive has no meaningful output.
if (container.isSVGResourceFilterPrimitive())
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h (287915 => 287916)
--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -39,7 +39,7 @@
class Node;
class RenderImage;
class RenderObject;
-class RenderSVGContainer;
+class LegacyRenderSVGContainer;
class RenderSVGGradientStop;
class RenderSVGImage;
class RenderSVGInlineText;
@@ -58,7 +58,7 @@
#endif
void writeSVGGradientStop(WTF::TextStream&, const RenderSVGGradientStop&, OptionSet<RenderAsTextFlag>);
void writeSVGResourceContainer(WTF::TextStream&, const RenderSVGResourceContainer&, OptionSet<RenderAsTextFlag>);
-void writeSVGContainer(WTF::TextStream&, const RenderSVGContainer&, OptionSet<RenderAsTextFlag>);
+void writeSVGContainer(WTF::TextStream&, const LegacyRenderSVGContainer&, OptionSet<RenderAsTextFlag>);
void writeSVGImage(WTF::TextStream&, const RenderSVGImage&, OptionSet<RenderAsTextFlag>);
void writeSVGInlineText(WTF::TextStream&, const RenderSVGInlineText&, OptionSet<RenderAsTextFlag>);
void writeSVGText(WTF::TextStream&, const RenderSVGText&, OptionSet<RenderAsTextFlag>);
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -30,6 +30,7 @@
#include "DocumentInlines.h"
#include "Frame.h"
#include "FrameSelection.h"
+#include "LegacyRenderSVGContainer.h"
#include "LegacyRenderSVGRoot.h"
#include "RenderButton.h"
#include "RenderCounter.h"
@@ -48,7 +49,6 @@
#include "RenderRuby.h"
#include "RenderRubyBase.h"
#include "RenderRubyRun.h"
-#include "RenderSVGContainer.h"
#include "RenderSVGInline.h"
#include "RenderSVGRoot.h"
#include "RenderSVGText.h"
@@ -281,8 +281,8 @@
return;
}
- if (is<RenderSVGContainer>(parent)) {
- svgBuilder().attach(downcast<RenderSVGContainer>(parent), WTFMove(child), beforeChild);
+ if (is<LegacyRenderSVGContainer>(parent)) {
+ svgBuilder().attach(downcast<LegacyRenderSVGContainer>(parent), WTFMove(child), beforeChild);
return;
}
@@ -379,8 +379,8 @@
if (is<RenderSVGInline>(parent))
return svgBuilder().detach(downcast<RenderSVGInline>(parent), child);
- if (is<RenderSVGContainer>(parent))
- return svgBuilder().detach(downcast<RenderSVGContainer>(parent), child);
+ if (is<LegacyRenderSVGContainer>(parent))
+ return svgBuilder().detach(downcast<LegacyRenderSVGContainer>(parent), child);
#if ENABLE(LAYER_BASED_SVG_ENGINE)
if (is<RenderSVGRoot>(parent))
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp (287915 => 287916)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -26,8 +26,8 @@
#include "config.h"
#include "RenderTreeBuilderSVG.h"
+#include "LegacyRenderSVGContainer.h"
#include "LegacyRenderSVGRoot.h"
-#include "RenderSVGContainer.h"
#include "RenderSVGInline.h"
#include "RenderSVGRoot.h"
#include "RenderSVGText.h"
@@ -50,7 +50,7 @@
SVGResourcesCache::clientWasAddedToTree(childToAdd);
}
-void RenderTreeBuilder::SVG::attach(RenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
+void RenderTreeBuilder::SVG::attach(LegacyRenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
{
auto& childToAdd = *child;
m_builder.attachToRenderElement(parent, WTFMove(child), beforeChild);
@@ -117,7 +117,7 @@
return takenChild;
}
-RenderPtr<RenderObject> RenderTreeBuilder::SVG::detach(RenderSVGContainer& parent, RenderObject& child)
+RenderPtr<RenderObject> RenderTreeBuilder::SVG::detach(LegacyRenderSVGContainer& parent, RenderObject& child)
{
SVGResourcesCache::clientWillBeRemovedFromTree(child);
return m_builder.detachFromRenderElement(parent, child);
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h (287915 => 287916)
--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilderSVG.h 2022-01-12 10:29:01 UTC (rev 287916)
@@ -30,7 +30,7 @@
namespace WebCore {
class LegacyRenderSVGRoot;
-class RenderSVGContainer;
+class LegacyRenderSVGContainer;
class RenderSVGInline;
class RenderSVGRoot;
class RenderSVGText;
@@ -41,7 +41,7 @@
SVG(RenderTreeBuilder&);
void attach(LegacyRenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
- void attach(RenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
+ void attach(LegacyRenderSVGContainer& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
void attach(RenderSVGInline& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
#if ENABLE(LAYER_BASED_SVG_ENGINE)
void attach(RenderSVGRoot& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
@@ -49,7 +49,7 @@
void attach(RenderSVGText& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild);
RenderPtr<RenderObject> detach(LegacyRenderSVGRoot& parent, RenderObject& child) WARN_UNUSED_RETURN;
- RenderPtr<RenderObject> detach(RenderSVGContainer& parent, RenderObject& child) WARN_UNUSED_RETURN;
+ RenderPtr<RenderObject> detach(LegacyRenderSVGContainer& parent, RenderObject& child) WARN_UNUSED_RETURN;
RenderPtr<RenderObject> detach(RenderSVGInline& parent, RenderObject& child) WARN_UNUSED_RETURN;
#if ENABLE(LAYER_BASED_SVG_ENGINE)
RenderPtr<RenderObject> detach(RenderSVGRoot& parent, RenderObject& child) WARN_UNUSED_RETURN;
Modified: trunk/Source/WebCore/svg/SVGPatternElement.cpp (287915 => 287916)
--- trunk/Source/WebCore/svg/SVGPatternElement.cpp 2022-01-12 09:44:27 UTC (rev 287915)
+++ trunk/Source/WebCore/svg/SVGPatternElement.cpp 2022-01-12 10:29:01 UTC (rev 287916)
@@ -30,7 +30,6 @@
#include "GraphicsContext.h"
#include "ImageBuffer.h"
#include "PatternAttributes.h"
-#include "RenderSVGContainer.h"
#include "RenderSVGResourcePattern.h"
#include "SVGElementInlines.h"
#include "SVGFitToViewBox.h"