-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add CSSValue types for the shape() function #31352
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
Merged
webkit-commit-queue
merged 1 commit into
WebKit:main
from
smfr:eng/Add-CSSValue-types-for-the-shape-function
Jul 28, 2024
Merged
Add CSSValue types for the shape() function #31352
webkit-commit-queue
merged 1 commit into
WebKit:main
from
smfr:eng/Add-CSSValue-types-for-the-shape-function
Jul 28, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
|
EWS run on previous version of this PR (hash 6a3f105)
|
6a3f105 to
4fc1a7f
Compare
Collaborator
|
EWS run on previous version of this PR (hash 4fc1a7f) |
4fc1a7f to
047f258
Compare
Collaborator
|
EWS run on current version of this PR (hash 047f258) |
nt1m
approved these changes
Jul 28, 2024
https://bugs.webkit.org/show_bug.cgi?id=277211 rdar://132644760 Reviewed by Tim Nguyen. To support the CSS shape() function[1] we need two new CSSValue subclasses. CSSShapeValue subclasses CSSValueContainingVector, since the segments form a list. Those segments are represented by CSSShapeSegmentValue. The spec calls these "commands", but I chose to use "segment" to match terminology in Path and SVG code. Internally CSSShapeSegmentValue uses one of several data types to store the segment data, based on how many lengths or points need to be stored. These classes are not yet instantiated. Based on code by Noam Rosenthal. [1] https://drafts.csswg.org/css-shapes-2/#shape-function * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/css/CSSBasicShapes.cpp: (WebCore::CSSPolygonValue::CSSPolygonValue): Use r-value reference for the CSSValueListBuilder argument. (WebCore::CSSPolygonValue::create): (WebCore::CSSShapeValue::create): (WebCore::CSSShapeValue::CSSShapeValue): (WebCore::CSSShapeValue::customCSSText const): (WebCore::CSSShapeValue::equals const): * Source/WebCore/css/CSSBasicShapes.h: * Source/WebCore/css/CSSShapeSegmentValue.cpp: Added. (WebCore::CSSShapeSegmentValue::createMove): (WebCore::CSSShapeSegmentValue::createLine): (WebCore::CSSShapeSegmentValue::createHorizontalLine): (WebCore::CSSShapeSegmentValue::createVerticalLine): (WebCore::CSSShapeSegmentValue::createCubicCurve): (WebCore::CSSShapeSegmentValue::createQuadraticCurve): (WebCore::CSSShapeSegmentValue::createSmoothCubicCurve): (WebCore::CSSShapeSegmentValue::createSmoothQuadraticCurve): (WebCore::CSSShapeSegmentValue::createArc): (WebCore::CSSShapeSegmentValue::createClose): (WebCore::CSSShapeSegmentValue::equals const): (WebCore::CSSShapeSegmentValue::customCSSText const): * Source/WebCore/css/CSSShapeSegmentValue.h: Added. (WebCore::CSSShapeSegmentValue::type const): (WebCore::CSSShapeSegmentValue::ShapeSegmentData::ShapeSegmentData): (WebCore::CSSShapeSegmentValue::ShapeSegmentData::operator== const): (WebCore::CSSShapeSegmentValue::OnePointData::OnePointData): (WebCore::CSSShapeSegmentValue::TwoPointData::TwoPointData): (WebCore::CSSShapeSegmentValue::ArcData::ArcData): (WebCore::CSSShapeSegmentValue::create): (WebCore::CSSShapeSegmentValue::CSSShapeSegmentValue): * Source/WebCore/css/CSSValue.cpp: (WebCore::CSSValue::visitDerived): * Source/WebCore/css/CSSValue.h: (WebCore::CSSValue::isShape const): (WebCore::CSSValue::isShapeSegment const): * Source/WebCore/css/CSSValueKeywords.in: Add shape-related keywords. * Source/WebCore/rendering/style/BasicShapes.h: Canonical link: https://commits.webkit.org/281462@main
047f258 to
5b3fbae
Compare
Collaborator
|
Committed 281462@main (5b3fbae): https://commits.webkit.org/281462@main Reviewed commits have been landed. Closing PR #31352 and removing active labels. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
5b3fbae
047f258