⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284718 in webkit


Ignore:
Timestamp:
Oct 22, 2021, 3:17:02 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Rename ClipPathOperation to PathOperation
https://bugs.webkit.org/show_bug.cgi?id=232167

Patch by Kiet Ho <Kiet Ho> on 2021-10-22
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):

Location:
trunk/Source/WebCore
Files:
19 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r284713 r284718  
     12021-10-22  Kiet Ho  <tho22@apple.com>
     2
     3        Rename ClipPathOperation to PathOperation
     4        https://bugs.webkit.org/show_bug.cgi?id=232167
     5
     6        Reviewed by Simon Fraser.
     7
     8        No functional changes, no tests required.
     9
     10        * Headers.cmake:
     11        * WebCore.xcodeproj/project.pbxproj:
     12        * animation/CSSPropertyAnimation.cpp:
     13        (WebCore::blendFunc):
     14        * css/CSSBasicShapes.cpp:
     15        * css/CSSComputedStyleDeclaration.cpp:
     16        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     17        * rendering/PathOperation.h: Renamed from Source/WebCore/rendering/ClipPathOperation.h.
     18        (WebCore::PathOperation::operator!= const):
     19        (WebCore::PathOperation::isSameType const):
     20        (WebCore::PathOperation::PathOperation):
     21        * rendering/ReferencedSVGResources.cpp:
     22        (WebCore::ReferencedSVGResources::referencedSVGResourceIDs):
     23        (WebCore::ReferencedSVGResources::referencedClipperRenderer):
     24        * rendering/ReferencedSVGResources.h:
     25        * rendering/RenderBox.cpp:
     26        (WebCore::RenderBox::hitTestClipPath const):
     27        * rendering/RenderLayer.cpp:
     28        (WebCore::RenderLayer::willCompositeClipPath const):
     29        (WebCore::RenderLayer::computeClipPath const):
     30        (WebCore::RenderLayer::setupClipPath):
     31        * rendering/RenderLayerBacking.cpp:
     32        (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
     33        (WebCore::RenderLayerBacking::updateMaskingLayer):
     34        * rendering/style/BasicShapes.cpp:
     35        * rendering/style/RenderStyle.h:
     36        (WebCore::RenderStyle::clipPath const):
     37        (WebCore::RenderStyle::initialClipPath):
     38        (WebCore::RenderStyle::setClipPath):
     39        * rendering/style/StyleRareNonInheritedData.h:
     40        * rendering/svg/SVGRenderSupport.cpp:
     41        (WebCore::isPointInCSSClippingArea):
     42        (WebCore::SVGRenderSupport::clipContextToCSSClippingArea):
     43        (WebCore::SVGRenderSupport::pointInClippingArea):
     44        * rendering/svg/SVGRenderTreeAsText.cpp:
     45        (WebCore::writeResources):
     46        * rendering/svg/SVGRenderingContext.cpp:
     47        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
     48        * rendering/svg/SVGResources.cpp:
     49        (WebCore::SVGResources::buildCachedResources):
     50        * style/StyleBuilderConverter.h:
     51        (WebCore::Style::BuilderConverter::convertClipPath):
     52
    1532021-10-22  Ian Anderson  <iana@apple.com>
    254
  • trunk/Source/WebCore/Headers.cmake

    r284528 r284718  
    15911591
    15921592    rendering/BreakLines.h
    1593     rendering/ClipPathOperation.h
    15941593    rendering/ClipRect.h
    15951594    rendering/EventRegion.h
     
    16151614    rendering/PaintInfo.h
    16161615    rendering/PaintPhase.h
     1616    rendering/PathOperation.h
    16171617    rendering/RenderAttachment.h
    16181618    rendering/RenderBlock.h
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r284630 r284718  
    55255525                FB3056C2169E5DAC0096A232 /* CSSGroupingRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */; settings = {ATTRIBUTES = (Private, ); }; };
    55265526                FB484F4D171F821E00040755 /* TransformFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = FB484F4B171F821E00040755 /* TransformFunctions.h */; };
    5527                 FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = FB92DF4915FED08700994433 /* ClipPathOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
     5527                FB92DF4B15FED08700994433 /* PathOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = FB92DF4915FED08700994433 /* PathOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    55285528                FBB0C5B817BBD629003D3677 /* CSSFilterImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = FB965B8117BBB5F900E835B9 /* CSSFilterImageValue.h */; settings = {ATTRIBUTES = (); }; };
    55295529                FBD6AF8815EF25C9008B7110 /* CSSBasicShapes.h in Headers */ = {isa = PBXBuildFile; fileRef = FBD6AF8715EF21D4008B7110 /* CSSBasicShapes.h */; };
     
    1711117111                FB484F4A171F821E00040755 /* TransformFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformFunctions.cpp; sourceTree = "<group>"; };
    1711217112                FB484F4B171F821E00040755 /* TransformFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformFunctions.h; sourceTree = "<group>"; };
    17113                 FB92DF4915FED08700994433 /* ClipPathOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipPathOperation.h; sourceTree = "<group>"; };
     17113                FB92DF4915FED08700994433 /* PathOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathOperation.h; sourceTree = "<group>"; };
    1711417114                FB965B8117BBB5F900E835B9 /* CSSFilterImageValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFilterImageValue.h; sourceTree = "<group>"; };
    1711517115                FB965B8217BBB62C00E835B9 /* CSSFilterImageValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFilterImageValue.cpp; sourceTree = "<group>"; };
     
    3019730197                                E4F0BE3025710A76009E7431 /* CaretRectComputation.cpp */,
    3019830198                                E4F0BE2E25710A75009E7431 /* CaretRectComputation.h */,
    30199                                 FB92DF4915FED08700994433 /* ClipPathOperation.h */,
    3020030199                                5803715F1A66F00A00BAF519 /* ClipRect.cpp */,
    3020130200                                580371601A66F00A00BAF519 /* ClipRect.h */,
     
    3027530274                                0885067D11DA045B00182B98 /* PaintInfo.h */,
    3027630275                                0885067E11DA045B00182B98 /* PaintPhase.h */,
     30276                                FB92DF4915FED08700994433 /* PathOperation.h */,
    3027730277                                B2B1F7140D00CAA8004AEA64 /* PointerEventsHitRules.cpp */,
    3027830278                                B2B1F7150D00CAA8004AEA64 /* PointerEventsHitRules.h */,
     
    3207732077                                F4D07558234D822D00881E73 /* ClipboardItemDataSource.h in Headers */,
    3207832078                                F4D07559234D823300881E73 /* ClipboardItemPasteboardDataSource.h in Headers */,
    32079                                 FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */,
    3208032079                                580371621A66F00A00BAF519 /* ClipRect.h in Headers */,
    3208132080                                97AABD1314FA09D5007457AE /* CloseEvent.h in Headers */,
     
    3473234731                                B27535800B053814002CE64F /* Path.h in Headers */,
    3473334732                                7C193BC21F5E0EED0088F3E6 /* Path2D.h in Headers */,
     34733                                FB92DF4B15FED08700994433 /* PathOperation.h in Headers */,
    3473434734                                A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */,
    3473534735                                2D5002FC1B56D7990020AAF7 /* PathUtilities.h in Headers */,
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r284602 r284718  
    4242#include "CachedImage.h"
    4343#include "CalculationValue.h"
    44 #include "ClipPathOperation.h"
    4544#include "ColorBlending.h"
    4645#include "CompositeOperation.h"
     
    5655#include "Matrix3DTransformOperation.h"
    5756#include "MatrixTransformOperation.h"
     57#include "PathOperation.h"
    5858#include "RenderBox.h"
    5959#include "RenderStyle.h"
     
    272272}
    273273
    274 static inline RefPtr<ClipPathOperation> blendFunc(ClipPathOperation* from, ClipPathOperation* to, const CSSPropertyBlendingContext& context)
     274static inline RefPtr<PathOperation> blendFunc(PathOperation* from, PathOperation* to, const CSSPropertyBlendingContext& context)
    275275{
    276276    if (!from || !to)
     
    278278
    279279    // Other clip-path operations than BasicShapes can not be animated.
    280     if (from->type() != ClipPathOperation::Shape || to->type() != ClipPathOperation::Shape)
     280    if (from->type() != PathOperation::Shape || to->type() != PathOperation::Shape)
    281281        return to;
    282282
    283     const BasicShape& fromShape = downcast<ShapeClipPathOperation>(*from).basicShape();
    284     const BasicShape& toShape = downcast<ShapeClipPathOperation>(*to).basicShape();
     283    const BasicShape& fromShape = downcast<ShapePathOperation>(*from).basicShape();
     284    const BasicShape& toShape = downcast<ShapePathOperation>(*to).basicShape();
    285285
    286286    if (!fromShape.canBlend(toShape))
    287287        return to;
    288288
    289     return ShapeClipPathOperation::create(toShape.blend(fromShape, context));
     289    return ShapePathOperation::create(toShape.blend(fromShape, context));
    290290}
    291291
     
    10201020};
    10211021
    1022 class PropertyWrapperClipPath final : public RefCountedPropertyWrapper<ClipPathOperation> {
    1023     WTF_MAKE_FAST_ALLOCATED;
    1024 public:
    1025     PropertyWrapperClipPath(CSSPropertyID property, ClipPathOperation* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(RefPtr<ClipPathOperation>&&))
    1026         : RefCountedPropertyWrapper<ClipPathOperation>(property, getter, setter)
     1022class PropertyWrapperClipPath final : public RefCountedPropertyWrapper<PathOperation> {
     1023    WTF_MAKE_FAST_ALLOCATED;
     1024public:
     1025    PropertyWrapperClipPath(CSSPropertyID property, PathOperation* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(RefPtr<PathOperation>&&))
     1026        : RefCountedPropertyWrapper<PathOperation>(property, getter, setter)
    10271027    {
    10281028    }
  • trunk/Source/WebCore/css/CSSBasicShapes.cpp

    r277967 r284718  
    398398
    399399} // namespace WebCore
    400 
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r284642 r284718  
    37943794            if (!operation)
    37953795                return cssValuePool.createIdentifierValue(CSSValueNone);
    3796             if (is<ReferenceClipPathOperation>(*operation))
    3797                 return CSSPrimitiveValue::create(downcast<ReferenceClipPathOperation>(*operation).url(), CSSUnitType::CSS_URI);
     3796            if (is<ReferencePathOperation>(*operation))
     3797                return CSSPrimitiveValue::create(downcast<ReferencePathOperation>(*operation).url(), CSSUnitType::CSS_URI);
    37983798            auto list = CSSValueList::createSpaceSeparated();
    3799             if (is<ShapeClipPathOperation>(*operation)) {
    3800                 auto& shapeOperation = downcast<ShapeClipPathOperation>(*operation);
     3799            if (is<ShapePathOperation>(*operation)) {
     3800                auto& shapeOperation = downcast<ShapePathOperation>(*operation);
    38013801                list->append(valueForBasicShape(style, shapeOperation.basicShape()));
    38023802                if (shapeOperation.referenceBox() != CSSBoxType::BoxMissing)
    38033803                    list->append(cssValuePool.createValue(shapeOperation.referenceBox()));
    38043804            }
    3805             if (is<BoxClipPathOperation>(*operation))
    3806                 list->append(cssValuePool.createValue(downcast<BoxClipPathOperation>(*operation).referenceBox()));
     3805            if (is<BoxPathOperation>(*operation))
     3806                list->append(cssValuePool.createValue(downcast<BoxPathOperation>(*operation).referenceBox()));
    38073807            return list;
    38083808        }
  • trunk/Source/WebCore/rendering/PathOperation.h

    r284716 r284718  
    3939namespace WebCore {
    4040
    41 class ClipPathOperation : public RefCounted<ClipPathOperation> {
     41class PathOperation : public RefCounted<PathOperation> {
    4242public:
    4343    enum OperationType {
     
    4747    };
    4848
    49     virtual ~ClipPathOperation() = default;
     49    virtual ~PathOperation() = default;
    5050
    51     virtual bool operator==(const ClipPathOperation&) const = 0;
    52     bool operator!=(const ClipPathOperation& o) const { return !(*this == o); }
     51    virtual bool operator==(const PathOperation&) const = 0;
     52    bool operator!=(const PathOperation& o) const { return !(*this == o); }
    5353
    5454    OperationType type() const { return m_type; }
    55     bool isSameType(const ClipPathOperation& o) const { return o.type() == m_type; }
     55    bool isSameType(const PathOperation& o) const { return o.type() == m_type; }
    5656
    5757protected:
    58     explicit ClipPathOperation(OperationType type)
     58    explicit PathOperation(OperationType type)
    5959        : m_type(type)
    6060    {
     
    6464};
    6565
    66 class ReferenceClipPathOperation final : public ClipPathOperation {
     66class ReferencePathOperation final : public PathOperation {
    6767public:
    68     static Ref<ReferenceClipPathOperation> create(const String& url, const String& fragment)
     68    static Ref<ReferencePathOperation> create(const String& url, const String& fragment)
    6969    {
    70         return adoptRef(*new ReferenceClipPathOperation(url, fragment));
     70        return adoptRef(*new ReferencePathOperation(url, fragment));
    7171    }
    7272
     
    7575
    7676private:
    77     bool operator==(const ClipPathOperation& other) const override
     77    bool operator==(const PathOperation& other) const override
    7878    {
    7979        if (!isSameType(other))
    8080            return false;
    81         auto& referenceClip = downcast<ReferenceClipPathOperation>(other);
     81        auto& referenceClip = downcast<ReferencePathOperation>(other);
    8282        return m_url == referenceClip.m_url;
    8383    }
    8484
    85     ReferenceClipPathOperation(const String& url, const String& fragment)
    86         : ClipPathOperation(Reference)
     85    ReferencePathOperation(const String& url, const String& fragment)
     86        : PathOperation(Reference)
    8787        , m_url(url)
    8888        , m_fragment(fragment)
     
    9494};
    9595
    96 class ShapeClipPathOperation final : public ClipPathOperation {
     96class ShapePathOperation final : public PathOperation {
    9797public:
    98     static Ref<ShapeClipPathOperation> create(Ref<BasicShape>&& shape)
     98    static Ref<ShapePathOperation> create(Ref<BasicShape>&& shape)
    9999    {
    100         return adoptRef(*new ShapeClipPathOperation(WTFMove(shape)));
     100        return adoptRef(*new ShapePathOperation(WTFMove(shape)));
    101101    }
    102102
    103103    const BasicShape& basicShape() const { return m_shape; }
    104104    WindRule windRule() const { return m_shape.get().windRule(); }
    105     const Path& pathForReferenceRect(const FloatRect& boundingRect) { return m_shape.get().path(boundingRect); }
     105    const Path& pathForReferenceRect(const FloatRect& boundingRect) const { return m_shape.get().path(boundingRect); }
    106106
    107107    void setReferenceBox(CSSBoxType referenceBox) { m_referenceBox = referenceBox; }
     
    109109
    110110private:
    111     bool operator==(const ClipPathOperation& other) const override
     111    bool operator==(const PathOperation& other) const override
    112112    {
    113113        if (!isSameType(other))
    114114            return false;
    115         auto& shapeClip = downcast<ShapeClipPathOperation>(other);
     115        auto& shapeClip = downcast<ShapePathOperation>(other);
    116116        return m_referenceBox == shapeClip.referenceBox()
    117117            && (m_shape.ptr() == shapeClip.m_shape.ptr() || m_shape.get() == shapeClip.m_shape.get());
    118118    }
    119119
    120     explicit ShapeClipPathOperation(Ref<BasicShape>&& shape)
    121         : ClipPathOperation(Shape)
     120    explicit ShapePathOperation(Ref<BasicShape>&& shape)
     121        : PathOperation(Shape)
    122122        , m_shape(WTFMove(shape))
    123123        , m_referenceBox(CSSBoxType::BoxMissing)
     
    129129};
    130130
    131 class BoxClipPathOperation final : public ClipPathOperation {
     131class BoxPathOperation final : public PathOperation {
    132132public:
    133     static Ref<BoxClipPathOperation> create(CSSBoxType referenceBox)
     133    static Ref<BoxPathOperation> create(CSSBoxType referenceBox)
    134134    {
    135         return adoptRef(*new BoxClipPathOperation(referenceBox));
     135        return adoptRef(*new BoxPathOperation(referenceBox));
    136136    }
    137137
     
    145145
    146146private:
    147     bool operator==(const ClipPathOperation& other) const override
     147    bool operator==(const PathOperation& other) const override
    148148    {
    149149        if (!isSameType(other))
    150150            return false;
    151         auto& boxClip = downcast<BoxClipPathOperation>(other);
     151        auto& boxClip = downcast<BoxPathOperation>(other);
    152152        return m_referenceBox == boxClip.m_referenceBox;
    153153    }
    154154
    155     explicit BoxClipPathOperation(CSSBoxType referenceBox)
    156         : ClipPathOperation(Box)
     155    explicit BoxPathOperation(CSSBoxType referenceBox)
     156        : PathOperation(Box)
    157157        , m_referenceBox(referenceBox)
    158158    {
     
    166166#define SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ToValueTypeName, predicate) \
    167167SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
    168     static bool isType(const WebCore::ClipPathOperation& operation) { return operation.type() == WebCore::predicate; } \
     168    static bool isType(const WebCore::PathOperation& operation) { return operation.type() == WebCore::predicate; } \
    169169SPECIALIZE_TYPE_TRAITS_END()
    170170
    171 SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ReferenceClipPathOperation, ClipPathOperation::Reference)
    172 SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ShapeClipPathOperation, ClipPathOperation::Shape)
    173 SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(BoxClipPathOperation, ClipPathOperation::Box)
     171SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ReferencePathOperation, PathOperation::Reference)
     172SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ShapePathOperation, PathOperation::Shape)
     173SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(BoxPathOperation, PathOperation::Box)
  • trunk/Source/WebCore/rendering/ReferencedSVGResources.cpp

    r283851 r284718  
    2727#include "ReferencedSVGResources.h"
    2828
    29 #include "ClipPathOperation.h"
    3029#include "FilterOperations.h"
     30#include "PathOperation.h"
    3131#include "RenderSVGResourceClipper.h"
    3232#include "RenderSVGResourceFilter.h"
     
    9999{
    100100    Vector<std::pair<AtomString, QualifiedName>> referencedResources;
    101     if (is<ReferenceClipPathOperation>(style.clipPath())) {
    102         auto& clipPath = downcast<ReferenceClipPathOperation>(*style.clipPath());
     101    if (is<ReferencePathOperation>(style.clipPath())) {
     102        auto& clipPath = downcast<ReferencePathOperation>(*style.clipPath());
    103103        if (!clipPath.fragment().isEmpty())
    104104            referencedResources.append({ clipPath.fragment(), SVGNames::clipPathTag });
     
    158158}
    159159
    160 RenderSVGResourceClipper* ReferencedSVGResources::referencedClipperRenderer(Document& document, const ReferenceClipPathOperation& clipPath)
     160RenderSVGResourceClipper* ReferencedSVGResources::referencedClipperRenderer(Document& document, const ReferencePathOperation& clipPath)
    161161{
    162162    if (clipPath.fragment().isEmpty())
  • trunk/Source/WebCore/rendering/ReferencedSVGResources.h

    r282080 r284718  
    3636class CSSSVGResourceElementClient;
    3737class Document;
    38 class ReferenceClipPathOperation;
     38class ReferencePathOperation;
    3939class ReferenceFilterOperation;
    4040class RenderElement;
     
    5656
    5757    // Clipping needs a renderer, filters use an element.
    58     RenderSVGResourceClipper* referencedClipperRenderer(Document&, const ReferenceClipPathOperation&);
     58    RenderSVGResourceClipper* referencedClipperRenderer(Document&, const ReferencePathOperation&);
    5959    SVGFilterElement* referencedFilterElement(Document&, const ReferenceFilterOperation&);
    6060
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r284548 r284718  
    2727
    2828#include "CSSFontSelector.h"
    29 #include "ClipPathOperation.h"
    3029#include "ControlStates.h"
    3130#include "Document.h"
     
    5554#include "Page.h"
    5655#include "PaintInfo.h"
     56#include "PathOperation.h"
    5757#include "RenderBoxFragmentInfo.h"
    5858#include "RenderChildIterator.h"
     
    13861386    auto hitTestLocationInLocalCoordinates = hitTestLocation.point() - offsetFromHitTestRoot;
    13871387    switch (style().clipPath()->type()) {
    1388     case ClipPathOperation::Shape: {
    1389         auto& clipPath = downcast<ShapeClipPathOperation>(*style().clipPath());
     1388    case PathOperation::Shape: {
     1389        auto& clipPath = downcast<ShapePathOperation>(*style().clipPath());
    13901390        auto referenceBoxRect = referenceBox(clipPath.referenceBox());
    13911391        if (!clipPath.pathForReferenceRect(referenceBoxRect).contains(hitTestLocationInLocalCoordinates, clipPath.windRule()))
     
    13931393        break;
    13941394    }
    1395     case ClipPathOperation::Reference: {
    1396         const auto& referenceClipPathOperation = downcast<ReferenceClipPathOperation>(*style().clipPath());
    1397         auto* element = document().getElementById(referenceClipPathOperation.fragment());
     1395    case PathOperation::Reference: {
     1396        const auto& referencePathOperation = downcast<ReferencePathOperation>(*style().clipPath());
     1397        auto* element = document().getElementById(referencePathOperation.fragment());
    13981398        if (!element || !element->renderer())
    13991399            break;
     
    14051405        break;
    14061406    }
    1407     case ClipPathOperation::Box:
     1407    case PathOperation::Box:
    14081408        break;
    14091409    }
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r284684 r284718  
    696696        return false;
    697697
    698     return (clipPath->type() != ClipPathOperation::Shape || clipPath->type() == ClipPathOperation::Shape) && GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape);
     698    return (clipPath->type() != PathOperation::Shape || clipPath->type() == PathOperation::Shape) && GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape);
    699699}
    700700
     
    31293129    float deviceScaleFactor = renderer().document().deviceScaleFactor();
    31303130
    3131     if (is<ShapeClipPathOperation>(*style.clipPath())) {
    3132         auto& clipPath = downcast<ShapeClipPathOperation>(*style.clipPath());
     3131    if (is<ShapePathOperation>(*style.clipPath())) {
     3132        auto& clipPath = downcast<ShapePathOperation>(*style.clipPath());
    31333133
    31343134        LayoutRect referenceBox;
     
    31453145    }
    31463146
    3147     if (is<BoxClipPathOperation>(*style.clipPath()) && is<RenderBox>(renderer())) {
    3148         auto& clipPath = downcast<BoxClipPathOperation>(*style.clipPath());
     3147    if (is<BoxPathOperation>(*style.clipPath()) && is<RenderBox>(renderer())) {
     3148        auto& clipPath = downcast<BoxPathOperation>(*style.clipPath());
    31493149
    31503150        auto shapeRect = computeRoundedRectForBoxShape(clipPath.referenceBox(), downcast<RenderBox>(renderer())).pixelSnappedRoundedRectForPainting(deviceScaleFactor);
     
    31713171    LayoutSize paintingOffsetFromRoot = LayoutSize(snapSizeToDevicePixel(offsetFromRoot + paintingInfo.subpixelOffset, LayoutPoint(), renderer().document().deviceScaleFactor()));
    31723172    ASSERT(style.clipPath());
    3173     if (is<ShapeClipPathOperation>(*style.clipPath()) || (is<BoxClipPathOperation>(*style.clipPath()) && is<RenderBox>(renderer()))) {
     3173    if (is<ShapePathOperation>(*style.clipPath()) || (is<BoxPathOperation>(*style.clipPath()) && is<RenderBox>(renderer()))) {
    31743174        // clippedContentBounds is used as the reference box for inlines, which is also poorly specified: https://github.com/w3c/csswg-drafts/issues/6383.
    31753175        auto [path, windRule] = computeClipPath(paintingOffsetFromRoot, clippedContentBounds);
     
    31783178    }
    31793179
    3180     if (is<ReferenceClipPathOperation>(style.clipPath())) {
    3181         auto& referenceClipPathOperation = downcast<ReferenceClipPathOperation>(*style.clipPath());
     3180    if (is<ReferencePathOperation>(style.clipPath())) {
     3181        auto& referenceClipPathOperation = downcast<ReferencePathOperation>(*style.clipPath());
    31823182        if (auto* clipperRenderer = renderer().ensureReferencedSVGResources().referencedClipperRenderer(renderer().document(), referenceClipPathOperation)) {
    31833183            // Use the border box as the reference box, even though this is not clearly specified: https://github.com/w3c/csswg-drafts/issues/5786.
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r284490 r284718  
    16161616    if (!m_maskLayer->drawsContent()) {
    16171617        if (renderer().hasClipPath()) {
    1618             ASSERT(renderer().style().clipPath()->type() != ClipPathOperation::Reference);
     1618            ASSERT(renderer().style().clipPath()->type() != PathOperation::Reference);
    16191619
    16201620            // FIXME: Use correct reference box for inlines: https://bugs.webkit.org/show_bug.cgi?id=129047, https://github.com/w3c/csswg-drafts/issues/6383
     
    22572257        if (hasClipPath) {
    22582258            // If we have a mask, we need to paint the combined clip-path and mask into the mask layer.
    2259             if (hasMask || renderer().style().clipPath()->type() == ClipPathOperation::Reference || !GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape))
     2259            if (hasMask || renderer().style().clipPath()->type() == PathOperation::Reference || !GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape))
    22602260                maskPhases.add(GraphicsLayerPaintingPhase::ClipPath);
    22612261        }
  • trunk/Source/WebCore/rendering/style/BasicShapes.cpp

    r276141 r284718  
    495495
    496496} // namespace WebCore
    497 
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r284642 r284718  
    14691469    static float initialShapeImageThreshold() { return 0; }
    14701470
    1471     void setClipPath(RefPtr<ClipPathOperation>&&);
    1472     ClipPathOperation* clipPath() const { return m_rareNonInheritedData->clipPath.get(); }
    1473     static ClipPathOperation* initialClipPath() { return nullptr; }
     1471    void setClipPath(RefPtr<PathOperation>&&);
     1472    PathOperation* clipPath() const { return m_rareNonInheritedData->clipPath.get(); }
     1473    static PathOperation* initialClipPath() { return nullptr; }
    14741474
    14751475    bool hasContent() const { return contentData(); }
     
    23552355}
    23562356
    2357 inline void RenderStyle::setClipPath(RefPtr<ClipPathOperation>&& operation)
     2357inline void RenderStyle::setClipPath(RefPtr<PathOperation>&& operation)
    23582358{
    23592359    if (m_rareNonInheritedData->clipPath != operation)
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r284361 r284718  
    2626
    2727#include "CSSPropertyNames.h"
    28 #include "ClipPathOperation.h"
    2928#include "CounterDirectives.h"
    3029#include "FillLayer.h"
     
    3332#include "LineClampValue.h"
    3433#include "NinePieceImage.h"
     34#include "PathOperation.h"
    3535#include "RotateTransformOperation.h"
    3636#include "ScaleTransformOperation.h"
     
    165165    int order;
    166166
    167     RefPtr<ClipPathOperation> clipPath;
     167    RefPtr<PathOperation> clipPath;
    168168
    169169    Color textDecorationColor;
  • trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp

    r284093 r284718  
    387387inline bool isPointInCSSClippingArea(const RenderElement& renderer, const FloatPoint& point)
    388388{
    389     ClipPathOperation* clipPathOperation = renderer.style().clipPath();
    390     if (is<ShapeClipPathOperation>(clipPathOperation)) {
    391         auto& clipPath = downcast<ShapeClipPathOperation>(*clipPathOperation);
     389    PathOperation* clipPathOperation = renderer.style().clipPath();
     390    if (is<ShapePathOperation>(clipPathOperation)) {
     391        auto& clipPath = downcast<ShapePathOperation>(*clipPathOperation);
    392392        FloatRect referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox());
    393393        if (!referenceBox.contains(point))
     
    395395        return clipPath.pathForReferenceRect(referenceBox).contains(point, clipPath.windRule());
    396396    }
    397     if (is<BoxClipPathOperation>(clipPathOperation)) {
    398         auto& clipPath = downcast<BoxClipPathOperation>(*clipPathOperation);
     397    if (is<BoxPathOperation>(clipPathOperation)) {
     398        auto& clipPath = downcast<BoxPathOperation>(*clipPathOperation);
    399399        FloatRect referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox());
    400400        if (!referenceBox.contains(point))
     
    408408void SVGRenderSupport::clipContextToCSSClippingArea(GraphicsContext& context, const RenderElement& renderer)
    409409{
    410     ClipPathOperation* clipPathOperation = renderer.style().clipPath();
    411     if (is<ShapeClipPathOperation>(clipPathOperation)) {
    412         auto& clipPath = downcast<ShapeClipPathOperation>(*clipPathOperation);
     410    PathOperation* clipPathOperation = renderer.style().clipPath();
     411    if (is<ShapePathOperation>(clipPathOperation)) {
     412        auto& clipPath = downcast<ShapePathOperation>(*clipPathOperation);
    413413        auto localToParentTransform = renderer.localToParentTransform();
    414414
     
    421421        context.clipPath(path, clipPath.windRule());
    422422    }
    423     if (is<BoxClipPathOperation>(clipPathOperation)) {
    424         auto& clipPath = downcast<BoxClipPathOperation>(*clipPathOperation);
     423    if (is<BoxPathOperation>(clipPathOperation)) {
     424        auto& clipPath = downcast<BoxPathOperation>(*clipPathOperation);
    425425        FloatRect referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox());
    426426        context.clipPath(clipPath.pathForReferenceRect(FloatRoundedRect {referenceBox}));
     
    433433        return false;
    434434
    435     ClipPathOperation* clipPathOperation = renderer.style().clipPath();
    436     if (is<ShapeClipPathOperation>(clipPathOperation) || is<BoxClipPathOperation>(clipPathOperation))
     435    PathOperation* clipPathOperation = renderer.style().clipPath();
     436    if (is<ShapePathOperation>(clipPathOperation) || is<BoxPathOperation>(clipPathOperation))
    437437        return isPointInCSSClippingArea(renderer, point);
    438438
  • trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp

    r283851 r284718  
    573573        }
    574574    }
    575     if (style.clipPath() && is<ReferenceClipPathOperation>(style.clipPath())) {
    576         auto resourceClipPath = downcast<ReferenceClipPathOperation>(style.clipPath());
     575    if (style.clipPath() && is<ReferencePathOperation>(style.clipPath())) {
     576        auto resourceClipPath = downcast<ReferencePathOperation>(style.clipPath());
    577577        AtomString id = resourceClipPath->fragment();
    578578        if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(renderer.document(), id)) {
  • trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp

    r284078 r284718  
    128128    }
    129129
    130     ClipPathOperation* clipPathOperation = style.clipPath();
    131     bool hasCSSClipping = is<ShapeClipPathOperation>(clipPathOperation) || is<BoxClipPathOperation>(clipPathOperation);
     130    PathOperation* clipPathOperation = style.clipPath();
     131    bool hasCSSClipping = is<ShapePathOperation>(clipPathOperation) || is<BoxPathOperation>(clipPathOperation);
    132132    if (hasCSSClipping)
    133133        SVGRenderSupport::clipContextToCSSClippingArea(m_paintInfo->context(), renderer);
  • trunk/Source/WebCore/rendering/svg/SVGResources.cpp

    r284078 r284718  
    2121#include "SVGResources.h"
    2222
    23 #include "ClipPathOperation.h"
    2423#include "FilterOperation.h"
     24#include "PathOperation.h"
    2525#include "RenderSVGResourceClipper.h"
    2626#include "RenderSVGResourceFilter.h"
     
    220220    bool foundResources = false;
    221221    if (clipperFilterMaskerTags().contains(tagName)) {
    222         if (is<ReferenceClipPathOperation>(style.clipPath())) {
     222        if (is<ReferencePathOperation>(style.clipPath())) {
    223223            // FIXME: -webkit-clip-path should support external resources
    224224            // https://bugs.webkit.org/show_bug.cgi?id=127032
    225             auto& clipPath = downcast<ReferenceClipPathOperation>(*style.clipPath());
     225            auto& clipPath = downcast<ReferencePathOperation>(*style.clipPath());
    226226            AtomString id(clipPath.fragment());
    227227            if (setClipper(getRenderSVGResourceById<RenderSVGResourceClipper>(document, id)))
  • trunk/Source/WebCore/style/StyleBuilderConverter.h

    r284440 r284718  
    9999    static OptionSet<TextEmphasisPosition> convertTextEmphasisPosition(BuilderState&, const CSSValue&);
    100100    static TextAlignMode convertTextAlign(BuilderState&, const CSSValue&);
    101     static RefPtr<ClipPathOperation> convertClipPath(BuilderState&, const CSSValue&);
     101    static RefPtr<PathOperation> convertClipPath(BuilderState&, const CSSValue&);
    102102    static Resize convertResize(BuilderState&, const CSSValue&);
    103103    static int convertMarqueeRepetition(BuilderState&, const CSSValue&);
     
    620620}
    621621
    622 inline RefPtr<ClipPathOperation> BuilderConverter::convertClipPath(BuilderState& builderState, const CSSValue& value)
     622inline RefPtr<PathOperation> BuilderConverter::convertClipPath(BuilderState& builderState, const CSSValue& value)
    623623{
    624624    if (is<CSSPrimitiveValue>(value)) {
     
    628628            String fragment = SVGURIReference::fragmentIdentifierFromIRIString(cssURLValue, builderState.document());
    629629            // FIXME: It doesn't work with external SVG references (see https://bugs.webkit.org/show_bug.cgi?id=126133)
    630             return ReferenceClipPathOperation::create(cssURLValue, fragment);
     630            return ReferencePathOperation::create(cssURLValue, fragment);
    631631        }
    632632        ASSERT(primitiveValue.valueID() == CSSValueNone);
     
    635635
    636636    CSSBoxType referenceBox = CSSBoxType::BoxMissing;
    637     RefPtr<ClipPathOperation> operation;
     637    RefPtr<PathOperation> operation;
    638638
    639639    for (auto& currentValue : downcast<CSSValueList>(value)) {
     
    641641        if (primitiveValue.isShape()) {
    642642            ASSERT(!operation);
    643             operation = ShapeClipPathOperation::create(
     643            operation = ShapePathOperation::create(
    644644                basicShapeForValue(builderState.cssToLengthConversionData(),
    645645                *primitiveValue.shapeValue(),
     
    658658    }
    659659    if (operation)
    660         downcast<ShapeClipPathOperation>(*operation).setReferenceBox(referenceBox);
     660        downcast<ShapePathOperation>(*operation).setReferenceBox(referenceBox);
    661661    else {
    662662        ASSERT(referenceBox != CSSBoxType::BoxMissing);
    663         operation = BoxClipPathOperation::create(referenceBox);
     663        operation = BoxPathOperation::create(referenceBox);
    664664    }
    665665
Note: See TracChangeset for help on using the changeset viewer.