Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5b3fbae5a519afb6ea1fa38df0bad5e6e4b724b9
      
https://github.com/WebKit/WebKit/commit/5b3fbae5a519afb6ea1fa38df0bad5e6e4b724b9
  Author: Simon Fraser <[email protected]>
  Date:   2024-07-27 (Sat, 27 Jul 2024)

  Changed paths:
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/css/CSSBasicShapes.cpp
    M Source/WebCore/css/CSSBasicShapes.h
    A Source/WebCore/css/CSSShapeSegmentValue.cpp
    A Source/WebCore/css/CSSShapeSegmentValue.h
    M Source/WebCore/css/CSSValue.cpp
    M Source/WebCore/css/CSSValue.h
    M Source/WebCore/css/CSSValueKeywords.in
    M Source/WebCore/rendering/style/BasicShapes.h

  Log Message:
  -----------
  Add CSSValue types for the shape() function
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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to