Changeset 286086 in webkit for trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
- Timestamp:
- Nov 19, 2021, 4:56:18 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r285904 r286086 42 42 #include "CSSPropertyNames.h" 43 43 #include "CSSPropertyParser.h" 44 #include "CSSRayValue.h" 44 45 #include "CSSReflectValue.h" 45 46 #include "CSSSelector.h" … … 1457 1458 } 1458 1459 1460 static CSSValueID valueIDForRaySize(RayPathOperation::Size size) 1461 { 1462 switch (size) { 1463 case RayPathOperation::Size::ClosestCorner: 1464 return CSSValueClosestCorner; 1465 case RayPathOperation::Size::ClosestSide: 1466 return CSSValueClosestSide; 1467 case RayPathOperation::Size::FarthestCorner: 1468 return CSSValueFarthestCorner; 1469 case RayPathOperation::Size::FarthestSide: 1470 return CSSValueFarthestSide; 1471 case RayPathOperation::Size::Sides: 1472 return CSSValueSides; 1473 } 1474 1475 ASSERT_NOT_REACHED(); 1476 return CSSValueInvalid; 1477 } 1478 1459 1479 static Ref<CSSValue> valueForPathOperation(const RenderStyle& style, const PathOperation* operation, SVGPathConversion conversion = SVGPathConversion::None) 1460 1480 { … … 1464 1484 return cssValuePool.createIdentifierValue(CSSValueNone); 1465 1485 1466 if (is<ReferencePathOperation>(*operation)) 1486 switch (operation->type()) { 1487 case PathOperation::Reference: 1467 1488 return CSSPrimitiveValue::create(downcast<ReferencePathOperation>(*operation).url(), CSSUnitType::CSS_URI); 1468 1489 1469 auto list = CSSValueList::createSpaceSeparated(); 1470 if (is<ShapePathOperation>(*operation)) { 1490 case PathOperation::Shape: { 1491 auto list = CSSValueList::createSpaceSeparated(); 1492 1471 1493 auto& shapeOperation = downcast<ShapePathOperation>(*operation); 1472 1494 list->append(valueForBasicShape(style, shapeOperation.basicShape(), conversion)); 1495 1473 1496 if (shapeOperation.referenceBox() != CSSBoxType::BoxMissing) 1474 1497 list->append(cssValuePool.createValue(shapeOperation.referenceBox())); 1475 } 1476 1477 if (is<BoxPathOperation>(*operation)) 1478 list->append(cssValuePool.createValue(downcast<BoxPathOperation>(*operation).referenceBox())); 1479 1480 return list; 1498 1499 return list; 1500 } 1501 1502 case PathOperation::Box: 1503 return cssValuePool.createValue(downcast<BoxPathOperation>(*operation).referenceBox()); 1504 1505 case PathOperation::Ray: { 1506 auto& ray = downcast<RayPathOperation>(*operation); 1507 1508 auto angle = cssValuePool.createValue(ray.angle(), CSSUnitType::CSS_DEG); 1509 auto size = cssValuePool.createIdentifierValue(valueIDForRaySize(ray.size())); 1510 1511 return CSSRayValue::create(WTFMove(angle), WTFMove(size), ray.isContaining()); 1512 } 1513 } 1514 1515 ASSERT_NOT_REACHED(); 1516 return cssValuePool.createIdentifierValue(CSSValueNone); 1481 1517 } 1482 1518
Note:
See TracChangeset
for help on using the changeset viewer.