| Index: Source/core/css/parser/CSSPropertyParser.cpp
|
| diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
|
| index 8b082c78598b56264b1ab0d8053348048309681e..ca9286a5313aeaf2f831908fff65639d29d88ef0 100644
|
| --- a/Source/core/css/parser/CSSPropertyParser.cpp
|
| +++ b/Source/core/css/parser/CSSPropertyParser.cpp
|
| @@ -122,7 +122,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));
|
|
|
| @@ -314,10 +314,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;
|
| }
|
|
|
| @@ -396,7 +396,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();
|
| @@ -405,7 +405,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)
|
| @@ -454,7 +454,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] ]
|
| @@ -486,17 +486,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;
|
| }
|
|
|
| @@ -520,7 +519,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;
|
| }
|
| @@ -606,7 +605,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())
|
| @@ -638,7 +637,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));
|
|
|
| if (!consumeComma(m_valueList))
|
| return false;
|
| @@ -700,8 +699,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)) {
|
| @@ -710,13 +709,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;
|
| }
|
| @@ -929,8 +928,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;
|
| @@ -947,9 +946,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;
|
| @@ -1043,9 +1042,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;
|
| @@ -1231,7 +1230,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;
|
| }
|
| @@ -1442,7 +1441,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;
|
| @@ -1514,22 +1513,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;
|
| }
|
| @@ -1538,7 +1536,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) {
|
| @@ -1559,14 +1557,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;
|
| @@ -1615,29 +1613,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)
|
| @@ -1669,34 +1667,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;
|
| @@ -1709,10 +1707,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;
|
| @@ -1752,9 +1750,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;
|
| }
|
| }
|
| @@ -1805,9 +1803,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;
|
| }
|
| }
|
| @@ -1832,24 +1830,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;
|
| }
|
| @@ -1858,8 +1856,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++) {
|
| @@ -1901,11 +1899,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;
|
| @@ -1977,7 +1975,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);
|
| @@ -1987,7 +1985,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();
|
| @@ -1997,7 +1995,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;
|
| @@ -2016,7 +2014,7 @@ bool CSSPropertyParser::parse4Values(CSSPropertyID propId, const CSSPropertyID *
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollSnapPoints()
|
| +NullableCSSValue CSSPropertyParser::parseScrollSnapPoints()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
|
|
| @@ -2044,7 +2042,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollSnapPoints()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollSnapCoordinate()
|
| +NullableCSSValue CSSPropertyParser::parseScrollSnapCoordinate()
|
| {
|
| if (m_valueList->current()->id == CSSValueNone) {
|
| m_valueList->next();
|
| @@ -2134,15 +2132,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)
|
| @@ -2158,7 +2156,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));
|
| @@ -2196,14 +2194,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;
|
| @@ -2226,7 +2224,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 ||
|
| @@ -2235,7 +2233,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);
|
| @@ -2258,7 +2256,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) {
|
| @@ -2274,7 +2272,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) {
|
| @@ -2355,7 +2353,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.
|
| @@ -2403,7 +2401,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;
|
| @@ -2485,8 +2483,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);
|
| @@ -2499,7 +2497,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) {
|
| @@ -2542,27 +2540,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;
|
| @@ -2587,7 +2585,7 @@ void CSSPropertyParser::parse2ValuesFillPosition(CSSParserValueList* valueList,
|
| valueList->next();
|
| else {
|
| if (!inShorthand()) {
|
| - value1.clear();
|
| + value1 = nullptr;
|
| return;
|
| }
|
| }
|
| @@ -2604,7 +2602,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) {
|
| @@ -2642,10 +2640,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();
|
| @@ -2687,16 +2685,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) {
|
| @@ -2714,8 +2713,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();
|
| @@ -2831,23 +2830,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
|
| @@ -2870,14 +2869,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))
|
| @@ -2885,7 +2884,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)
|
| @@ -2893,7 +2892,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationDirection()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationDuration()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationDuration()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (validUnit(value, FTime | FNonNeg))
|
| @@ -2901,7 +2900,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)
|
| @@ -2909,7 +2908,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationFillMode()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationIterationCount()
|
| +NullableCSSValue CSSPropertyParser::parseAnimationIterationCount()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
| if (value->id == CSSValueInfinite)
|
| @@ -2919,7 +2918,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationIterationCount
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationName(bool allowQuotedName)
|
| +NullableCSSValue CSSPropertyParser::parseAnimationName(bool allowQuotedName)
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
|
|
| @@ -2941,7 +2940,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)
|
| @@ -2949,7 +2948,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)
|
| @@ -2984,7 +2983,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
|
| @@ -3065,9 +3064,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:
|
| @@ -3106,17 +3105,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())
|
| @@ -3166,7 +3165,7 @@ bool CSSPropertyParser::parseIntegerOrCustomIdentFromGridPosition(RefPtrWillBeRa
|
| return false;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridPosition()
|
| +NullableCSSValue CSSPropertyParser::parseGridPosition()
|
| {
|
| ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
|
|
|
| @@ -3222,9 +3221,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridPosition()
|
| return values.release();
|
| }
|
|
|
| -static PassRefPtrWillBeRawPtr<CSSValue> gridMissingGridPositionValue(CSSValue* value)
|
| +static CSSValue gridMissingGridPositionValue(CSSValue value)
|
| {
|
| - if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->isCustomIdent())
|
| + if (value.isPrimitiveValue() && toCSSPrimitiveValue(value).isCustomIdent())
|
| return value;
|
|
|
| return cssValuePool().createIdentifierValue(CSSValueAuto);
|
| @@ -3236,11 +3235,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;
|
| @@ -3252,15 +3251,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;
|
| @@ -3274,7 +3273,7 @@ bool CSSPropertyParser::parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSS
|
|
|
| while (m_valueList->current()) {
|
| // Handle leading <custom-ident>*.
|
| - if (!parseGridLineNames(*m_valueList, *templateRows, trailingIdentWasAdded ? toCSSGridLineNamesValue(templateRows->item(templateRows->length() - 1)) : nullptr))
|
| + if (!parseGridLineNames(*m_valueList, *templateRows, trailingIdentWasAdded ? toCSSGridLineNamesValue(NullableCSSValue(templateRows->item(templateRows->length() - 1))) : nullptr))
|
| return false;
|
|
|
| // Handle a template-area's row.
|
| @@ -3284,10 +3283,10 @@ bool CSSPropertyParser::parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSS
|
|
|
| // Handle template-rows's track-size.
|
| if (m_valueList->current() && 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));
|
| }
|
| @@ -3295,18 +3294,18 @@ bool CSSPropertyParser::parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSS
|
| // This will handle the trailing/leading <custom-ident>* in the grammar.
|
| if (!parseGridLineNames(*m_valueList, *templateRows))
|
| return false;
|
| - trailingIdentWasAdded = templateRows->item(templateRows->length() - 1)->isGridLineNamesValue();
|
| + trailingIdentWasAdded = templateRows->item(templateRows->length() - 1).isGridLineNamesValue();
|
| }
|
|
|
| // [<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);
|
|
|
| return true;
|
| @@ -3335,7 +3334,7 @@ bool CSSPropertyParser::parseGridTemplateShorthand(bool important)
|
| }
|
|
|
| unsigned index = 0;
|
| - RefPtrWillBeRawPtr<CSSValue> columnsValue = nullptr;
|
| + NullableCSSValue columnsValue;
|
| if (firstValueIsNone) {
|
| columnsValue = cssValuePool().createIdentifierValue(CSSValueNone);
|
| } else {
|
| @@ -3347,11 +3346,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;
|
| }
|
| @@ -3389,8 +3388,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);
|
| @@ -3415,8 +3414,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.
|
| @@ -3435,39 +3434,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;
|
| @@ -3487,7 +3486,7 @@ static inline bool isClosingBracket(const CSSParserValue& value)
|
| return value.unit == CSSParserValue::Operator && value.iValue == ']';
|
| }
|
|
|
| -bool CSSPropertyParser::parseGridLineNames(CSSParserValueList& inputList, CSSValueList& valueList, CSSGridLineNamesValue* previousNamedAreaTrailingLineNames)
|
| +bool CSSPropertyParser::parseGridLineNames(CSSParserValueList& inputList, CSSValueList& valueList, NullableCSSValue previousNamedAreaTrailingLineNames)
|
| {
|
| if (!inputList.current() || inputList.current()->unit != CSSParserValue::Operator || inputList.current()->iValue != '[')
|
| return true;
|
| @@ -3495,7 +3494,7 @@ bool CSSPropertyParser::parseGridLineNames(CSSParserValueList& inputList, CSSVal
|
| // Skip '['
|
| inputList.next();
|
|
|
| - RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = previousNamedAreaTrailingLineNames;
|
| + RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = toCSSGridLineNamesValue(previousNamedAreaTrailingLineNames);
|
| if (!lineNames)
|
| lineNames = CSSGridLineNamesValue::create();
|
|
|
| @@ -3522,7 +3521,7 @@ bool CSSPropertyParser::parseGridLineNames(CSSParserValueList& inputList, CSSVal
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackList()
|
| +NullableCSSValue CSSPropertyParser::parseGridTrackList()
|
| {
|
| ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
|
|
|
| @@ -3546,10 +3545,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 <custom-ident>* in the grammar.
|
| @@ -3583,11 +3582,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 <custom-ident>* in the grammar.
|
| @@ -3614,7 +3613,7 @@ bool CSSPropertyParser::parseGridTrackRepeatFunction(CSSValueList& list)
|
| }
|
|
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackSize(CSSParserValueList& inputList)
|
| +NullableCSSValue CSSPropertyParser::parseGridTrackSize(CSSParserValueList& inputList)
|
| {
|
| ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
|
|
|
| @@ -3768,7 +3767,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();
|
| @@ -3791,7 +3790,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());
|
| @@ -3831,7 +3830,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)
|
| @@ -4109,7 +4108,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;
|
| @@ -4248,14 +4247,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;
|
| }
|
| @@ -4300,16 +4299,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;
|
| @@ -4377,18 +4376,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();
|
|
|
| @@ -4520,11 +4519,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
|
| @@ -5232,7 +5231,7 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseShadow(CSSParserVal
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseReflect()
|
| +NullableCSSValue CSSPropertyParser::parseReflect()
|
| {
|
| // box-reflect: <direction> <offset> <mask>
|
|
|
| @@ -5262,7 +5261,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseReflect()
|
| }
|
|
|
| // Now for the mask.
|
| - RefPtrWillBeRawPtr<CSSValue> mask = nullptr;
|
| + NullableCSSValue mask;
|
| val = m_valueList->next();
|
| if (val) {
|
| mask = parseBorderImage(CSSPropertyWebkitBoxReflect);
|
| @@ -5270,7 +5269,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)
|
| @@ -5322,27 +5321,28 @@ bool CSSPropertyParser::parseFlex(CSSParserValueList* args, bool important)
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parsePosition(CSSParserValueList* valueList)
|
| +NullableCSSValue CSSPropertyParser::parsePosition(CSSParserValueList* valueList)
|
| {
|
| - RefPtrWillBeRawPtr<CSSValue> xValue = nullptr;
|
| - RefPtrWillBeRawPtr<CSSValue> yValue = nullptr;
|
| + NullableCSSValue xValue;
|
| + NullableCSSValue yValue;
|
| parseFillPosition(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);
|
| }
|
|
|
| // Parses a list of comma separated positions. i.e., <position>#
|
| -PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parsePositionList(CSSParserValueList* valueList)
|
| +NullableCSSValue CSSPropertyParser::parsePositionList(CSSParserValueList* valueList)
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> positions = CSSValueList::createCommaSeparated();
|
| while (true) {
|
| // parsePosition consumes values until it reaches a separator [,/],
|
| // an invalid token, or end of the list
|
| - RefPtrWillBeRawPtr<CSSValue> position = parsePosition(valueList);
|
| + NullableCSSValue position = parsePosition(valueList);
|
| if (!position)
|
| return nullptr;
|
| - positions->append(position);
|
| + positions->append(*position);
|
|
|
| if (!valueList->current())
|
| break;
|
| @@ -5379,7 +5379,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;
|
| @@ -5444,7 +5444,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;
|
| @@ -5457,9 +5457,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;
|
| @@ -5473,12 +5473,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)
|
| @@ -5494,15 +5494,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)
|
| @@ -5516,9 +5516,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()) {
|
| @@ -5542,10 +5542,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);
|
| }
|
| @@ -5560,7 +5560,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);
|
| @@ -5577,7 +5577,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)) {
|
| @@ -5591,7 +5591,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;
|
| @@ -5900,7 +5900,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();
|
|
|
| @@ -6009,7 +6009,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();
|
| @@ -6162,7 +6162,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);
|
|
|
| @@ -6232,7 +6232,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);
|
|
|
| @@ -6248,8 +6248,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);
|
|
|
| @@ -6260,11 +6260,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;
|
| @@ -6344,7 +6344,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);
|
|
|
| @@ -6418,7 +6418,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);
|
|
|
| @@ -6510,8 +6510,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)
|
| @@ -6524,11 +6524,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)
|
| @@ -6603,7 +6603,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();
|
|
|
| @@ -6665,14 +6665,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))
|
| @@ -6703,7 +6703,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;
|
| @@ -6711,7 +6711,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();
|
| @@ -6727,7 +6727,7 @@ bool CSSPropertyParser::parseCanvas(CSSParserValueList* valueList, RefPtrWillBeR
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseImageSet(CSSParserValueList* valueList)
|
| +NullableCSSValue CSSPropertyParser::parseImageSet(CSSParserValueList* valueList)
|
| {
|
| CSSParserValue* function = valueList->current();
|
|
|
| @@ -6745,7 +6745,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();
|
| @@ -6776,7 +6776,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) {
|
| @@ -6949,9 +6949,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) {
|
| @@ -7004,15 +7004,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();
|
| @@ -7035,8 +7035,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:
|
| @@ -7047,8 +7047,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:
|
| @@ -7063,7 +7063,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTouchAction()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseScrollBlocksOn()
|
| +NullableCSSValue CSSPropertyParser::parseScrollBlocksOn()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
| CSSParserValue* value = m_valueList->current();
|
| @@ -7072,10 +7072,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:
|
| @@ -7088,7 +7088,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()) {
|
| @@ -7138,7 +7138,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;
|
| @@ -7185,7 +7185,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTextEmphasisStyle()
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTextIndent()
|
| +NullableCSSValue CSSPropertyParser::parseTextIndent()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
|
|
| @@ -7291,7 +7291,7 @@ bool CSSPropertyParser::parseFontFeatureTag(CSSValueList* settings)
|
| return true;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseFontFeatureSettings()
|
| +NullableCSSValue CSSPropertyParser::parseFontFeatureSettings()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> settings = CSSValueList::createCommaSeparated();
|
| while (true) {
|
| @@ -7380,7 +7380,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:
|
| @@ -7421,7 +7421,7 @@ bool CSSPropertyParser::parseFontFaceDescriptor(CSSPropertyID propId)
|
| if (!parsedValue || m_valueList->current())
|
| return false;
|
|
|
| - addProperty(propId, parsedValue.release(), false);
|
| + addProperty(propId, *parsedValue, false);
|
| return true;
|
| }
|
|
|
| @@ -7469,7 +7469,7 @@ bool CSSPropertyParser::parseViewportProperty(CSSPropertyID propId, bool importa
|
| break;
|
| }
|
|
|
| - RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr;
|
| + NullableCSSValue parsedValue;
|
| if (validPrimitive) {
|
| parsedValue = parseValidPrimitive(id, value);
|
| m_valueList->next();
|
| @@ -7477,7 +7477,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;
|
| }
|
| }
|
| @@ -7599,7 +7599,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
|
| @@ -7744,7 +7744,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;
|
| }
|
| }
|
| @@ -7825,7 +7825,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;
|
| @@ -7859,11 +7859,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();
|
| @@ -7890,7 +7890,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;
|
| @@ -8053,17 +8053,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;
|
| @@ -8135,7 +8135,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTransformValue(bool use
|
| return transformValue.release();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseMotionPath()
|
| +NullableCSSValue CSSPropertyParser::parseMotionPath()
|
| {
|
| CSSParserValue* value = m_valueList->current();
|
|
|
| @@ -8161,7 +8161,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseMotionPath()
|
| return CSSPathValue::create(pathString);
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseMotionRotation()
|
| +NullableCSSValue CSSPropertyParser::parseMotionRotation()
|
| {
|
| RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
|
| bool hasAutoOrReverse = false;
|
|
|