Changeset 175481 in webkit
- Timestamp:
- Nov 3, 2014 11:40:23 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r175477 r175481 1 2014-11-03 Chris Dumez <cdumez@apple.com> 2 3 Move -webkit-shape-outside to the new StyleBuilder 4 https://bugs.webkit.org/show_bug.cgi?id=138296 5 6 Reviewed by Zoltan Horvath. 7 8 Move -webkit-shape-outside to the new StyleBuilder, using custom 9 code as it does not always call setShapeOutside(). 10 11 No new tests, no behavior change. 12 13 * css/CSSPropertyNames.in: 14 * css/DeprecatedStyleBuilder.cpp: 15 (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): 16 (WebCore::ApplyPropertyShape::setValue): Deleted. 17 (WebCore::ApplyPropertyShape::applyValue): Deleted. 18 (WebCore::ApplyPropertyShape::createHandler): Deleted. 19 * css/StyleBuilderCustom.h: 20 (WebCore::StyleBuilderFunctions::applyValueWebkitShapeOutside): 21 1 22 2014-11-03 Alexey Proskuryakov <ap@apple.com> 2 23 -
trunk/Source/WebCore/css/CSSPropertyNames.in
r175467 r175481 515 515 #endif 516 516 #if defined(ENABLE_CSS_SHAPES) && ENABLE_CSS_SHAPES 517 -webkit-shape-outside 517 -webkit-shape-outside [NewStyleBuilder, Custom=Value] 518 518 -webkit-shape-margin [NewStyleBuilder, Converter=Length] 519 519 -webkit-shape-image-threshold [NewStyleBuilder, Converter=Number<float>] -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r175467 r175481 1803 1803 } 1804 1804 }; 1805 1806 #if ENABLE(CSS_SHAPES)1807 template <ShapeValue* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<ShapeValue>), ShapeValue* (*initialFunction)()>1808 class ApplyPropertyShape {1809 public:1810 static void setValue(RenderStyle* style, PassRefPtr<ShapeValue> value) { (style->*setterFunction)(value); }1811 static void applyValue(CSSPropertyID property, StyleResolver* styleResolver, CSSValue* value)1812 {1813 if (is<CSSPrimitiveValue>(*value)) {1814 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);1815 if (primitiveValue.getValueID() == CSSValueAuto)1816 setValue(styleResolver->style(), 0);1817 } else if (value->isImageValue() || value->isImageGeneratorValue() || value->isImageSetValue()) {1818 RefPtr<ShapeValue> shape = ShapeValue::createImageValue(styleResolver->styleImage(property, value));1819 setValue(styleResolver->style(), shape.release());1820 } else if (is<CSSValueList>(*value)) {1821 RefPtr<BasicShape> shape;1822 CSSBoxType referenceBox = BoxMissing;1823 CSSValueList& valueList = downcast<CSSValueList>(*value);1824 for (unsigned i = 0; i < valueList.length(); ++i) {1825 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*valueList.itemWithoutBoundsCheck(i));1826 if (primitiveValue.isShape())1827 shape = basicShapeForValue(styleResolver->state().cssToLengthConversionData(), primitiveValue.getShapeValue());1828 else if (primitiveValue.getValueID() == CSSValueContentBox1829 || primitiveValue.getValueID() == CSSValueBorderBox1830 || primitiveValue.getValueID() == CSSValuePaddingBox1831 || primitiveValue.getValueID() == CSSValueMarginBox)1832 referenceBox = CSSBoxType(primitiveValue);1833 else1834 return;1835 }1836 1837 if (shape)1838 setValue(styleResolver->style(), ShapeValue::createShapeValue(shape.release(), referenceBox));1839 else if (referenceBox != BoxMissing)1840 setValue(styleResolver->style(), ShapeValue::createBoxShapeValue(referenceBox));1841 1842 }1843 }1844 1845 static PropertyHandler createHandler()1846 {1847 PropertyHandler handler = ApplyPropertyDefaultBase<ShapeValue*, getterFunction, PassRefPtr<ShapeValue>, setterFunction, ShapeValue*, initialFunction>::createHandler();1848 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);1849 }1850 };1851 #endif1852 1805 1853 1806 #if ENABLE(CSS_IMAGE_RESOLUTION) … … 2071 2024 setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler()); 2072 2025 setPropertyHandler(CSSPropertyWebkitClipPath, ApplyPropertyClipPath<&RenderStyle::clipPath, &RenderStyle::setClipPath, &RenderStyle::initialClipPath>::createHandler()); 2073 #if ENABLE(CSS_SHAPES)2074 setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyShape<&RenderStyle::shapeOutside, &RenderStyle::setShapeOutside, &RenderStyle::initialShapeOutside>::createHandler());2075 #endif2076 2026 setPropertyHandler(CSSPropertyWidows, ApplyPropertyAuto<short, &RenderStyle::widows, &RenderStyle::setWidows, &RenderStyle::hasAutoWidows, &RenderStyle::setHasAutoWidows>::createHandler()); 2077 2027 setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyWordSpacing::createHandler()); -
trunk/Source/WebCore/css/StyleBuilderCustom.h
r175467 r175481 28 28 #define StyleBuilderCustom_h 29 29 30 #include "BasicShapeFunctions.h" 31 #include "CSSImageGeneratorValue.h" 32 #include "CSSImageSetValue.h" 33 #include "CSSImageValue.h" 30 34 #include "StyleResolver.h" 31 35 … … 110 114 } 111 115 116 #if ENABLE(CSS_SHAPES) 117 inline void applyValueWebkitShapeOutside(StyleResolver& styleResolver, CSSValue& value) 118 { 119 if (is<CSSPrimitiveValue>(value)) { 120 // FIXME: Shouldn't this be CSSValueNone? 121 // http://www.w3.org/TR/css-shapes/#shape-outside-property 122 if (downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueAuto) 123 styleResolver.style()->setShapeOutside(nullptr); 124 } if (is<CSSImageValue>(value) || is<CSSImageGeneratorValue>(value) || is<CSSImageSetValue>(value)) { 125 RefPtr<ShapeValue> shape = ShapeValue::createImageValue(styleResolver.styleImage(CSSPropertyWebkitShapeOutside, &value)); 126 styleResolver.style()->setShapeOutside(shape.release()); 127 } else if (is<CSSValueList>(value)) { 128 RefPtr<BasicShape> shape; 129 CSSBoxType referenceBox = BoxMissing; 130 auto& valueList = downcast<CSSValueList>(value); 131 for (unsigned i = 0; i < valueList.length(); ++i) { 132 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*valueList.itemWithoutBoundsCheck(i)); 133 if (primitiveValue.isShape()) 134 shape = basicShapeForValue(styleResolver.state().cssToLengthConversionData(), primitiveValue.getShapeValue()); 135 else if (primitiveValue.getValueID() == CSSValueContentBox 136 || primitiveValue.getValueID() == CSSValueBorderBox 137 || primitiveValue.getValueID() == CSSValuePaddingBox 138 || primitiveValue.getValueID() == CSSValueMarginBox) 139 referenceBox = CSSBoxType(primitiveValue); 140 else 141 return; 142 } 143 144 if (shape) 145 styleResolver.style()->setShapeOutside(ShapeValue::createShapeValue(shape.release(), referenceBox)); 146 else if (referenceBox != BoxMissing) 147 styleResolver.style()->setShapeOutside(ShapeValue::createBoxShapeValue(referenceBox)); 148 } 149 } 150 #endif // ENABLE(CSS_SHAPES) 151 112 152 } // namespace StyleBuilderFunctions 113 153
Note: See TracChangeset
for help on using the changeset viewer.