| Index: Source/core/css/parser/CSSPropertyParser.cpp
|
| diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
|
| index 2f4321b5a737654dd1ab30bffb950259d49f0749..77f8725b72cdd334eac05c962f7146d1d1ede420 100644
|
| --- a/Source/core/css/parser/CSSPropertyParser.cpp
|
| +++ b/Source/core/css/parser/CSSPropertyParser.cpp
|
| @@ -125,7 +125,7 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| return parseSuccess;
|
| }
|
|
|
| -void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr<CSSValue> value, bool important, bool implicit)
|
| +void CSSPropertyParser::addProperty(CSSPropertyID propId, CSSValue value, bool important, bool implicit)
|
| {
|
| ASSERT(!isPropertyAlias(propId));
|
|
|
| @@ -317,10 +317,10 @@ inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::createPrimit
|
| return cssValuePool().createValue(value->string, CSSPrimitiveValue::CSS_CUSTOM_IDENT);
|
| }
|
|
|
| -inline PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::createCSSImageValueWithReferrer(const String& rawValue, const KURL& url)
|
| +inline CSSValue CSSPropertyParser::createCSSImageValueWithReferrer(const String& rawValue, const KURL& url)
|
| {
|
| - RefPtrWillBeRawPtr<CSSValue> imageValue = CSSImageValue::create(rawValue, url);
|
| - toCSSImageValue(imageValue.get())->setReferrer(m_context.referrer());
|
| + CSSValue imageValue = CSSImageValue::create(rawValue, url);
|
| + toCSSImageValue(imageValue).setReferrer(m_context.referrer());
|
| return imageValue;
|
| }
|
|
|
| @@ -399,7 +399,7 @@ inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseValidPr
|
| return nullptr;
|
| }
|
|
|
| -void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID propId, PassRefPtrWillBeRawPtr<CSSValue> prpValue, bool important)
|
| +void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID propId, CSSValue prpValue, bool important)
|
| {
|
| const StylePropertyShorthand& shorthand = shorthandForProperty(propId);
|
| unsigned shorthandLength = shorthand.length();
|
| @@ -408,7 +408,7 @@ void CSSPropertyParser::addExpandedPropertyForValue(CSSPropertyID propId, PassRe
|
| return;
|
| }
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> value = prpValue;
|
| + CSSValue value = prpValue;
|
| ShorthandScope scope(this, propId);
|
| const CSSPropertyID* longhands = shorthand.properties();
|
| for (unsigned i = 0; i < shorthandLength; ++i)
|
| @@ -457,7 +457,7 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
|
|
| bool validPrimitive = false;
|
| Units unitless = FUnknown;
|
| - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr;
|
| + NullableCSSValue parsedValue;
|
|
|
| switch (propId) {
|
| case CSSPropertySize: // <length>{1,2} | auto | [ <page-size> || [ portrait | landscape] ]
|
| @@ -489,17 +489,16 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| if (num != 1 || !parseValue(CSSPropertyOverflowY, important))
|
| return false;
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> overflowXValue = nullptr;
|
| -
|
| // FIXME: -webkit-paged-x or -webkit-paged-y only apply to overflow-y. If this value has been
|
| // set using the shorthand, then for now overflow-x will default to auto, but once we implement
|
| // pagination controls, it should default to hidden. If the overflow-y value is anything but
|
| // paged-x or paged-y, then overflow-x and overflow-y should have the same value.
|
| + NullableCSSValue overflowXValue;
|
| if (id == CSSValueWebkitPagedX || id == CSSValueWebkitPagedY)
|
| overflowXValue = cssValuePool().createIdentifierValue(CSSValueAuto);
|
| else
|
| overflowXValue = m_parsedProperties.last().value();
|
| - addProperty(CSSPropertyOverflowX, overflowXValue.release(), important);
|
| + addProperty(CSSPropertyOverflowX, *overflowXValue, important);
|
| return true;
|
| }
|
|
|
| @@ -523,7 +522,7 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| ShorthandScope scope(this, CSSPropertyBorderSpacing);
|
| if (!parseValue(CSSPropertyWebkitBorderHorizontalSpacing, important))
|
| return false;
|
| - CSSValue* value = m_parsedProperties.last().value();
|
| + CSSValue value = m_parsedProperties.last().value();
|
| addProperty(CSSPropertyWebkitBorderVerticalSpacing, value, important);
|
| return true;
|
| }
|
| @@ -609,7 +608,7 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| // zoom-in | zoom-out | -webkit-grab | -webkit-grabbing | -webkit-zoom-in | -webkit-zoom-out ] ] | inherit
|
| RefPtrWillBeRawPtr<CSSValueList> list = nullptr;
|
| while (value) {
|
| - RefPtrWillBeRawPtr<CSSValue> image = nullptr;
|
| + NullableCSSValue image;
|
| if (value->unit == CSSPrimitiveValue::CSS_URI) {
|
| String uri = value->string;
|
| if (!uri.isNull())
|
| @@ -641,7 +640,7 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| list = CSSValueList::createCommaSeparated();
|
|
|
| if (image)
|
| - list->append(CSSCursorImageValue::create(image, hotSpotSpecified, hotSpot));
|
| + list->append(CSSCursorImageValue::create(*image, hotSpotSpecified, hotSpot).get());
|
|
|
| if (!consumeComma(m_valueList))
|
| return false;
|
| @@ -703,8 +702,8 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| case CSSPropertyWebkitMaskRepeatX:
|
| case CSSPropertyWebkitMaskRepeatY:
|
| {
|
| - RefPtrWillBeRawPtr<CSSValue> val1 = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> val2 = nullptr;
|
| + NullableCSSValue val1;
|
| + NullableCSSValue val2;
|
| CSSPropertyID propId1, propId2;
|
| bool result = false;
|
| if (parseFillProperty(unresolvedProperty, propId1, propId2, val1, val2)) {
|
| @@ -713,13 +712,13 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| propId == CSSPropertyWebkitMaskPosition ||
|
| propId == CSSPropertyWebkitMaskRepeat) {
|
| ShorthandScope scope(this, propId);
|
| - addProperty(propId1, val1.release(), important);
|
| + addProperty(propId1, *val1, important);
|
| if (val2)
|
| - addProperty(propId2, val2.release(), important);
|
| + addProperty(propId2, *val2, important);
|
| } else {
|
| - addProperty(propId1, val1.release(), important);
|
| + addProperty(propId1, *val1, important);
|
| if (val2)
|
| - addProperty(propId2, val2.release(), important);
|
| + addProperty(propId2, *val2, important);
|
| }
|
| result = true;
|
| }
|
| @@ -932,8 +931,8 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| case CSSPropertyWebkitMaskBoxImage:
|
| return parseBorderImageShorthand(propId, important);
|
| case CSSPropertyWebkitBorderImage: {
|
| - if (RefPtrWillBeRawPtr<CSSValue> result = parseBorderImage(propId)) {
|
| - addProperty(propId, result, important);
|
| + if (NullableCSSValue result = parseBorderImage(propId)) {
|
| + addProperty(propId, *result, important);
|
| return true;
|
| }
|
| return false;
|
| @@ -950,9 +949,9 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| }
|
| case CSSPropertyBorderImageRepeat:
|
| case CSSPropertyWebkitMaskBoxImageRepeat: {
|
| - RefPtrWillBeRawPtr<CSSValue> result = nullptr;
|
| + NullableCSSValue result;
|
| if (parseBorderImageRepeat(result)) {
|
| - addProperty(propId, result, important);
|
| + addProperty(propId, *result, important);
|
| return true;
|
| }
|
| break;
|
| @@ -1046,9 +1045,9 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| if (id == CSSValueNone)
|
| validPrimitive = true;
|
| else {
|
| - RefPtrWillBeRawPtr<CSSValue> val = parseFilter();
|
| + NullableCSSValue val = parseFilter();
|
| if (val) {
|
| - addProperty(propId, val, important);
|
| + addProperty(propId, *val, important);
|
| return true;
|
| }
|
| return false;
|
| @@ -1234,7 +1233,7 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| ShorthandScope scope(this, CSSPropertyWebkitMarginCollapse);
|
| if (!parseValue(webkitMarginCollapseShorthand().properties()[0], important))
|
| return false;
|
| - CSSValue* value = m_parsedProperties.last().value();
|
| + CSSValue value = m_parsedProperties.last().value();
|
| addProperty(webkitMarginCollapseShorthand().properties()[1], value, important);
|
| return true;
|
| }
|
| @@ -1445,7 +1444,7 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| parsedValue = parseBasicShape();
|
| } else if (value->unit == CSSPrimitiveValue::CSS_URI) {
|
| parsedValue = CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_URI);
|
| - addProperty(propId, parsedValue.release(), important);
|
| + addProperty(propId, *parsedValue, important);
|
| return true;
|
| }
|
| break;
|
| @@ -1506,22 +1505,21 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
|
| ASSERT(!m_parsedCalculation);
|
| if (parsedValue) {
|
| if (!m_valueList->current() || inShorthand()) {
|
| - addProperty(propId, parsedValue.release(), important);
|
| + addProperty(propId, *parsedValue, important);
|
| return true;
|
| }
|
| }
|
| return false;
|
| }
|
|
|
| -void CSSPropertyParser::addFillValue(RefPtrWillBeRawPtr<CSSValue>& lval, PassRefPtrWillBeRawPtr<CSSValue> rval)
|
| +void CSSPropertyParser::addFillValue(NullableCSSValue& lval, CSSValue rval)
|
| {
|
| if (lval) {
|
| if (lval->isBaseValueList())
|
| - toCSSValueList(lval.get())->append(rval);
|
| + toCSSValueList(lval)->append(rval);
|
| else {
|
| - PassRefPtrWillBeRawPtr<CSSValue> oldlVal(lval.release());
|
| PassRefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
|
| - list->append(oldlVal);
|
| + list->append(*lval);
|
| list->append(rval);
|
| lval = list;
|
| }
|
| @@ -1530,7 +1528,7 @@ void CSSPropertyParser::addFillValue(RefPtrWillBeRawPtr<CSSValue>& lval, PassRef
|
| lval = rval;
|
| }
|
|
|
| -static bool parseBackgroundClip(CSSParserValue* parserValue, RefPtrWillBeRawPtr<CSSValue>& cssValue)
|
| +static bool parseBackgroundClip(CSSParserValue* parserValue, NullableCSSValue& cssValue)
|
| {
|
| if (parserValue->id == CSSValueBorderBox || parserValue->id == CSSValuePaddingBox
|
| || parserValue->id == CSSValueContentBox || parserValue->id == CSSValueWebkitText) {
|
| @@ -1551,14 +1549,14 @@ bool CSSPropertyParser::parseFillShorthand(CSSPropertyID propId, const CSSProper
|
| ShorthandScope scope(this, propId);
|
|
|
| bool parsedProperty[cMaxFillProperties] = { false };
|
| - RefPtrWillBeRawPtr<CSSValue> values[cMaxFillProperties];
|
| + NullableCSSValue values[cMaxFillProperties];
|
| #if ENABLE(OILPAN)
|
| // Zero initialize the array of raw pointers.
|
| memset(&values, 0, sizeof(values));
|
| #endif
|
| - RefPtrWillBeRawPtr<CSSValue> clipValue = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> positionYValue = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> repeatYValue = nullptr;
|
| + NullableCSSValue clipValue;
|
| + NullableCSSValue positionYValue;
|
| + NullableCSSValue repeatYValue;
|
| bool foundClip = false;
|
| int i;
|
| bool foundPositionCSSProperty = false;
|
| @@ -1607,29 +1605,29 @@ bool CSSPropertyParser::parseFillShorthand(CSSPropertyID propId, const CSSProper
|
| continue;
|
|
|
| if (!parsedProperty[i]) {
|
| - RefPtrWillBeRawPtr<CSSValue> val1 = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> val2 = nullptr;
|
| + NullableCSSValue val1;
|
| + NullableCSSValue val2;
|
| CSSPropertyID propId1, propId2;
|
| CSSParserValue* parserValue = m_valueList->current();
|
| // parseFillProperty() may modify m_implicitShorthand, so we MUST reset it
|
| // before EACH return below.
|
| if (parserValue && parseFillProperty(properties[i], propId1, propId2, val1, val2)) {
|
| parsedProperty[i] = found = true;
|
| - addFillValue(values[i], val1.release());
|
| + addFillValue(values[i], *val1);
|
| if (properties[i] == CSSPropertyBackgroundPosition || properties[i] == CSSPropertyWebkitMaskPosition)
|
| - addFillValue(positionYValue, val2.release());
|
| + addFillValue(positionYValue, *val2);
|
| if (properties[i] == CSSPropertyBackgroundRepeat || properties[i] == CSSPropertyWebkitMaskRepeat)
|
| - addFillValue(repeatYValue, val2.release());
|
| + addFillValue(repeatYValue, *val2);
|
| if (properties[i] == CSSPropertyBackgroundOrigin || properties[i] == CSSPropertyWebkitMaskOrigin) {
|
| // Reparse the value as a clip, and see if we succeed.
|
| if (parseBackgroundClip(parserValue, val1))
|
| - addFillValue(clipValue, val1.release()); // The property parsed successfully.
|
| + addFillValue(clipValue, *val1); // The property parsed successfully.
|
| else
|
| addFillValue(clipValue, cssValuePool().createImplicitInitialValue()); // Some value was used for origin that is not supported by clip. Just reset clip instead.
|
| }
|
| if (properties[i] == CSSPropertyBackgroundClip || properties[i] == CSSPropertyWebkitMaskClip) {
|
| // Update clipValue
|
| - addFillValue(clipValue, val1.release());
|
| + addFillValue(clipValue, *val1);
|
| foundClip = true;
|
| }
|
| if (properties[i] == CSSPropertyBackgroundPosition || properties[i] == CSSPropertyWebkitMaskPosition)
|
| @@ -1661,34 +1659,34 @@ bool CSSPropertyParser::parseFillShorthand(CSSPropertyID propId, const CSSProper
|
| }
|
| }
|
| if (properties[i] == CSSPropertyBackgroundPosition) {
|
| - addProperty(CSSPropertyBackgroundPositionX, values[i].release(), important);
|
| + addProperty(CSSPropertyBackgroundPositionX, *values[i], important);
|
| // it's OK to call positionYValue.release() since we only see CSSPropertyBackgroundPosition once
|
| - addProperty(CSSPropertyBackgroundPositionY, positionYValue.release(), important);
|
| + addProperty(CSSPropertyBackgroundPositionY, *positionYValue, important);
|
| } else if (properties[i] == CSSPropertyWebkitMaskPosition) {
|
| - addProperty(CSSPropertyWebkitMaskPositionX, values[i].release(), important);
|
| + addProperty(CSSPropertyWebkitMaskPositionX, *values[i], important);
|
| // it's OK to call positionYValue.release() since we only see CSSPropertyWebkitMaskPosition once
|
| - addProperty(CSSPropertyWebkitMaskPositionY, positionYValue.release(), important);
|
| + addProperty(CSSPropertyWebkitMaskPositionY, *positionYValue, important);
|
| } else if (properties[i] == CSSPropertyBackgroundRepeat) {
|
| - addProperty(CSSPropertyBackgroundRepeatX, values[i].release(), important);
|
| + addProperty(CSSPropertyBackgroundRepeatX, *values[i], important);
|
| // it's OK to call repeatYValue.release() since we only see CSSPropertyBackgroundPosition once
|
| - addProperty(CSSPropertyBackgroundRepeatY, repeatYValue.release(), important);
|
| + addProperty(CSSPropertyBackgroundRepeatY, *repeatYValue, important);
|
| } else if (properties[i] == CSSPropertyWebkitMaskRepeat) {
|
| - addProperty(CSSPropertyWebkitMaskRepeatX, values[i].release(), important);
|
| + addProperty(CSSPropertyWebkitMaskRepeatX, *values[i], important);
|
| // it's OK to call repeatYValue.release() since we only see CSSPropertyBackgroundPosition once
|
| - addProperty(CSSPropertyWebkitMaskRepeatY, repeatYValue.release(), important);
|
| + addProperty(CSSPropertyWebkitMaskRepeatY, *repeatYValue, important);
|
| } else if ((properties[i] == CSSPropertyBackgroundClip || properties[i] == CSSPropertyWebkitMaskClip) && !foundClip)
|
| // Value is already set while updating origin
|
| continue;
|
| else if (properties[i] == CSSPropertyBackgroundSize && !parsedProperty[i] && m_context.useLegacyBackgroundSizeShorthandBehavior())
|
| continue;
|
| else
|
| - addProperty(properties[i], values[i].release(), important);
|
| + addProperty(properties[i], *values[i], important);
|
|
|
| // Add in clip values when we hit the corresponding origin property.
|
| if (properties[i] == CSSPropertyBackgroundOrigin && !foundClip)
|
| - addProperty(CSSPropertyBackgroundClip, clipValue.release(), important);
|
| + addProperty(CSSPropertyBackgroundClip, *clipValue, important);
|
| else if (properties[i] == CSSPropertyWebkitMaskOrigin && !foundClip)
|
| - addProperty(CSSPropertyWebkitMaskClip, clipValue.release(), important);
|
| + addProperty(CSSPropertyWebkitMaskClip, *clipValue, important);
|
| }
|
|
|
| m_implicitShorthand = false;
|
| @@ -1701,10 +1699,10 @@ static bool isValidTransitionPropertyList(CSSValueList* value)
|
| return true;
|
| for (auto& property : *value) {
|
| // FIXME: Shorthand parsing shouldn't add initial to the list since it won't round-trip
|
| - if (property->isInitialValue())
|
| + if (property.isInitialValue())
|
| continue;
|
| - CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(property.get());
|
| - if (primitiveValue->isValueID() && primitiveValue->getValueID() == CSSValueNone)
|
| + CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(property);
|
| + if (primitiveValue.isValueID() && primitiveValue.getValueID() == CSSValueNone)
|
| return false;
|
| }
|
| return true;
|
| @@ -1744,9 +1742,9 @@ bool CSSPropertyParser::parseAnimationShorthand(bool useLegacyparsing, bool impo
|
| for (size_t i = 0; i < numProperties; ++i) {
|
| if (parsedProperty[i])
|
| continue;
|
| - if (RefPtrWillBeRawPtr<CSSValue> val = parseAnimationProperty(animationProperties.properties()[i], useLegacyparsing)) {
|
| + if (NullableCSSValue val = parseAnimationProperty(animationProperties.properties()[i], useLegacyparsing)) {
|
| parsedProperty[i] = found = true;
|
| - values[i]->append(val.release());
|
| + values[i]->append(*val);
|
| break;
|
| }
|
| }
|
| @@ -1797,9 +1795,9 @@ bool CSSPropertyParser::parseTransitionShorthand(bool important)
|
| for (size_t i = 0; i < numProperties; ++i) {
|
| if (parsedProperty[i])
|
| continue;
|
| - if (RefPtrWillBeRawPtr<CSSValue> val = parseAnimationProperty(shorthand.properties()[i], false)) {
|
| + if (NullableCSSValue val = parseAnimationProperty(shorthand.properties()[i], false)) {
|
| parsedProperty[i] = found = true;
|
| - values[i]->append(val.release());
|
| + values[i]->append(*val);
|
| break;
|
| }
|
| }
|
| @@ -1824,24 +1822,24 @@ bool CSSPropertyParser::parseTransitionShorthand(bool important)
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseColumnWidth()
|
| +NullableCSSValue CSSPropertyParser::parseColumnWidth()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| // Always parse lengths in strict mode here, since it would be ambiguous otherwise when used in
|
| // the 'columns' shorthand property.
|
| if (value->id == CSSValueAuto || (validUnit(value, FLength | FNonNeg, HTMLStandardMode) && (m_parsedCalculation || value->fValue != 0))) {
|
| - RefPtrWillBeRawPtr<CSSValue> parsedValue = parseValidPrimitive(value->id, value);
|
| + CSSValue parsedValue = parseValidPrimitive(value->id, value);
|
| m_valueList->next();
|
| return parsedValue;
|
| }
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseColumnCount()
|
| +NullableCSSValue CSSPropertyParser::parseColumnCount()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (value->id == CSSValueAuto || validUnit(value, FPositiveInteger)) {
|
| - RefPtrWillBeRawPtr<CSSValue> parsedValue = parseValidPrimitive(value->id, value);
|
| + CSSValue parsedValue = parseValidPrimitive(value->id, value);
|
| m_valueList->next();
|
| return parsedValue;
|
| }
|
| @@ -1850,8 +1848,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseColumnCount()
|
|
|
| bool CSSPropertyParser::parseColumnsShorthand(bool important)
|
| {
|
| - RefPtrWillBeRawPtr<CSSValue> columnWidth = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> columnCount = nullptr;
|
| + NullableCSSValue columnWidth;
|
| + NullableCSSValue columnCount;
|
| bool hasPendingExplicitAuto = false;
|
|
|
| for (unsigned propertiesParsed = 0; CSSParserValue* value = m_valueList->current(); propertiesParsed++) {
|
| @@ -1893,11 +1891,11 @@ bool CSSPropertyParser::parseColumnsShorthand(bool important)
|
|
|
| // Any unassigned property at this point will become implicit 'auto'.
|
| if (columnWidth)
|
| - addProperty(CSSPropertyWebkitColumnWidth, columnWidth, important);
|
| + addProperty(CSSPropertyWebkitColumnWidth, *columnWidth, important);
|
| else
|
| addProperty(CSSPropertyWebkitColumnWidth, cssValuePool().createIdentifierValue(CSSValueAuto), important, true /* implicit */);
|
| if (columnCount)
|
| - addProperty(CSSPropertyWebkitColumnCount, columnCount, important);
|
| + addProperty(CSSPropertyWebkitColumnCount, *columnCount, important);
|
| else
|
| addProperty(CSSPropertyWebkitColumnCount, cssValuePool().createIdentifierValue(CSSValueAuto), important, true /* implicit */);
|
| return true;
|
| @@ -1969,7 +1967,7 @@ bool CSSPropertyParser::parse4Values(CSSPropertyID propId, const CSSPropertyID *
|
| case 1: {
|
| if (!parseValue(properties[0], important))
|
| return false;
|
| - CSSValue* value = m_parsedProperties.last().value();
|
| + CSSValue value = m_parsedProperties.last().value();
|
| ImplicitScope implicitScope(this);
|
| addProperty(properties[1], value, important);
|
| addProperty(properties[2], value, important);
|
| @@ -1979,7 +1977,7 @@ bool CSSPropertyParser::parse4Values(CSSPropertyID propId, const CSSPropertyID *
|
| case 2: {
|
| if (!parseValue(properties[0], important) || !parseValue(properties[1], important))
|
| return false;
|
| - CSSValue* value = m_parsedProperties[m_parsedProperties.size() - 2].value();
|
| + CSSValue value = m_parsedProperties[m_parsedProperties.size() - 2].value();
|
| ImplicitScope implicitScope(this);
|
| addProperty(properties[2], value, important);
|
| value = m_parsedProperties[m_parsedProperties.size() - 2].value();
|
| @@ -1989,7 +1987,7 @@ bool CSSPropertyParser::parse4Values(CSSPropertyID propId, const CSSPropertyID *
|
| case 3: {
|
| if (!parseValue(properties[0], important) || !parseValue(properties[1], important) || !parseValue(properties[2], important))
|
| return false;
|
| - CSSValue* value = m_parsedProperties[m_parsedProperties.size() - 2].value();
|
| + CSSValue value = m_parsedProperties[m_parsedProperties.size() - 2].value();
|
| ImplicitScope implicitScope(this);
|
| addProperty(properties[3], value, important);
|
| break;
|
| @@ -2088,15 +2086,15 @@ CSSPropertyParser::SizeParameterType CSSPropertyParser::parseSizeParameter(CSSVa
|
| }
|
|
|
| // [ <string> <string> ]+ | none, but none is handled in parseValue
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseQuotes()
|
| +NullableCSSValue CSSPropertyParser::parseQuotes()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
|
| while (CSSParserValue* val = m_valueList->current()) {
|
| - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr;
|
| + NullableCSSValue parsedValue;
|
| if (val->unit != CSSPrimitiveValue::CSS_STRING)
|
| return nullptr;
|
| parsedValue = createPrimitiveStringValue(val);
|
| - values->append(parsedValue.release());
|
| + values->append(*parsedValue);
|
| m_valueList->next();
|
| }
|
| if (values->length() && values->length() % 2 == 0)
|
| @@ -2112,7 +2110,7 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseContent()
|
| RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
|
|
|
| while (CSSParserValue* val = m_valueList->current()) {
|
| - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr;
|
| + NullableCSSValue parsedValue;
|
| if (val->unit == CSSPrimitiveValue::CSS_URI) {
|
| // url
|
| parsedValue = createCSSImageValueWithReferrer(val->string, completeURL(val->string));
|
| @@ -2150,14 +2148,14 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseContent()
|
| }
|
| if (!parsedValue)
|
| return nullptr;
|
| - values->append(parsedValue.release());
|
| + values->append(*parsedValue);
|
| m_valueList->next();
|
| }
|
|
|
| return values.release();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAttr(CSSParserValueList* args)
|
| +NullableCSSValue CSSPropertyParser::parseAttr(CSSParserValueList* args)
|
| {
|
| if (args->size() != 1)
|
| return nullptr;
|
| @@ -2180,7 +2178,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAttr(CSSParserValueList
|
| return cssValuePool().createValue(attrName, CSSPrimitiveValue::CSS_ATTR);
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseBackgroundColor()
|
| +NullableCSSValue CSSPropertyParser::parseBackgroundColor()
|
| {
|
| CSSValueID id = m_valueList->current()->id;
|
| if (id == CSSValueWebkitText || (id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu || id == CSSValueCurrentcolor ||
|
| @@ -2189,7 +2187,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseBackgroundColor()
|
| return parseColor();
|
| }
|
|
|
| -bool CSSPropertyParser::parseFillImage(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value)
|
| +bool CSSPropertyParser::parseFillImage(CSSParserValueList* valueList, NullableCSSValue& value)
|
| {
|
| if (valueList->current()->id == CSSValueNone) {
|
| value = cssValuePool().createIdentifierValue(CSSValueNone);
|
| @@ -2212,7 +2210,7 @@ bool CSSPropertyParser::parseFillImage(CSSParserValueList* valueList, RefPtrWill
|
| return false;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseFillPositionX(CSSParserValueList* valueList)
|
| +NullableCSSValue CSSPropertyParser::parseFillPositionX(CSSParserValueList* valueList)
|
| {
|
| int id = valueList->current()->id;
|
| if (id == CSSValueLeft || id == CSSValueRight || id == CSSValueCenter) {
|
| @@ -2228,7 +2226,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseFillPositionX(CSSParser
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseFillPositionY(CSSParserValueList* valueList)
|
| +NullableCSSValue CSSPropertyParser::parseFillPositionY(CSSParserValueList* valueList)
|
| {
|
| int id = valueList->current()->id;
|
| if (id == CSSValueTop || id == CSSValueBottom || id == CSSValueCenter) {
|
| @@ -2309,7 +2307,7 @@ static bool isFillPositionKeyword(CSSValueID value)
|
| return value == CSSValueLeft || value == CSSValueTop || value == CSSValueBottom || value == CSSValueRight || value == CSSValueCenter;
|
| }
|
|
|
| -void CSSPropertyParser::parse4ValuesFillPosition(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2)
|
| +void CSSPropertyParser::parse4ValuesFillPosition(CSSParserValueList* valueList, NullableCSSValue& value1, NullableCSSValue& value2, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2)
|
| {
|
| // [ left | right ] [ <percentage] | <length> ] && [ top | bottom ] [ <percentage> | <length> ]
|
| // In the case of 4 values <position> requires the second value to be a length or a percentage.
|
| @@ -2357,7 +2355,7 @@ void CSSPropertyParser::parse4ValuesFillPosition(CSSParserValueList* valueList,
|
|
|
| valueList->next();
|
| }
|
| -void CSSPropertyParser::parse3ValuesFillPosition(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2)
|
| +void CSSPropertyParser::parse3ValuesFillPosition(CSSParserValueList* valueList, NullableCSSValue& value1, NullableCSSValue& value2, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2)
|
| {
|
| unsigned cumulativeFlags = 0;
|
| FillPositionFlag value3Flag = InvalidFillPosition;
|
| @@ -2439,8 +2437,8 @@ void CSSPropertyParser::parse3ValuesFillPosition(CSSParserValueList* valueList,
|
| value1.swap(value2);
|
|
|
| #if ENABLE(ASSERT)
|
| - CSSPrimitiveValue* first = toCSSPrimitiveValue(value1.get());
|
| - CSSPrimitiveValue* second = toCSSPrimitiveValue(value2.get());
|
| + CSSPrimitiveValue* first = toCSSPrimitiveValue(value1);
|
| + CSSPrimitiveValue* second = toCSSPrimitiveValue(value2);
|
| ident1 = first->getPairValue()->first()->getValueID();
|
| ident2 = second->getPairValue()->first()->getValueID();
|
| ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight);
|
| @@ -2453,7 +2451,7 @@ inline bool CSSPropertyParser::isPotentialPositionValue(CSSParserValue* value)
|
| return isFillPositionKeyword(value->id) || validUnit(value, FPercent | FLength, ReleaseParsedCalcValue);
|
| }
|
|
|
| -void CSSPropertyParser::parseFillPosition(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, Units unitless)
|
| +void CSSPropertyParser::parseFillPosition(CSSParserValueList* valueList, NullableCSSValue& value1, NullableCSSValue& value2, Units unitless)
|
| {
|
| unsigned numberOfValues = 0;
|
| for (unsigned i = valueList->currentIndex(); i < valueList->size(); ++i, ++numberOfValues) {
|
| @@ -2496,27 +2494,27 @@ void CSSPropertyParser::parseFillPosition(CSSParserValueList* valueList, RefPtrW
|
| if (value2)
|
| valueList->next();
|
| else {
|
| - value1.clear();
|
| + value1 = nullptr;
|
| return;
|
| }
|
|
|
| - RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1 = toCSSPrimitiveValue(value1.get());
|
| - RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2 = toCSSPrimitiveValue(value2.get());
|
| + RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1 = toCSSPrimitiveValue(value1);
|
| + RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2 = toCSSPrimitiveValue(value2);
|
|
|
| - value1.clear();
|
| - value2.clear();
|
| + value1 = nullptr;
|
| + value2 = nullptr;
|
|
|
| // Per CSS3 syntax, <position> can't have 'center' as its second keyword as we have more arguments to follow.
|
| if (parsedValue2->getValueID() == CSSValueCenter)
|
| return;
|
|
|
| if (numberOfValues == 3)
|
| - parse3ValuesFillPosition(valueList, value1, value2, parsedValue1.release(), parsedValue2.release());
|
| + parse3ValuesFillPosition(valueList, value1, value2, parsedValue1, parsedValue2);
|
| else
|
| - parse4ValuesFillPosition(valueList, value1, value2, parsedValue1.release(), parsedValue2.release());
|
| + parse4ValuesFillPosition(valueList, value1, value2, parsedValue1, parsedValue2);
|
| }
|
|
|
| -void CSSPropertyParser::parse2ValuesFillPosition(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, Units unitless)
|
| +void CSSPropertyParser::parse2ValuesFillPosition(CSSParserValueList* valueList, NullableCSSValue& value1, NullableCSSValue& value2, Units unitless)
|
| {
|
| // Parse the first value. We're just making sure that it is one of the valid keywords or a percentage/length.
|
| unsigned cumulativeFlags = 0;
|
| @@ -2541,7 +2539,7 @@ void CSSPropertyParser::parse2ValuesFillPosition(CSSParserValueList* valueList,
|
| valueList->next();
|
| else {
|
| if (!inShorthand()) {
|
| - value1.clear();
|
| + value1 = nullptr;
|
| return;
|
| }
|
| }
|
| @@ -2558,7 +2556,7 @@ void CSSPropertyParser::parse2ValuesFillPosition(CSSParserValueList* valueList,
|
| value1.swap(value2);
|
| }
|
|
|
| -void CSSPropertyParser::parseFillRepeat(RefPtrWillBeRawPtr<CSSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2)
|
| +void CSSPropertyParser::parseFillRepeat(NullableCSSValue& value1, NullableCSSValue& value2)
|
| {
|
| CSSValueID id = m_valueList->current()->id;
|
| if (id == CSSValueRepeatX) {
|
| @@ -2596,10 +2594,10 @@ void CSSPropertyParser::parseFillRepeat(RefPtrWillBeRawPtr<CSSValue>& value1, Re
|
|
|
| // If only one value was specified, value2 is the same as value1.
|
| m_implicitShorthand = true;
|
| - value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(value1.get())->getValueID());
|
| + value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(value1)->getValueID());
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseFillSize(CSSPropertyID unresolvedProperty)
|
| +NullableCSSValue CSSPropertyParser::parseFillSize(CSSPropertyID unresolvedProperty)
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| m_valueList->next();
|
| @@ -2641,16 +2639,17 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseFillSize(CSSPropertyID
|
| }
|
|
|
| bool CSSPropertyParser::parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1, CSSPropertyID& propId2,
|
| - RefPtrWillBeRawPtr<CSSValue>& retValue1, RefPtrWillBeRawPtr<CSSValue>& retValue2)
|
| + NullableCSSValue& retValue1, NullableCSSValue& retValue2)
|
| {
|
| // We initially store the first value in value/value2, and only create
|
| // CSSValueLists if we have more values.
|
| RefPtrWillBeRawPtr<CSSValueList> values = nullptr;
|
| RefPtrWillBeRawPtr<CSSValueList> values2 = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> value = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> value2 = nullptr;
|
| + NullableCSSValue value;
|
| + NullableCSSValue value2;
|
|
|
| - retValue1 = retValue2 = nullptr;
|
| + retValue1 = nullptr;
|
| + retValue2 = nullptr;
|
| propId1 = resolveCSSPropertyID(propId);
|
| propId2 = propId1;
|
| if (propId == CSSPropertyBackgroundPosition) {
|
| @@ -2668,8 +2667,8 @@ bool CSSPropertyParser::parseFillProperty(CSSPropertyID propId, CSSPropertyID& p
|
| }
|
|
|
| while (true) {
|
| - RefPtrWillBeRawPtr<CSSValue> currValue = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> currValue2 = nullptr;
|
| + NullableCSSValue currValue;
|
| + NullableCSSValue currValue2;
|
|
|
| Units unitless = FUnknown;
|
| CSSParserValue* val = m_valueList->current();
|
| @@ -2785,23 +2784,23 @@ bool CSSPropertyParser::parseFillProperty(CSSPropertyID propId, CSSPropertyID& p
|
|
|
| if (value && !values) {
|
| values = CSSValueList::createCommaSeparated();
|
| - values->append(value.release());
|
| + values->append(*value);
|
| }
|
|
|
| if (value2 && !values2) {
|
| values2 = CSSValueList::createCommaSeparated();
|
| - values2->append(value2.release());
|
| + values2->append(*value2);
|
| }
|
|
|
| if (values)
|
| - values->append(currValue.release());
|
| + values->append(*currValue);
|
| else
|
| - value = currValue.release();
|
| + value = currValue;
|
| if (currValue2) {
|
| if (values2)
|
| - values2->append(currValue2.release());
|
| + values2->append(*currValue2);
|
| else
|
| - value2 = currValue2.release();
|
| + value2 = currValue2;
|
| }
|
|
|
| // When parsing any fill shorthand property, we let it handle building up the lists for all
|
| @@ -2824,14 +2823,14 @@ bool CSSPropertyParser::parseFillProperty(CSSPropertyID propId, CSSPropertyID& p
|
| }
|
| } else {
|
| ASSERT(value);
|
| - retValue1 = value.release();
|
| - retValue2 = value2.release();
|
| + retValue1 = value;
|
| + retValue2 = value2;
|
| }
|
|
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationDelay()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationDelay()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (validUnit(value, FTime))
|
| @@ -2839,7 +2838,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationDelay()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationDirection()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationDirection()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (value->id == CSSValueNormal || value->id == CSSValueAlternate || value->id == CSSValueReverse || value->id == CSSValueAlternateReverse)
|
| @@ -2847,7 +2846,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationDirection()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationDuration()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationDuration()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (validUnit(value, FTime | FNonNeg))
|
| @@ -2855,7 +2854,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationDuration()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationFillMode()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationFillMode()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (value->id == CSSValueNone || value->id == CSSValueForwards || value->id == CSSValueBackwards || value->id == CSSValueBoth)
|
| @@ -2863,7 +2862,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationFillMode()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationIterationCount()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationIterationCount()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (value->id == CSSValueInfinite)
|
| @@ -2873,7 +2872,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationIterationCount
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationName(bool allowQuotedName)
|
| +NullableCSSValue CSSPropertyParser::parseAnimationName(bool allowQuotedName)
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
|
|
| @@ -2895,7 +2894,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationName(bool allo
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationPlayState()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationPlayState()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (value->id == CSSValueRunning || value->id == CSSValuePaused)
|
| @@ -2903,7 +2902,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationPlayState()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationProperty()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationProperty()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (value->unit != CSSPrimitiveValue::CSS_IDENT)
|
| @@ -2938,7 +2937,7 @@ bool CSSPropertyParser::parseCubicBezierTimingFunctionValue(CSSParserValueList*&
|
| return consumeComma(args);
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationTimingFunction()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationTimingFunction()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (value->id == CSSValueEase || value->id == CSSValueLinear || value->id == CSSValueEaseIn || value->id == CSSValueEaseOut
|
| @@ -3019,9 +3018,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationTimingFunction
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationProperty(CSSPropertyID propId, bool useLegacyParsing)
|
| +NullableCSSValue CSSPropertyParser::parseAnimationProperty(CSSPropertyID propId, bool useLegacyParsing)
|
| {
|
| - RefPtrWillBeRawPtr<CSSValue> value = nullptr;
|
| + NullableCSSValue value;
|
| switch (propId) {
|
| case CSSPropertyAnimationDelay:
|
| case CSSPropertyTransitionDelay:
|
| @@ -3060,17 +3059,17 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationProperty(CSSPr
|
|
|
| if (value)
|
| m_valueList->next();
|
| - return value.release();
|
| + return value;
|
| }
|
|
|
| PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseAnimationPropertyList(CSSPropertyID propId, bool useLegacyParsing)
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
|
| while (true) {
|
| - RefPtrWillBeRawPtr<CSSValue> value = parseAnimationProperty(propId, useLegacyParsing);
|
| + NullableCSSValue value = parseAnimationProperty(propId, useLegacyParsing);
|
| if (!value)
|
| return nullptr;
|
| - list->append(value.release());
|
| + list->append(*value);
|
| if (!m_valueList->current())
|
| break;
|
| if (!consumeComma(m_valueList) || !m_valueList->current())
|
| @@ -3120,7 +3119,7 @@ bool CSSPropertyParser::parseIntegerOrCustomIdentFromGridPosition(RefPtrWillBeRa
|
| return false;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridPosition()
|
| +NullableCSSValue CSSPropertyParser::parseGridPosition()
|
| {
|
| ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
|
|
|
| @@ -3176,9 +3175,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridPosition()
|
| return values.release();
|
| }
|
|
|
| -static PassRefPtrWillBeRawPtr<CSSValue> gridMissingGridPositionValue(CSSValue* value)
|
| +static CSSValue gridMissingGridPositionValue(CSSValue value)
|
| {
|
| - if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->isString())
|
| + if (value.isPrimitiveValue() && toCSSPrimitiveValue(value).isString())
|
| return value;
|
|
|
| return cssValuePool().createIdentifierValue(CSSValueAuto);
|
| @@ -3190,11 +3189,11 @@ bool CSSPropertyParser::parseGridItemPositionShorthand(CSSPropertyID shorthandId
|
| const StylePropertyShorthand& shorthand = shorthandForProperty(shorthandId);
|
| ASSERT(shorthand.length() == 2);
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> startValue = parseGridPosition();
|
| + NullableCSSValue startValue = parseGridPosition();
|
| if (!startValue)
|
| return false;
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> endValue = nullptr;
|
| + NullableCSSValue endValue;
|
| if (m_valueList->current()) {
|
| if (!isForwardSlashOperator(m_valueList->current()))
|
| return false;
|
| @@ -3206,15 +3205,15 @@ bool CSSPropertyParser::parseGridItemPositionShorthand(CSSPropertyID shorthandId
|
| if (!endValue || m_valueList->current())
|
| return false;
|
| } else {
|
| - endValue = gridMissingGridPositionValue(startValue.get());
|
| + endValue = gridMissingGridPositionValue(*startValue);
|
| }
|
|
|
| - addProperty(shorthand.properties()[0], startValue, important);
|
| - addProperty(shorthand.properties()[1], endValue, important);
|
| + addProperty(shorthand.properties()[0], *startValue, important);
|
| + addProperty(shorthand.properties()[1], *endValue, important);
|
| return true;
|
| }
|
|
|
| -bool CSSPropertyParser::parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSSValue> templateColumns, bool important)
|
| +bool CSSPropertyParser::parseGridTemplateRowsAndAreas(NullableCSSValue templateColumns, bool important)
|
| {
|
| NamedGridAreaMap gridAreaMap;
|
| size_t rowCount = 0;
|
| @@ -3230,7 +3229,7 @@ bool CSSPropertyParser::parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSS
|
| // Handle leading <custom-ident>*.
|
| if (trailingIdentWasAdded) {
|
| // A row's trailing ident must be concatenated with the next row's leading one.
|
| - maybeParseGridLineNames(*m_valueList, *templateRows, toCSSGridLineNamesValue(templateRows->item(templateRows->length() - 1)));
|
| + maybeParseGridLineNames(*m_valueList, *templateRows, &toCSSGridLineNamesValue(templateRows->item(templateRows->length() - 1)));
|
| } else {
|
| maybeParseGridLineNames(*m_valueList, *templateRows);
|
| }
|
| @@ -3242,10 +3241,10 @@ bool CSSPropertyParser::parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSS
|
|
|
| // Handle template-rows's track-size.
|
| if (m_valueList->current() && m_valueList->current()->unit != CSSParserValue::ValueList && m_valueList->current()->unit != CSSPrimitiveValue::CSS_STRING) {
|
| - RefPtrWillBeRawPtr<CSSValue> value = parseGridTrackSize(*m_valueList);
|
| + NullableCSSValue value = parseGridTrackSize(*m_valueList);
|
| if (!value)
|
| return false;
|
| - templateRows->append(value);
|
| + templateRows->append(*value);
|
| } else {
|
| templateRows->append(cssValuePool().createIdentifierValue(CSSValueAuto));
|
| }
|
| @@ -3258,13 +3257,13 @@ bool CSSPropertyParser::parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSS
|
|
|
| // [<track-list> /]?
|
| if (templateColumns)
|
| - addProperty(CSSPropertyGridTemplateColumns, templateColumns, important);
|
| + addProperty(CSSPropertyGridTemplateColumns, *templateColumns, important);
|
| else
|
| addProperty(CSSPropertyGridTemplateColumns, cssValuePool().createIdentifierValue(CSSValueNone), important);
|
|
|
| // [<line-names>? <string> [<track-size> <line-names>]? ]+
|
| - RefPtrWillBeRawPtr<CSSValue> templateAreas = CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount);
|
| - addProperty(CSSPropertyGridTemplateAreas, templateAreas.release(), important);
|
| + CSSValue templateAreas = CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount);
|
| + addProperty(CSSPropertyGridTemplateAreas, templateAreas, important);
|
| addProperty(CSSPropertyGridTemplateRows, templateRows.release(), important);
|
|
|
|
|
| @@ -3294,7 +3293,7 @@ bool CSSPropertyParser::parseGridTemplateShorthand(bool important)
|
| }
|
|
|
| unsigned index = 0;
|
| - RefPtrWillBeRawPtr<CSSValue> columnsValue = nullptr;
|
| + NullableCSSValue columnsValue;
|
| if (firstValueIsNone) {
|
| columnsValue = cssValuePool().createIdentifierValue(CSSValueNone);
|
| } else {
|
| @@ -3306,11 +3305,11 @@ bool CSSPropertyParser::parseGridTemplateShorthand(bool important)
|
| if (!(m_valueList->current() && isForwardSlashOperator(m_valueList->current()) && m_valueList->next()))
|
| return false;
|
| index = m_valueList->currentIndex();
|
| - if (RefPtrWillBeRawPtr<CSSValue> rowsValue = parseGridTrackList()) {
|
| + if (NullableCSSValue rowsValue = parseGridTrackList()) {
|
| if (m_valueList->current())
|
| return false;
|
| - addProperty(CSSPropertyGridTemplateColumns, columnsValue, important);
|
| - addProperty(CSSPropertyGridTemplateRows, rowsValue, important);
|
| + addProperty(CSSPropertyGridTemplateColumns, *columnsValue, important);
|
| + addProperty(CSSPropertyGridTemplateRows, *rowsValue, important);
|
| addProperty(CSSPropertyGridTemplateAreas, cssValuePool().createIdentifierValue(CSSValueNone), important);
|
| return true;
|
| }
|
| @@ -3348,8 +3347,8 @@ bool CSSPropertyParser::parseGridShorthand(bool important)
|
| if (!parseValue(CSSPropertyGridAutoFlow, important))
|
| return false;
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> autoColumnsValue = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> autoRowsValue = nullptr;
|
| + NullableCSSValue autoColumnsValue;
|
| + NullableCSSValue autoRowsValue;
|
|
|
| if (m_valueList->current()) {
|
| autoColumnsValue = parseGridTrackSize(*m_valueList);
|
| @@ -3374,8 +3373,8 @@ bool CSSPropertyParser::parseGridShorthand(bool important)
|
| if (!autoRowsValue)
|
| autoRowsValue = autoColumnsValue;
|
|
|
| - addProperty(CSSPropertyGridAutoColumns, autoColumnsValue, important);
|
| - addProperty(CSSPropertyGridAutoRows, autoRowsValue, important);
|
| + addProperty(CSSPropertyGridAutoColumns, *autoColumnsValue, important);
|
| + addProperty(CSSPropertyGridAutoRows, *autoRowsValue, important);
|
|
|
| // It can only be specified the explicit or the implicit grid properties in a single grid declaration.
|
| // The sub-properties not specified are set to their initial value, as normal for shorthands.
|
| @@ -3394,39 +3393,39 @@ bool CSSPropertyParser::parseGridAreaShorthand(bool important)
|
| const StylePropertyShorthand& shorthand = gridAreaShorthand();
|
| ASSERT_UNUSED(shorthand, shorthand.length() == 4);
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> rowStartValue = parseGridPosition();
|
| + NullableCSSValue rowStartValue = parseGridPosition();
|
| if (!rowStartValue)
|
| return false;
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> columnStartValue = nullptr;
|
| + NullableCSSValue columnStartValue;
|
| if (!parseSingleGridAreaLonghand(columnStartValue))
|
| return false;
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> rowEndValue = nullptr;
|
| + NullableCSSValue rowEndValue;
|
| if (!parseSingleGridAreaLonghand(rowEndValue))
|
| return false;
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> columnEndValue = nullptr;
|
| + NullableCSSValue columnEndValue;
|
| if (!parseSingleGridAreaLonghand(columnEndValue))
|
| return false;
|
|
|
| if (!columnStartValue)
|
| - columnStartValue = gridMissingGridPositionValue(rowStartValue.get());
|
| + columnStartValue = gridMissingGridPositionValue(*rowStartValue);
|
|
|
| if (!rowEndValue)
|
| - rowEndValue = gridMissingGridPositionValue(rowStartValue.get());
|
| + rowEndValue = gridMissingGridPositionValue(*rowStartValue);
|
|
|
| if (!columnEndValue)
|
| - columnEndValue = gridMissingGridPositionValue(columnStartValue.get());
|
| + columnEndValue = gridMissingGridPositionValue(*columnStartValue);
|
|
|
| - addProperty(CSSPropertyGridRowStart, rowStartValue, important);
|
| - addProperty(CSSPropertyGridColumnStart, columnStartValue, important);
|
| - addProperty(CSSPropertyGridRowEnd, rowEndValue, important);
|
| - addProperty(CSSPropertyGridColumnEnd, columnEndValue, important);
|
| + addProperty(CSSPropertyGridRowStart, *rowStartValue, important);
|
| + addProperty(CSSPropertyGridColumnStart, *columnStartValue, important);
|
| + addProperty(CSSPropertyGridRowEnd, *rowEndValue, important);
|
| + addProperty(CSSPropertyGridColumnEnd, *columnEndValue, important);
|
| return true;
|
| }
|
|
|
| -bool CSSPropertyParser::parseSingleGridAreaLonghand(RefPtrWillBeRawPtr<CSSValue>& property)
|
| +bool CSSPropertyParser::parseSingleGridAreaLonghand(NullableCSSValue& property)
|
| {
|
| if (!m_valueList->current())
|
| return true;
|
| @@ -3471,7 +3470,7 @@ void CSSPropertyParser::maybeParseGridLineNames(CSSParserValueList& inputList, C
|
| inputList.next();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackList()
|
| +NullableCSSValue CSSPropertyParser::parseGridTrackList()
|
| {
|
| ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
|
|
|
| @@ -3494,10 +3493,10 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackList()
|
| return nullptr;
|
| seenTrackSizeOrRepeatFunction = true;
|
| } else {
|
| - RefPtrWillBeRawPtr<CSSValue> value = parseGridTrackSize(*m_valueList);
|
| + NullableCSSValue value = parseGridTrackSize(*m_valueList);
|
| if (!value)
|
| return nullptr;
|
| - values->append(value);
|
| + values->append(*value);
|
| seenTrackSizeOrRepeatFunction = true;
|
| }
|
| // This will handle the trailing <ident>* in the grammar.
|
| @@ -3529,11 +3528,11 @@ bool CSSPropertyParser::parseGridTrackRepeatFunction(CSSValueList& list)
|
|
|
| size_t numberOfTracks = 0;
|
| while (arguments->current()) {
|
| - RefPtrWillBeRawPtr<CSSValue> trackSize = parseGridTrackSize(*arguments);
|
| + NullableCSSValue trackSize = parseGridTrackSize(*arguments);
|
| if (!trackSize)
|
| return false;
|
|
|
| - repeatedValues->append(trackSize);
|
| + repeatedValues->append(*trackSize);
|
| ++numberOfTracks;
|
|
|
| // This takes care of any trailing <ident>* in the grammar.
|
| @@ -3559,7 +3558,7 @@ bool CSSPropertyParser::parseGridTrackRepeatFunction(CSSValueList& list)
|
| }
|
|
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackSize(CSSParserValueList& inputList)
|
| +NullableCSSValue CSSPropertyParser::parseGridTrackSize(CSSParserValueList& inputList)
|
| {
|
| ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
|
|
|
| @@ -3676,7 +3675,7 @@ bool CSSPropertyParser::parseGridTemplateAreasRow(NamedGridAreaMap& gridAreaMap,
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTemplateAreas()
|
| +NullableCSSValue CSSPropertyParser::parseGridTemplateAreas()
|
| {
|
| if (m_valueList->current() && m_valueList->current()->id == CSSValueNone) {
|
| m_valueList->next();
|
| @@ -3699,7 +3698,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTemplateAreas()
|
| return CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount);
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridAutoFlow(CSSParserValueList& list)
|
| +NullableCSSValue CSSPropertyParser::parseGridAutoFlow(CSSParserValueList& list)
|
| {
|
| // [ row | column ] || dense
|
| ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
|
| @@ -3739,7 +3738,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridAutoFlow(CSSParserV
|
| return parsedValues;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseCounterContent(CSSParserValueList* args, bool counters)
|
| +NullableCSSValue CSSPropertyParser::parseCounterContent(CSSParserValueList* args, bool counters)
|
| {
|
| unsigned numArgs = args->size();
|
| if (counters && numArgs != 3 && numArgs != 5)
|
| @@ -4017,7 +4016,7 @@ bool CSSPropertyParser::parseLegacyPosition(CSSPropertyID propId, bool important
|
| return !m_valueList->next();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseContentDistributionOverflowPosition()
|
| +NullableCSSValue CSSPropertyParser::parseContentDistributionOverflowPosition()
|
| {
|
| // auto | <baseline-position> | <content-distribution> || [ <overflow-position>? && <content-position> ]
|
| // <baseline-position> = baseline | last-baseline;
|
| @@ -4156,14 +4155,14 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeCircle(C
|
| }
|
|
|
| if (argument->id == CSSValueAt && args->next()) {
|
| - RefPtrWillBeRawPtr<CSSValue> centerX = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> centerY = nullptr;
|
| + NullableCSSValue centerX;
|
| + NullableCSSValue centerY;
|
| parseFillPosition(args, centerX, centerY);
|
| if (centerX && centerY && !args->current()) {
|
| ASSERT(centerX->isPrimitiveValue());
|
| ASSERT(centerY->isPrimitiveValue());
|
| - shape->setCenterX(toCSSPrimitiveValue(centerX.get()));
|
| - shape->setCenterY(toCSSPrimitiveValue(centerY.get()));
|
| + shape->setCenterX(toCSSPrimitiveValue(centerX));
|
| + shape->setCenterY(toCSSPrimitiveValue(centerY));
|
| } else {
|
| return nullptr;
|
| }
|
| @@ -4208,16 +4207,16 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeEllipse(
|
|
|
| if (argument->id != CSSValueAt || !args->next()) // expecting ellipse(.. at <position>)
|
| return nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> centerX = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> centerY = nullptr;
|
| + NullableCSSValue centerX;
|
| + NullableCSSValue centerY;
|
| parseFillPosition(args, centerX, centerY);
|
| if (!centerX || !centerY || args->current())
|
| return nullptr;
|
|
|
| ASSERT(centerX->isPrimitiveValue());
|
| ASSERT(centerY->isPrimitiveValue());
|
| - shape->setCenterX(toCSSPrimitiveValue(centerX.get()));
|
| - shape->setCenterY(toCSSPrimitiveValue(centerY.get()));
|
| + shape->setCenterX(toCSSPrimitiveValue(centerX));
|
| + shape->setCenterY(toCSSPrimitiveValue(centerY));
|
| }
|
|
|
| return shape;
|
| @@ -4285,18 +4284,18 @@ static bool isBoxValue(CSSValueID valueId)
|
| return false;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseShapeProperty(CSSPropertyID propId)
|
| +NullableCSSValue CSSPropertyParser::parseShapeProperty(CSSPropertyID propId)
|
| {
|
| - RefPtrWillBeRawPtr<CSSValue> imageValue = nullptr;
|
| + NullableCSSValue imageValue;
|
| if (parseFillImage(m_valueList, imageValue)) {
|
| m_valueList->next();
|
| - return imageValue.release();
|
| + return imageValue;
|
| }
|
|
|
| return parseBasicShapeAndOrBox();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseBasicShapeAndOrBox()
|
| +NullableCSSValue CSSPropertyParser::parseBasicShapeAndOrBox()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
|
|
| @@ -4428,11 +4427,11 @@ bool CSSPropertyParser::parseFont(bool important)
|
| }
|
|
|
| // Font family must come now.
|
| - RefPtrWillBeRawPtr<CSSValue> parsedFamilyValue = parseFontFamily();
|
| + NullableCSSValue parsedFamilyValue = parseFontFamily();
|
| if (!parsedFamilyValue)
|
| return false;
|
|
|
| - addProperty(CSSPropertyFontFamily, parsedFamilyValue.release(), important);
|
| + addProperty(CSSPropertyFontFamily, *parsedFamilyValue, important);
|
|
|
| // FIXME: http://www.w3.org/TR/2011/WD-css3-fonts-20110324/#font-prop requires that
|
| // "font-stretch", "font-size-adjust", and "font-kerning" be reset to their initial values
|
| @@ -5449,7 +5448,7 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseShadow(CSSParserVal
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseReflect()
|
| +NullableCSSValue CSSPropertyParser::parseReflect()
|
| {
|
| // box-reflect: <direction> <offset> <mask>
|
|
|
| @@ -5479,7 +5478,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseReflect()
|
| }
|
|
|
| // Now for the mask.
|
| - RefPtrWillBeRawPtr<CSSValue> mask = nullptr;
|
| + NullableCSSValue mask;
|
| val = m_valueList->next();
|
| if (val) {
|
| mask = parseBorderImage(CSSPropertyWebkitBoxReflect);
|
| @@ -5487,7 +5486,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseReflect()
|
| return nullptr;
|
| }
|
|
|
| - return CSSReflectValue::create(direction.release(), offset.release(), mask.release());
|
| + return CSSReflectValue::create(direction.get(), offset.get(), mask);
|
| }
|
|
|
| static bool isFlexBasisMiddleArg(double flexGrow, double flexShrink, double unsetValue, int argSize)
|
| @@ -5539,14 +5538,14 @@ bool CSSPropertyParser::parseFlex(CSSParserValueList* args, bool important)
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseObjectPosition()
|
| +NullableCSSValue CSSPropertyParser::parseObjectPosition()
|
| {
|
| - RefPtrWillBeRawPtr<CSSValue> xValue = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> yValue = nullptr;
|
| + NullableCSSValue xValue;
|
| + NullableCSSValue yValue;
|
| parseFillPosition(m_valueList, xValue, yValue);
|
| if (!xValue || !yValue)
|
| return nullptr;
|
| - return createPrimitiveValuePair(toCSSPrimitiveValue(xValue.get()), toCSSPrimitiveValue(yValue.get()), Pair::KeepIdenticalValues);
|
| + return createPrimitiveValuePair(toCSSPrimitiveValue(xValue), toCSSPrimitiveValue(yValue), Pair::KeepIdenticalValues);
|
| }
|
|
|
| class BorderImageParseContext {
|
| @@ -5575,7 +5574,7 @@ public:
|
| bool allowWidth() const { return m_allowWidth; }
|
| bool requireOutset() const { return m_requireOutset; }
|
|
|
| - void commitImage(PassRefPtrWillBeRawPtr<CSSValue> image)
|
| + void commitImage(CSSValue image)
|
| {
|
| m_image = image;
|
| m_canAdvance = true;
|
| @@ -5640,7 +5639,7 @@ public:
|
| m_allowImage = !m_image;
|
| m_allowRepeat = !m_repeat;
|
| }
|
| - void commitRepeat(PassRefPtrWillBeRawPtr<CSSValue> repeat)
|
| + void commitRepeat(CSSValue repeat)
|
| {
|
| m_repeat = repeat;
|
| m_canAdvance = true;
|
| @@ -5653,9 +5652,9 @@ public:
|
| m_allowImage = !m_image;
|
| }
|
|
|
| - PassRefPtrWillBeRawPtr<CSSValue> commitCSSValue()
|
| + CSSValue commitCSSValue()
|
| {
|
| - return createBorderImageValue(m_image, m_imageSlice.get(), m_borderWidth.get(), m_outset.get(), m_repeat.get());
|
| + return createBorderImageValue(m_image, m_imageSlice.get(), m_borderWidth.get(), m_outset.get(), m_repeat);
|
| }
|
|
|
| bool m_canAdvance;
|
| @@ -5669,12 +5668,12 @@ public:
|
| bool m_allowWidth;
|
| bool m_requireOutset;
|
|
|
| - RefPtrWillBeMember<CSSValue> m_image;
|
| + NullableCSSValue m_image;
|
| RefPtrWillBeMember<CSSBorderImageSliceValue> m_imageSlice;
|
| RefPtrWillBeMember<CSSPrimitiveValue> m_borderWidth;
|
| RefPtrWillBeMember<CSSPrimitiveValue> m_outset;
|
|
|
| - RefPtrWillBeMember<CSSValue> m_repeat;
|
| + NullableCSSValue m_repeat;
|
| };
|
|
|
| bool CSSPropertyParser::buildBorderImageParseContext(CSSPropertyID propId, BorderImageParseContext& context)
|
| @@ -5690,15 +5689,15 @@ bool CSSPropertyParser::buildBorderImageParseContext(CSSPropertyID propId, Borde
|
| if (val->unit == CSSPrimitiveValue::CSS_URI) {
|
| context.commitImage(createCSSImageValueWithReferrer(val->string, m_context.completeURL(val->string)));
|
| } else if (isGeneratedImageValue(val)) {
|
| - RefPtrWillBeRawPtr<CSSValue> value = nullptr;
|
| + NullableCSSValue value;
|
| if (parseGeneratedImage(m_valueList, value))
|
| - context.commitImage(value.release());
|
| + context.commitImage(*value);
|
| else
|
| return false;
|
| } else if (val->unit == CSSParserValue::Function && val->function->id == CSSValueWebkitImageSet) {
|
| - RefPtrWillBeRawPtr<CSSValue> value = parseImageSet(m_valueList);
|
| + NullableCSSValue value = parseImageSet(m_valueList);
|
| if (value)
|
| - context.commitImage(value.release());
|
| + context.commitImage(*value);
|
| else
|
| return false;
|
| } else if (val->id == CSSValueNone)
|
| @@ -5712,9 +5711,9 @@ bool CSSPropertyParser::buildBorderImageParseContext(CSSPropertyID propId, Borde
|
| }
|
|
|
| if (!context.canAdvance() && context.allowRepeat()) {
|
| - RefPtrWillBeRawPtr<CSSValue> repeat = nullptr;
|
| + NullableCSSValue repeat;
|
| if (parseBorderImageRepeat(repeat))
|
| - context.commitRepeat(repeat.release());
|
| + context.commitRepeat(*repeat);
|
| }
|
|
|
| if (!context.canAdvance() && context.allowWidth()) {
|
| @@ -5738,10 +5737,10 @@ bool CSSPropertyParser::buildBorderImageParseContext(CSSPropertyID propId, Borde
|
| return context.allowCommit();
|
| }
|
|
|
| -void CSSPropertyParser::commitBorderImageProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr<CSSValue> value, bool important)
|
| +void CSSPropertyParser::commitBorderImageProperty(CSSPropertyID propId, NullableCSSValue value, bool important)
|
| {
|
| if (value)
|
| - addProperty(propId, value, important);
|
| + addProperty(propId, *value, important);
|
| else
|
| addProperty(propId, cssValuePool().createImplicitInitialValue(), important, true);
|
| }
|
| @@ -5756,7 +5755,7 @@ bool CSSPropertyParser::parseBorderImageShorthand(CSSPropertyID propId, bool imp
|
| commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageSlice, context.m_imageSlice.get(), important);
|
| commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageWidth, context.m_borderWidth.get(), important);
|
| commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageOutset, context.m_outset.get(), important);
|
| - commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageRepeat, context.m_repeat.get(), important);
|
| + commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageRepeat, context.m_repeat, important);
|
| return true;
|
| case CSSPropertyBorderImage:
|
| commitBorderImageProperty(CSSPropertyBorderImageSource, context.m_image, important);
|
| @@ -5773,7 +5772,7 @@ bool CSSPropertyParser::parseBorderImageShorthand(CSSPropertyID propId, bool imp
|
| return false;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseBorderImage(CSSPropertyID propId)
|
| +NullableCSSValue CSSPropertyParser::parseBorderImage(CSSPropertyID propId)
|
| {
|
| BorderImageParseContext context;
|
| if (buildBorderImageParseContext(propId, context)) {
|
| @@ -5787,7 +5786,7 @@ static bool isBorderImageRepeatKeyword(int id)
|
| return id == CSSValueStretch || id == CSSValueRepeat || id == CSSValueSpace || id == CSSValueRound;
|
| }
|
|
|
| -bool CSSPropertyParser::parseBorderImageRepeat(RefPtrWillBeRawPtr<CSSValue>& result)
|
| +bool CSSPropertyParser::parseBorderImageRepeat(NullableCSSValue& result)
|
| {
|
| RefPtrWillBeRawPtr<CSSPrimitiveValue> firstValue = nullptr;
|
| RefPtrWillBeRawPtr<CSSPrimitiveValue> secondValue = nullptr;
|
| @@ -6096,7 +6095,7 @@ bool CSSPropertyParser::parseBorderRadius(CSSPropertyID unresolvedProperty, bool
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseCounter(int defaultValue)
|
| +NullableCSSValue CSSPropertyParser::parseCounter(int defaultValue)
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
|
|
|
| @@ -6205,7 +6204,7 @@ bool CSSPropertyParser::parseDeprecatedGradientColorStop(CSSParserValue* a, CSSG
|
| return true;
|
| }
|
|
|
| -bool CSSPropertyParser::parseDeprecatedGradient(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& gradient)
|
| +bool CSSPropertyParser::parseDeprecatedGradient(CSSParserValueList* valueList, NullableCSSValue& gradient)
|
| {
|
| // Walk the arguments.
|
| CSSParserValueList* args = valueList->current()->function->args.get();
|
| @@ -6358,7 +6357,7 @@ static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueFromSideKeyword(CSSParserV
|
| return cssValuePool().createIdentifierValue(a->id);
|
| }
|
|
|
| -bool CSSPropertyParser::parseDeprecatedLinearGradient(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& gradient, CSSGradientRepeat repeating)
|
| +bool CSSPropertyParser::parseDeprecatedLinearGradient(CSSParserValueList* valueList, NullableCSSValue& gradient, CSSGradientRepeat repeating)
|
| {
|
| RefPtrWillBeRawPtr<CSSLinearGradientValue> result = CSSLinearGradientValue::create(repeating, CSSPrefixedLinearGradient);
|
|
|
| @@ -6428,7 +6427,7 @@ bool CSSPropertyParser::parseDeprecatedLinearGradient(CSSParserValueList* valueL
|
| return true;
|
| }
|
|
|
| -bool CSSPropertyParser::parseDeprecatedRadialGradient(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& gradient, CSSGradientRepeat repeating)
|
| +bool CSSPropertyParser::parseDeprecatedRadialGradient(CSSParserValueList* valueList, NullableCSSValue& gradient, CSSGradientRepeat repeating)
|
| {
|
| RefPtrWillBeRawPtr<CSSRadialGradientValue> result = CSSRadialGradientValue::create(repeating, CSSPrefixedRadialGradient);
|
|
|
| @@ -6444,8 +6443,8 @@ bool CSSPropertyParser::parseDeprecatedRadialGradient(CSSParserValueList* valueL
|
| bool expectComma = false;
|
|
|
| // Optional background-position
|
| - RefPtrWillBeRawPtr<CSSValue> centerX = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> centerY = nullptr;
|
| + NullableCSSValue centerX;
|
| + NullableCSSValue centerY;
|
| // parse2ValuesFillPosition advances the args next pointer.
|
| parse2ValuesFillPosition(args, centerX, centerY);
|
|
|
| @@ -6456,11 +6455,11 @@ bool CSSPropertyParser::parseDeprecatedRadialGradient(CSSParserValueList* valueL
|
| if (!a)
|
| return false;
|
|
|
| - result->setFirstX(toCSSPrimitiveValue(centerX.get()));
|
| - result->setSecondX(toCSSPrimitiveValue(centerX.get()));
|
| + result->setFirstX(toCSSPrimitiveValue(centerX));
|
| + result->setSecondX(toCSSPrimitiveValue(centerX));
|
| // CSS3 radial gradients always share the same start and end point.
|
| - result->setFirstY(toCSSPrimitiveValue(centerY.get()));
|
| - result->setSecondY(toCSSPrimitiveValue(centerY.get()));
|
| + result->setFirstY(toCSSPrimitiveValue(centerY));
|
| + result->setSecondY(toCSSPrimitiveValue(centerY));
|
|
|
| RefPtrWillBeRawPtr<CSSPrimitiveValue> shapeValue = nullptr;
|
| RefPtrWillBeRawPtr<CSSPrimitiveValue> sizeValue = nullptr;
|
| @@ -6540,7 +6539,7 @@ bool CSSPropertyParser::parseDeprecatedRadialGradient(CSSParserValueList* valueL
|
| return true;
|
| }
|
|
|
| -bool CSSPropertyParser::parseLinearGradient(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& gradient, CSSGradientRepeat repeating)
|
| +bool CSSPropertyParser::parseLinearGradient(CSSParserValueList* valueList, NullableCSSValue& gradient, CSSGradientRepeat repeating)
|
| {
|
| RefPtrWillBeRawPtr<CSSLinearGradientValue> result = CSSLinearGradientValue::create(repeating, CSSLinearGradient);
|
|
|
| @@ -6614,7 +6613,7 @@ bool CSSPropertyParser::parseLinearGradient(CSSParserValueList* valueList, RefPt
|
| return true;
|
| }
|
|
|
| -bool CSSPropertyParser::parseRadialGradient(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& gradient, CSSGradientRepeat repeating)
|
| +bool CSSPropertyParser::parseRadialGradient(CSSParserValueList* valueList, NullableCSSValue& gradient, CSSGradientRepeat repeating)
|
| {
|
| RefPtrWillBeRawPtr<CSSRadialGradientValue> result = CSSRadialGradientValue::create(repeating, CSSRadialGradient);
|
|
|
| @@ -6706,8 +6705,8 @@ bool CSSPropertyParser::parseRadialGradient(CSSParserValueList* valueList, RefPt
|
|
|
| // Second part of grammar, the center-position clause:
|
| // at <position>
|
| - RefPtrWillBeRawPtr<CSSValue> centerX = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> centerY = nullptr;
|
| + NullableCSSValue centerX;
|
| + NullableCSSValue centerY;
|
| if (a->unit == CSSPrimitiveValue::CSS_IDENT && a->id == CSSValueAt) {
|
| a = args->next();
|
| if (!a)
|
| @@ -6720,11 +6719,11 @@ bool CSSPropertyParser::parseRadialGradient(CSSParserValueList* valueList, RefPt
|
| a = args->current();
|
| if (!a)
|
| return false;
|
| - result->setFirstX(toCSSPrimitiveValue(centerX.get()));
|
| - result->setFirstY(toCSSPrimitiveValue(centerY.get()));
|
| + result->setFirstX(toCSSPrimitiveValue(centerX));
|
| + result->setFirstY(toCSSPrimitiveValue(centerY));
|
| // Right now, CSS radial gradients have the same start and end centers.
|
| - result->setSecondX(toCSSPrimitiveValue(centerX.get()));
|
| - result->setSecondY(toCSSPrimitiveValue(centerY.get()));
|
| + result->setSecondX(toCSSPrimitiveValue(centerX));
|
| + result->setSecondY(toCSSPrimitiveValue(centerY));
|
| }
|
|
|
| if (shapeValue || sizeValue || horizontalSize || centerX || centerY)
|
| @@ -6799,7 +6798,7 @@ bool CSSPropertyParser::parseGradientColorStops(CSSParserValueList* valueList, C
|
| return gradient->stopCount() >= 2;
|
| }
|
|
|
| -bool CSSPropertyParser::parseGeneratedImage(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& value)
|
| +bool CSSPropertyParser::parseGeneratedImage(CSSParserValueList* valueList, NullableCSSValue& value)
|
| {
|
| CSSParserValue* val = valueList->current();
|
|
|
| @@ -6861,14 +6860,14 @@ bool CSSPropertyParser::parseGeneratedImage(CSSParserValueList* valueList, RefPt
|
| return false;
|
| }
|
|
|
| -bool CSSPropertyParser::parseCrossfade(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& crossfade)
|
| +bool CSSPropertyParser::parseCrossfade(CSSParserValueList* valueList, NullableCSSValue& crossfade)
|
| {
|
| // Walk the arguments.
|
| CSSParserValueList* args = valueList->current()->function->args.get();
|
| if (!args || args->size() != 5)
|
| return false;
|
| - RefPtrWillBeRawPtr<CSSValue> fromImageValue = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> toImageValue = nullptr;
|
| + NullableCSSValue fromImageValue;
|
| + NullableCSSValue toImageValue;
|
|
|
| // The first argument is the "from" image. It is a fill image.
|
| if (!args->current() || !parseFillImage(args, fromImageValue))
|
| @@ -6899,7 +6898,7 @@ bool CSSPropertyParser::parseCrossfade(CSSParserValueList* valueList, RefPtrWill
|
| else
|
| return false;
|
|
|
| - RefPtrWillBeRawPtr<CSSCrossfadeValue> result = CSSCrossfadeValue::create(fromImageValue, toImageValue);
|
| + RefPtrWillBeRawPtr<CSSCrossfadeValue> result = CSSCrossfadeValue::create(*fromImageValue, *toImageValue);
|
| result->setPercentage(percentage);
|
|
|
| crossfade = result;
|
| @@ -6907,7 +6906,7 @@ bool CSSPropertyParser::parseCrossfade(CSSParserValueList* valueList, RefPtrWill
|
| return true;
|
| }
|
|
|
| -bool CSSPropertyParser::parseCanvas(CSSParserValueList* valueList, RefPtrWillBeRawPtr<CSSValue>& canvas)
|
| +bool CSSPropertyParser::parseCanvas(CSSParserValueList* valueList, NullableCSSValue& canvas)
|
| {
|
| // Walk the arguments.
|
| CSSParserValueList* args = valueList->current()->function->args.get();
|
| @@ -6923,7 +6922,7 @@ bool CSSPropertyParser::parseCanvas(CSSParserValueList* valueList, RefPtrWillBeR
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseImageSet(CSSParserValueList* valueList)
|
| +NullableCSSValue CSSPropertyParser::parseImageSet(CSSParserValueList* valueList)
|
| {
|
| CSSParserValue* function = valueList->current();
|
|
|
| @@ -6941,7 +6940,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseImageSet(CSSParserValue
|
| if (arg->unit != CSSPrimitiveValue::CSS_URI)
|
| return nullptr;
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> image = createCSSImageValueWithReferrer(arg->string, completeURL(arg->string));
|
| + CSSValue image = createCSSImageValueWithReferrer(arg->string, completeURL(arg->string));
|
| imageSet->append(image);
|
|
|
| arg = functionArgs->next();
|
| @@ -6972,7 +6971,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseImageSet(CSSParserValue
|
| return imageSet.release();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseWillChange()
|
| +NullableCSSValue CSSPropertyParser::parseWillChange()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
|
| if (m_valueList->current()->id == CSSValueAuto) {
|
| @@ -7144,9 +7143,9 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseTransformOrigin()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| CSSValueID id = value->id;
|
| - RefPtrWillBeRawPtr<CSSValue> xValue = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> yValue = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> zValue = nullptr;
|
| + NullableCSSValue xValue;
|
| + NullableCSSValue yValue;
|
| + NullableCSSValue zValue;
|
| if (id == CSSValueLeft || id == CSSValueRight) {
|
| xValue = cssValuePool().createIdentifierValue(id);
|
| } else if (id == CSSValueTop || id == CSSValueBottom) {
|
| @@ -7199,15 +7198,15 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseTransformOrigin()
|
| }
|
|
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
| - list->append(xValue.release());
|
| + list->append(*xValue);
|
| if (yValue)
|
| - list->append(yValue.release());
|
| + list->append(*yValue);
|
| if (zValue)
|
| - list->append(zValue.release());
|
| + list->append(*zValue);
|
| return list.release();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTouchAction()
|
| +NullableCSSValue CSSPropertyParser::parseTouchAction()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
| @@ -7230,8 +7229,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTouchAction()
|
| if (value->id != CSSValuePanX && !RuntimeEnabledFeatures::cssTouchActionPanDirectionsEnabled())
|
| return nullptr;
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> panValue = cssValuePool().createIdentifierValue(value->id);
|
| - list->append(panValue.release());
|
| + CSSValue panValue = cssValuePool().createIdentifierValue(value->id);
|
| + list->append(panValue);
|
| break;
|
| }
|
| case CSSValuePanY:
|
| @@ -7242,8 +7241,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTouchAction()
|
| ySet = true;
|
| if (value->id != CSSValuePanY && !RuntimeEnabledFeatures::cssTouchActionPanDirectionsEnabled())
|
| return nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> panValue = cssValuePool().createIdentifierValue(value->id);
|
| - list->append(panValue.release());
|
| + CSSValue panValue = cssValuePool().createIdentifierValue(value->id);
|
| + list->append(panValue);
|
| break;
|
| }
|
| default:
|
| @@ -7258,7 +7257,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTouchAction()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollBlocksOn()
|
| +NullableCSSValue CSSPropertyParser::parseScrollBlocksOn()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
| CSSParserValue* value = m_valueList->current();
|
| @@ -7267,10 +7266,10 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollBlocksOn()
|
| case CSSValueStartTouch:
|
| case CSSValueWheelEvent:
|
| case CSSValueScrollEvent: {
|
| - RefPtrWillBeRawPtr<CSSValue> flagValue = cssValuePool().createIdentifierValue(value->id);
|
| - if (list->hasValue(flagValue.get()))
|
| + CSSValue flagValue = cssValuePool().createIdentifierValue(value->id);
|
| + if (list->hasValue(flagValue))
|
| return nullptr;
|
| - list->append(flagValue.release());
|
| + list->append(flagValue);
|
| break;
|
| }
|
| default:
|
| @@ -7283,7 +7282,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollBlocksOn()
|
| return list.release();
|
| }
|
|
|
| -void CSSPropertyParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr<CSSValue> value, bool important)
|
| +void CSSPropertyParser::addTextDecorationProperty(CSSPropertyID propId, CSSValue value, bool important)
|
| {
|
| // The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set.
|
| if (propId == CSSPropertyTextDecoration && !important && !inShorthand()) {
|
| @@ -7333,7 +7332,7 @@ bool CSSPropertyParser::parseTextDecoration(CSSPropertyID propId, bool important
|
| return false;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTextEmphasisStyle()
|
| +NullableCSSValue CSSPropertyParser::parseTextEmphasisStyle()
|
| {
|
| RefPtrWillBeRawPtr<CSSPrimitiveValue> fill = nullptr;
|
| RefPtrWillBeRawPtr<CSSPrimitiveValue> shape = nullptr;
|
| @@ -7380,7 +7379,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTextEmphasisStyle()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTextIndent()
|
| +NullableCSSValue CSSPropertyParser::parseTextIndent()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
|
|
| @@ -7486,7 +7485,7 @@ bool CSSPropertyParser::parseFontFeatureTag(CSSValueList* settings)
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseFontFeatureSettings()
|
| +NullableCSSValue CSSPropertyParser::parseFontFeatureSettings()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> settings = CSSValueList::createCommaSeparated();
|
| while (true) {
|
| @@ -7575,7 +7574,7 @@ bool CSSPropertyParser::parseFontFaceDescriptor(CSSPropertyID propId)
|
| CSSParserValue* value = m_valueList->current();
|
| ASSERT(value);
|
| CSSValueID id = value->id;
|
| - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr;
|
| + NullableCSSValue parsedValue;
|
|
|
| switch (propId) {
|
| case CSSPropertyFontFamily:
|
| @@ -7616,7 +7615,7 @@ bool CSSPropertyParser::parseFontFaceDescriptor(CSSPropertyID propId)
|
| if (!parsedValue || m_valueList->current())
|
| return false;
|
|
|
| - addProperty(propId, parsedValue.release(), false);
|
| + addProperty(propId, *parsedValue, false);
|
| return true;
|
| }
|
|
|
| @@ -7664,7 +7663,7 @@ bool CSSPropertyParser::parseViewportProperty(CSSPropertyID propId, bool importa
|
| break;
|
| }
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr;
|
| + NullableCSSValue parsedValue;
|
| if (validPrimitive) {
|
| parsedValue = parseValidPrimitive(id, value);
|
| m_valueList->next();
|
| @@ -7672,7 +7671,7 @@ bool CSSPropertyParser::parseViewportProperty(CSSPropertyID propId, bool importa
|
|
|
| if (parsedValue) {
|
| if (!m_valueList->current() || inShorthand()) {
|
| - addProperty(propId, parsedValue.release(), important);
|
| + addProperty(propId, *parsedValue, important);
|
| return true;
|
| }
|
| }
|
| @@ -7805,7 +7804,7 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
|
| CSSValueID id = value->id;
|
|
|
| bool validPrimitive = false;
|
| - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr;
|
| + NullableCSSValue parsedValue;
|
|
|
| switch (propId) {
|
| /* The comment to the right defines all valid value of these
|
| @@ -7950,7 +7949,7 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
|
| else if (m_valueList->current()->id == CSSValueNone || m_valueList->current()->id == CSSValueCurrentcolor)
|
| parsedValue = cssValuePool().createIdentifierValue(m_valueList->current()->id);
|
| if (parsedValue) {
|
| - values->append(parsedValue);
|
| + values->append(*parsedValue);
|
| parsedValue = values;
|
| }
|
| }
|
| @@ -8031,7 +8030,7 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
|
| rollbackLastProperties(1);
|
| return false;
|
| }
|
| - CSSValue* value = m_parsedProperties.last().value();
|
| + CSSValue value = m_parsedProperties.last().value();
|
| addProperty(CSSPropertyMarkerMid, value, important);
|
| addProperty(CSSPropertyMarkerEnd, value, important);
|
| return true;
|
| @@ -8065,11 +8064,11 @@ bool CSSPropertyParser::parseSVGValue(CSSPropertyID propId, bool important)
|
| if (!parsedValue || (m_valueList->current() && !inShorthand()))
|
| return false;
|
|
|
| - addProperty(propId, parsedValue.release(), important);
|
| + addProperty(propId, *parsedValue, important);
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSVGStrokeDasharray()
|
| +NullableCSSValue CSSPropertyParser::parseSVGStrokeDasharray()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated();
|
| CSSParserValue* value = m_valueList->current();
|
| @@ -8096,7 +8095,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSVGStrokeDasharray()
|
| }
|
|
|
| // normal | [ fill || stroke || markers ]
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parsePaintOrder() const
|
| +NullableCSSValue CSSPropertyParser::parsePaintOrder() const
|
| {
|
| if (m_valueList->size() > 3)
|
| return nullptr;
|
| @@ -8259,17 +8258,17 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseTransform(bool useL
|
|
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
| for (CSSParserValue* value = m_valueList->current(); value; value = m_valueList->next()) {
|
| - RefPtrWillBeRawPtr<CSSValue> parsedTransformValue = parseTransformValue(useLegacyParsing, value);
|
| + NullableCSSValue parsedTransformValue = parseTransformValue(useLegacyParsing, value);
|
| if (!parsedTransformValue)
|
| return nullptr;
|
|
|
| - list->append(parsedTransformValue.release());
|
| + list->append(*parsedTransformValue);
|
| }
|
|
|
| return list.release();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTransformValue(bool useLegacyParsing, CSSParserValue *value)
|
| +NullableCSSValue CSSPropertyParser::parseTransformValue(bool useLegacyParsing, CSSParserValue *value)
|
| {
|
| if (value->unit != CSSParserValue::Function || !value->function)
|
| return nullptr;
|
| @@ -8341,7 +8340,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTransformValue(bool use
|
| return transformValue.release();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseMotionPath()
|
| +NullableCSSValue CSSPropertyParser::parseMotionPath()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
|
|
| @@ -8367,7 +8366,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseMotionPath()
|
| return CSSPathValue::create(pathString);
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseMotionRotation()
|
| +NullableCSSValue CSSPropertyParser::parseMotionRotation()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
| bool hasAutoOrReverse = false;
|
|
|