Changeset 284718 in webkit
- Timestamp:
- Oct 22, 2021, 3:17:02 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 19 edited
- 1 moved
-
ChangeLog (modified) (1 diff)
-
Headers.cmake (modified) (2 diffs)
-
WebCore.xcodeproj/project.pbxproj (modified) (6 diffs)
-
animation/CSSPropertyAnimation.cpp (modified) (5 diffs)
-
css/CSSBasicShapes.cpp (modified) (1 diff)
-
css/CSSComputedStyleDeclaration.cpp (modified) (1 diff)
-
rendering/PathOperation.h (moved) (moved from trunk/Source/WebCore/rendering/ClipPathOperation.h ) (9 diffs)
-
rendering/ReferencedSVGResources.cpp (modified) (3 diffs)
-
rendering/ReferencedSVGResources.h (modified) (2 diffs)
-
rendering/RenderBox.cpp (modified) (5 diffs)
-
rendering/RenderLayer.cpp (modified) (5 diffs)
-
rendering/RenderLayerBacking.cpp (modified) (2 diffs)
-
rendering/style/BasicShapes.cpp (modified) (1 diff)
-
rendering/style/RenderStyle.h (modified) (2 diffs)
-
rendering/style/StyleRareNonInheritedData.h (modified) (3 diffs)
-
rendering/svg/SVGRenderSupport.cpp (modified) (5 diffs)
-
rendering/svg/SVGRenderTreeAsText.cpp (modified) (1 diff)
-
rendering/svg/SVGRenderingContext.cpp (modified) (1 diff)
-
rendering/svg/SVGResources.cpp (modified) (2 diffs)
-
style/StyleBuilderConverter.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r284713 r284718 1 2021-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 1 53 2021-10-22 Ian Anderson <iana@apple.com> 2 54 -
trunk/Source/WebCore/Headers.cmake
r284528 r284718 1591 1591 1592 1592 rendering/BreakLines.h 1593 rendering/ClipPathOperation.h1594 1593 rendering/ClipRect.h 1595 1594 rendering/EventRegion.h … … 1615 1614 rendering/PaintInfo.h 1616 1615 rendering/PaintPhase.h 1616 rendering/PathOperation.h 1617 1617 rendering/RenderAttachment.h 1618 1618 rendering/RenderBlock.h -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r284630 r284718 5525 5525 FB3056C2169E5DAC0096A232 /* CSSGroupingRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5526 5526 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, ); }; }; 5528 5528 FBB0C5B817BBD629003D3677 /* CSSFilterImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = FB965B8117BBB5F900E835B9 /* CSSFilterImageValue.h */; settings = {ATTRIBUTES = (); }; }; 5529 5529 FBD6AF8815EF25C9008B7110 /* CSSBasicShapes.h in Headers */ = {isa = PBXBuildFile; fileRef = FBD6AF8715EF21D4008B7110 /* CSSBasicShapes.h */; }; … … 17111 17111 FB484F4A171F821E00040755 /* TransformFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformFunctions.cpp; sourceTree = "<group>"; }; 17112 17112 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>"; }; 17114 17114 FB965B8117BBB5F900E835B9 /* CSSFilterImageValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFilterImageValue.h; sourceTree = "<group>"; }; 17115 17115 FB965B8217BBB62C00E835B9 /* CSSFilterImageValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFilterImageValue.cpp; sourceTree = "<group>"; }; … … 30197 30197 E4F0BE3025710A76009E7431 /* CaretRectComputation.cpp */, 30198 30198 E4F0BE2E25710A75009E7431 /* CaretRectComputation.h */, 30199 FB92DF4915FED08700994433 /* ClipPathOperation.h */,30200 30199 5803715F1A66F00A00BAF519 /* ClipRect.cpp */, 30201 30200 580371601A66F00A00BAF519 /* ClipRect.h */, … … 30275 30274 0885067D11DA045B00182B98 /* PaintInfo.h */, 30276 30275 0885067E11DA045B00182B98 /* PaintPhase.h */, 30276 FB92DF4915FED08700994433 /* PathOperation.h */, 30277 30277 B2B1F7140D00CAA8004AEA64 /* PointerEventsHitRules.cpp */, 30278 30278 B2B1F7150D00CAA8004AEA64 /* PointerEventsHitRules.h */, … … 32077 32077 F4D07558234D822D00881E73 /* ClipboardItemDataSource.h in Headers */, 32078 32078 F4D07559234D823300881E73 /* ClipboardItemPasteboardDataSource.h in Headers */, 32079 FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */,32080 32079 580371621A66F00A00BAF519 /* ClipRect.h in Headers */, 32081 32080 97AABD1314FA09D5007457AE /* CloseEvent.h in Headers */, … … 34732 34731 B27535800B053814002CE64F /* Path.h in Headers */, 34733 34732 7C193BC21F5E0EED0088F3E6 /* Path2D.h in Headers */, 34733 FB92DF4B15FED08700994433 /* PathOperation.h in Headers */, 34734 34734 A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */, 34735 34735 2D5002FC1B56D7990020AAF7 /* PathUtilities.h in Headers */, -
trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp
r284602 r284718 42 42 #include "CachedImage.h" 43 43 #include "CalculationValue.h" 44 #include "ClipPathOperation.h"45 44 #include "ColorBlending.h" 46 45 #include "CompositeOperation.h" … … 56 55 #include "Matrix3DTransformOperation.h" 57 56 #include "MatrixTransformOperation.h" 57 #include "PathOperation.h" 58 58 #include "RenderBox.h" 59 59 #include "RenderStyle.h" … … 272 272 } 273 273 274 static inline RefPtr< ClipPathOperation> blendFunc(ClipPathOperation* from, ClipPathOperation* to, const CSSPropertyBlendingContext& context)274 static inline RefPtr<PathOperation> blendFunc(PathOperation* from, PathOperation* to, const CSSPropertyBlendingContext& context) 275 275 { 276 276 if (!from || !to) … … 278 278 279 279 // 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) 281 281 return to; 282 282 283 const BasicShape& fromShape = downcast<Shape ClipPathOperation>(*from).basicShape();284 const BasicShape& toShape = downcast<Shape ClipPathOperation>(*to).basicShape();283 const BasicShape& fromShape = downcast<ShapePathOperation>(*from).basicShape(); 284 const BasicShape& toShape = downcast<ShapePathOperation>(*to).basicShape(); 285 285 286 286 if (!fromShape.canBlend(toShape)) 287 287 return to; 288 288 289 return Shape ClipPathOperation::create(toShape.blend(fromShape, context));289 return ShapePathOperation::create(toShape.blend(fromShape, context)); 290 290 } 291 291 … … 1020 1020 }; 1021 1021 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)1022 class PropertyWrapperClipPath final : public RefCountedPropertyWrapper<PathOperation> { 1023 WTF_MAKE_FAST_ALLOCATED; 1024 public: 1025 PropertyWrapperClipPath(CSSPropertyID property, PathOperation* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(RefPtr<PathOperation>&&)) 1026 : RefCountedPropertyWrapper<PathOperation>(property, getter, setter) 1027 1027 { 1028 1028 } -
trunk/Source/WebCore/css/CSSBasicShapes.cpp
r277967 r284718 398 398 399 399 } // namespace WebCore 400 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r284642 r284718 3794 3794 if (!operation) 3795 3795 return cssValuePool.createIdentifierValue(CSSValueNone); 3796 if (is<Reference ClipPathOperation>(*operation))3797 return CSSPrimitiveValue::create(downcast<Reference ClipPathOperation>(*operation).url(), CSSUnitType::CSS_URI);3796 if (is<ReferencePathOperation>(*operation)) 3797 return CSSPrimitiveValue::create(downcast<ReferencePathOperation>(*operation).url(), CSSUnitType::CSS_URI); 3798 3798 auto list = CSSValueList::createSpaceSeparated(); 3799 if (is<Shape ClipPathOperation>(*operation)) {3800 auto& shapeOperation = downcast<Shape ClipPathOperation>(*operation);3799 if (is<ShapePathOperation>(*operation)) { 3800 auto& shapeOperation = downcast<ShapePathOperation>(*operation); 3801 3801 list->append(valueForBasicShape(style, shapeOperation.basicShape())); 3802 3802 if (shapeOperation.referenceBox() != CSSBoxType::BoxMissing) 3803 3803 list->append(cssValuePool.createValue(shapeOperation.referenceBox())); 3804 3804 } 3805 if (is<Box ClipPathOperation>(*operation))3806 list->append(cssValuePool.createValue(downcast<Box ClipPathOperation>(*operation).referenceBox()));3805 if (is<BoxPathOperation>(*operation)) 3806 list->append(cssValuePool.createValue(downcast<BoxPathOperation>(*operation).referenceBox())); 3807 3807 return list; 3808 3808 } -
trunk/Source/WebCore/rendering/PathOperation.h
r284716 r284718 39 39 namespace WebCore { 40 40 41 class ClipPathOperation : public RefCounted<ClipPathOperation> {41 class PathOperation : public RefCounted<PathOperation> { 42 42 public: 43 43 enum OperationType { … … 47 47 }; 48 48 49 virtual ~ ClipPathOperation() = default;49 virtual ~PathOperation() = default; 50 50 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); } 53 53 54 54 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; } 56 56 57 57 protected: 58 explicit ClipPathOperation(OperationType type)58 explicit PathOperation(OperationType type) 59 59 : m_type(type) 60 60 { … … 64 64 }; 65 65 66 class Reference ClipPathOperation final : public ClipPathOperation {66 class ReferencePathOperation final : public PathOperation { 67 67 public: 68 static Ref<Reference ClipPathOperation> create(const String& url, const String& fragment)68 static Ref<ReferencePathOperation> create(const String& url, const String& fragment) 69 69 { 70 return adoptRef(*new Reference ClipPathOperation(url, fragment));70 return adoptRef(*new ReferencePathOperation(url, fragment)); 71 71 } 72 72 … … 75 75 76 76 private: 77 bool operator==(const ClipPathOperation& other) const override77 bool operator==(const PathOperation& other) const override 78 78 { 79 79 if (!isSameType(other)) 80 80 return false; 81 auto& referenceClip = downcast<Reference ClipPathOperation>(other);81 auto& referenceClip = downcast<ReferencePathOperation>(other); 82 82 return m_url == referenceClip.m_url; 83 83 } 84 84 85 Reference ClipPathOperation(const String& url, const String& fragment)86 : ClipPathOperation(Reference)85 ReferencePathOperation(const String& url, const String& fragment) 86 : PathOperation(Reference) 87 87 , m_url(url) 88 88 , m_fragment(fragment) … … 94 94 }; 95 95 96 class Shape ClipPathOperation final : public ClipPathOperation {96 class ShapePathOperation final : public PathOperation { 97 97 public: 98 static Ref<Shape ClipPathOperation> create(Ref<BasicShape>&& shape)98 static Ref<ShapePathOperation> create(Ref<BasicShape>&& shape) 99 99 { 100 return adoptRef(*new Shape ClipPathOperation(WTFMove(shape)));100 return adoptRef(*new ShapePathOperation(WTFMove(shape))); 101 101 } 102 102 103 103 const BasicShape& basicShape() const { return m_shape; } 104 104 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); } 106 106 107 107 void setReferenceBox(CSSBoxType referenceBox) { m_referenceBox = referenceBox; } … … 109 109 110 110 private: 111 bool operator==(const ClipPathOperation& other) const override111 bool operator==(const PathOperation& other) const override 112 112 { 113 113 if (!isSameType(other)) 114 114 return false; 115 auto& shapeClip = downcast<Shape ClipPathOperation>(other);115 auto& shapeClip = downcast<ShapePathOperation>(other); 116 116 return m_referenceBox == shapeClip.referenceBox() 117 117 && (m_shape.ptr() == shapeClip.m_shape.ptr() || m_shape.get() == shapeClip.m_shape.get()); 118 118 } 119 119 120 explicit Shape ClipPathOperation(Ref<BasicShape>&& shape)121 : ClipPathOperation(Shape)120 explicit ShapePathOperation(Ref<BasicShape>&& shape) 121 : PathOperation(Shape) 122 122 , m_shape(WTFMove(shape)) 123 123 , m_referenceBox(CSSBoxType::BoxMissing) … … 129 129 }; 130 130 131 class Box ClipPathOperation final : public ClipPathOperation {131 class BoxPathOperation final : public PathOperation { 132 132 public: 133 static Ref<Box ClipPathOperation> create(CSSBoxType referenceBox)133 static Ref<BoxPathOperation> create(CSSBoxType referenceBox) 134 134 { 135 return adoptRef(*new Box ClipPathOperation(referenceBox));135 return adoptRef(*new BoxPathOperation(referenceBox)); 136 136 } 137 137 … … 145 145 146 146 private: 147 bool operator==(const ClipPathOperation& other) const override147 bool operator==(const PathOperation& other) const override 148 148 { 149 149 if (!isSameType(other)) 150 150 return false; 151 auto& boxClip = downcast<Box ClipPathOperation>(other);151 auto& boxClip = downcast<BoxPathOperation>(other); 152 152 return m_referenceBox == boxClip.m_referenceBox; 153 153 } 154 154 155 explicit Box ClipPathOperation(CSSBoxType referenceBox)156 : ClipPathOperation(Box)155 explicit BoxPathOperation(CSSBoxType referenceBox) 156 : PathOperation(Box) 157 157 , m_referenceBox(referenceBox) 158 158 { … … 166 166 #define SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ToValueTypeName, predicate) \ 167 167 SPECIALIZE_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; } \ 169 169 SPECIALIZE_TYPE_TRAITS_END() 170 170 171 SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(Reference ClipPathOperation, ClipPathOperation::Reference)172 SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(Shape ClipPathOperation, ClipPathOperation::Shape)173 SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(Box ClipPathOperation, ClipPathOperation::Box)171 SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ReferencePathOperation, PathOperation::Reference) 172 SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(ShapePathOperation, PathOperation::Shape) 173 SPECIALIZE_TYPE_TRAITS_CLIP_PATH_OPERATION(BoxPathOperation, PathOperation::Box) -
trunk/Source/WebCore/rendering/ReferencedSVGResources.cpp
r283851 r284718 27 27 #include "ReferencedSVGResources.h" 28 28 29 #include "ClipPathOperation.h"30 29 #include "FilterOperations.h" 30 #include "PathOperation.h" 31 31 #include "RenderSVGResourceClipper.h" 32 32 #include "RenderSVGResourceFilter.h" … … 99 99 { 100 100 Vector<std::pair<AtomString, QualifiedName>> referencedResources; 101 if (is<Reference ClipPathOperation>(style.clipPath())) {102 auto& clipPath = downcast<Reference ClipPathOperation>(*style.clipPath());101 if (is<ReferencePathOperation>(style.clipPath())) { 102 auto& clipPath = downcast<ReferencePathOperation>(*style.clipPath()); 103 103 if (!clipPath.fragment().isEmpty()) 104 104 referencedResources.append({ clipPath.fragment(), SVGNames::clipPathTag }); … … 158 158 } 159 159 160 RenderSVGResourceClipper* ReferencedSVGResources::referencedClipperRenderer(Document& document, const Reference ClipPathOperation& clipPath)160 RenderSVGResourceClipper* ReferencedSVGResources::referencedClipperRenderer(Document& document, const ReferencePathOperation& clipPath) 161 161 { 162 162 if (clipPath.fragment().isEmpty()) -
trunk/Source/WebCore/rendering/ReferencedSVGResources.h
r282080 r284718 36 36 class CSSSVGResourceElementClient; 37 37 class Document; 38 class Reference ClipPathOperation;38 class ReferencePathOperation; 39 39 class ReferenceFilterOperation; 40 40 class RenderElement; … … 56 56 57 57 // Clipping needs a renderer, filters use an element. 58 RenderSVGResourceClipper* referencedClipperRenderer(Document&, const Reference ClipPathOperation&);58 RenderSVGResourceClipper* referencedClipperRenderer(Document&, const ReferencePathOperation&); 59 59 SVGFilterElement* referencedFilterElement(Document&, const ReferenceFilterOperation&); 60 60 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r284548 r284718 27 27 28 28 #include "CSSFontSelector.h" 29 #include "ClipPathOperation.h"30 29 #include "ControlStates.h" 31 30 #include "Document.h" … … 55 54 #include "Page.h" 56 55 #include "PaintInfo.h" 56 #include "PathOperation.h" 57 57 #include "RenderBoxFragmentInfo.h" 58 58 #include "RenderChildIterator.h" … … 1386 1386 auto hitTestLocationInLocalCoordinates = hitTestLocation.point() - offsetFromHitTestRoot; 1387 1387 switch (style().clipPath()->type()) { 1388 case ClipPathOperation::Shape: {1389 auto& clipPath = downcast<Shape ClipPathOperation>(*style().clipPath());1388 case PathOperation::Shape: { 1389 auto& clipPath = downcast<ShapePathOperation>(*style().clipPath()); 1390 1390 auto referenceBoxRect = referenceBox(clipPath.referenceBox()); 1391 1391 if (!clipPath.pathForReferenceRect(referenceBoxRect).contains(hitTestLocationInLocalCoordinates, clipPath.windRule())) … … 1393 1393 break; 1394 1394 } 1395 case ClipPathOperation::Reference: {1396 const auto& reference ClipPathOperation = downcast<ReferenceClipPathOperation>(*style().clipPath());1397 auto* element = document().getElementById(reference ClipPathOperation.fragment());1395 case PathOperation::Reference: { 1396 const auto& referencePathOperation = downcast<ReferencePathOperation>(*style().clipPath()); 1397 auto* element = document().getElementById(referencePathOperation.fragment()); 1398 1398 if (!element || !element->renderer()) 1399 1399 break; … … 1405 1405 break; 1406 1406 } 1407 case ClipPathOperation::Box:1407 case PathOperation::Box: 1408 1408 break; 1409 1409 } -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r284684 r284718 696 696 return false; 697 697 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); 699 699 } 700 700 … … 3129 3129 float deviceScaleFactor = renderer().document().deviceScaleFactor(); 3130 3130 3131 if (is<Shape ClipPathOperation>(*style.clipPath())) {3132 auto& clipPath = downcast<Shape ClipPathOperation>(*style.clipPath());3131 if (is<ShapePathOperation>(*style.clipPath())) { 3132 auto& clipPath = downcast<ShapePathOperation>(*style.clipPath()); 3133 3133 3134 3134 LayoutRect referenceBox; … … 3145 3145 } 3146 3146 3147 if (is<Box ClipPathOperation>(*style.clipPath()) && is<RenderBox>(renderer())) {3148 auto& clipPath = downcast<Box ClipPathOperation>(*style.clipPath());3147 if (is<BoxPathOperation>(*style.clipPath()) && is<RenderBox>(renderer())) { 3148 auto& clipPath = downcast<BoxPathOperation>(*style.clipPath()); 3149 3149 3150 3150 auto shapeRect = computeRoundedRectForBoxShape(clipPath.referenceBox(), downcast<RenderBox>(renderer())).pixelSnappedRoundedRectForPainting(deviceScaleFactor); … … 3171 3171 LayoutSize paintingOffsetFromRoot = LayoutSize(snapSizeToDevicePixel(offsetFromRoot + paintingInfo.subpixelOffset, LayoutPoint(), renderer().document().deviceScaleFactor())); 3172 3172 ASSERT(style.clipPath()); 3173 if (is<Shape ClipPathOperation>(*style.clipPath()) || (is<BoxClipPathOperation>(*style.clipPath()) && is<RenderBox>(renderer()))) {3173 if (is<ShapePathOperation>(*style.clipPath()) || (is<BoxPathOperation>(*style.clipPath()) && is<RenderBox>(renderer()))) { 3174 3174 // clippedContentBounds is used as the reference box for inlines, which is also poorly specified: https://github.com/w3c/csswg-drafts/issues/6383. 3175 3175 auto [path, windRule] = computeClipPath(paintingOffsetFromRoot, clippedContentBounds); … … 3178 3178 } 3179 3179 3180 if (is<Reference ClipPathOperation>(style.clipPath())) {3181 auto& referenceClipPathOperation = downcast<Reference ClipPathOperation>(*style.clipPath());3180 if (is<ReferencePathOperation>(style.clipPath())) { 3181 auto& referenceClipPathOperation = downcast<ReferencePathOperation>(*style.clipPath()); 3182 3182 if (auto* clipperRenderer = renderer().ensureReferencedSVGResources().referencedClipperRenderer(renderer().document(), referenceClipPathOperation)) { 3183 3183 // 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 1616 1616 if (!m_maskLayer->drawsContent()) { 1617 1617 if (renderer().hasClipPath()) { 1618 ASSERT(renderer().style().clipPath()->type() != ClipPathOperation::Reference);1618 ASSERT(renderer().style().clipPath()->type() != PathOperation::Reference); 1619 1619 1620 1620 // FIXME: Use correct reference box for inlines: https://bugs.webkit.org/show_bug.cgi?id=129047, https://github.com/w3c/csswg-drafts/issues/6383 … … 2257 2257 if (hasClipPath) { 2258 2258 // 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)) 2260 2260 maskPhases.add(GraphicsLayerPaintingPhase::ClipPath); 2261 2261 } -
trunk/Source/WebCore/rendering/style/BasicShapes.cpp
r276141 r284718 495 495 496 496 } // namespace WebCore 497 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r284642 r284718 1469 1469 static float initialShapeImageThreshold() { return 0; } 1470 1470 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; } 1474 1474 1475 1475 bool hasContent() const { return contentData(); } … … 2355 2355 } 2356 2356 2357 inline void RenderStyle::setClipPath(RefPtr< ClipPathOperation>&& operation)2357 inline void RenderStyle::setClipPath(RefPtr<PathOperation>&& operation) 2358 2358 { 2359 2359 if (m_rareNonInheritedData->clipPath != operation) -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r284361 r284718 26 26 27 27 #include "CSSPropertyNames.h" 28 #include "ClipPathOperation.h"29 28 #include "CounterDirectives.h" 30 29 #include "FillLayer.h" … … 33 32 #include "LineClampValue.h" 34 33 #include "NinePieceImage.h" 34 #include "PathOperation.h" 35 35 #include "RotateTransformOperation.h" 36 36 #include "ScaleTransformOperation.h" … … 165 165 int order; 166 166 167 RefPtr< ClipPathOperation> clipPath;167 RefPtr<PathOperation> clipPath; 168 168 169 169 Color textDecorationColor; -
trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
r284093 r284718 387 387 inline bool isPointInCSSClippingArea(const RenderElement& renderer, const FloatPoint& point) 388 388 { 389 ClipPathOperation* clipPathOperation = renderer.style().clipPath();390 if (is<Shape ClipPathOperation>(clipPathOperation)) {391 auto& clipPath = downcast<Shape ClipPathOperation>(*clipPathOperation);389 PathOperation* clipPathOperation = renderer.style().clipPath(); 390 if (is<ShapePathOperation>(clipPathOperation)) { 391 auto& clipPath = downcast<ShapePathOperation>(*clipPathOperation); 392 392 FloatRect referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox()); 393 393 if (!referenceBox.contains(point)) … … 395 395 return clipPath.pathForReferenceRect(referenceBox).contains(point, clipPath.windRule()); 396 396 } 397 if (is<Box ClipPathOperation>(clipPathOperation)) {398 auto& clipPath = downcast<Box ClipPathOperation>(*clipPathOperation);397 if (is<BoxPathOperation>(clipPathOperation)) { 398 auto& clipPath = downcast<BoxPathOperation>(*clipPathOperation); 399 399 FloatRect referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox()); 400 400 if (!referenceBox.contains(point)) … … 408 408 void SVGRenderSupport::clipContextToCSSClippingArea(GraphicsContext& context, const RenderElement& renderer) 409 409 { 410 ClipPathOperation* clipPathOperation = renderer.style().clipPath();411 if (is<Shape ClipPathOperation>(clipPathOperation)) {412 auto& clipPath = downcast<Shape ClipPathOperation>(*clipPathOperation);410 PathOperation* clipPathOperation = renderer.style().clipPath(); 411 if (is<ShapePathOperation>(clipPathOperation)) { 412 auto& clipPath = downcast<ShapePathOperation>(*clipPathOperation); 413 413 auto localToParentTransform = renderer.localToParentTransform(); 414 414 … … 421 421 context.clipPath(path, clipPath.windRule()); 422 422 } 423 if (is<Box ClipPathOperation>(clipPathOperation)) {424 auto& clipPath = downcast<Box ClipPathOperation>(*clipPathOperation);423 if (is<BoxPathOperation>(clipPathOperation)) { 424 auto& clipPath = downcast<BoxPathOperation>(*clipPathOperation); 425 425 FloatRect referenceBox = clipPathReferenceBox(renderer, clipPath.referenceBox()); 426 426 context.clipPath(clipPath.pathForReferenceRect(FloatRoundedRect {referenceBox})); … … 433 433 return false; 434 434 435 ClipPathOperation* clipPathOperation = renderer.style().clipPath();436 if (is<Shape ClipPathOperation>(clipPathOperation) || is<BoxClipPathOperation>(clipPathOperation))435 PathOperation* clipPathOperation = renderer.style().clipPath(); 436 if (is<ShapePathOperation>(clipPathOperation) || is<BoxPathOperation>(clipPathOperation)) 437 437 return isPointInCSSClippingArea(renderer, point); 438 438 -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
r283851 r284718 573 573 } 574 574 } 575 if (style.clipPath() && is<Reference ClipPathOperation>(style.clipPath())) {576 auto resourceClipPath = downcast<Reference ClipPathOperation>(style.clipPath());575 if (style.clipPath() && is<ReferencePathOperation>(style.clipPath())) { 576 auto resourceClipPath = downcast<ReferencePathOperation>(style.clipPath()); 577 577 AtomString id = resourceClipPath->fragment(); 578 578 if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(renderer.document(), id)) { -
trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
r284078 r284718 128 128 } 129 129 130 ClipPathOperation* clipPathOperation = style.clipPath();131 bool hasCSSClipping = is<Shape ClipPathOperation>(clipPathOperation) || is<BoxClipPathOperation>(clipPathOperation);130 PathOperation* clipPathOperation = style.clipPath(); 131 bool hasCSSClipping = is<ShapePathOperation>(clipPathOperation) || is<BoxPathOperation>(clipPathOperation); 132 132 if (hasCSSClipping) 133 133 SVGRenderSupport::clipContextToCSSClippingArea(m_paintInfo->context(), renderer); -
trunk/Source/WebCore/rendering/svg/SVGResources.cpp
r284078 r284718 21 21 #include "SVGResources.h" 22 22 23 #include "ClipPathOperation.h"24 23 #include "FilterOperation.h" 24 #include "PathOperation.h" 25 25 #include "RenderSVGResourceClipper.h" 26 26 #include "RenderSVGResourceFilter.h" … … 220 220 bool foundResources = false; 221 221 if (clipperFilterMaskerTags().contains(tagName)) { 222 if (is<Reference ClipPathOperation>(style.clipPath())) {222 if (is<ReferencePathOperation>(style.clipPath())) { 223 223 // FIXME: -webkit-clip-path should support external resources 224 224 // https://bugs.webkit.org/show_bug.cgi?id=127032 225 auto& clipPath = downcast<Reference ClipPathOperation>(*style.clipPath());225 auto& clipPath = downcast<ReferencePathOperation>(*style.clipPath()); 226 226 AtomString id(clipPath.fragment()); 227 227 if (setClipper(getRenderSVGResourceById<RenderSVGResourceClipper>(document, id))) -
trunk/Source/WebCore/style/StyleBuilderConverter.h
r284440 r284718 99 99 static OptionSet<TextEmphasisPosition> convertTextEmphasisPosition(BuilderState&, const CSSValue&); 100 100 static TextAlignMode convertTextAlign(BuilderState&, const CSSValue&); 101 static RefPtr< ClipPathOperation> convertClipPath(BuilderState&, const CSSValue&);101 static RefPtr<PathOperation> convertClipPath(BuilderState&, const CSSValue&); 102 102 static Resize convertResize(BuilderState&, const CSSValue&); 103 103 static int convertMarqueeRepetition(BuilderState&, const CSSValue&); … … 620 620 } 621 621 622 inline RefPtr< ClipPathOperation> BuilderConverter::convertClipPath(BuilderState& builderState, const CSSValue& value)622 inline RefPtr<PathOperation> BuilderConverter::convertClipPath(BuilderState& builderState, const CSSValue& value) 623 623 { 624 624 if (is<CSSPrimitiveValue>(value)) { … … 628 628 String fragment = SVGURIReference::fragmentIdentifierFromIRIString(cssURLValue, builderState.document()); 629 629 // FIXME: It doesn't work with external SVG references (see https://bugs.webkit.org/show_bug.cgi?id=126133) 630 return Reference ClipPathOperation::create(cssURLValue, fragment);630 return ReferencePathOperation::create(cssURLValue, fragment); 631 631 } 632 632 ASSERT(primitiveValue.valueID() == CSSValueNone); … … 635 635 636 636 CSSBoxType referenceBox = CSSBoxType::BoxMissing; 637 RefPtr< ClipPathOperation> operation;637 RefPtr<PathOperation> operation; 638 638 639 639 for (auto& currentValue : downcast<CSSValueList>(value)) { … … 641 641 if (primitiveValue.isShape()) { 642 642 ASSERT(!operation); 643 operation = Shape ClipPathOperation::create(643 operation = ShapePathOperation::create( 644 644 basicShapeForValue(builderState.cssToLengthConversionData(), 645 645 *primitiveValue.shapeValue(), … … 658 658 } 659 659 if (operation) 660 downcast<Shape ClipPathOperation>(*operation).setReferenceBox(referenceBox);660 downcast<ShapePathOperation>(*operation).setReferenceBox(referenceBox); 661 661 else { 662 662 ASSERT(referenceBox != CSSBoxType::BoxMissing); 663 operation = Box ClipPathOperation::create(referenceBox);663 operation = BoxPathOperation::create(referenceBox); 664 664 } 665 665
Note:
See TracChangeset
for help on using the changeset viewer.