Diff
Modified: trunk/Source/WebCore/ChangeLog (284717 => 284718)
--- trunk/Source/WebCore/ChangeLog 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/ChangeLog 2021-10-22 22:17:02 UTC (rev 284718)
@@ -1,3 +1,55 @@
+2021-10-22 Kiet Ho <[email protected]>
+
+ Rename ClipPathOperation to PathOperation
+ https://bugs.webkit.org/show_bug.cgi?id=232167
+
+ Reviewed by Simon Fraser.
+
+ No functional changes, no tests required.
+
+ * Headers.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * animation/CSSPropertyAnimation.cpp:
+ (WebCore::blendFunc):
+ * css/CSSBasicShapes.cpp:
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
+ * rendering/PathOperation.h: Renamed from Source/WebCore/rendering/ClipPathOperation.h.
+ (WebCore::PathOperation::operator!= const):
+ (WebCore::PathOperation::isSameType const):
+ (WebCore::PathOperation::PathOperation):
+ * rendering/ReferencedSVGResources.cpp:
+ (WebCore::ReferencedSVGResources::referencedSVGResourceIDs):
+ (WebCore::ReferencedSVGResources::referencedClipperRenderer):
+ * rendering/ReferencedSVGResources.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::hitTestClipPath const):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::willCompositeClipPath const):
+ (WebCore::RenderLayer::computeClipPath const):
+ (WebCore::RenderLayer::setupClipPath):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
+ (WebCore::RenderLayerBacking::updateMaskingLayer):
+ * rendering/style/BasicShapes.cpp:
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyle::clipPath const):
+ (WebCore::RenderStyle::initialClipPath):
+ (WebCore::RenderStyle::setClipPath):
+ * rendering/style/StyleRareNonInheritedData.h:
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::isPointInCSSClippingArea):
+ (WebCore::SVGRenderSupport::clipContextToCSSClippingArea):
+ (WebCore::SVGRenderSupport::pointInClippingArea):
+ * rendering/svg/SVGRenderTreeAsText.cpp:
+ (WebCore::writeResources):
+ * rendering/svg/SVGRenderingContext.cpp:
+ (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+ * rendering/svg/SVGResources.cpp:
+ (WebCore::SVGResources::buildCachedResources):
+ * style/StyleBuilderConverter.h:
+ (WebCore::Style::BuilderConverter::convertClipPath):
+
2021-10-22 Ian Anderson <[email protected]>
Add a module map file for PrivateFrameworks/WebKitLegacy
Modified: trunk/Source/WebCore/Headers.cmake (284717 => 284718)
--- trunk/Source/WebCore/Headers.cmake 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/Headers.cmake 2021-10-22 22:17:02 UTC (rev 284718)
@@ -1590,7 +1590,6 @@
plugins/nptypes.h
rendering/BreakLines.h
- rendering/ClipPathOperation.h
rendering/ClipRect.h
rendering/EventRegion.h
rendering/FloatingObjects.h
@@ -1614,6 +1613,7 @@
rendering/PaintFrequencyTracker.h
rendering/PaintInfo.h
rendering/PaintPhase.h
+ rendering/PathOperation.h
rendering/RenderAttachment.h
rendering/RenderBlock.h
rendering/RenderBlockFlow.h
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (284717 => 284718)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2021-10-22 22:17:02 UTC (rev 284718)
@@ -5524,7 +5524,7 @@
FB2C15C3165D649D0039C9F8 /* CachedSVGDocumentReference.h in Headers */ = {isa = PBXBuildFile; fileRef = FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */; settings = {ATTRIBUTES = (Private, ); }; };
FB3056C2169E5DAC0096A232 /* CSSGroupingRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */; settings = {ATTRIBUTES = (Private, ); }; };
FB484F4D171F821E00040755 /* TransformFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = FB484F4B171F821E00040755 /* TransformFunctions.h */; };
- FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = FB92DF4915FED08700994433 /* ClipPathOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ FB92DF4B15FED08700994433 /* PathOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = FB92DF4915FED08700994433 /* PathOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
FBB0C5B817BBD629003D3677 /* CSSFilterImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = FB965B8117BBB5F900E835B9 /* CSSFilterImageValue.h */; settings = {ATTRIBUTES = (); }; };
FBD6AF8815EF25C9008B7110 /* CSSBasicShapes.h in Headers */ = {isa = PBXBuildFile; fileRef = FBD6AF8715EF21D4008B7110 /* CSSBasicShapes.h */; };
FBD6AF8A15EF25DF008B7110 /* BasicShapeFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = FBD6AF8515EF21D4008B7110 /* BasicShapeFunctions.h */; };
@@ -17110,7 +17110,7 @@
FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGroupingRule.h; sourceTree = "<group>"; };
FB484F4A171F821E00040755 /* TransformFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformFunctions.cpp; sourceTree = "<group>"; };
FB484F4B171F821E00040755 /* TransformFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformFunctions.h; sourceTree = "<group>"; };
- FB92DF4915FED08700994433 /* ClipPathOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipPathOperation.h; sourceTree = "<group>"; };
+ FB92DF4915FED08700994433 /* PathOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathOperation.h; sourceTree = "<group>"; };
FB965B8117BBB5F900E835B9 /* CSSFilterImageValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFilterImageValue.h; sourceTree = "<group>"; };
FB965B8217BBB62C00E835B9 /* CSSFilterImageValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFilterImageValue.cpp; sourceTree = "<group>"; };
FBD6AF8215EF21A3008B7110 /* BasicShapes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BasicShapes.cpp; sourceTree = "<group>"; };
@@ -30196,7 +30196,6 @@
BCEA4816097D93020094C9E4 /* BreakLines.h */,
E4F0BE3025710A76009E7431 /* CaretRectComputation.cpp */,
E4F0BE2E25710A75009E7431 /* CaretRectComputation.h */,
- FB92DF4915FED08700994433 /* ClipPathOperation.h */,
5803715F1A66F00A00BAF519 /* ClipRect.cpp */,
580371601A66F00A00BAF519 /* ClipRect.h */,
BCDD454D1236C95C009A7985 /* ColumnInfo.h */,
@@ -30274,6 +30273,7 @@
55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */,
0885067D11DA045B00182B98 /* PaintInfo.h */,
0885067E11DA045B00182B98 /* PaintPhase.h */,
+ FB92DF4915FED08700994433 /* PathOperation.h */,
B2B1F7140D00CAA8004AEA64 /* PointerEventsHitRules.cpp */,
B2B1F7150D00CAA8004AEA64 /* PointerEventsHitRules.h */,
0FC276BA26DAF9E90093E8ED /* ReferencedSVGResources.cpp */,
@@ -32076,7 +32076,6 @@
F46C447E234654540039A79D /* ClipboardItemBindingsDataSource.h in Headers */,
F4D07558234D822D00881E73 /* ClipboardItemDataSource.h in Headers */,
F4D07559234D823300881E73 /* ClipboardItemPasteboardDataSource.h in Headers */,
- FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */,
580371621A66F00A00BAF519 /* ClipRect.h in Headers */,
97AABD1314FA09D5007457AE /* CloseEvent.h in Headers */,
C0C054CB1118C8E400CE2636 /* CodeGenerator.pm in Headers */,
@@ -34731,6 +34730,7 @@
1AF5E4D51E56735B004A1F01 /* PasteboardWriterData.h in Headers */,
B27535800B053814002CE64F /* Path.h in Headers */,
7C193BC21F5E0EED0088F3E6 /* Path2D.h in Headers */,
+ FB92DF4B15FED08700994433 /* PathOperation.h in Headers */,
A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */,
2D5002FC1B56D7990020AAF7 /* PathUtilities.h in Headers */,
A8FA6E5D0E4CFDED00D5CF49 /* Pattern.h in Headers */,
Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (284717 => 284718)
--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -41,7 +41,6 @@
#include "CSSPropertyNames.h"
#include "CachedImage.h"
#include "CalculationValue.h"
-#include "ClipPathOperation.h"
#include "ColorBlending.h"
#include "CompositeOperation.h"
#include "FloatConversion.h"
@@ -55,6 +54,7 @@
#include "Logging.h"
#include "Matrix3DTransformOperation.h"
#include "MatrixTransformOperation.h"
+#include "PathOperation.h"
#include "RenderBox.h"
#include "RenderStyle.h"
#include "StyleCachedImage.h"
@@ -271,22 +271,22 @@
return nullptr;
}
-static inline RefPtr<ClipPathOperation> blendFunc(ClipPathOperation* from, ClipPathOperation* to, const CSSPropertyBlendingContext& context)
+static inline RefPtr<PathOperation> blendFunc(PathOperation* from, PathOperation* to, const CSSPropertyBlendingContext& context)
{
if (!from || !to)
return to;
// Other clip-path operations than BasicShapes can not be animated.
- if (from->type() != ClipPathOperation::Shape || to->type() != ClipPathOperation::Shape)
+ if (from->type() != PathOperation::Shape || to->type() != PathOperation::Shape)
return to;
- const BasicShape& fromShape = downcast<ShapeClipPathOperation>(*from).basicShape();
- const BasicShape& toShape = downcast<ShapeClipPathOperation>(*to).basicShape();
+ const BasicShape& fromShape = downcast<ShapePathOperation>(*from).basicShape();
+ const BasicShape& toShape = downcast<ShapePathOperation>(*to).basicShape();
if (!fromShape.canBlend(toShape))
return to;
- return ShapeClipPathOperation::create(toShape.blend(fromShape, context));
+ return ShapePathOperation::create(toShape.blend(fromShape, context));
}
static inline RefPtr<ShapeValue> blendFunc(ShapeValue* from, ShapeValue* to, const CSSPropertyBlendingContext& context)
@@ -1019,11 +1019,11 @@
}
};
-class PropertyWrapperClipPath final : public RefCountedPropertyWrapper<ClipPathOperation> {
+class PropertyWrapperClipPath final : public RefCountedPropertyWrapper<PathOperation> {
WTF_MAKE_FAST_ALLOCATED;
public:
- PropertyWrapperClipPath(CSSPropertyID property, ClipPathOperation* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(RefPtr<ClipPathOperation>&&))
- : RefCountedPropertyWrapper<ClipPathOperation>(property, getter, setter)
+ PropertyWrapperClipPath(CSSPropertyID property, PathOperation* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(RefPtr<PathOperation>&&))
+ : RefCountedPropertyWrapper<PathOperation>(property, getter, setter)
{
}
Modified: trunk/Source/WebCore/css/CSSBasicShapes.cpp (284717 => 284718)
--- trunk/Source/WebCore/css/CSSBasicShapes.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/css/CSSBasicShapes.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -397,4 +397,3 @@
}
} // namespace WebCore
-
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (284717 => 284718)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -3793,17 +3793,17 @@
auto* operation = style.clipPath();
if (!operation)
return cssValuePool.createIdentifierValue(CSSValueNone);
- if (is<ReferenceClipPathOperation>(*operation))
- return CSSPrimitiveValue::create(downcast<ReferenceClipPathOperation>(*operation).url(), CSSUnitType::CSS_URI);
+ if (is<ReferencePathOperation>(*operation))
+ return CSSPrimitiveValue::create(downcast<ReferencePathOperation>(*operation).url(), CSSUnitType::CSS_URI);
auto list = CSSValueList::createSpaceSeparated();
- if (is<ShapeClipPathOperation>(*operation)) {
- auto& shapeOperation = downcast<ShapeClipPathOperation>(*operation);
+ if (is<ShapePathOperation>(*operation)) {
+ auto& shapeOperation = downcast<ShapePathOperation>(*operation);
list->append(valueForBasicShape(style, shapeOperation.basicShape()));
if (shapeOperation.referenceBox() != CSSBoxType::BoxMissing)
list->append(cssValuePool.createValue(shapeOperation.referenceBox()));
}
- if (is<BoxClipPathOperation>(*operation))
- list->append(cssValuePool.createValue(downcast<BoxClipPathOperation>(*operation).referenceBox()));
+ if (is<BoxPathOperation>(*operation))
+ list->append(cssValuePool.createValue(downcast<BoxPathOperation>(*operation).referenceBox()));
return list;
}
case CSSPropertyShapeMargin:
Deleted: trunk/Source/WebCore/rendering/ClipPathOperation.h (284717 => 284718)
--- trunk/Source/WebCore/rendering/ClipPathOperation.h 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/ClipPathOperation.h 2021-10-22 22:17:02 UTC (rev 284718)
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "BasicShapes.h"
-#include "Path.h"
-#include "RenderStyleConstants.h"
-#include <wtf/RefCounted.h>
-#include <wtf/TypeCasts.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class ClipPathOperation : public RefCounted<ClipPathOperation> {
-public:
- enum OperationType {
- Reference,
- Shape,
- Box
- };
-
- virtual ~ClipPathOperation() = default;
-
- virtual bool operator==(const ClipPathOperation&) const = 0;
- bool operator!=(const ClipPathOperation& o) const { return !(*this == o); }
-
- OperationType type() const { return m_type; }
- bool isSameType(const ClipPathOperation& o) const { return o.type() == m_type; }
-
-protected:
- explicit ClipPathOperation(OperationType type)
- : m_type(type)
- {
- }
-
- OperationType m_type;
-};
-
-class ReferenceClipPathOperation final : public ClipPathOperation {
-public:
- static Ref<ReferenceClipPathOperation> create(const String& url, const String& fragment)
- {
- return adoptRef(*new ReferenceClipPathOperation(url, fragment));
- }
-
- const String& url() const { return m_url; }
- const String& fragment() const { return m_fragment; }
-
-private:
- bool operator==(const ClipPathOperation& other) const override
- {
- if (!isSameType(other))
- return false;
- auto& referenceClip = downcast<ReferenceClipPathOperation>(other);
- return m_url == referenceClip.m_url;
- }
-
- ReferenceClipPathOperation(const String& url, const String& fragment)
- : ClipPathOperation(Reference)
- , m_url(url)
- , m_fragment(fragment)
- {
- }
-
- String m_url;
- String m_fragment;
-};
-
-class ShapeClipPathOperation final : public ClipPathOperation {
-public:
- static Ref<ShapeClipPathOperation> create(Ref<BasicShape>&& shape)
- {
- return adoptRef(*new ShapeClipPathOperation(WTFMove(shape)));
- }
-
- const BasicShape& basicShape() const { return m_shape; }
- WindRule windRule() const { return m_shape.get().windRule(); }
- const Path& pathForReferenceRect(const FloatRect& boundingRect) { return m_shape.get().path(boundingRect); }
-
- void setReferenceBox(CSSBoxType referenceBox) { m_referenceBox = referenceBox; }
- CSSBoxType referenceBox() const { return m_referenceBox; }
-
-private:
- bool operator==(const ClipPathOperation& other) const override
- {
- if (!isSameType(other))
- return false;
- auto& shapeClip = downcast<ShapeClipPathOperation>(other);
- return m_referenceBox == shapeClip.referenceBox()
- && (m_shape.ptr() == shapeClip.m_shape.ptr() || m_shape.get() == shapeClip.m_shape.get());
- }
-
- explicit ShapeClipPathOperation(Ref<BasicShape>&& shape)
- : ClipPathOperation(Shape)
- , m_shape(WTFMove(shape))
- , m_referenceBox(CSSBoxType::BoxMissing)
- {
- }
-
- Ref<BasicShape> m_shape;
- CSSBoxType m_referenceBox;
-};
-
-class BoxClipPathOperation final : public ClipPathOperation {
-public:
- static Ref<BoxClipPathOperation> create(CSSBoxType referenceBox)
- {
- return adoptRef(*new BoxClipPathOperation(referenceBox));
- }
-
- const Path pathForReferenceRect(const FloatRoundedRect& boundingRect) const
- {
- Path path;
- path.addRoundedRect(boundingRect);
- return path;
- }
- CSSBoxType referenceBox() const { return m_referenceBox; }
-
-private:
- bool operator==(const ClipPathOperation& other) const override
- {
- if (!isSameType(other))
- return false;
- auto& boxClip = downcast<BoxClipPathOperation>(other);
- return m_referenceBox == boxClip.m_referenceBox;
- }
-
- explicit BoxClipPathOperation(CSSBoxType referenceBox)
- : ClipPathOperation(Box)
- , m_referenceBox(referenceBox)
- {
- }
-
- CSSBoxType m_referenceBox;
-};
-
-} // namespace WebCore
-
-#define SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ToValueTypeName, predicate) \
-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
- static bool isType(const WebCore::ClipPathOperation& operation) { return operation.type() == WebCore::predicate; } \
-SPECIALIZE_TYPE_TRAITS_END()
-
-SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ReferenceClipPathOperation, ClipPathOperation::Reference)
-SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ShapeClipPathOperation, ClipPathOperation::Shape)
-SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(BoxClipPathOperation, ClipPathOperation::Box)
Copied: trunk/Source/WebCore/rendering/PathOperation.h (from rev 284716, trunk/Source/WebCore/rendering/ClipPathOperation.h) (0 => 284718)
--- trunk/Source/WebCore/rendering/PathOperation.h (rev 0)
+++ trunk/Source/WebCore/rendering/PathOperation.h 2021-10-22 22:17:02 UTC (rev 284718)
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "BasicShapes.h"
+#include "Path.h"
+#include "RenderStyleConstants.h"
+#include <wtf/RefCounted.h>
+#include <wtf/TypeCasts.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class PathOperation : public RefCounted<PathOperation> {
+public:
+ enum OperationType {
+ Reference,
+ Shape,
+ Box
+ };
+
+ virtual ~PathOperation() = default;
+
+ virtual bool operator==(const PathOperation&) const = 0;
+ bool operator!=(const PathOperation& o) const { return !(*this == o); }
+
+ OperationType type() const { return m_type; }
+ bool isSameType(const PathOperation& o) const { return o.type() == m_type; }
+
+protected:
+ explicit PathOperation(OperationType type)
+ : m_type(type)
+ {
+ }
+
+ OperationType m_type;
+};
+
+class ReferencePathOperation final : public PathOperation {
+public:
+ static Ref<ReferencePathOperation> create(const String& url, const String& fragment)
+ {
+ return adoptRef(*new ReferencePathOperation(url, fragment));
+ }
+
+ const String& url() const { return m_url; }
+ const String& fragment() const { return m_fragment; }
+
+private:
+ bool operator==(const PathOperation& other) const override
+ {
+ if (!isSameType(other))
+ return false;
+ auto& referenceClip = downcast<ReferencePathOperation>(other);
+ return m_url == referenceClip.m_url;
+ }
+
+ ReferencePathOperation(const String& url, const String& fragment)
+ : PathOperation(Reference)
+ , m_url(url)
+ , m_fragment(fragment)
+ {
+ }
+
+ String m_url;
+ String m_fragment;
+};
+
+class ShapePathOperation final : public PathOperation {
+public:
+ static Ref<ShapePathOperation> create(Ref<BasicShape>&& shape)
+ {
+ return adoptRef(*new ShapePathOperation(WTFMove(shape)));
+ }
+
+ const BasicShape& basicShape() const { return m_shape; }
+ WindRule windRule() const { return m_shape.get().windRule(); }
+ const Path& pathForReferenceRect(const FloatRect& boundingRect) const { return m_shape.get().path(boundingRect); }
+
+ void setReferenceBox(CSSBoxType referenceBox) { m_referenceBox = referenceBox; }
+ CSSBoxType referenceBox() const { return m_referenceBox; }
+
+private:
+ bool operator==(const PathOperation& other) const override
+ {
+ if (!isSameType(other))
+ return false;
+ auto& shapeClip = downcast<ShapePathOperation>(other);
+ return m_referenceBox == shapeClip.referenceBox()
+ && (m_shape.ptr() == shapeClip.m_shape.ptr() || m_shape.get() == shapeClip.m_shape.get());
+ }
+
+ explicit ShapePathOperation(Ref<BasicShape>&& shape)
+ : PathOperation(Shape)
+ , m_shape(WTFMove(shape))
+ , m_referenceBox(CSSBoxType::BoxMissing)
+ {
+ }
+
+ Ref<BasicShape> m_shape;
+ CSSBoxType m_referenceBox;
+};
+
+class BoxPathOperation final : public PathOperation {
+public:
+ static Ref<BoxPathOperation> create(CSSBoxType referenceBox)
+ {
+ return adoptRef(*new BoxPathOperation(referenceBox));
+ }
+
+ const Path pathForReferenceRect(const FloatRoundedRect& boundingRect) const
+ {
+ Path path;
+ path.addRoundedRect(boundingRect);
+ return path;
+ }
+ CSSBoxType referenceBox() const { return m_referenceBox; }
+
+private:
+ bool operator==(const PathOperation& other) const override
+ {
+ if (!isSameType(other))
+ return false;
+ auto& boxClip = downcast<BoxPathOperation>(other);
+ return m_referenceBox == boxClip.m_referenceBox;
+ }
+
+ explicit BoxPathOperation(CSSBoxType referenceBox)
+ : PathOperation(Box)
+ , m_referenceBox(referenceBox)
+ {
+ }
+
+ CSSBoxType m_referenceBox;
+};
+
+} // namespace WebCore
+
+#define SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
+ static bool isType(const WebCore::PathOperation& operation) { return operation.type() == WebCore::predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()
+
+SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ReferencePathOperation, PathOperation::Reference)
+SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ShapePathOperation, PathOperation::Shape)
+SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(BoxPathOperation, PathOperation::Box)
Modified: trunk/Source/WebCore/rendering/ReferencedSVGResources.cpp (284717 => 284718)
--- trunk/Source/WebCore/rendering/ReferencedSVGResources.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/ReferencedSVGResources.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -26,8 +26,8 @@
#include "config.h"
#include "ReferencedSVGResources.h"
-#include "ClipPathOperation.h"
#include "FilterOperations.h"
+#include "PathOperation.h"
#include "RenderSVGResourceClipper.h"
#include "RenderSVGResourceFilter.h"
#include "RenderStyle.h"
@@ -98,8 +98,8 @@
Vector<std::pair<AtomString, QualifiedName>> ReferencedSVGResources::referencedSVGResourceIDs(const RenderStyle& style)
{
Vector<std::pair<AtomString, QualifiedName>> referencedResources;
- if (is<ReferenceClipPathOperation>(style.clipPath())) {
- auto& clipPath = downcast<ReferenceClipPathOperation>(*style.clipPath());
+ if (is<ReferencePathOperation>(style.clipPath())) {
+ auto& clipPath = downcast<ReferencePathOperation>(*style.clipPath());
if (!clipPath.fragment().isEmpty())
referencedResources.append({ clipPath.fragment(), SVGNames::clipPathTag });
}
@@ -157,7 +157,7 @@
return element ? downcast<SVGFilterElement>(element) : nullptr;
}
-RenderSVGResourceClipper* ReferencedSVGResources::referencedClipperRenderer(Document& document, const ReferenceClipPathOperation& clipPath)
+RenderSVGResourceClipper* ReferencedSVGResources::referencedClipperRenderer(Document& document, const ReferencePathOperation& clipPath)
{
if (clipPath.fragment().isEmpty())
return nullptr;
Modified: trunk/Source/WebCore/rendering/ReferencedSVGResources.h (284717 => 284718)
--- trunk/Source/WebCore/rendering/ReferencedSVGResources.h 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/ReferencedSVGResources.h 2021-10-22 22:17:02 UTC (rev 284718)
@@ -35,7 +35,7 @@
class CSSSVGResourceElementClient;
class Document;
-class ReferenceClipPathOperation;
+class ReferencePathOperation;
class ReferenceFilterOperation;
class RenderElement;
class RenderSVGResourceClipper;
@@ -55,7 +55,7 @@
void updateReferencedResources(Document&, const Vector<std::pair<AtomString, QualifiedName>>&);
// Clipping needs a renderer, filters use an element.
- RenderSVGResourceClipper* referencedClipperRenderer(Document&, const ReferenceClipPathOperation&);
+ RenderSVGResourceClipper* referencedClipperRenderer(Document&, const ReferencePathOperation&);
SVGFilterElement* referencedFilterElement(Document&, const ReferenceFilterOperation&);
private:
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (284717 => 284718)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -26,7 +26,6 @@
#include "RenderBox.h"
#include "CSSFontSelector.h"
-#include "ClipPathOperation.h"
#include "ControlStates.h"
#include "Document.h"
#include "Editing.h"
@@ -54,6 +53,7 @@
#include "LegacyInlineElementBox.h"
#include "Page.h"
#include "PaintInfo.h"
+#include "PathOperation.h"
#include "RenderBoxFragmentInfo.h"
#include "RenderChildIterator.h"
#include "RenderDeprecatedFlexibleBox.h"
@@ -1385,16 +1385,16 @@
auto offsetFromHitTestRoot = toLayoutSize(accumulatedOffset + location());
auto hitTestLocationInLocalCoordinates = hitTestLocation.point() - offsetFromHitTestRoot;
switch (style().clipPath()->type()) {
- case ClipPathOperation::Shape: {
- auto& clipPath = downcast<ShapeClipPathOperation>(*style().clipPath());
+ case PathOperation::Shape: {
+ auto& clipPath = downcast<ShapePathOperation>(*style().clipPath());
auto referenceBoxRect = referenceBox(clipPath.referenceBox());
if (!clipPath.pathForReferenceRect(referenceBoxRect).contains(hitTestLocationInLocalCoordinates, clipPath.windRule()))
return false;
break;
}
- case ClipPathOperation::Reference: {
- const auto& referenceClipPathOperation = downcast<ReferenceClipPathOperation>(*style().clipPath());
- auto* element = document().getElementById(referenceClipPathOperation.fragment());
+ case PathOperation::Reference: {
+ const auto& referencePathOperation = downcast<ReferencePathOperation>(*style().clipPath());
+ auto* element = document().getElementById(referencePathOperation.fragment());
if (!element || !element->renderer())
break;
if (!is<SVGClipPathElement>(*element))
@@ -1404,7 +1404,7 @@
return false;
break;
}
- case ClipPathOperation::Box:
+ case PathOperation::Box:
break;
}
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (284717 => 284718)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -695,7 +695,7 @@
if (renderer().hasMask())
return false;
- return (clipPath->type() != ClipPathOperation::Shape || clipPath->type() == ClipPathOperation::Shape) && GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape);
+ return (clipPath->type() != PathOperation::Shape || clipPath->type() == PathOperation::Shape) && GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape);
}
void RenderLayer::dirtyNormalFlowList()
@@ -3128,8 +3128,8 @@
const RenderStyle& style = renderer().style();
float deviceScaleFactor = renderer().document().deviceScaleFactor();
- if (is<ShapeClipPathOperation>(*style.clipPath())) {
- auto& clipPath = downcast<ShapeClipPathOperation>(*style.clipPath());
+ if (is<ShapePathOperation>(*style.clipPath())) {
+ auto& clipPath = downcast<ShapePathOperation>(*style.clipPath());
LayoutRect referenceBox;
if (is<RenderBox>(renderer())) {
@@ -3144,8 +3144,8 @@
return { clipPath.pathForReferenceRect(snappedReferenceBox), clipPath.windRule() };
}
- if (is<BoxClipPathOperation>(*style.clipPath()) && is<RenderBox>(renderer())) {
- auto& clipPath = downcast<BoxClipPathOperation>(*style.clipPath());
+ if (is<BoxPathOperation>(*style.clipPath()) && is<RenderBox>(renderer())) {
+ auto& clipPath = downcast<BoxPathOperation>(*style.clipPath());
auto shapeRect = computeRoundedRectForBoxShape(clipPath.referenceBox(), downcast<RenderBox>(renderer())).pixelSnappedRoundedRectForPainting(deviceScaleFactor);
shapeRect.move(offsetFromRoot);
@@ -3170,7 +3170,7 @@
auto& style = renderer().style();
LayoutSize paintingOffsetFromRoot = LayoutSize(snapSizeToDevicePixel(offsetFromRoot + paintingInfo.subpixelOffset, LayoutPoint(), renderer().document().deviceScaleFactor()));
ASSERT(style.clipPath());
- if (is<ShapeClipPathOperation>(*style.clipPath()) || (is<BoxClipPathOperation>(*style.clipPath()) && is<RenderBox>(renderer()))) {
+ if (is<ShapePathOperation>(*style.clipPath()) || (is<BoxPathOperation>(*style.clipPath()) && is<RenderBox>(renderer()))) {
// clippedContentBounds is used as the reference box for inlines, which is also poorly specified: https://github.com/w3c/csswg-drafts/issues/6383.
auto [path, windRule] = computeClipPath(paintingOffsetFromRoot, clippedContentBounds);
stateSaver.save();
@@ -3177,8 +3177,8 @@
context.clipPath(path, windRule);
}
- if (is<ReferenceClipPathOperation>(style.clipPath())) {
- auto& referenceClipPathOperation = downcast<ReferenceClipPathOperation>(*style.clipPath());
+ if (is<ReferencePathOperation>(style.clipPath())) {
+ auto& referenceClipPathOperation = downcast<ReferencePathOperation>(*style.clipPath());
if (auto* clipperRenderer = renderer().ensureReferencedSVGResources().referencedClipperRenderer(renderer().document(), referenceClipPathOperation)) {
// Use the border box as the reference box, even though this is not clearly specified: https://github.com/w3c/csswg-drafts/issues/5786.
// clippedContentBounds is used as the reference box for inlines, which is also poorly specified: https://github.com/w3c/csswg-drafts/issues/6383.
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (284717 => 284718)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -1615,7 +1615,7 @@
if (!m_maskLayer->drawsContent()) {
if (renderer().hasClipPath()) {
- ASSERT(renderer().style().clipPath()->type() != ClipPathOperation::Reference);
+ ASSERT(renderer().style().clipPath()->type() != PathOperation::Reference);
// FIXME: Use correct reference box for inlines: https://bugs.webkit.org/show_bug.cgi?id=129047, https://github.com/w3c/csswg-drafts/issues/6383
LayoutRect boundingBox = m_owningLayer.boundingBox(&m_owningLayer);
@@ -2256,7 +2256,7 @@
if (hasClipPath) {
// If we have a mask, we need to paint the combined clip-path and mask into the mask layer.
- if (hasMask || renderer().style().clipPath()->type() == ClipPathOperation::Reference || !GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape))
+ if (hasMask || renderer().style().clipPath()->type() == PathOperation::Reference || !GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape))
maskPhases.add(GraphicsLayerPaintingPhase::ClipPath);
}
Modified: trunk/Source/WebCore/rendering/style/BasicShapes.cpp (284717 => 284718)
--- trunk/Source/WebCore/rendering/style/BasicShapes.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -494,4 +494,3 @@
}
} // namespace WebCore
-
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (284717 => 284718)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2021-10-22 22:17:02 UTC (rev 284718)
@@ -1468,9 +1468,9 @@
void setShapeImageThreshold(float);
static float initialShapeImageThreshold() { return 0; }
- void setClipPath(RefPtr<ClipPathOperation>&&);
- ClipPathOperation* clipPath() const { return m_rareNonInheritedData->clipPath.get(); }
- static ClipPathOperation* initialClipPath() { return nullptr; }
+ void setClipPath(RefPtr<PathOperation>&&);
+ PathOperation* clipPath() const { return m_rareNonInheritedData->clipPath.get(); }
+ static PathOperation* initialClipPath() { return nullptr; }
bool hasContent() const { return contentData(); }
const ContentData* contentData() const { return m_rareNonInheritedData->content.get(); }
@@ -2354,7 +2354,7 @@
SET_VAR(m_rareNonInheritedData, shapeImageThreshold, clampedShapeImageThreshold);
}
-inline void RenderStyle::setClipPath(RefPtr<ClipPathOperation>&& operation)
+inline void RenderStyle::setClipPath(RefPtr<PathOperation>&& operation)
{
if (m_rareNonInheritedData->clipPath != operation)
m_rareNonInheritedData.access().clipPath = WTFMove(operation);
Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (284717 => 284718)
--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2021-10-22 22:17:02 UTC (rev 284718)
@@ -25,7 +25,6 @@
#pragma once
#include "CSSPropertyNames.h"
-#include "ClipPathOperation.h"
#include "CounterDirectives.h"
#include "FillLayer.h"
#include "GapLength.h"
@@ -32,6 +31,7 @@
#include "LengthPoint.h"
#include "LineClampValue.h"
#include "NinePieceImage.h"
+#include "PathOperation.h"
#include "RotateTransformOperation.h"
#include "ScaleTransformOperation.h"
#include "ShapeValue.h"
@@ -164,7 +164,7 @@
int order;
- RefPtr<ClipPathOperation> clipPath;
+ RefPtr<PathOperation> clipPath;
Color textDecorationColor;
Color visitedLinkTextDecorationColor;
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (284717 => 284718)
--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -386,16 +386,16 @@
inline bool isPointInCSSClippingArea(const RenderElement& renderer, const FloatPoint& point)
{
- ClipPathOperation* clipPathOperation = renderer.style().clipPath();
- if (is<ShapeClipPathOperation>(clipPathOperation)) {
- auto& clipPath = downcast<ShapeClipPathOperation>(*clipPathOperation);
+ PathOperation* clipPathOperation = renderer.style().clipPath();
+ if (is<ShapePathOperation>(clipPathOperation)) {
+ auto& clipPath = downcast<ShapePathOperation>(*clipPathOperation);
FloatRect referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox());
if (!referenceBox.contains(point))
return false;
return clipPath.pathForReferenceRect(referenceBox).contains(point, clipPath.windRule());
}
- if (is<BoxClipPathOperation>(clipPathOperation)) {
- auto& clipPath = downcast<BoxClipPathOperation>(*clipPathOperation);
+ if (is<BoxPathOperation>(clipPathOperation)) {
+ auto& clipPath = downcast<BoxPathOperation>(*clipPathOperation);
FloatRect referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox());
if (!referenceBox.contains(point))
return false;
@@ -407,9 +407,9 @@
void SVGRenderSupport::clipContextToCSSClippingArea(GraphicsContext& context, const RenderElement& renderer)
{
- ClipPathOperation* clipPathOperation = renderer.style().clipPath();
- if (is<ShapeClipPathOperation>(clipPathOperation)) {
- auto& clipPath = downcast<ShapeClipPathOperation>(*clipPathOperation);
+ PathOperation* clipPathOperation = renderer.style().clipPath();
+ if (is<ShapePathOperation>(clipPathOperation)) {
+ auto& clipPath = downcast<ShapePathOperation>(*clipPathOperation);
auto localToParentTransform = renderer.localToParentTransform();
auto referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox());
@@ -420,8 +420,8 @@
context.clipPath(path, clipPath.windRule());
}
- if (is<BoxClipPathOperation>(clipPathOperation)) {
- auto& clipPath = downcast<BoxClipPathOperation>(*clipPathOperation);
+ if (is<BoxPathOperation>(clipPathOperation)) {
+ auto& clipPath = downcast<BoxPathOperation>(*clipPathOperation);
FloatRect referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox());
context.clipPath(clipPath.pathForReferenceRect(FloatRoundedRect {referenceBox}));
}
@@ -432,8 +432,8 @@
if (SVGHitTestCycleDetectionScope::isVisiting(renderer))
return false;
- ClipPathOperation* clipPathOperation = renderer.style().clipPath();
- if (is<ShapeClipPathOperation>(clipPathOperation) || is<BoxClipPathOperation>(clipPathOperation))
+ PathOperation* clipPathOperation = renderer.style().clipPath();
+ if (is<ShapePathOperation>(clipPathOperation) || is<BoxPathOperation>(clipPathOperation))
return isPointInCSSClippingArea(renderer, point);
// We just take clippers into account to determine if a point is on the node. The Specification may
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (284717 => 284718)
--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -572,8 +572,8 @@
ts << " " << masker->resourceBoundingBox(renderer) << "\n";
}
}
- if (style.clipPath() && is<ReferenceClipPathOperation>(style.clipPath())) {
- auto resourceClipPath = downcast<ReferenceClipPathOperation>(style.clipPath());
+ if (style.clipPath() && is<ReferencePathOperation>(style.clipPath())) {
+ auto resourceClipPath = downcast<ReferencePathOperation>(style.clipPath());
AtomString id = resourceClipPath->fragment();
if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(renderer.document(), id)) {
ts << indent << " ";
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (284717 => 284718)
--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -127,8 +127,8 @@
}
}
- ClipPathOperation* clipPathOperation = style.clipPath();
- bool hasCSSClipping = is<ShapeClipPathOperation>(clipPathOperation) || is<BoxClipPathOperation>(clipPathOperation);
+ PathOperation* clipPathOperation = style.clipPath();
+ bool hasCSSClipping = is<ShapePathOperation>(clipPathOperation) || is<BoxPathOperation>(clipPathOperation);
if (hasCSSClipping)
SVGRenderSupport::clipContextToCSSClippingArea(m_paintInfo->context(), renderer);
Modified: trunk/Source/WebCore/rendering/svg/SVGResources.cpp (284717 => 284718)
--- trunk/Source/WebCore/rendering/svg/SVGResources.cpp 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/rendering/svg/SVGResources.cpp 2021-10-22 22:17:02 UTC (rev 284718)
@@ -20,8 +20,8 @@
#include "config.h"
#include "SVGResources.h"
-#include "ClipPathOperation.h"
#include "FilterOperation.h"
+#include "PathOperation.h"
#include "RenderSVGResourceClipper.h"
#include "RenderSVGResourceFilter.h"
#include "RenderSVGResourceMarker.h"
@@ -219,10 +219,10 @@
bool foundResources = false;
if (clipperFilterMaskerTags().contains(tagName)) {
- if (is<ReferenceClipPathOperation>(style.clipPath())) {
+ if (is<ReferencePathOperation>(style.clipPath())) {
// FIXME: -webkit-clip-path should support external resources
// https://bugs.webkit.org/show_bug.cgi?id=127032
- auto& clipPath = downcast<ReferenceClipPathOperation>(*style.clipPath());
+ auto& clipPath = downcast<ReferencePathOperation>(*style.clipPath());
AtomString id(clipPath.fragment());
if (setClipper(getRenderSVGResourceById<RenderSVGResourceClipper>(document, id)))
foundResources = true;
Modified: trunk/Source/WebCore/style/StyleBuilderConverter.h (284717 => 284718)
--- trunk/Source/WebCore/style/StyleBuilderConverter.h 2021-10-22 22:05:35 UTC (rev 284717)
+++ trunk/Source/WebCore/style/StyleBuilderConverter.h 2021-10-22 22:17:02 UTC (rev 284718)
@@ -98,7 +98,7 @@
static String convertStringOrNone(BuilderState&, const CSSValue&);
static OptionSet<TextEmphasisPosition> convertTextEmphasisPosition(BuilderState&, const CSSValue&);
static TextAlignMode convertTextAlign(BuilderState&, const CSSValue&);
- static RefPtr<ClipPathOperation> convertClipPath(BuilderState&, const CSSValue&);
+ static RefPtr<PathOperation> convertClipPath(BuilderState&, const CSSValue&);
static Resize convertResize(BuilderState&, const CSSValue&);
static int convertMarqueeRepetition(BuilderState&, const CSSValue&);
static int convertMarqueeSpeed(BuilderState&, const CSSValue&);
@@ -619,7 +619,7 @@
return parentStyle.textAlign();
}
-inline RefPtr<ClipPathOperation> BuilderConverter::convertClipPath(BuilderState& builderState, const CSSValue& value)
+inline RefPtr<PathOperation> BuilderConverter::convertClipPath(BuilderState& builderState, const CSSValue& value)
{
if (is<CSSPrimitiveValue>(value)) {
auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
@@ -627,7 +627,7 @@
String cssURLValue = primitiveValue.stringValue();
String fragment = SVGURIReference::fragmentIdentifierFromIRIString(cssURLValue, builderState.document());
// FIXME: It doesn't work with external SVG references (see https://bugs.webkit.org/show_bug.cgi?id=126133)
- return ReferenceClipPathOperation::create(cssURLValue, fragment);
+ return ReferencePathOperation::create(cssURLValue, fragment);
}
ASSERT(primitiveValue.valueID() == CSSValueNone);
return nullptr;
@@ -634,13 +634,13 @@
}
CSSBoxType referenceBox = CSSBoxType::BoxMissing;
- RefPtr<ClipPathOperation> operation;
+ RefPtr<PathOperation> operation;
for (auto& currentValue : downcast<CSSValueList>(value)) {
auto& primitiveValue = downcast<CSSPrimitiveValue>(currentValue.get());
if (primitiveValue.isShape()) {
ASSERT(!operation);
- operation = ShapeClipPathOperation::create(
+ operation = ShapePathOperation::create(
basicShapeForValue(builderState.cssToLengthConversionData(),
*primitiveValue.shapeValue(),
builderState.style().effectiveZoom()));
@@ -657,10 +657,10 @@
}
}
if (operation)
- downcast<ShapeClipPathOperation>(*operation).setReferenceBox(referenceBox);
+ downcast<ShapePathOperation>(*operation).setReferenceBox(referenceBox);
else {
ASSERT(referenceBox != CSSBoxType::BoxMissing);
- operation = BoxClipPathOperation::create(referenceBox);
+ operation = BoxPathOperation::create(referenceBox);
}
return operation;