Changeset 201113 in webkit
- Timestamp:
- May 18, 2016, 4:09:09 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r201109 r201113 1 2016-05-18 Alex Christensen <achristensen@webkit.org> 2 3 Clean up CSS code 4 https://bugs.webkit.org/show_bug.cgi?id=157808 5 6 Reviewed by Chris Dumez. 7 8 No new tests. Just cleaning up and modernizing code. 9 10 * css/BasicShapeFunctions.cpp: 11 (WebCore::convertToCenterCoordinate): 12 (WebCore::cssValueToBasicShapeRadius): 13 (WebCore::basicShapeForValue): 14 * css/BasicShapeFunctions.h: 15 * css/CSSAnimationTriggerScrollValue.h: 16 (WebCore::CSSAnimationTriggerScrollValue::create): 17 (WebCore::CSSAnimationTriggerScrollValue::startValue): 18 (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue): 19 * css/CSSAspectRatioValue.h: 20 * css/CSSBasicShapes.h: 21 * css/CSSBorderImage.cpp: 22 (WebCore::createBorderImageValue): 23 * css/CSSBorderImage.h: 24 * css/CSSBorderImageSliceValue.h: 25 (WebCore::CSSBorderImageSliceValue::create): 26 * css/CSSCalculationValue.h: 27 * css/CSSCanvasValue.h: 28 (WebCore::CSSCanvasValue::CSSCanvasValue): 29 * css/CSSComputedStyleDeclaration.cpp: 30 (WebCore::valueForNinePieceImageSlice): 31 (WebCore::valueForNinePieceImageQuad): 32 (WebCore::valueForNinePieceImage): 33 (WebCore::zoomAdjustedPixelValue): 34 * css/CSSComputedStyleDeclaration.h: 35 * css/CSSFontFaceLoadEvent.cpp: 36 (WebCore::CSSFontFaceLoadEvent::CSSFontFaceLoadEvent): 37 * css/CSSFontFaceLoadEvent.h: 38 * css/CSSFontValue.h: 39 * css/CSSFunctionValue.h: 40 * css/CSSGradientValue.h: 41 (WebCore::CSSGradientValue::setFirstX): 42 (WebCore::CSSGradientValue::setFirstY): 43 (WebCore::CSSGradientValue::setSecondX): 44 (WebCore::CSSGradientValue::setSecondY): 45 (WebCore::CSSGradientValue::addStop): 46 (WebCore::CSSLinearGradientValue::create): 47 (WebCore::CSSLinearGradientValue::setAngle): 48 (WebCore::CSSRadialGradientValue::setFirstRadius): 49 (WebCore::CSSRadialGradientValue::setSecondRadius): 50 (WebCore::CSSRadialGradientValue::setShape): 51 (WebCore::CSSRadialGradientValue::setSizingBehavior): 52 (WebCore::CSSRadialGradientValue::setEndHorizontalSize): 53 (WebCore::CSSRadialGradientValue::setEndVerticalSize): 54 * css/CSSGroupingRule.cpp: 55 (WebCore::CSSGroupingRule::item): 56 (WebCore::CSSGroupingRule::cssRules): 57 * css/CSSKeyframesRule.cpp: 58 (WebCore::CSSKeyframesRule::cssRules): 59 * css/CSSParser.cpp: 60 (WebCore::CSSParser::addProperty): 61 (WebCore::CSSParser::rollbackLastProperties): 62 (WebCore::CSSParser::parseDashboardRegions): 63 (WebCore::CSSParser::parseClipShape): 64 (WebCore::CSSParser::parseBasicShapeCircle): 65 (WebCore::BorderImageParseContext::commitWebKitBorderImage): 66 (WebCore::BorderImageParseContext::commitBorderImage): 67 (WebCore::BorderImageSliceParseContext::commitBorderImageSlice): 68 (WebCore::BorderImageQuadParseContext::commitBorderImageQuad): 69 (WebCore::CSSParser::parseDeprecatedRadialGradient): 70 (WebCore::CSSParser::parseRadialGradient): 71 * css/CSSParser.h: 72 (WebCore::cssyylex): 73 * css/CSSPrimitiveValue.h: 74 * css/CSSProperty.cpp: 75 * css/CSSProperty.h: 76 (WebCore::CSSProperty::CSSProperty): 77 * css/CSSRule.h: 78 * css/CSSRuleList.h: 79 * css/CSSSegmentedFontFace.h: 80 * css/Counter.h: 81 (WebCore::Counter::create): 82 (WebCore::Counter::identifier): 83 (WebCore::Counter::listStyleIdent): 84 (WebCore::Counter::setIdentifier): 85 (WebCore::Counter::setListStyle): 86 (WebCore::Counter::setSeparator): 87 (WebCore::Counter::equals): 88 (WebCore::Counter::cloneForCSSOM): 89 (WebCore::Counter::Counter): 90 * css/Pair.h: 91 * css/Rect.h: 92 (WebCore::RectBase::bottom): 93 (WebCore::RectBase::left): 94 (WebCore::RectBase::setTop): 95 (WebCore::RectBase::setRight): 96 (WebCore::RectBase::setBottom): 97 (WebCore::RectBase::setLeft): 98 (WebCore::RectBase::equals): 99 * css/SVGCSSComputedStyleDeclaration.cpp: 100 (WebCore::strokeDashArrayToCSSValueList): 101 (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor): 102 * css/StyleBuilderConverter.h: 103 (WebCore::StyleBuilderConverter::convertClipPath): 104 (WebCore::StyleBuilderConverter::convertShapeValue): 105 * css/StyleProperties.cpp: 106 (WebCore::StyleProperties::borderPropertyValue): 107 (WebCore::StyleProperties::getPropertyCSSValue): 108 (WebCore::StyleProperties::getPropertyCSSValueInternal): 109 (WebCore::MutableStyleProperties::setCustomProperty): 110 (WebCore::MutableStyleProperties::setProperty): 111 * css/StyleProperties.h: 112 (WebCore::StyleProperties::isEmpty): 113 (isType): 114 * css/StylePropertyShorthand.cpp: 115 * css/StylePropertyShorthand.h: 116 (WebCore::StylePropertyShorthand::StylePropertyShorthand): 117 (WebCore::StylePropertyShorthand::id): 118 * css/StyleResolver.cpp: 119 (WebCore::StyleResolver::appendAuthorStyleSheets): 120 (WebCore::StyleResolver::addKeyframeStyle): 121 (WebCore::StyleResolver::~StyleResolver): 122 (WebCore::StyleResolver::resolvedVariableValue): 123 (WebCore::StyleResolver::styleImage): 124 (WebCore::StyleResolver::cachedOrPendingFromValue): 125 (WebCore::StyleResolver::generatedOrPendingFromValue): 126 (WebCore::StyleResolver::createFilterOperations): 127 (WebCore::StyleResolver::loadPendingImage): 128 * css/StyleResolver.h: 129 (WebCore::StyleResolver::hasViewportDependentMediaQueries): 130 (WebCore::StyleResolver::state): 131 (WebCore::checkRegionSelector): 132 * css/StyleSheetList.h: 133 * css/WebKitCSSFilterValue.cpp: 134 * css/WebKitCSSFilterValue.h: 135 * css/WebKitCSSTransformValue.cpp: 136 * css/WebKitCSSTransformValue.h: 137 * rendering/shapes/Shape.cpp: 138 1 139 2016-05-18 Jer Noble <jer.noble@apple.com> 2 140 -
trunk/Source/WebCore/css/BasicShapeFunctions.cpp
r194496 r201113 189 189 } 190 190 191 static BasicShapeRadius cssValueToBasicShapeRadius(const CSSToLengthConversionData& conversionData, PassRefPtr<CSSPrimitiveValue>radius)191 static BasicShapeRadius cssValueToBasicShapeRadius(const CSSToLengthConversionData& conversionData, CSSPrimitiveValue* radius) 192 192 { 193 193 if (!radius) … … 206 206 } 207 207 208 return BasicShapeRadius(convertToLength(conversionData, radius .get()));209 } 210 211 Ref<BasicShape> basicShapeForValue(const CSSToLengthConversionData& conversionData, const CSSBasicShape *basicShapeValue)208 return BasicShapeRadius(convertToLength(conversionData, radius)); 209 } 210 211 Ref<BasicShape> basicShapeForValue(const CSSToLengthConversionData& conversionData, const CSSBasicShape& basicShapeValue) 212 212 { 213 213 RefPtr<BasicShape> basicShape; 214 214 215 switch (basicShapeValue ->type()) {215 switch (basicShapeValue.type()) { 216 216 case CSSBasicShape::CSSBasicShapeCircleType: { 217 auto& circleValue = downcast<CSSBasicShapeCircle>( *basicShapeValue);217 auto& circleValue = downcast<CSSBasicShapeCircle>(basicShapeValue); 218 218 auto circle = BasicShapeCircle::create(); 219 219 … … 226 226 } 227 227 case CSSBasicShape::CSSBasicShapeEllipseType: { 228 auto& ellipseValue = downcast<CSSBasicShapeEllipse>( *basicShapeValue);228 auto& ellipseValue = downcast<CSSBasicShapeEllipse>(basicShapeValue); 229 229 auto ellipse = BasicShapeEllipse::create(); 230 230 … … 239 239 } 240 240 case CSSBasicShape::CSSBasicShapePolygonType: { 241 auto& polygonValue = downcast<CSSBasicShapePolygon>( *basicShapeValue);241 auto& polygonValue = downcast<CSSBasicShapePolygon>(basicShapeValue); 242 242 auto polygon = BasicShapePolygon::create(); 243 243 … … 251 251 } 252 252 case CSSBasicShape::CSSBasicShapeInsetType: { 253 auto& rectValue = downcast<CSSBasicShapeInset>( *basicShapeValue);253 auto& rectValue = downcast<CSSBasicShapeInset>(basicShapeValue); 254 254 auto rect = BasicShapeInset::create(); 255 255 … … 268 268 } 269 269 case CSSBasicShape::CSSBasicShapePathType: { 270 auto& pathValue = downcast<CSSBasicShapePath>( *basicShapeValue);270 auto& pathValue = downcast<CSSBasicShapePath>(basicShapeValue); 271 271 auto path = BasicShapePath::create(pathValue.pathData().copy()); 272 272 path->setWindRule(pathValue.windRule()); -
trunk/Source/WebCore/css/BasicShapeFunctions.h
r185238 r201113 28 28 */ 29 29 30 #ifndef BasicShapeFunctions_h 31 #define BasicShapeFunctions_h 30 #pragma once 32 31 33 #include "BasicShapes.h" 34 #include <wtf/PassRefPtr.h> 32 #include <wtf/Ref.h> 35 33 36 34 namespace WebCore { 37 35 36 class BasicShape; 37 class BasicShapeCenterCoordinate; 38 38 class CSSBasicShape; 39 class CSSToLengthConversionData;40 class CSSPrimitiveValue;41 39 class CSSToLengthConversionData; 42 40 class CSSValue; … … 44 42 45 43 Ref<CSSValue> valueForBasicShape(const RenderStyle&, const BasicShape&); 46 Ref<BasicShape> basicShapeForValue(const CSSToLengthConversionData&, const CSSBasicShape*); 44 Ref<BasicShape> basicShapeForValue(const CSSToLengthConversionData&, const CSSBasicShape&); 45 float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate&, float); 47 46 48 float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate&, float);49 47 } 50 51 #endif -
trunk/Source/WebCore/css/CSSAnimationTriggerScrollValue.h
r181602 r201113 24 24 */ 25 25 26 #ifndef CSSAnimationTriggerScrollValue_h 27 #define CSSAnimationTriggerScrollValue_h 26 #pragma once 28 27 29 28 #if ENABLE(CSS_ANIMATIONS_LEVEL_2) 30 29 31 30 #include "CSSValue.h" 32 #include <wtf/PassRefPtr.h>33 31 34 32 namespace WebCore { … … 36 34 class CSSAnimationTriggerScrollValue : public CSSValue { 37 35 public: 38 static Ref<CSSAnimationTriggerScrollValue> create( PassRefPtr<CSSValue> startValue, PassRefPtr<CSSValue>endValue = nullptr)36 static Ref<CSSAnimationTriggerScrollValue> create(Ref<CSSValue>&& startValue, RefPtr<CSSValue>&& endValue = nullptr) 39 37 { 40 return adoptRef(*new CSSAnimationTriggerScrollValue( startValue, endValue));38 return adoptRef(*new CSSAnimationTriggerScrollValue(WTFMove(startValue), WTFMove(endValue))); 41 39 } 42 40 … … 50 48 51 49 private: 52 CSSAnimationTriggerScrollValue( PassRefPtr<CSSValue> startValue, PassRefPtr<CSSValue>endValue)50 CSSAnimationTriggerScrollValue(Ref<CSSValue>&& startValue, RefPtr<CSSValue>&& endValue) 53 51 : CSSValue(AnimationTriggerScrollClass) 54 , m_startValue( startValue)55 , m_endValue( endValue)52 , m_startValue(WTFMove(startValue)) 53 , m_endValue(WTFMove(endValue)) 56 54 { 57 55 } … … 66 64 67 65 #endif 68 69 #endif -
trunk/Source/WebCore/css/CSSAspectRatioValue.h
r177259 r201113 27 27 */ 28 28 29 #ifndef CSSAspectRatioValue_h 30 #define CSSAspectRatioValue_h 29 #pragma once 31 30 32 #include "CSSPrimitiveValue.h"33 31 #include "CSSValue.h" 34 32 … … 64 62 65 63 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSAspectRatioValue, isAspectRatioValue()) 66 67 #endif -
trunk/Source/WebCore/css/CSSBasicShapes.h
r197563 r201113 28 28 */ 29 29 30 #ifndef CSSBasicShapes_h 31 #define CSSBasicShapes_h 32 33 #include "CSSPrimitiveValue.h" 30 #pragma once 31 34 32 #include "WindRule.h" 35 33 #include <wtf/RefPtr.h> … … 40 38 namespace WebCore { 41 39 40 class CSSPrimitiveValue; 42 41 class SVGPathByteStream; 43 42 … … 78 77 CSSPrimitiveValue* bottomLeftRadius() const { return m_bottomLeftRadius.get(); } 79 78 80 void setTop( PassRefPtr<CSSPrimitiveValue> top) { m_top = top; }81 void setRight( PassRefPtr<CSSPrimitiveValue> right) { m_right = right; }82 void setBottom( PassRefPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; }83 void setLeft( PassRefPtr<CSSPrimitiveValue> left) { m_left = left; }79 void setTop(RefPtr<CSSPrimitiveValue>&& top) { m_top = WTFMove(top); } 80 void setRight(RefPtr<CSSPrimitiveValue>&& right) { m_right = WTFMove(right); } 81 void setBottom(RefPtr<CSSPrimitiveValue>&& bottom) { m_bottom = WTFMove(bottom); } 82 void setLeft(RefPtr<CSSPrimitiveValue>&& left) { m_left = WTFMove(left); } 84 83 85 84 void updateShapeSize4Values(CSSPrimitiveValue* top, CSSPrimitiveValue* right, CSSPrimitiveValue* bottom, CSSPrimitiveValue* left) … … 106 105 } 107 106 108 void setTopLeftRadius( PassRefPtr<CSSPrimitiveValue> radius) { m_topLeftRadius = radius; }109 void setTopRightRadius( PassRefPtr<CSSPrimitiveValue> radius) { m_topRightRadius = radius; }110 void setBottomRightRadius( PassRefPtr<CSSPrimitiveValue> radius) { m_bottomRightRadius = radius; }111 void setBottomLeftRadius( PassRefPtr<CSSPrimitiveValue> radius) { m_bottomLeftRadius = radius; }107 void setTopLeftRadius(RefPtr<CSSPrimitiveValue>&& radius) { m_topLeftRadius = WTFMove(radius); } 108 void setTopRightRadius(RefPtr<CSSPrimitiveValue>&& radius) { m_topRightRadius = WTFMove(radius); } 109 void setBottomRightRadius(RefPtr<CSSPrimitiveValue>&& radius) { m_bottomRightRadius = WTFMove(radius); } 110 void setBottomLeftRadius(RefPtr<CSSPrimitiveValue>&& radius) { m_bottomLeftRadius = WTFMove(radius); } 112 111 113 112 private: … … 137 136 CSSPrimitiveValue* radius() const { return m_radius.get(); } 138 137 139 void setCenterX( PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX; }140 void setCenterY( PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }141 void setRadius( PassRefPtr<CSSPrimitiveValue> radius) { m_radius = radius; }138 void setCenterX(RefPtr<CSSPrimitiveValue>&& centerX) { m_centerX = WTFMove(centerX); } 139 void setCenterY(RefPtr<CSSPrimitiveValue>&& centerY) { m_centerY = WTFMove(centerY); } 140 void setRadius(RefPtr<CSSPrimitiveValue>&& radius) { m_radius = WTFMove(radius); } 142 141 143 142 private: … … 249 248 SPECIALIZE_TYPE_TRAITS_CSS_BASIC_SHAPES(CSSBasicShapePolygon) 250 249 SPECIALIZE_TYPE_TRAITS_CSS_BASIC_SHAPES(CSSBasicShapePath) 251 252 #endif // CSSBasicShapes_h -
trunk/Source/WebCore/css/CSSBorderImage.cpp
r194496 r201113 21 21 #include "CSSBorderImage.h" 22 22 23 #include "CSSValueList.h" 24 23 25 namespace WebCore { 24 26 25 Ref<CSSValueList> createBorderImageValue( PassRefPtr<CSSValue> image, PassRefPtr<CSSValue> imageSlice, PassRefPtr<CSSValue> borderSlice, PassRefPtr<CSSValue> outset, PassRefPtr<CSSValue>repeat)27 Ref<CSSValueList> createBorderImageValue(RefPtr<CSSValue>&& image, RefPtr<CSSValue>&& imageSlice, RefPtr<CSSValue>&& borderSlice, RefPtr<CSSValue>&& outset, RefPtr<CSSValue>&& repeat) 26 28 { 27 29 auto list = CSSValueList::createSpaceSeparated(); … … 32 34 auto listSlash = CSSValueList::createSlashSeparated(); 33 35 if (imageSlice) 34 listSlash.get().append( *imageSlice);36 listSlash.get().append(imageSlice.releaseNonNull()); 35 37 36 38 if (borderSlice) 37 listSlash.get().append( *borderSlice);39 listSlash.get().append(borderSlice.releaseNonNull()); 38 40 39 41 if (outset) 40 listSlash.get().append( *outset);42 listSlash.get().append(outset.releaseNonNull()); 41 43 42 44 list.get().append(WTFMove(listSlash)); 43 45 } else if (imageSlice) 44 list.get().append( *imageSlice);46 list.get().append(imageSlice.releaseNonNull()); 45 47 if (repeat) 46 list.get().append( *repeat);48 list.get().append(repeat.releaseNonNull()); 47 49 return list; 48 50 } -
trunk/Source/WebCore/css/CSSBorderImage.h
r177259 r201113 18 18 */ 19 19 20 #ifndef CSSBorderImage_h 21 #define CSSBorderImage_h 20 #pragma once 22 21 23 #include "CSSBorderImageSliceValue.h"24 #include "CSSValueList.h"25 #include <wtf/PassRefPtr.h>26 22 #include <wtf/RefPtr.h> 27 23 28 24 namespace WebCore { 29 25 30 Ref<CSSValueList> createBorderImageValue(PassRefPtr<CSSValue> image, PassRefPtr<CSSValue> imageSlice, PassRefPtr<CSSValue> borderSlice, PassRefPtr<CSSValue> outset, PassRefPtr<CSSValue> repeat); 26 class CSSValue; 27 class CSSValueList; 28 29 Ref<CSSValueList> createBorderImageValue(RefPtr<CSSValue>&& image, RefPtr<CSSValue>&& imageSlice, RefPtr<CSSValue>&& borderSlice, RefPtr<CSSValue>&& outset, RefPtr<CSSValue>&& repeat); 31 30 32 31 } // namespace WebCore 33 34 #endif // CSSBorderImage_h -
trunk/Source/WebCore/css/CSSBorderImageSliceValue.cpp
r165676 r201113 32 32 namespace WebCore { 33 33 34 CSSBorderImageSliceValue::CSSBorderImageSliceValue( PassRefPtr<CSSPrimitiveValue>slices, bool fill)34 CSSBorderImageSliceValue::CSSBorderImageSliceValue(RefPtr<CSSPrimitiveValue>&& slices, bool fill) 35 35 : CSSValue(BorderImageSliceClass) 36 , m_slices( slices)36 , m_slices(WTFMove(slices)) 37 37 , m_fill(fill) 38 38 { -
trunk/Source/WebCore/css/CSSBorderImageSliceValue.h
r196991 r201113 24 24 */ 25 25 26 #ifndef CSSBorderImageSliceValue_h 27 #define CSSBorderImageSliceValue_h 26 #pragma once 28 27 29 28 #include "CSSPrimitiveValue.h" 30 #include <wtf/PassRefPtr.h>31 29 #include <wtf/RefPtr.h> 32 30 … … 37 35 class CSSBorderImageSliceValue : public CSSValue { 38 36 public: 39 static Ref<CSSBorderImageSliceValue> create( PassRefPtr<CSSPrimitiveValue>slices, bool fill)37 static Ref<CSSBorderImageSliceValue> create(RefPtr<CSSPrimitiveValue>&& slices, bool fill) 40 38 { 41 return adoptRef(*new CSSBorderImageSliceValue( slices, fill));39 return adoptRef(*new CSSBorderImageSliceValue(WTFMove(slices), fill)); 42 40 } 43 41 … … 54 52 55 53 private: 56 CSSBorderImageSliceValue( PassRefPtr<CSSPrimitiveValue>slices, bool fill);54 CSSBorderImageSliceValue(RefPtr<CSSPrimitiveValue>&& slices, bool fill); 57 55 }; 58 56 … … 60 58 61 59 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSBorderImageSliceValue, isBorderImageSliceValue()) 62 63 #endif // CSSBorderImageSliceValue_h -
trunk/Source/WebCore/css/CSSCalculationValue.h
r195452 r201113 29 29 */ 30 30 31 #ifndef CSSCalculationValue_h 32 #define CSSCalculationValue_h 31 #pragma once 33 32 34 33 #include "CSSPrimitiveValue.h" … … 135 134 136 135 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCalcValue, isCalcValue()) 137 138 #endif // CSSCalculationValue_h -
trunk/Source/WebCore/css/CSSCanvasValue.h
r197563 r201113 24 24 */ 25 25 26 #ifndef CSSCanvasValue_h 27 #define CSSCanvasValue_h 26 #pragma once 28 27 29 28 #include "CSSImageGeneratorValue.h" … … 33 32 34 33 class Document; 34 class HTMLCanvasElement; 35 35 36 36 class CSSCanvasValue : public CSSImageGeneratorValue { … … 55 55 , m_canvasObserver(*this) 56 56 , m_name(name) 57 , m_element(0)58 57 { 59 58 } … … 100 99 String m_name; 101 100 // The document supplies the element and owns it. 102 HTMLCanvasElement* m_element ;101 HTMLCanvasElement* m_element { nullptr }; 103 102 }; 104 103 … … 107 106 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCanvasValue, isCanvasValue()) 108 107 109 #endif // CSSCanvasValue_h -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r200821 r201113 33 33 #include "CSSBasicShapes.h" 34 34 #include "CSSBorderImage.h" 35 #include "CSSBorderImageSliceValue.h" 35 36 #include "CSSCustomPropertyValue.h" 36 37 #include "CSSFontFeatureValue.h" … … 65 66 #include "StyleProperties.h" 66 67 #include "StylePropertyShorthand.h" 68 #include "StylePropertyShorthandFunctions.h" 67 69 #include "StyleResolver.h" 68 70 #include "WebKitCSSFilterValue.h" … … 539 541 540 542 auto quad = Quad::create(); 541 quad->setTop( top.release());542 quad->setRight( right.release());543 quad->setBottom( bottom.release());544 quad->setLeft( left.release());543 quad->setTop(WTFMove(top)); 544 quad->setRight(WTFMove(right)); 545 quad->setBottom(WTFMove(bottom)); 546 quad->setLeft(WTFMove(left)); 545 547 546 548 return CSSBorderImageSliceValue::create(CSSValuePool::singleton().createValue(WTFMove(quad)), image.fill()); … … 592 594 593 595 auto quad = Quad::create(); 594 quad->setTop( top);595 quad->setRight( right);596 quad->setBottom( bottom);597 quad->setLeft( left);596 quad->setTop(WTFMove(top)); 597 quad->setRight(WTFMove(right)); 598 quad->setBottom(WTFMove(bottom)); 599 quad->setLeft(WTFMove(left)); 598 600 599 601 return cssValuePool.createValue(WTFMove(quad)); … … 635 637 RefPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image); 636 638 637 return createBorderImageValue( imageValue.release(), imageSlices.release(), borderSlices.release(), outset.release(), repeat.release());639 return createBorderImageValue(WTFMove(imageValue), WTFMove(imageSlices), WTFMove(borderSlices), WTFMove(outset), WTFMove(repeat)); 638 640 } 639 641 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h
r200098 r201113 71 71 72 72 RefPtr<CSSValue> svgPropertyValue(CSSPropertyID, EUpdateLayout) const; 73 RefPtr<SVGPaint> adjustSVGPaintForCurrentColor( PassRefPtr<SVGPaint>, const RenderStyle*) const;73 RefPtr<SVGPaint> adjustSVGPaintForCurrentColor(RefPtr<SVGPaint>&&, const RenderStyle*) const; 74 74 75 75 static Ref<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle&, AdjustPixelValuesForComputedStyle = AdjustPixelValues); -
trunk/Source/WebCore/css/CSSFontFaceLoadEvent.cpp
r156241 r201113 40 40 } 41 41 42 CSSFontFaceLoadEvent::CSSFontFaceLoadEvent(const AtomicString& type, PassRefPtr<CSSFontFaceRule> fontface, PassRefPtr<DOMError>error)42 CSSFontFaceLoadEvent::CSSFontFaceLoadEvent(const AtomicString& type, RefPtr<CSSFontFaceRule>&& fontface, RefPtr<DOMError>&& error) 43 43 : Event(type, false, false) 44 , m_fontface( fontface)45 , m_error( error)44 , m_fontface(WTFMove(fontface)) 45 , m_error(WTFMove(error)) 46 46 { 47 47 } -
trunk/Source/WebCore/css/CSSFontFaceLoadEvent.h
r197563 r201113 29 29 */ 30 30 31 #pragma once 32 31 33 #if ENABLE(FONT_LOAD_EVENTS) 32 33 #ifndef CSSFontFaceLoadEvent_h34 #define CSSFontFaceLoadEvent_h35 34 36 35 #include "CSSFontFaceRule.h" 37 36 #include "CSSValue.h" 38 #include "DOMError.h"39 37 #include "Event.h" 40 38 #include "EventNames.h" 41 #include <wtf/PassRefPtr.h>42 39 #include <wtf/RefPtr.h> 43 40 44 41 namespace WebCore { 42 43 class DOMError; 45 44 46 45 struct CSSFontFaceLoadEventInit : public EventInit { … … 61 60 } 62 61 63 static Ref<CSSFontFaceLoadEvent> createForFontFaceRule(const AtomicString& type, PassRefPtr<CSSFontFaceRule>rule)62 static Ref<CSSFontFaceLoadEvent> createForFontFaceRule(const AtomicString& type, RefPtr<CSSFontFaceRule>&& rule) 64 63 { 65 return adoptRef<CSSFontFaceLoadEvent>(*new CSSFontFaceLoadEvent(type, rule, 0));64 return adoptRef<CSSFontFaceLoadEvent>(*new CSSFontFaceLoadEvent(type, WTFMove(rule), nullptr)); 66 65 } 67 66 68 static Ref<CSSFontFaceLoadEvent> createForError( PassRefPtr<CSSFontFaceRule> rule, PassRefPtr<DOMError>error)67 static Ref<CSSFontFaceLoadEvent> createForError(RefPtr<CSSFontFaceRule>&& rule, RefPtr<DOMError>&& error) 69 68 { 70 return adoptRef<CSSFontFaceLoadEvent>(*new CSSFontFaceLoadEvent(eventNames().errorEvent, rule, error));69 return adoptRef<CSSFontFaceLoadEvent>(*new CSSFontFaceLoadEvent(eventNames().errorEvent, WTFMove(rule), WTFMove(error))); 71 70 } 72 71 … … 80 79 private: 81 80 CSSFontFaceLoadEvent(); 82 CSSFontFaceLoadEvent(const AtomicString&, PassRefPtr<CSSFontFaceRule>, PassRefPtr<DOMError>);81 CSSFontFaceLoadEvent(const AtomicString&, RefPtr<CSSFontFaceRule>&&, RefPtr<DOMError>&&); 83 82 CSSFontFaceLoadEvent(const AtomicString&, const CSSFontFaceLoadEventInit&); 84 83 … … 89 88 } // namespace WebCore 90 89 91 #endif // CSSFontFaceLoadEvent_h92 90 #endif // ENABLE(FONT_LOAD_EVENTS) -
trunk/Source/WebCore/css/CSSFontValue.h
r177259 r201113 19 19 */ 20 20 21 #ifndef CSSFontValue_h 22 #define CSSFontValue_h 21 #pragma once 23 22 24 23 #include "CSSValue.h" 25 #include <wtf/PassRefPtr.h>26 24 #include <wtf/RefPtr.h> 27 25 … … 59 57 60 58 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSFontValue, isFontValue()) 61 62 #endif -
trunk/Source/WebCore/css/CSSFunctionValue.h
r191128 r201113 24 24 */ 25 25 26 #ifndef CSSFunctionValue_h 27 #define CSSFunctionValue_h 26 #pragma once 28 27 29 28 #include "CSSValue.h" … … 66 65 67 66 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSFunctionValue, isFunctionValue()) 68 69 #endif70 -
trunk/Source/WebCore/css/CSSGradientValue.h
r188315 r201113 24 24 */ 25 25 26 #ifndef CSSGradientValue_h 27 #define CSSGradientValue_h 26 #pragma once 28 27 29 28 #include "CSSImageGeneratorValue.h" … … 65 64 RefPtr<Image> image(RenderElement*, const FloatSize&); 66 65 67 void setFirstX( PassRefPtr<CSSPrimitiveValue> val) { m_firstX = val; }68 void setFirstY( PassRefPtr<CSSPrimitiveValue> val) { m_firstY = val; }69 void setSecondX( PassRefPtr<CSSPrimitiveValue> val) { m_secondX = val; }70 void setSecondY( PassRefPtr<CSSPrimitiveValue> val) { m_secondY = val; }66 void setFirstX(RefPtr<CSSPrimitiveValue>&& val) { m_firstX = WTFMove(val); } 67 void setFirstY(RefPtr<CSSPrimitiveValue>&& val) { m_firstY = WTFMove(val); } 68 void setSecondX(RefPtr<CSSPrimitiveValue>&& val) { m_secondX = WTFMove(val); } 69 void setSecondY(RefPtr<CSSPrimitiveValue>&& val) { m_secondY = WTFMove(val); } 71 70 72 71 void addStop(const CSSGradientColorStop& stop) { m_stops.append(stop); } … … 140 139 } 141 140 142 void setAngle( PassRefPtr<CSSPrimitiveValue> val) { m_angle = val; }141 void setAngle(RefPtr<CSSPrimitiveValue>&& val) { m_angle = WTFMove(val); } 143 142 144 143 String customCSSText() const; … … 183 182 String customCSSText() const; 184 183 185 void setFirstRadius( PassRefPtr<CSSPrimitiveValue> val) { m_firstRadius = val; }186 void setSecondRadius( PassRefPtr<CSSPrimitiveValue> val) { m_secondRadius = val; }187 188 void setShape( PassRefPtr<CSSPrimitiveValue> val) { m_shape = val; }189 void setSizingBehavior( PassRefPtr<CSSPrimitiveValue> val) { m_sizingBehavior = val; }190 191 void setEndHorizontalSize( PassRefPtr<CSSPrimitiveValue> val) { m_endHorizontalSize = val; }192 void setEndVerticalSize( PassRefPtr<CSSPrimitiveValue> val) { m_endVerticalSize = val; }184 void setFirstRadius(RefPtr<CSSPrimitiveValue>&& val) { m_firstRadius = WTFMove(val); } 185 void setSecondRadius(RefPtr<CSSPrimitiveValue>&& val) { m_secondRadius = WTFMove(val); } 186 187 void setShape(RefPtr<CSSPrimitiveValue>&& val) { m_shape = WTFMove(val); } 188 void setSizingBehavior(RefPtr<CSSPrimitiveValue>&& val) { m_sizingBehavior = WTFMove(val); } 189 190 void setEndHorizontalSize(RefPtr<CSSPrimitiveValue>&& val) { m_endHorizontalSize = WTFMove(val); } 191 void setEndVerticalSize(RefPtr<CSSPrimitiveValue>&& val) { m_endVerticalSize = WTFMove(val); } 193 192 194 193 // Create the gradient for a given size. … … 235 234 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSLinearGradientValue, isLinearGradientValue()) 236 235 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSRadialGradientValue, isRadialGradientValue()) 237 238 #endif // CSSGradientValue_h -
trunk/Source/WebCore/css/CSSGroupingRule.cpp
r174256 r201113 134 134 { 135 135 if (index >= length()) 136 return 0;136 return nullptr; 137 137 ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size()); 138 138 RefPtr<CSSRule>& rule = m_childRuleCSSOMWrappers[index]; … … 145 145 { 146 146 if (!m_ruleListCSSOMWrapper) 147 m_ruleListCSSOMWrapper = std::make_unique<LiveCSSRuleList<CSSGroupingRule>>(const_cast<CSSGroupingRule *>(this));147 m_ruleListCSSOMWrapper = std::make_unique<LiveCSSRuleList<CSSGroupingRule>>(const_cast<CSSGroupingRule&>(*this)); 148 148 return *m_ruleListCSSOMWrapper; 149 149 } -
trunk/Source/WebCore/css/CSSKeyframesRule.cpp
r191132 r201113 194 194 { 195 195 if (!m_ruleListCSSOMWrapper) 196 m_ruleListCSSOMWrapper = std::make_unique<LiveCSSRuleList<CSSKeyframesRule>>( this);196 m_ruleListCSSOMWrapper = std::make_unique<LiveCSSRuleList<CSSKeyframesRule>>(*this); 197 197 return *m_ruleListCSSOMWrapper; 198 198 } -
trunk/Source/WebCore/css/CSSParser.cpp
r201103 r201113 33 33 #include "CSSBasicShapes.h" 34 34 #include "CSSBorderImage.h" 35 #include "CSSBorderImageSliceValue.h" 35 36 #include "CSSCanvasValue.h" 36 37 #include "CSSContentDistributionValue.h" … … 91 92 #include "StyleProperties.h" 92 93 #include "StylePropertyShorthand.h" 94 #include "StylePropertyShorthandFunctions.h" 93 95 #include "StyleRule.h" 94 96 #include "StyleRuleImport.h" … … 1647 1649 // This property doesn't belong to a shorthand or is a CSS variable (which will be resolved later). 1648 1650 if (!m_currentShorthand) { 1649 m_parsedProperties.append(CSSProperty(propId, value, important, false, CSSPropertyInvalid, m_implicitShorthand || implicit));1651 m_parsedProperties.append(CSSProperty(propId, WTFMove(value), important, false, CSSPropertyInvalid, m_implicitShorthand || implicit)); 1650 1652 return; 1651 1653 } … … 1653 1655 Vector<StylePropertyShorthand> shorthands = matchingShorthandsForLonghand(propId); 1654 1656 if (shorthands.size() == 1) 1655 m_parsedProperties.append(CSSProperty(propId, value, important, true, CSSPropertyInvalid, m_implicitShorthand || implicit));1657 m_parsedProperties.append(CSSProperty(propId, WTFMove(value), important, true, CSSPropertyInvalid, m_implicitShorthand || implicit)); 1656 1658 else 1657 m_parsedProperties.append(CSSProperty(propId, value, important, true, indexOfShorthandForLonghand(m_currentShorthand, shorthands), m_implicitShorthand || implicit));1659 m_parsedProperties.append(CSSProperty(propId, WTFMove(value), important, true, indexOfShorthandForLonghand(m_currentShorthand, shorthands), m_implicitShorthand || implicit)); 1658 1660 } 1659 1661 … … 1881 1883 } 1882 1884 1883 void CSSParser::addExpandedPropertyForValue(CSSPropertyID propId, RefPtr<CSSValue>&& prpValue, bool important)1885 void CSSParser::addExpandedPropertyForValue(CSSPropertyID propId, RefPtr<CSSValue>&& value, bool important) 1884 1886 { 1885 1887 const StylePropertyShorthand& shorthand = shorthandForProperty(propId); 1886 1888 unsigned shorthandLength = shorthand.length(); 1887 1889 if (!shorthandLength) { 1888 addProperty(propId, WTFMove( prpValue), important);1890 addProperty(propId, WTFMove(value), important); 1889 1891 return; 1890 1892 } 1891 1893 1892 RefPtr<CSSValue> value = prpValue;1893 1894 ShorthandScope scope(this, propId); 1894 1895 const CSSPropertyID* longhands = shorthand.properties(); 1895 1896 for (unsigned i = 0; i < shorthandLength; ++i) 1896 addProperty(longhands[i], WTFMove(value), important);1897 addProperty(longhands[i], value.copyRef(), important); 1897 1898 } 1898 1899 … … 5115 5116 return nullptr; 5116 5117 5117 Ref Ptr<CSSValue> startValue = createPrimitiveNumericValue(firstArgumentWithCalculation);5118 Ref<CSSValue> startValue = createPrimitiveNumericValue(firstArgumentWithCalculation); 5118 5119 5119 5120 argument = args->next(); 5120 5121 5121 5122 if (!argument) 5122 return CSSAnimationTriggerScrollValue::create( startValue.release());5123 return CSSAnimationTriggerScrollValue::create(WTFMove(startValue)); 5123 5124 5124 5125 if (!isComma(argument)) … … 5130 5131 return nullptr; 5131 5132 5132 Ref Ptr<CSSValue> endValue = createPrimitiveNumericValue(secondArgumentWithCalculation);5133 5134 return CSSAnimationTriggerScrollValue::create( startValue.release(), endValue.release());5133 Ref<CSSValue> endValue = createPrimitiveNumericValue(secondArgumentWithCalculation); 5134 5135 return CSSAnimationTriggerScrollValue::create(WTFMove(startValue), WTFMove(endValue)); 5135 5136 } 5136 5137 … … 6235 6236 RefPtr<CSSPrimitiveValue> amount = CSSValuePool::singleton().createIdentifierValue(CSSValueInvalid); 6236 6237 6237 region->setTop(amount );6238 region->setRight(amount );6239 region->setBottom(amount );6240 region->setLeft( amount);6238 region->setTop(amount.copyRef()); 6239 region->setRight(amount.copyRef()); 6240 region->setBottom(amount.copyRef()); 6241 region->setLeft(WTFMove(amount)); 6241 6242 } else { 6242 6243 // Next four arguments must be offset numbers … … 6253 6254 6254 6255 if (i == 0) 6255 region->setTop( amount);6256 region->setTop(WTFMove(amount)); 6256 6257 else if (i == 1) 6257 region->setRight( amount);6258 region->setRight(WTFMove(amount)); 6258 6259 else if (i == 2) 6259 region->setBottom( amount);6260 region->setBottom(WTFMove(amount)); 6260 6261 else 6261 region->setLeft( amount);6262 region->setLeft(WTFMove(amount)); 6262 6263 } 6263 6264 } … … 6471 6472 RefPtr<CSSPrimitiveValue> length = argument->id == CSSValueAuto ? CSSValuePool::singleton().createIdentifierValue(CSSValueAuto) : createPrimitiveNumericValue(argumentWithCalculation); 6472 6473 if (i == 0) 6473 rect->setTop( length);6474 rect->setTop(WTFMove(length)); 6474 6475 else if (i == 1) 6475 rect->setRight( length);6476 rect->setRight(WTFMove(length)); 6476 6477 else if (i == 2) 6477 rect->setBottom( length);6478 rect->setBottom(WTFMove(length)); 6478 6479 else 6479 rect->setLeft( length);6480 rect->setLeft(WTFMove(length)); 6480 6481 argument = args->next(); 6481 6482 if (argument && args->size() == 7) { … … 6652 6653 if (!args.currentIndex() && argument->id != CSSValueAt) { 6653 6654 if (RefPtr<CSSPrimitiveValue> radius = parseShapeRadius(*argument)) { 6654 shape->setRadius( radius);6655 shape->setRadius(WTFMove(radius)); 6655 6656 continue; 6656 6657 } … … 6664 6665 parseFillPosition(args, centerX, centerY); 6665 6666 if (centerX && centerY && !args.current()) { 6666 shape->setCenterX( centerX);6667 shape->setCenterY( centerY);6667 shape->setCenterX(WTFMove(centerX)); 6668 shape->setCenterY(WTFMove(centerY)); 6668 6669 } else 6669 6670 return nullptr; … … 8246 8247 RefPtr<CSSValue> commitWebKitBorderImage() 8247 8248 { 8248 return createBorderImageValue(m_image , m_imageSlice, m_borderSlice, m_outset, m_repeat);8249 return createBorderImageValue(m_image.copyRef(), m_imageSlice.copyRef(), m_borderSlice.copyRef(), m_outset.copyRef(), m_repeat.copyRef()); 8249 8250 } 8250 8251 … … 8448 8449 // Now build a rect value to hold all four of our primitive values. 8449 8450 auto quad = Quad::create(); 8450 quad->setTop(m_top );8451 quad->setRight(m_right );8452 quad->setBottom(m_bottom );8453 quad->setLeft(m_left );8451 quad->setTop(m_top.copyRef()); 8452 quad->setRight(m_right.copyRef()); 8453 quad->setBottom(m_bottom.copyRef()); 8454 quad->setLeft(m_left.copyRef()); 8454 8455 8455 8456 // Make our new border image value now. … … 8566 8567 // Now build a quad value to hold all four of our primitive values. 8567 8568 auto quad = Quad::create(); 8568 quad->setTop(m_top );8569 quad->setRight(m_right );8570 quad->setBottom(m_bottom );8571 quad->setLeft(m_left );8569 quad->setTop(m_top.copyRef()); 8570 quad->setRight(m_right.copyRef()); 8571 quad->setBottom(m_bottom.copyRef()); 8572 quad->setLeft(m_left.copyRef()); 8572 8573 8573 8574 // Make our new value now. … … 9110 9111 } 9111 9112 9112 result->setFirstX(centerX );9113 result->setSecondX( centerX);9113 result->setFirstX(centerX.copyRef()); 9114 result->setSecondX(WTFMove(centerX)); 9114 9115 // CSS3 radial gradients always share the same start and end point. 9115 result->setFirstY(centerY );9116 result->setSecondY( centerY);9116 result->setFirstY(centerY.copyRef()); 9117 result->setSecondY(WTFMove(centerY)); 9117 9118 9118 9119 RefPtr<CSSPrimitiveValue> shapeValue; … … 9153 9154 } 9154 9155 9155 result->setShape(shapeValue );9156 result->setSizingBehavior(sizeValue );9156 result->setShape(shapeValue.copyRef()); 9157 result->setSizingBehavior(sizeValue.copyRef()); 9157 9158 9158 9159 // Or, two lengths or percentages … … 9186 9187 return false; 9187 9188 9188 result->setEndHorizontalSize( horizontalSize);9189 result->setEndVerticalSize( verticalSize);9189 result->setEndHorizontalSize(WTFMove(horizontalSize)); 9190 result->setEndVerticalSize(WTFMove(verticalSize)); 9190 9191 9191 9192 if (!parseGradientColorStops(*args, *result, expectComma)) … … 9356 9357 return false; 9357 9358 9358 result->setShape(shapeValue );9359 result->setSizingBehavior(sizeValue );9360 result->setEndHorizontalSize(horizontalSize );9361 result->setEndVerticalSize(verticalSize );9359 result->setShape(shapeValue.copyRef()); 9360 result->setSizingBehavior(sizeValue.copyRef()); 9361 result->setEndHorizontalSize(horizontalSize.copyRef()); 9362 result->setEndVerticalSize(verticalSize.copyRef()); 9362 9363 9363 9364 // Second part of grammar, the center-position clause: … … 9378 9379 return false; 9379 9380 9380 result->setFirstX(centerX );9381 result->setFirstY(centerY );9381 result->setFirstX(centerX.copyRef()); 9382 result->setFirstY(centerY.copyRef()); 9382 9383 // Right now, CSS radial gradients have the same start and end centers. 9383 result->setSecondX(centerX );9384 result->setSecondY(centerY );9384 result->setSecondX(centerX.copyRef()); 9385 result->setSecondY(centerY.copyRef()); 9385 9386 } 9386 9387 -
trunk/Source/WebCore/css/CSSParser.h
r201090 r201113 21 21 */ 22 22 23 #ifndef CSSParser_h 24 #define CSSParser_h 23 #pragma once 25 24 26 25 #include "CSSCalculationValue.h" … … 779 778 780 779 } // namespace WebCore 781 782 #endif // CSSParser_h -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r200789 r201113 20 20 */ 21 21 22 #ifndef CSSPrimitiveValue_h 23 #define CSSPrimitiveValue_h 22 #pragma once 24 23 25 24 #include "CSSPropertyNames.h" … … 470 469 471 470 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSPrimitiveValue, isPrimitiveValue()) 472 473 #endif // CSSPrimitiveValue_h -
trunk/Source/WebCore/css/CSSProperty.cpp
r194496 r201113 25 25 #include "RenderStyleConstants.h" 26 26 #include "StylePropertyShorthand.h" 27 #include "StylePropertyShorthandFunctions.h" 27 28 28 29 #include <wtf/NeverDestroyed.h> -
trunk/Source/WebCore/css/CSSProperty.h
r200977 r201113 20 20 */ 21 21 22 #ifndef CSSProperty_h 23 #define CSSProperty_h 22 #pragma once 24 23 25 24 #include "CSSPropertyNames.h" 26 25 #include "CSSValue.h" 27 #include "RenderStyleConstants.h"28 26 #include "WritingMode.h" 29 #include <wtf/PassRefPtr.h>30 27 #include <wtf/RefPtr.h> 31 28 … … 65 62 class CSSProperty { 66 63 public: 67 CSSProperty(CSSPropertyID propertyID, PassRefPtr<CSSValue>value, bool important = false, bool isSetFromShorthand = false, int indexInShorthandsVector = 0, bool implicit = false)64 CSSProperty(CSSPropertyID propertyID, RefPtr<CSSValue>&& value, bool important = false, bool isSetFromShorthand = false, int indexInShorthandsVector = 0, bool implicit = false) 68 65 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, important, implicit, isInheritedProperty(propertyID)) 69 , m_value( value)66 , m_value(WTFMove(value)) 70 67 { 71 68 } … … 181 178 }; 182 179 } 183 184 #endif // CSSProperty_h -
trunk/Source/WebCore/css/CSSRule.h
r176157 r201113 21 21 */ 22 22 23 #ifndef CSSRule_h 24 #define CSSRule_h 23 #pragma once 25 24 26 25 #include <wtf/RefCounted.h> … … 124 123 SPECIALIZE_TYPE_TRAITS_END() 125 124 126 #endif // CSSRule_h -
trunk/Source/WebCore/css/CSSRuleList.h
r197563 r201113 20 20 */ 21 21 22 #ifndef CSSRuleList_h 23 #define CSSRuleList_h 22 #pragma once 24 23 25 #include <wtf/PassRefPtr.h>26 24 #include <wtf/RefCounted.h> 27 25 #include <wtf/RefPtr.h> 28 26 #include <wtf/Vector.h> 29 #include <wtf/text/WTFString.h>30 27 31 28 namespace WebCore { … … 77 74 class LiveCSSRuleList final : public CSSRuleList { 78 75 public: 79 LiveCSSRuleList(Rule* rule) : m_rule(rule) { } 76 LiveCSSRuleList(Rule& rule) 77 : m_rule(rule) 78 { 79 } 80 80 81 void ref() override { m_rule ->ref(); }82 void deref() override { m_rule ->deref(); }81 void ref() override { m_rule.ref(); } 82 void deref() override { m_rule.deref(); } 83 83 84 84 private: 85 unsigned length() const override { return m_rule ->length(); }86 CSSRule* item(unsigned index) const override { return m_rule ->item(index); }87 CSSStyleSheet* styleSheet() const override { return m_rule ->parentStyleSheet(); }85 unsigned length() const override { return m_rule.length(); } 86 CSSRule* item(unsigned index) const override { return m_rule.item(index); } 87 CSSStyleSheet* styleSheet() const override { return m_rule.parentStyleSheet(); } 88 88 89 Rule *m_rule;89 Rule& m_rule; 90 90 }; 91 91 92 92 } // namespace WebCore 93 94 #endif // CSSRuleList_h -
trunk/Source/WebCore/css/CSSSegmentedFontFace.h
r197804 r201113 29 29 #include "CSSFontFace.h" 30 30 #include "FontCache.h" 31 #include "FontRanges.h"32 31 #include <wtf/HashMap.h> 33 #include <wtf/PassRefPtr.h>34 32 #include <wtf/RefCounted.h> 35 33 #include <wtf/Vector.h> … … 39 37 class CSSFontSelector; 40 38 class FontDescription; 39 class FontRanges; 41 40 42 41 class CSSSegmentedFontFace final : public RefCounted<CSSSegmentedFontFace>, public CSSFontFace::Client { -
trunk/Source/WebCore/css/Counter.h
r178951 r201113 19 19 */ 20 20 21 #ifndef Counter_h 22 #define Counter_h 21 #pragma once 23 22 24 23 #include "CSSPrimitiveValue.h" … … 29 28 class Counter : public RefCounted<Counter> { 30 29 public: 31 static Ref<Counter> create( PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue>separator)30 static Ref<Counter> create(RefPtr<CSSPrimitiveValue>&& identifier, RefPtr<CSSPrimitiveValue>&& listStyle, RefPtr<CSSPrimitiveValue>&& separator) 32 31 { 33 return adoptRef(*new Counter( identifier, listStyle, separator));32 return adoptRef(*new Counter(WTFMove(identifier), WTFMove(listStyle), WTFMove(separator))); 34 33 } 35 34 … … 40 39 CSSValueID listStyleIdent() const { return m_listStyle ? m_listStyle->getValueID() : CSSValueInvalid; } 41 40 42 void setIdentifier( PassRefPtr<CSSPrimitiveValue> identifier) { m_identifier = identifier; }43 void setListStyle( PassRefPtr<CSSPrimitiveValue> listStyle) { m_listStyle = listStyle; }44 void setSeparator( PassRefPtr<CSSPrimitiveValue> separator) { m_separator = separator; }41 void setIdentifier(RefPtr<CSSPrimitiveValue>&& identifier) { m_identifier = WTFMove(identifier); } 42 void setListStyle(RefPtr<CSSPrimitiveValue>&& listStyle) { m_listStyle = WTFMove(listStyle); } 43 void setSeparator(RefPtr<CSSPrimitiveValue>&& separator) { m_separator = WTFMove(separator); } 45 44 46 45 bool equals(const Counter& other) const … … 59 58 60 59 private: 61 Counter( PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue>separator)62 : m_identifier( identifier)63 , m_listStyle( listStyle)64 , m_separator( separator)60 Counter(RefPtr<CSSPrimitiveValue>&& identifier, RefPtr<CSSPrimitiveValue>&& listStyle, RefPtr<CSSPrimitiveValue>&& separator) 61 : m_identifier(WTFMove(identifier)) 62 , m_listStyle(WTFMove(listStyle)) 63 , m_separator(WTFMove(separator)) 65 64 { 66 65 } … … 72 71 73 72 } // namespace WebCore 74 75 #endif // Counter_h -
trunk/Source/WebCore/css/Pair.h
r194496 r201113 19 19 */ 20 20 21 #ifndef Pair_h 22 #define Pair_h 21 #pragma once 23 22 24 23 #include <wtf/RefCounted.h> 25 #include "CSSPrimitiveValue.h"26 #include <wtf/PassRefPtr.h>27 #include <wtf/text/StringBuilder.h>28 24 29 25 namespace WebCore { 26 27 class CSSPrimitiveValue; 30 28 31 29 // A primitive value representing a pair. This is useful for properties like border-radius, background-size/position, … … 74 72 75 73 } // namespace 76 77 #endif -
trunk/Source/WebCore/css/Rect.h
r185238 r201113 19 19 */ 20 20 21 #ifndef Rect_h 22 #define Rect_h 21 #pragma once 23 22 24 23 #include "CSSPrimitiveValue.h" … … 35 34 CSSPrimitiveValue* left() const { return m_left.get(); } 36 35 37 void setTop( PassRefPtr<CSSPrimitiveValue> top) { m_top = top; }38 void setRight( PassRefPtr<CSSPrimitiveValue> right) { m_right = right; }39 void setBottom( PassRefPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; }40 void setLeft( PassRefPtr<CSSPrimitiveValue> left) { m_left = left; }36 void setTop(RefPtr<CSSPrimitiveValue>&& top) { m_top = WTFMove(top); } 37 void setRight(RefPtr<CSSPrimitiveValue>&& right) { m_right = WTFMove(right); } 38 void setBottom(RefPtr<CSSPrimitiveValue>&& bottom) { m_bottom = WTFMove(bottom); } 39 void setLeft(RefPtr<CSSPrimitiveValue>&& left) { m_left = WTFMove(left); } 41 40 42 41 bool equals(const RectBase& other) const … … 124 123 125 124 } // namespace WebCore 126 127 #endif // Rect_h -
trunk/Source/WebCore/css/RuleSet.cpp
r199291 r201113 43 43 #include "StyleRuleImport.h" 44 44 #include "StyleSheetContents.h" 45 #include "ViewportStyleResolver.h" 45 46 46 47 #if ENABLE(VIDEO_TRACK) -
trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
r200626 r201113 94 94 } 95 95 96 RefPtr<SVGPaint> ComputedStyleExtractor::adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint> newPaint, const RenderStyle* style) const 97 { 98 RefPtr<SVGPaint> paint = newPaint; 96 RefPtr<SVGPaint> ComputedStyleExtractor::adjustSVGPaintForCurrentColor(RefPtr<SVGPaint>&& paint, const RenderStyle* style) const 97 { 99 98 if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR || paint->paintType() == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR) 100 99 paint->setColor(style->color()); 101 return paint;100 return WTFMove(paint); 102 101 } 103 102 -
trunk/Source/WebCore/css/StyleBuilderConverter.h
r200626 r201113 504 504 if (primitiveValue.isShape()) { 505 505 ASSERT(!operation); 506 operation = ShapeClipPathOperation::create(basicShapeForValue(styleResolver.state().cssToLengthConversionData(), primitiveValue.getShapeValue()));506 operation = ShapeClipPathOperation::create(basicShapeForValue(styleResolver.state().cssToLengthConversionData(), *primitiveValue.getShapeValue())); 507 507 } else { 508 508 ASSERT(primitiveValue.getValueID() == CSSValueContentBox … … 752 752 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(currentValue.get()); 753 753 if (primitiveValue.isShape()) 754 shape = basicShapeForValue(styleResolver.state().cssToLengthConversionData(), primitiveValue.getShapeValue());754 shape = basicShapeForValue(styleResolver.state().cssToLengthConversionData(), *primitiveValue.getShapeValue()); 755 755 else if (primitiveValue.getValueID() == CSSValueContentBox 756 756 || primitiveValue.getValueID() == CSSValueBorderBox -
trunk/Source/WebCore/css/StyleProperties.cpp
r200977 r201113 34 34 #include "PropertySetCSSStyleDeclaration.h" 35 35 #include "StylePropertyShorthand.h" 36 #include "StylePropertyShorthandFunctions.h" 36 37 #include "StyleSheetContents.h" 37 38 #include <bitset> … … 607 608 } 608 609 609 PassRefPtr<CSSValue> StyleProperties::getPropertyCSSValue(CSSPropertyID propertyID) const610 { 611 PassRefPtr<CSSValue> value = getPropertyCSSValueInternal(propertyID);610 RefPtr<CSSValue> StyleProperties::getPropertyCSSValue(CSSPropertyID propertyID) const 611 { 612 RefPtr<CSSValue> value = getPropertyCSSValueInternal(propertyID); 612 613 if (value && value->isVariableDependentValue()) { 613 614 auto& dependentValue = downcast<CSSVariableDependentValue>(*value); … … 618 619 } 619 620 620 PassRefPtr<CSSValue> StyleProperties::getPropertyCSSValueInternal(CSSPropertyID propertyID) const621 RefPtr<CSSValue> StyleProperties::getPropertyCSSValueInternal(CSSPropertyID propertyID) const 621 622 { 622 623 int foundPropertyIndex = findPropertyIndex(propertyID); … … 752 753 } 753 754 754 void MutableStyleProperties::setProperty(CSSPropertyID propertyID, PassRefPtr<CSSValue> prpValue, bool important)755 void MutableStyleProperties::setProperty(CSSPropertyID propertyID, RefPtr<CSSValue>&& value, bool important) 755 756 { 756 757 StylePropertyShorthand shorthand = shorthandForProperty(propertyID); 757 758 if (!shorthand.length()) { 758 setProperty(CSSProperty(propertyID, prpValue, important));759 setProperty(CSSProperty(propertyID, WTFMove(value), important)); 759 760 return; 760 761 } … … 762 763 removePropertiesInSet(shorthand.properties(), shorthand.length()); 763 764 764 RefPtr<CSSValue> value = prpValue;765 765 for (unsigned i = 0; i < shorthand.length(); ++i) 766 m_propertyVector.append(CSSProperty(shorthand.properties()[i], value , important));766 m_propertyVector.append(CSSProperty(shorthand.properties()[i], value.copyRef(), important)); 767 767 } 768 768 -
trunk/Source/WebCore/css/StyleProperties.h
r200977 r201113 20 20 */ 21 21 22 #ifndef StyleProperties_h 23 #define StyleProperties_h 22 #pragma once 24 23 25 24 #include "CSSParserMode.h" 26 #include "CSSPrimitiveValue.h"27 25 #include "CSSProperty.h" 28 #include "CSSPropertyNames.h"29 26 #include "CSSValueKeywords.h" 30 27 #include <memory> … … 86 83 PropertyReference propertyAt(unsigned) const; 87 84 88 WEBCORE_EXPORT PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const;85 WEBCORE_EXPORT RefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; 89 86 WEBCORE_EXPORT String getPropertyValue(CSSPropertyID) const; 90 87 bool propertyIsImportant(CSSPropertyID) const; … … 153 150 void appendFontLonghandValueIfExplicit(CSSPropertyID, StringBuilder& result, String& value) const; 154 151 155 PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) const;152 RefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) const; 156 153 157 154 friend class PropertySetCSSStyleDeclaration; … … 206 203 // These expand shorthand properties into multiple properties. 207 204 bool setProperty(CSSPropertyID, const String& value, bool important = false, StyleSheetContents* contextStyleSheet = 0); 208 void setProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important = false);205 void setProperty(CSSPropertyID, RefPtr<CSSValue>&&, bool important = false); 209 206 210 207 // These do not. FIXME: This is too messy, we can do better. … … 306 303 static bool isType(const WebCore::StyleProperties& set) { return !set.isMutable(); } 307 304 SPECIALIZE_TYPE_TRAITS_END() 308 309 #endif // StyleProperties_h -
trunk/Source/WebCore/css/StylePropertyShorthand.cpp
r200043 r201113 22 22 #include "config.h" 23 23 #include "StylePropertyShorthand.h" 24 25 #include <wtf/StdLibExtras.h> 24 #include "StylePropertyShorthandFunctions.h" 26 25 27 26 namespace WebCore { -
trunk/Source/WebCore/css/StylePropertyShorthand.h
r179227 r201113 20 20 */ 21 21 22 #ifndef StylePropertyShorthand_h 23 #define StylePropertyShorthand_h 22 #pragma once 24 23 25 24 #include "CSSPropertyNames.h" 26 #include "StylePropertyShorthandFunctions.h"27 25 #include <wtf/Vector.h> 28 26 … … 31 29 class StylePropertyShorthand { 32 30 public: 33 StylePropertyShorthand() 34 : m_properties(0) 35 , m_propertiesForInitialization(0) 36 , m_length(0) 37 , m_shorthandID(CSSPropertyInvalid) 38 { 39 } 31 StylePropertyShorthand() = default; 40 32 41 33 template<unsigned numProperties> … … 54 46 55 47 private: 56 const CSSPropertyID* m_properties ;57 const StylePropertyShorthand* m_propertiesForInitialization ;58 unsigned m_length ;59 CSSPropertyID m_shorthandID ;48 const CSSPropertyID* m_properties { nullptr }; 49 const StylePropertyShorthand* m_propertiesForInitialization { nullptr }; 50 unsigned m_length { 0 }; 51 CSSPropertyID m_shorthandID { CSSPropertyInvalid }; 60 52 }; 61 53 … … 77 69 78 70 } // namespace WebCore 79 80 #endif // StylePropertyShorthand_h -
trunk/Source/WebCore/css/StyleResolver.cpp
r201086 r201113 304 304 305 305 // This is a simplified style setting function for keyframe styles 306 void StyleResolver::addKeyframeStyle( PassRefPtr<StyleRuleKeyframes>rule)306 void StyleResolver::addKeyframeStyle(RefPtr<StyleRuleKeyframes>&& rule) 307 307 { 308 308 AtomicString s(rule->name()); 309 m_keyframesRuleMap.set(s.impl(), rule);309 m_keyframesRuleMap.set(s.impl(), WTFMove(rule)); 310 310 } 311 311 … … 1664 1664 } 1665 1665 1666 PassRefPtr<StyleImage> StyleResolver::styleImage(CSSPropertyID property, CSSValue& value)1666 RefPtr<StyleImage> StyleResolver::styleImage(CSSPropertyID property, CSSValue& value) 1667 1667 { 1668 1668 if (is<CSSImageValue>(value)) … … 1694 1694 } 1695 1695 1696 PassRefPtr<StyleImage> StyleResolver::generatedOrPendingFromValue(CSSPropertyID property, CSSImageGeneratorValue& value)1696 Ref<StyleImage> StyleResolver::generatedOrPendingFromValue(CSSPropertyID property, CSSImageGeneratorValue& value) 1697 1697 { 1698 1698 if (is<CSSFilterImageValue>(value)) { … … 2084 2084 } 2085 2085 2086 PassRefPtr<StyleImage> StyleResolver::loadPendingImage(const StylePendingImage& pendingImage, const ResourceLoaderOptions& options)2086 RefPtr<StyleImage> StyleResolver::loadPendingImage(const StylePendingImage& pendingImage, const ResourceLoaderOptions& options) 2087 2087 { 2088 2088 if (auto imageValue = pendingImage.cssImageValue()) … … 2105 2105 } 2106 2106 2107 PassRefPtr<StyleImage> StyleResolver::loadPendingImage(const StylePendingImage& pendingImage)2107 RefPtr<StyleImage> StyleResolver::loadPendingImage(const StylePendingImage& pendingImage) 2108 2108 { 2109 2109 ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions(); -
trunk/Source/WebCore/css/StyleResolver.h
r201073 r201113 20 20 */ 21 21 22 #ifndef StyleResolver_h 23 #define StyleResolver_h 22 #pragma once 24 23 25 24 #include "CSSToLengthConversionData.h" 26 25 #include "CSSToStyleMap.h" 27 #include "CSSValueList.h"28 26 #include "DocumentRuleSets.h" 29 27 #include "InspectorCSSOMWrappers.h" 30 #include "LinkHash.h"31 28 #include "MediaQueryEvaluator.h" 32 29 #include "RenderStyle.h" 33 30 #include "RuleFeature.h" 34 31 #include "RuleSet.h" 35 #include "RuntimeEnabledFeatures.h"36 #include "ScrollTypes.h"37 32 #include "SelectorChecker.h" 38 #include "StyleInheritedData.h"39 #include "StyleRelations.h"40 #include "ViewportStyleResolver.h"41 33 #include <bitset> 42 34 #include <memory> … … 214 206 bool hasMediaQueriesAffectedByViewportChange() const; 215 207 216 void addKeyframeStyle( PassRefPtr<StyleRuleKeyframes>);208 void addKeyframeStyle(RefPtr<StyleRuleKeyframes>&&); 217 209 218 210 bool checkRegionStyle(const Element* regionElement); … … 464 456 State& state() { return m_state; } 465 457 466 PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue&);458 RefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue&); 467 459 RefPtr<StyleImage> cachedOrPendingFromValue(CSSPropertyID, CSSImageValue&); 468 PassRefPtr<StyleImage> generatedOrPendingFromValue(CSSPropertyID, CSSImageGeneratorValue&);460 Ref<StyleImage> generatedOrPendingFromValue(CSSPropertyID, CSSImageGeneratorValue&); 469 461 #if ENABLE(CSS_IMAGE_SET) 470 462 RefPtr<StyleImage> setOrPendingFromValue(CSSPropertyID, CSSImageSetValue&); … … 498 490 void applySVGProperty(CSSPropertyID, CSSValue*); 499 491 500 PassRefPtr<StyleImage> loadPendingImage(const StylePendingImage&, const ResourceLoaderOptions&);501 PassRefPtr<StyleImage> loadPendingImage(const StylePendingImage&);492 RefPtr<StyleImage> loadPendingImage(const StylePendingImage&, const ResourceLoaderOptions&); 493 RefPtr<StyleImage> loadPendingImage(const StylePendingImage&); 502 494 void loadPendingImages(); 503 495 #if ENABLE(CSS_SHAPES) … … 591 583 592 584 } // namespace WebCore 593 594 #endif // StyleResolver_h -
trunk/Source/WebCore/css/StyleSheetList.h
r190280 r201113 19 19 */ 20 20 21 #ifndef StyleSheetList_h 22 #define StyleSheetList_h 21 #pragma once 23 22 24 23 #include <wtf/Forward.h> 25 24 #include <wtf/RefCounted.h> 26 #include <wtf/PassRefPtr.h>27 25 #include <wtf/Vector.h> 28 26 … … 57 55 58 56 } // namespace WebCore 59 60 #endif // StyleSheetList_h -
trunk/Source/WebCore/css/WebKitCSSFilterValue.cpp
r188315 r201113 28 28 29 29 #include "CSSValueList.h" 30 #include <wtf/PassRefPtr.h>31 30 #include <wtf/text/WTFString.h> 32 31 -
trunk/Source/WebCore/css/WebKitCSSFilterValue.h
r188315 r201113 28 28 29 29 #include "CSSValueList.h" 30 #include <wtf/PassRefPtr.h>31 30 #include <wtf/RefPtr.h> 32 31 -
trunk/Source/WebCore/css/WebKitCSSTransformValue.cpp
r188315 r201113 28 28 29 29 #include "CSSValueList.h" 30 #include <wtf/PassRefPtr.h>31 30 #include <wtf/text/WTFString.h> 32 31 … … 35 34 // These names must be kept in sync with TransformOperationType. 36 35 const char* const transformNamePrefixes[] = { 37 0,36 nullptr, 38 37 "translate(", 39 38 "translateX(", -
trunk/Source/WebCore/css/WebKitCSSTransformValue.h
r188315 r201113 24 24 */ 25 25 26 #ifndef WebKitCSSTransformValue_h 27 #define WebKitCSSTransformValue_h 26 #pragma once 28 27 29 28 #include "CSSValueList.h" 30 #include <wtf/PassRefPtr.h>31 29 #include <wtf/RefPtr.h> 32 30 … … 83 81 84 82 SPECIALIZE_TYPE_TRAITS_CSS_VALUE(WebKitCSSTransformValue, isWebKitCSSTransformValue()) 85 86 #endif -
trunk/Source/WebCore/rendering/shapes/Shape.cpp
r194496 r201113 32 32 33 33 #include "BasicShapeFunctions.h" 34 #include "BasicShapes.h" 34 35 #include "BoxShape.h" 35 36 #include "GraphicsContext.h" -
trunk/Source/WebKit2/ChangeLog
r201110 r201113 1 2016-05-18 Alex Christensen <achristensen@webkit.org> 2 3 Clean up CSS code 4 https://bugs.webkit.org/show_bug.cgi?id=157808 5 6 Reviewed by Chris Dumez. 7 8 * UIProcess/Cocoa/WebViewImpl.mm: 9 1 10 2016-05-18 Jer Noble <jer.noble@apple.com> 2 11 -
trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
r200624 r201113 91 91 #import <WebKitSystemInterface.h> 92 92 #import <sys/stat.h> 93 #import <wtf/NeverDestroyed.h> 93 94 94 95 #if USE(APPLE_INTERNAL_SDK)
Note:
See TracChangeset
for help on using the changeset viewer.