Changeset 285343 in webkit for trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
- Timestamp:
- Nov 5, 2021, 10:18:00 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r284876 r285343 1455 1455 1456 1456 return valueForPosition(style, position); 1457 } 1458 1459 static Ref<CSSValue> valueForPathOperation(const RenderStyle& style, const PathOperation* operation, SVGPathConversion conversion = SVGPathConversion::None) 1460 { 1461 auto& cssValuePool = CSSValuePool::singleton(); 1462 1463 if (!operation) 1464 return cssValuePool.createIdentifierValue(CSSValueNone); 1465 1466 if (is<ReferencePathOperation>(*operation)) 1467 return CSSPrimitiveValue::create(downcast<ReferencePathOperation>(*operation).url(), CSSUnitType::CSS_URI); 1468 1469 auto list = CSSValueList::createSpaceSeparated(); 1470 if (is<ShapePathOperation>(*operation)) { 1471 auto& shapeOperation = downcast<ShapePathOperation>(*operation); 1472 list->append(valueForBasicShape(style, shapeOperation.basicShape(), conversion)); 1473 if (shapeOperation.referenceBox() != CSSBoxType::BoxMissing) 1474 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; 1457 1481 } 1458 1482 … … 3180 3204 case CSSPropertyObjectPosition: 3181 3205 return valueForPosition(style, style.objectPosition()); 3206 case CSSPropertyOffsetPath: 3207 // The computed value of offset-path must only contain absolute draw commands. 3208 // https://github.com/w3c/fxtf-drafts/issues/225#issuecomment-334322738 3209 return valueForPathOperation(style, style.offsetPath(), SVGPathConversion::ForceAbsolute); 3182 3210 case CSSPropertyOffsetDistance: 3183 3211 return cssValuePool.createValue(style.offsetDistance(), style); … … 3790 3818 case CSSPropertyCounterReset: 3791 3819 return counterToCSSValue(style, propertyID); 3792 case CSSPropertyClipPath: { 3793 auto* operation = style.clipPath(); 3794 if (!operation) 3795 return cssValuePool.createIdentifierValue(CSSValueNone); 3796 if (is<ReferencePathOperation>(*operation)) 3797 return CSSPrimitiveValue::create(downcast<ReferencePathOperation>(*operation).url(), CSSUnitType::CSS_URI); 3798 auto list = CSSValueList::createSpaceSeparated(); 3799 if (is<ShapePathOperation>(*operation)) { 3800 auto& shapeOperation = downcast<ShapePathOperation>(*operation); 3801 list->append(valueForBasicShape(style, shapeOperation.basicShape())); 3802 if (shapeOperation.referenceBox() != CSSBoxType::BoxMissing) 3803 list->append(cssValuePool.createValue(shapeOperation.referenceBox())); 3804 } 3805 if (is<BoxPathOperation>(*operation)) 3806 list->append(cssValuePool.createValue(downcast<BoxPathOperation>(*operation).referenceBox())); 3807 return list; 3808 } 3820 case CSSPropertyClipPath: 3821 return valueForPathOperation(style, style.clipPath()); 3809 3822 case CSSPropertyShapeMargin: 3810 3823 return cssValuePool.createValue(style.shapeMargin(), style);
Note:
See TracChangeset
for help on using the changeset viewer.