-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Style] Convert clip-path and offset-path to use strong style types #47005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Style] Convert clip-path and offset-path to use strong style types #47005
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
63a29e3
to
a7e1be0
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
a7e1be0
to
8237a45
Compare
This comment was marked as outdated.
This comment was marked as outdated.
8237a45
to
25ac024
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
25ac024
to
25afd55
Compare
EWS run on previous version of this PR (hash 25afd55) |
25afd55
to
96a9927
Compare
EWS run on previous version of this PR (hash 96a9927) |
96a9927
to
8adb468
Compare
@@ -154,6 +156,8 @@ class FloatRoundedRect { | |||
|
|||
bool intersectionIsRectangular(const FloatRect&) const; | |||
|
|||
Path path() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure I like the pattern here.
Does FloatRect
have a path
function in it? What about IntRect
? If we want to convert something that can be added to a path into a path with just that single geometric figure in it, wouldn’t we want to do that with a template function rather than adding a member function to each type?
I didn’t necessarily spot all the new code that depends on this, so I’m not sure how much this makes the code more elegant or if it makes a template abstraction possible. At least some of the call sites I found don’t really seem like they need to be the way they are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having FloatRect
and IntRect
having path()
functions sounds good actually.
The alternative, to make the call sites a bit more weirdly is to give Path() a constructor that takes a FloatRoundedRect (and ones for FloatRect and IntRect), which would also be ok with me.
Its all just to avoid the multiple lines needed to construct and add the one shape you want.
This comment was marked as outdated.
This comment was marked as outdated.
8adb468
to
1db1449
Compare
EWS run on previous version of this PR (hash 1db1449) |
EWS run on previous version of this PR (hash 8adb468) |
1db1449
to
65716b7
Compare
EWS run on previous version of this PR (hash 65716b7) |
Safer C++ Build #41339 (65716b7)❌ Found 1 failing file with 4 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
65716b7
to
ce278de
Compare
EWS run on previous version of this PR (hash ce278de) |
ce278de
to
1ad15b4
Compare
EWS run on current version of this PR (hash 1ad15b4) |
https://bugs.webkit.org/show_bug.cgi?id=294754 Reviewed by Darin Adler. Add strongly typed wrappers for the clip-path and offset-path properties. These are both "zero-cost" wrappers around the existing reference counted path operation types. Converted the PathComputation and WindRuleComputation interfaces to use the new CPO style invokers to match the other invokers. Added support for generic Variant support in TextStream and made it so that elided tuples can be supported in TextStream as well. * Source/WTF/wtf/text/TextStream.h: * Source/WebCore/CMakeLists.txt: * Source/WebCore/Headers.cmake: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/animation/KeyframeEffect.cpp: * Source/WebCore/css/CSSProperties.json: * Source/WebCore/page/InteractionRegion.cpp: * Source/WebCore/platform/animation/AcceleratedEffectValues.cpp: * Source/WebCore/platform/graphics/FloatRoundedRect.cpp: * Source/WebCore/platform/graphics/FloatRoundedRect.h: * Source/WebCore/rendering/MotionPath.cpp: * Source/WebCore/rendering/MotionPath.h: * Source/WebCore/rendering/PathOperation.cpp: * Source/WebCore/rendering/PathOperation.h: * Source/WebCore/rendering/ReferencedSVGResources.cpp: * Source/WebCore/rendering/ReferencedSVGResources.h: * Source/WebCore/rendering/RenderBox.cpp: * Source/WebCore/rendering/RenderElementInlines.h: * Source/WebCore/rendering/RenderLayer.cpp: * Source/WebCore/rendering/RenderLayerBacking.cpp: * Source/WebCore/rendering/RenderLayerCompositor.cpp: * Source/WebCore/rendering/RenderLayerModelObject.cpp: * Source/WebCore/rendering/style/RenderStyle.cpp: * Source/WebCore/rendering/style/RenderStyle.h: * Source/WebCore/rendering/style/RenderStyleInlines.h: * Source/WebCore/rendering/style/RenderStyleSetters.h: * Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp: * Source/WebCore/rendering/style/StyleRareNonInheritedData.h: * Source/WebCore/rendering/svg/SVGRenderSupport.cpp: * Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp: * Source/WebCore/rendering/svg/SVGRenderingContext.cpp: * Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceClipper.cpp: * Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceContainer.cpp: * Source/WebCore/rendering/svg/legacy/SVGResources.cpp: * Source/WebCore/rendering/svg/legacy/SVGResourcesCache.cpp: * Source/WebCore/style/StyleAdjuster.cpp: * Source/WebCore/style/StyleBuilderConverter.h: * Source/WebCore/style/StyleBuilderCustom.h: * Source/WebCore/style/StyleExtractorConverter.h: * Source/WebCore/style/StyleExtractorCustom.h: * Source/WebCore/style/StyleExtractorSerializer.h: * Source/WebCore/style/values/StyleValueTypes.h: * Source/WebCore/style/values/masking/StyleClipPath.cpp: Added. * Source/WebCore/style/values/masking/StyleClipPath.h: Added. * Source/WebCore/style/values/motion/StyleOffsetPath.cpp: Added. * Source/WebCore/style/values/motion/StyleOffsetPath.h: Added. * Source/WebCore/style/values/shapes/StylePathComputation.h: * Source/WebCore/style/values/shapes/StylePathFunction.cpp: * Source/WebCore/style/values/shapes/StylePathFunction.h: * Source/WebCore/style/values/shapes/StylePathOperationWrappers.cpp: Added. * Source/WebCore/style/values/shapes/StylePathOperationWrappers.h: Added. * Source/WebCore/style/values/shapes/StyleWindRuleComputation.h: * Source/WebCore/svg/SVGClipPathElement.cpp: Canonical link: https://commits.webkit.org/296560@main
1ad15b4
to
2e33f4c
Compare
Committed 296560@main (2e33f4c): https://commits.webkit.org/296560@main Reviewed commits have been landed. Closing PR #47005 and removing active labels. |
2e33f4c
1ad15b4
🧪 wpe-wk2🧪 mac-AS-debug-wk2🧪 gtk-wk2🧪 jsc-armv7-tests