Index: Source/core/css/parser/CSSPropertyParser.cpp |
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp |
index f4b04463235b9b7fac2cead8fdc56c6832f60cd0..113724f4d307a3fba6222cdf0442e502f3397cf4 100644 |
--- a/Source/core/css/parser/CSSPropertyParser.cpp |
+++ b/Source/core/css/parser/CSSPropertyParser.cpp |
@@ -75,7 +75,7 @@ static bool equalIgnoringCase(const CSSParserString& a, const char (&b)[N]) |
return a.is8Bit() ? WTF::equalIgnoringCase(b, a.characters8(), length) : WTF::equalIgnoringCase(b, a.characters16(), length); |
} |
-static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createPrimitiveValuePair(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> first, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> second, Pair::IdenticalValuesPolicy identicalValuesPolicy = Pair::DropIdenticalValues) |
+static CSSPrimitiveValue createPrimitiveValuePair(CSSPrimitiveValue first, CSSPrimitiveValue second, Pair::IdenticalValuesPolicy identicalValuesPolicy = Pair::DropIdenticalValues) |
{ |
return cssValuePool().createValue(Pair::create(first, second, identicalValuesPolicy)); |
} |
@@ -288,7 +288,7 @@ bool CSSPropertyParser::validUnit(CSSParserValue* value, Units unitflags, CSSPar |
} |
} |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::createPrimitiveNumericValue(CSSParserValue* value) |
+CSSPrimitiveValue CSSPropertyParser::createPrimitiveNumericValue(CSSParserValue* value) |
{ |
if (m_parsedCalculation) { |
ASSERT(isCalculation(value)); |
@@ -302,13 +302,13 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::createPrimitiveNume |
return cssValuePool().createValue(value->fValue, static_cast<CSSPrimitiveValue::UnitType>(value->unit)); |
} |
-inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::createPrimitiveStringValue(CSSParserValue* value) |
+inline CSSPrimitiveValue CSSPropertyParser::createPrimitiveStringValue(CSSParserValue* value) |
{ |
ASSERT(value->unit == CSSPrimitiveValue::CSS_STRING || value->unit == CSSPrimitiveValue::CSS_IDENT); |
return cssValuePool().createValue(value->string, CSSPrimitiveValue::CSS_STRING); |
} |
-inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::createPrimitiveCustomIdentValue(CSSParserValue* value) |
+inline CSSPrimitiveValue CSSPropertyParser::createPrimitiveCustomIdentValue(CSSParserValue* value) |
{ |
ASSERT(value->unit == CSSPrimitiveValue::CSS_STRING || value->unit == CSSPrimitiveValue::CSS_IDENT); |
return cssValuePool().createValue(value->string, CSSPrimitiveValue::CSS_CUSTOM_IDENT); |
@@ -376,7 +376,7 @@ bool CSSPropertyParser::validWidthOrHeight(CSSParserValue* value, Units unitless |
return validUnit(value, FLength | FPercent | FNonNeg | unitless); |
} |
-inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseValidPrimitive(CSSValueID identifier, CSSParserValue* value) |
+inline NullableCSSValue CSSPropertyParser::parseValidPrimitive(CSSValueID identifier, CSSParserValue* value) |
{ |
if (identifier) |
return cssValuePool().createIdentifierValue(identifier); |
@@ -911,9 +911,9 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import |
case CSSPropertyBorderImageOutset: |
case CSSPropertyWebkitMaskBoxImageOutset: { |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> result = nullptr; |
+ NullableCSSValue result; |
if (parseBorderImageOutset(result)) { |
- addProperty(propId, result, important); |
+ addProperty(propId, *result, important); |
return true; |
} |
break; |
@@ -938,9 +938,9 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import |
} |
case CSSPropertyBorderImageWidth: |
case CSSPropertyWebkitMaskBoxImageWidth: { |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> result = nullptr; |
+ NullableCSSValue result; |
if (parseBorderImageWidth(result)) { |
- addProperty(propId, result, important); |
+ addProperty(propId, *result, important); |
return true; |
} |
break; |
@@ -954,8 +954,8 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import |
validPrimitive = validUnit(value, FLength | FPercent | FNonNeg); |
if (!validPrimitive) |
return false; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1 = createPrimitiveNumericValue(value); |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2 = nullptr; |
+ CSSPrimitiveValue parsedValue1 = createPrimitiveNumericValue(value); |
+ NullableCSSValue parsedValue2; |
if (num == 2) { |
value = m_valueList->next(); |
validPrimitive = validUnit(value, FLength | FPercent | FNonNeg); |
@@ -965,7 +965,7 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import |
} else |
parsedValue2 = parsedValue1; |
- addProperty(propId, createPrimitiveValuePair(parsedValue1.release(), parsedValue2.release()), important); |
+ addProperty(propId, createPrimitiveValuePair(parsedValue1, toCSSPrimitiveValue(*parsedValue2)), important); |
return true; |
} |
case CSSPropertyTabSize: |
@@ -1750,7 +1750,7 @@ static bool isValidTransitionPropertyList(CSSValueList* value) |
// FIXME: Shorthand parsing shouldn't add initial to the list since it won't round-trip |
if (property.isInitialValue()) |
continue; |
- CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(property); |
+ CSSPrimitiveValue primitiveValue = toCSSPrimitiveValue(property); |
if (primitiveValue.isValueID() && primitiveValue.getValueID() == CSSValueNone) |
return false; |
} |
@@ -1877,7 +1877,7 @@ NullableCSSValue CSSPropertyParser::parseColumnWidth() |
// 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))) { |
- CSSValue parsedValue = parseValidPrimitive(value->id, value); |
+ NullableCSSValue parsedValue = parseValidPrimitive(value->id, value); |
m_valueList->next(); |
return parsedValue; |
} |
@@ -1888,7 +1888,7 @@ NullableCSSValue CSSPropertyParser::parseColumnCount() |
{ |
CSSParserValue* value = m_valueList->current(); |
if (value->id == CSSValueAuto || validUnit(value, FPositiveInteger)) { |
- CSSValue parsedValue = parseValidPrimitive(value->id, value); |
+ NullableCSSValue parsedValue = parseValidPrimitive(value->id, value); |
m_valueList->next(); |
return parsedValue; |
} |
@@ -2073,7 +2073,7 @@ NullableCSSValue CSSPropertyParser::parseScrollSnapPoints() |
CSSParserValue* repeatValue = arguments->valueAt(0); |
if (validUnit(repeatValue, FNonNeg | FLength | FPercent) && (m_parsedCalculation || repeatValue->fValue > 0)) { |
RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueRepeat); |
- result->append(parseValidPrimitive(repeatValue->id, repeatValue)); |
+ result->append(*parseValidPrimitive(repeatValue->id, repeatValue)); |
m_valueList->next(); |
return result.release(); |
} |
@@ -2092,7 +2092,7 @@ NullableCSSValue CSSPropertyParser::parseScrollSnapCoordinate() |
return parsePositionList(m_valueList); |
} |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parsePage() |
+NullableCSSValue CSSPropertyParser::parsePage() |
{ |
CSSParserValue* value = m_valueList->current(); |
m_valueList->next(); |
@@ -2310,7 +2310,7 @@ bool CSSPropertyParser::isColorKeyword(CSSValueID id) |
return (id >= CSSValueAqua && id <= CSSValueWebkitText) || id == CSSValueMenu; |
} |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseColor(const CSSParserValue* value, bool acceptQuirkyColors) |
+NullableCSSValue CSSPropertyParser::parseColor(const CSSParserValue* value, bool acceptQuirkyColors) |
{ |
CSSValueID id = value->id; |
if (isColorKeyword(id)) { |
@@ -2325,7 +2325,7 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseColor(const CS |
} |
// Used to parse background-color when part of a shorthand. |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseBackgroundColor(const CSSParserValue* value) |
+NullableCSSValue CSSPropertyParser::parseBackgroundColor(const CSSParserValue* value) |
{ |
CSSValueID id = value->id; |
// Allow -webkit-text regardless of quirks. |
@@ -2335,7 +2335,7 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseBackgroundColo |
} |
// Used to parse the '-webkit-tap-highlight-color' property. |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseTapHighlightColor(const CSSParserValue* value) |
+NullableCSSValue CSSPropertyParser::parseTapHighlightColor(const CSSParserValue* value) |
{ |
CSSValueID id = value->id; |
// Disallow -webkit-text regardless of quirks. |
@@ -2345,7 +2345,7 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseTapHighlightCo |
} |
// Used to parse <color> for CSS gradients. |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseGradientStopColor(const CSSParserValue* value) |
+NullableCSSValue CSSPropertyParser::parseGradientStopColor(const CSSParserValue* value) |
{ |
CSSValueID id = value->id; |
// Allow -webkit-text regardless of quirks. |
@@ -2355,7 +2355,7 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseGradientStopCo |
} |
// Used to parse colors for -webkit-gradient(...). |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseDeprecatedGradientStopColor(const CSSParserValue* value) |
+NullableCSSValue CSSPropertyParser::parseDeprecatedGradientStopColor(const CSSParserValue* value) |
{ |
// Disallow currentcolor. |
if (value->id == CSSValueCurrentcolor) |
@@ -2418,7 +2418,7 @@ NullableCSSValue CSSPropertyParser::parseFillPositionY(CSSParserValueList* value |
return nullptr; |
} |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseFillPositionComponent(CSSParserValueList* valueList, unsigned& cumulativeFlags, FillPositionFlag& individualFlag, FillPositionParsingMode parsingMode, Units unitless) |
+NullableCSSValue CSSPropertyParser::parseFillPositionComponent(CSSParserValueList* valueList, unsigned& cumulativeFlags, FillPositionFlag& individualFlag, FillPositionParsingMode parsingMode, Units unitless) |
{ |
CSSValueID id = valueList->current()->id; |
if (id == CSSValueLeft || id == CSSValueTop || id == CSSValueRight || id == CSSValueBottom || id == CSSValueCenter) { |
@@ -2483,21 +2483,21 @@ static bool isFillPositionKeyword(CSSValueID value) |
return value == CSSValueLeft || value == CSSValueTop || value == CSSValueBottom || value == CSSValueRight || value == CSSValueCenter; |
} |
-void CSSPropertyParser::parse4ValuesFillPosition(CSSParserValueList* valueList, NullableCSSValue& value1, NullableCSSValue& value2, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2) |
+void CSSPropertyParser::parse4ValuesFillPosition(CSSParserValueList* valueList, NullableCSSValue& value1, NullableCSSValue& value2, CSSPrimitiveValue parsedValue1, 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. |
- if (isFillPositionKeyword(parsedValue2->getValueID())) |
+ if (isFillPositionKeyword(parsedValue2.getValueID())) |
return; |
unsigned cumulativeFlags = 0; |
FillPositionFlag value3Flag = InvalidFillPosition; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> value3 = parseFillPositionComponent(valueList, cumulativeFlags, value3Flag, ResolveValuesAsKeyword); |
+ NullableCSSValue value3 = parseFillPositionComponent(valueList, cumulativeFlags, value3Flag, ResolveValuesAsKeyword); |
if (!value3) |
return; |
- CSSValueID ident1 = parsedValue1->getValueID(); |
- CSSValueID ident3 = value3->getValueID(); |
+ CSSValueID ident1 = parsedValue1.getValueID(); |
+ CSSValueID ident3 = toCSSPrimitiveValue(*value3).getValueID(); |
if (ident1 == CSSValueCenter) |
return; |
@@ -2515,27 +2515,27 @@ void CSSPropertyParser::parse4ValuesFillPosition(CSSParserValueList* valueList, |
cumulativeFlags = 0; |
FillPositionFlag value4Flag = InvalidFillPosition; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> value4 = parseFillPositionComponent(valueList, cumulativeFlags, value4Flag, ResolveValuesAsKeyword); |
+ NullableCSSValue value4 = parseFillPositionComponent(valueList, cumulativeFlags, value4Flag, ResolveValuesAsKeyword); |
if (!value4) |
return; |
// 4th value must be a length or a percentage. |
- if (isFillPositionKeyword(value4->getValueID())) |
+ if (isFillPositionKeyword(toCSSPrimitiveValue(*value4).getValueID())) |
return; |
value1 = createPrimitiveValuePair(parsedValue1, parsedValue2); |
- value2 = createPrimitiveValuePair(value3, value4); |
+ value2 = createPrimitiveValuePair(toCSSPrimitiveValue(*value3), toCSSPrimitiveValue(*value4)); |
if (ident1 == CSSValueTop || ident1 == CSSValueBottom) |
value1.swap(value2); |
valueList->next(); |
} |
-void CSSPropertyParser::parse3ValuesFillPosition(CSSParserValueList* valueList, NullableCSSValue& value1, NullableCSSValue& value2, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1, PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2) |
+void CSSPropertyParser::parse3ValuesFillPosition(CSSParserValueList* valueList, NullableCSSValue& value1, NullableCSSValue& value2, CSSPrimitiveValue parsedValue1, CSSPrimitiveValue parsedValue2) |
{ |
unsigned cumulativeFlags = 0; |
FillPositionFlag value3Flag = InvalidFillPosition; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> value3 = parseFillPositionComponent(valueList, cumulativeFlags, value3Flag, ResolveValuesAsKeyword); |
+ NullableCSSValue value3 = parseFillPositionComponent(valueList, cumulativeFlags, value3Flag, ResolveValuesAsKeyword); |
// value3 is not an expected value, we return. |
if (!value3) |
@@ -2544,9 +2544,9 @@ void CSSPropertyParser::parse3ValuesFillPosition(CSSParserValueList* valueList, |
valueList->next(); |
bool swapNeeded = false; |
- CSSValueID ident1 = parsedValue1->getValueID(); |
- CSSValueID ident2 = parsedValue2->getValueID(); |
- CSSValueID ident3 = value3->getValueID(); |
+ CSSValueID ident1 = parsedValue1.getValueID(); |
+ CSSValueID ident2 = parsedValue2.getValueID(); |
+ CSSValueID ident3 = toCSSPrimitiveValue(*value3).getValueID(); |
CSSValueID firstPositionKeyword; |
CSSValueID secondPositionKeyword; |
@@ -2566,7 +2566,7 @@ void CSSPropertyParser::parse3ValuesFillPosition(CSSParserValueList* valueList, |
swapNeeded = true; |
} |
value1 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(firstPositionKeyword), cssValuePool().createValue(50, CSSPrimitiveValue::CSS_PERCENTAGE)); |
- value2 = createPrimitiveValuePair(parsedValue2, value3); |
+ value2 = createPrimitiveValuePair(parsedValue2, toCSSPrimitiveValue(*value3)); |
} else if (ident3 == CSSValueCenter) { |
if (isFillPositionKeyword(ident2)) |
return; |
@@ -2579,8 +2579,8 @@ void CSSPropertyParser::parse3ValuesFillPosition(CSSParserValueList* valueList, |
value1 = createPrimitiveValuePair(parsedValue1, parsedValue2); |
value2 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(secondPositionKeyword), cssValuePool().createValue(50, CSSPrimitiveValue::CSS_PERCENTAGE)); |
} else { |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> firstPositionValue = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> secondPositionValue = nullptr; |
+ NullableCSSValue firstPositionValue; |
+ NullableCSSValue secondPositionValue; |
if (isFillPositionKeyword(ident2)) { |
// To match CSS grammar, we should only accept: [ center | left | right | bottom | top ] [ left | right | top | bottom ] [ <percentage> | <length> ]. |
@@ -2605,18 +2605,18 @@ void CSSPropertyParser::parse3ValuesFillPosition(CSSParserValueList* valueList, |
if (isValueConflictingWithCurrentEdge(ident1, secondPositionKeyword)) |
return; |
- value1 = createPrimitiveValuePair(parsedValue1, firstPositionValue); |
- value2 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(secondPositionKeyword), secondPositionValue); |
+ value1 = createPrimitiveValuePair(parsedValue1, toCSSPrimitiveValue(*firstPositionValue)); |
+ value2 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(secondPositionKeyword), toCSSPrimitiveValue(*secondPositionValue)); |
} |
if (ident1 == CSSValueTop || ident1 == CSSValueBottom || swapNeeded) |
value1.swap(value2); |
#if ENABLE(ASSERT) |
- CSSPrimitiveValue* first = toCSSPrimitiveValue(value1); |
- CSSPrimitiveValue* second = toCSSPrimitiveValue(value2); |
- ident1 = first->getPairValue()->first()->getValueID(); |
- ident2 = second->getPairValue()->first()->getValueID(); |
+ CSSPrimitiveValue first = toCSSPrimitiveValue(*value1); |
+ CSSPrimitiveValue second = toCSSPrimitiveValue(*value2); |
+ ident1 = toCSSPrimitiveValue(*first.getPairValue()->first()).getValueID(); |
+ ident2 = toCSSPrimitiveValue(*second.getPairValue()->first()).getValueID(); |
ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight); |
ASSERT(ident2 == CSSValueBottom || ident2 == CSSValueTop); |
#endif |
@@ -2674,14 +2674,14 @@ void CSSPropertyParser::parseFillPosition(CSSParserValueList* valueList, Nullabl |
return; |
} |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1 = toCSSPrimitiveValue(value1); |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2 = toCSSPrimitiveValue(value2); |
+ CSSPrimitiveValue parsedValue1 = toCSSPrimitiveValue(*value1); |
+ CSSPrimitiveValue parsedValue2 = toCSSPrimitiveValue(*value2); |
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) |
+ if (parsedValue2.getValueID() == CSSValueCenter) |
return; |
if (numberOfValues == 3) |
@@ -2770,7 +2770,7 @@ void CSSPropertyParser::parseFillRepeat(NullableCSSValue& value1, NullableCSSVal |
// If only one value was specified, value2 is the same as value1. |
m_implicitShorthand = true; |
- value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(value1)->getValueID()); |
+ value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(*value1).getValueID()); |
} |
NullableCSSValue CSSPropertyParser::parseFillSize(CSSPropertyID unresolvedProperty) |
@@ -2781,7 +2781,7 @@ NullableCSSValue CSSPropertyParser::parseFillSize(CSSPropertyID unresolvedProper |
if (value->id == CSSValueContain || value->id == CSSValueCover) |
return cssValuePool().createIdentifierValue(value->id); |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue1 = nullptr; |
+ NullableCSSValue parsedValue1; |
if (value->id == CSSValueAuto) |
parsedValue1 = cssValuePool().createIdentifierValue(CSSValueAuto); |
@@ -2791,7 +2791,7 @@ NullableCSSValue CSSPropertyParser::parseFillSize(CSSPropertyID unresolvedProper |
parsedValue1 = createPrimitiveNumericValue(value); |
} |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue2 = nullptr; |
+ NullableCSSValue parsedValue2; |
value = m_valueList->current(); |
if (value) { |
if (value->id == CSSValueAuto) { |
@@ -2811,7 +2811,7 @@ NullableCSSValue CSSPropertyParser::parseFillSize(CSSPropertyID unresolvedProper |
if (!parsedValue2) |
return parsedValue1; |
- return createPrimitiveValuePair(parsedValue1.release(), parsedValue2.release(), Pair::KeepIdenticalValues); |
+ return createPrimitiveValuePair(toCSSPrimitiveValue(*parsedValue1), toCSSPrimitiveValue(*parsedValue2), Pair::KeepIdenticalValues); |
} |
bool CSSPropertyParser::parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1, CSSPropertyID& propId2, |
@@ -3269,7 +3269,7 @@ static inline bool isValidCustomIdentForGridPositions(const CSSParserValue& valu |
} |
// The function parses [ <integer> || <custom-ident> ] in <grid-line> (which can be stand alone or with 'span'). |
-bool CSSPropertyParser::parseIntegerOrCustomIdentFromGridPosition(RefPtrWillBeRawPtr<CSSPrimitiveValue>& numericValue, RefPtrWillBeRawPtr<CSSPrimitiveValue>& gridLineName) |
+bool CSSPropertyParser::parseIntegerOrCustomIdentFromGridPosition(NullableCSSValue& numericValue, NullableCSSValue& gridLineName) |
{ |
CSSParserValue* value = m_valueList->current(); |
if (validUnit(value, FInteger) && value->fValue) { |
@@ -3305,8 +3305,8 @@ NullableCSSValue CSSPropertyParser::parseGridPosition() |
return cssValuePool().createIdentifierValue(CSSValueAuto); |
} |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> numericValue = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> gridLineName = nullptr; |
+ NullableCSSValue numericValue; |
+ NullableCSSValue gridLineName; |
bool hasSeenSpanKeyword = false; |
if (parseIntegerOrCustomIdentFromGridPosition(numericValue, gridLineName)) { |
@@ -3333,20 +3333,20 @@ NullableCSSValue CSSPropertyParser::parseGridPosition() |
return nullptr; |
// Negative numbers are not allowed for span (but are for <integer>). |
- if (hasSeenSpanKeyword && numericValue && numericValue->getIntValue() < 0) |
+ if (hasSeenSpanKeyword && numericValue && toCSSPrimitiveValue(*numericValue).getIntValue() < 0) |
return nullptr; |
// For the <custom-ident> case. |
if (gridLineName && !numericValue && !hasSeenSpanKeyword) |
- return cssValuePool().createValue(gridLineName->getStringValue(), CSSPrimitiveValue::CSS_CUSTOM_IDENT); |
+ return cssValuePool().createValue(toCSSPrimitiveValue(*gridLineName).getStringValue(), CSSPrimitiveValue::CSS_CUSTOM_IDENT); |
RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated(); |
if (hasSeenSpanKeyword) |
values->append(cssValuePool().createIdentifierValue(CSSValueSpan)); |
if (numericValue) |
- values->append(numericValue.release()); |
+ values->append(*numericValue); |
if (gridLineName) |
- values->append(gridLineName.release()); |
+ values->append(*gridLineName); |
ASSERT(values->length()); |
return values.release(); |
} |
@@ -3635,8 +3635,8 @@ bool CSSPropertyParser::parseGridLineNames(CSSParserValueList& inputList, CSSVal |
if (!isValidCustomIdentForGridPositions(*identValue)) |
return false; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> lineName = createPrimitiveCustomIdentValue(identValue); |
- lineNames->append(lineName.release()); |
+ CSSPrimitiveValue lineName = createPrimitiveCustomIdentValue(identValue); |
+ lineNames->append(lineName); |
inputList.next(); |
} |
@@ -3759,24 +3759,24 @@ NullableCSSValue CSSPropertyParser::parseGridTrackSize(CSSParserValueList& input |
if (!arguments || arguments->size() != 3 || !isComma(arguments->valueAt(1))) |
return nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> minTrackBreadth = parseGridBreadth(arguments->valueAt(0)); |
+ NullableCSSValue minTrackBreadth = parseGridBreadth(arguments->valueAt(0)); |
if (!minTrackBreadth) |
return nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> maxTrackBreadth = parseGridBreadth(arguments->valueAt(2)); |
+ NullableCSSValue maxTrackBreadth = parseGridBreadth(arguments->valueAt(2)); |
if (!maxTrackBreadth) |
return nullptr; |
RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValueMinmax); |
- result->append(minTrackBreadth); |
- result->append(maxTrackBreadth); |
+ result->append(*minTrackBreadth); |
+ result->append(*maxTrackBreadth); |
return result.release(); |
} |
return parseGridBreadth(currentValue); |
} |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseGridBreadth(CSSParserValue* currentValue) |
+NullableCSSValue CSSPropertyParser::parseGridBreadth(CSSParserValue* currentValue) |
{ |
if (currentValue->id == CSSValueMinContent || currentValue->id == CSSValueMaxContent) |
return cssValuePool().createIdentifierValue(currentValue->id); |
@@ -3971,9 +3971,9 @@ NullableCSSValue CSSPropertyParser::parseCounterContent(CSSParserValueList* args |
CSSParserValue* i = args->current(); |
if (i->unit != CSSPrimitiveValue::CSS_IDENT) |
return nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> identifier = createPrimitiveCustomIdentValue(i); |
+ CSSPrimitiveValue identifier = createPrimitiveCustomIdentValue(i); |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> separator = nullptr; |
+ NullableCSSValue separator; |
if (!counters) |
separator = cssValuePool().createValue(String(), CSSPrimitiveValue::CSS_CUSTOM_IDENT); |
else { |
@@ -3988,7 +3988,7 @@ NullableCSSValue CSSPropertyParser::parseCounterContent(CSSParserValueList* args |
separator = createPrimitiveCustomIdentValue(i); |
} |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = nullptr; |
+ NullableCSSValue listStyle; |
i = args->next(); |
if (!i) // Make the list style default decimal |
listStyle = cssValuePool().createIdentifierValue(CSSValueDecimal); |
@@ -4009,10 +4009,10 @@ NullableCSSValue CSSPropertyParser::parseCounterContent(CSSParserValueList* args |
listStyle = cssValuePool().createIdentifierValue(listStyleID); |
} |
- return cssValuePool().createValue(Counter::create(identifier.release(), listStyle.release(), separator.release())); |
+ return cssValuePool().createValue(Counter::create(identifier, toCSSPrimitiveValue(*listStyle), toCSSPrimitiveValue(*separator))); |
} |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseClipShape() |
+NullableCSSValue CSSPropertyParser::parseClipShape() |
{ |
CSSParserValue* value = m_valueList->current(); |
CSSParserValueList* args = value->function->args.get(); |
@@ -4029,7 +4029,7 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseClipShape() |
while (a) { |
if (a->id != CSSValueAuto && !validUnit(a, FLength | FUnitlessQuirk)) |
return nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> length = a->id == CSSValueAuto ? |
+ CSSPrimitiveValue length = a->id == CSSValueAuto ? |
cssValuePool().createIdentifierValue(CSSValueAuto) : |
createPrimitiveNumericValue(a); |
if (i == 0) |
@@ -4052,7 +4052,7 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseClipShape() |
return cssValuePool().createValue(rect.release()); |
} |
-static void completeBorderRadii(RefPtrWillBeRawPtr<CSSPrimitiveValue> radii[4]) |
+static void completeBorderRadii(NullableCSSValue radii[4]) |
{ |
if (radii[3]) |
return; |
@@ -4084,7 +4084,7 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseInsetRoundedCorner |
return nullptr; |
// FIXME: Refactor completeBorderRadii and the array |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> radii[2][4]; |
+ NullableCSSValue radii[2][4]; |
#if ENABLE(OILPAN) |
// Zero initialize the array of raw pointers. |
memset(&radii, 0, sizeof(radii)); |
@@ -4111,12 +4111,12 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseInsetRoundedCorner |
if (!validUnit(value, FLength | FPercent | FNonNeg)) |
return nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> radius = createPrimitiveNumericValue(value); |
+ CSSPrimitiveValue radius = createPrimitiveNumericValue(value); |
if (!indexAfterSlash) |
radii[0][i] = radius; |
else |
- radii[1][i - indexAfterSlash] = radius.release(); |
+ radii[1][i - indexAfterSlash] = radius; |
} |
if (!indexAfterSlash) { |
@@ -4126,10 +4126,10 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseInsetRoundedCorner |
} else { |
completeBorderRadii(radii[1]); |
} |
- shape->setTopLeftRadius(createPrimitiveValuePair(radii[0][0].release(), radii[1][0].release())); |
- shape->setTopRightRadius(createPrimitiveValuePair(radii[0][1].release(), radii[1][1].release())); |
- shape->setBottomRightRadius(createPrimitiveValuePair(radii[0][2].release(), radii[1][2].release())); |
- shape->setBottomLeftRadius(createPrimitiveValuePair(radii[0][3].release(), radii[1][3].release())); |
+ shape->setTopLeftRadius(createPrimitiveValuePair(toCSSPrimitiveValue(*radii[0][0]), toCSSPrimitiveValue(*radii[1][0]))); |
+ shape->setTopRightRadius(createPrimitiveValuePair(toCSSPrimitiveValue(*radii[0][1]), toCSSPrimitiveValue(*radii[1][1]))); |
+ shape->setBottomRightRadius(createPrimitiveValuePair(toCSSPrimitiveValue(*radii[0][2]), toCSSPrimitiveValue(*radii[1][2]))); |
+ shape->setBottomLeftRadius(createPrimitiveValuePair(toCSSPrimitiveValue(*radii[0][3]), toCSSPrimitiveValue(*radii[1][3]))); |
return shape; |
} |
@@ -4141,7 +4141,7 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeInset(CS |
RefPtrWillBeRawPtr<CSSBasicShapeInset> shape = CSSBasicShapeInset::create(); |
CSSParserValue* argument = args->current(); |
- WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>> widthArguments; |
+ WillBeHeapVector<CSSValue> widthArguments; |
bool hasRoundedInset = false; |
while (argument) { |
@@ -4160,19 +4160,19 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeInset(CS |
switch (widthArguments.size()) { |
case 1: { |
- shape->updateShapeSize1Value(widthArguments[0].get()); |
+ shape->updateShapeSize1Value(toCSSPrimitiveValue(widthArguments[0])); |
break; |
} |
case 2: { |
- shape->updateShapeSize2Values(widthArguments[0].get(), widthArguments[1].get()); |
+ shape->updateShapeSize2Values(toCSSPrimitiveValue(widthArguments[0]), toCSSPrimitiveValue(widthArguments[1])); |
break; |
} |
case 3: { |
- shape->updateShapeSize3Values(widthArguments[0].get(), widthArguments[1].get(), widthArguments[2].get()); |
+ shape->updateShapeSize3Values(toCSSPrimitiveValue(widthArguments[0]), toCSSPrimitiveValue(widthArguments[1]), toCSSPrimitiveValue(widthArguments[2])); |
break; |
} |
case 4: { |
- shape->updateShapeSize4Values(widthArguments[0].get(), widthArguments[1].get(), widthArguments[2].get(), widthArguments[3].get()); |
+ shape->updateShapeSize4Values(toCSSPrimitiveValue(widthArguments[0]), toCSSPrimitiveValue(widthArguments[1]), toCSSPrimitiveValue(widthArguments[2]), toCSSPrimitiveValue(widthArguments[3])); |
break; |
} |
default: |
@@ -4305,8 +4305,8 @@ bool CSSPropertyParser::parseItemPositionOverflowPosition(CSSPropertyID propId, |
return true; |
} |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> position = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> overflowAlignmentKeyword = nullptr; |
+ NullableCSSValue position; |
+ NullableCSSValue overflowAlignmentKeyword; |
if (isItemPositionKeyword(value->id)) { |
position = cssValuePool().createIdentifierValue(value->id); |
value = m_valueList->next(); |
@@ -4332,14 +4332,14 @@ bool CSSPropertyParser::parseItemPositionOverflowPosition(CSSPropertyID propId, |
ASSERT(position); |
if (overflowAlignmentKeyword) |
- addProperty(propId, createPrimitiveValuePair(position, overflowAlignmentKeyword), important); |
+ addProperty(propId, createPrimitiveValuePair(toCSSPrimitiveValue(*position), toCSSPrimitiveValue(*overflowAlignmentKeyword)), important); |
else |
- addProperty(propId, position.release(), important); |
+ addProperty(propId, *position, important); |
return true; |
} |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseShapeRadius(CSSParserValue* value) |
+NullableCSSValue CSSPropertyParser::parseShapeRadius(CSSParserValue* value) |
{ |
if (value->id == CSSValueClosestSide || value->id == CSSValueFarthestSide) |
return cssValuePool().createIdentifierValue(value->id); |
@@ -4368,8 +4368,8 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeCircle(C |
return nullptr; |
if (!args->currentIndex() && argument->id != CSSValueAt) { |
- if (RefPtrWillBeRawPtr<CSSPrimitiveValue> radius = parseShapeRadius(argument)) { |
- shape->setRadius(radius); |
+ if (NullableCSSValue radius = parseShapeRadius(argument)) { |
+ shape->setRadius(toCSSPrimitiveValue(*radius)); |
continue; |
} |
@@ -4383,8 +4383,8 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeCircle(C |
if (centerX && centerY && !args->current()) { |
ASSERT(centerX->isPrimitiveValue()); |
ASSERT(centerY->isPrimitiveValue()); |
- shape->setCenterX(toCSSPrimitiveValue(centerX)); |
- shape->setCenterY(toCSSPrimitiveValue(centerY)); |
+ shape->setCenterX(toCSSPrimitiveValue(*centerX)); |
+ shape->setCenterY(toCSSPrimitiveValue(*centerY)); |
} else { |
return nullptr; |
} |
@@ -4416,11 +4416,11 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeEllipse( |
return nullptr; |
if (args->currentIndex() < 2 && argument->id != CSSValueAt) { |
- if (RefPtrWillBeRawPtr<CSSPrimitiveValue> radius = parseShapeRadius(argument)) { |
+ if (NullableCSSValue radius = parseShapeRadius(argument)) { |
if (!shape->radiusX()) |
- shape->setRadiusX(radius); |
+ shape->setRadiusX(toCSSPrimitiveValue(*radius)); |
else |
- shape->setRadiusY(radius); |
+ shape->setRadiusY(toCSSPrimitiveValue(*radius)); |
continue; |
} |
@@ -4437,8 +4437,8 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeEllipse( |
ASSERT(centerX->isPrimitiveValue()); |
ASSERT(centerY->isPrimitiveValue()); |
- shape->setCenterX(toCSSPrimitiveValue(centerX)); |
- shape->setCenterY(toCSSPrimitiveValue(centerY)); |
+ shape->setCenterX(toCSSPrimitiveValue(*centerX)); |
+ shape->setCenterY(toCSSPrimitiveValue(*centerY)); |
} |
return shape; |
@@ -4473,14 +4473,14 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapePolygon( |
CSSParserValue* argumentX = args->current(); |
if (!argumentX || !validUnit(argumentX, FLength | FPercent)) |
return nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> xLength = createPrimitiveNumericValue(argumentX); |
+ CSSPrimitiveValue xLength = createPrimitiveNumericValue(argumentX); |
CSSParserValue* argumentY = args->next(); |
if (!argumentY || !validUnit(argumentY, FLength | FPercent)) |
return nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> yLength = createPrimitiveNumericValue(argumentY); |
+ CSSPrimitiveValue yLength = createPrimitiveNumericValue(argumentY); |
- shape->appendPoint(xLength.release(), yLength.release()); |
+ shape->appendPoint(xLength, yLength); |
if (!args->next()) |
break; |
@@ -4532,13 +4532,13 @@ NullableCSSValue CSSPropertyParser::parseBasicShapeAndOrBox() |
valueId = value->id; |
if (value->unit == CSSParserValue::Function && !shapeFound) { |
// parseBasicShape already asks for the next value list item. |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> shapeValue = parseBasicShape(); |
+ NullableCSSValue shapeValue = parseBasicShape(); |
if (!shapeValue) |
return nullptr; |
- list->append(shapeValue.release()); |
+ list->append(*shapeValue); |
shapeFound = true; |
} else if (isBoxValue(valueId) && !boxFound) { |
- list->append(parseValidPrimitive(valueId, value)); |
+ list->append(*parseValidPrimitive(valueId, value)); |
boxFound = true; |
m_valueList->next(); |
} else { |
@@ -4553,7 +4553,7 @@ NullableCSSValue CSSPropertyParser::parseBasicShapeAndOrBox() |
return list.release(); |
} |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseBasicShape() |
+NullableCSSValue CSSPropertyParser::parseBasicShape() |
{ |
CSSParserValue* value = m_valueList->current(); |
ASSERT(value->unit == CSSParserValue::Function); |
@@ -4640,10 +4640,10 @@ bool CSSPropertyParser::parseFont(bool important) |
value = m_valueList->next(); |
if (!value) |
return false; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> lineHeight = parseLineHeight(); |
+ NullableCSSValue lineHeight = parseLineHeight(); |
if (!lineHeight) |
return false; |
- addProperty(CSSPropertyLineHeight, lineHeight.release(), important); |
+ addProperty(CSSPropertyLineHeight, *lineHeight, important); |
} else { |
addProperty(CSSPropertyLineHeight, cssValuePool().createIdentifierValue(CSSValueNormal), important, true); |
} |
@@ -4795,7 +4795,7 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseFontFamily() |
return list.release(); |
} |
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseLineHeight() |
+NullableCSSValue CSSPropertyParser::parseLineHeight() |
{ |
CSSParserValue* value = m_valueList->current(); |
CSSValueID id = value->id; |
@@ -4829,7 +4829,7 @@ bool CSSPropertyParser::parseFontSize(bool important) |
else |
validPrimitive = validUnit(value, FLength | FPercent | FNonNeg | (inShorthand() ? FUnknown : FUnitlessQuirk)); |
if (validPrimitive && (!m_valueList->next() || inShorthand())) |
- addProperty(CSSPropertyFontSize, parseValidPrimitive(id, value), important); |
+ addProperty(CSSPropertyFontSize, *parseValidPrimitive(id, value), important); |
return validPrimitive; |
} |
@@ -4840,7 +4840,7 @@ bool CSSPropertyParser::parseFontVariant(bool important) |
values = CSSValueList::createCommaSeparated(); |
bool expectComma = false; |
for (CSSParserValue* val = m_valueList->current(); val; val = m_valueList->current()) { |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedValue = nullptr; |
+ NullableCSSValue parsedValue; |
if (!expectComma) { |
expectComma = true; |
if (val->id == CSSValueNormal || val->id == CSSValueSmallCaps) |
@@ -4865,9 +4865,9 @@ bool CSSPropertyParser::parseFontVariant(bool important) |
m_valueList->next(); |
if (values) |
- values->append(parsedValue.release()); |
+ values->append(*parsedValue); |
else { |
- addProperty(CSSPropertyFontVariant, parsedValue.release(), important); |
+ addProperty(CSSPropertyFontVariant, *parsedValue, important); |
return true; |
} |
} |
@@ -5198,7 +5198,7 @@ public: |
values = CSSValueList::createCommaSeparated(); |
// Construct the current shadow value and add it to the list. |
- values->append(CSSShadowValue::create(x.release(), y.release(), blur.release(), spread.release(), style.release(), color.release())); |
+ values->append(CSSShadowValue::create(x, y, blur, spread, style, color)); |
} |
// Now reset for the next shadow value. |
@@ -5218,7 +5218,7 @@ public: |
allowStyle = property == CSSPropertyBoxShadow; |
} |
- void commitLength(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) |
+ void commitLength(CSSPrimitiveValue val) |
{ |
if (allowX) { |
x = val; |
@@ -5244,7 +5244,7 @@ public: |
} |
} |
- void commitColor(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) |
+ void commitColor(CSSPrimitiveValue val) |
{ |
color = val; |
allowColor = false; |
@@ -5274,12 +5274,12 @@ public: |
CSSPropertyID property; |
RefPtrWillBeMember<CSSValueList> values; |
- RefPtrWillBeMember<CSSPrimitiveValue> x; |
- RefPtrWillBeMember<CSSPrimitiveValue> y; |
- RefPtrWillBeMember<CSSPrimitiveValue> blur; |
- RefPtrWillBeMember<CSSPrimitiveValue> spread; |
- RefPtrWillBeMember<CSSPrimitiveValue> style; |
- RefPtrWillBeMember<CSSPrimitiveValue> color; |
+ NullableCSSValue x; |
+ NullableCSSValue y; |
+ NullableCSSValue blur; |
+ NullableCSSValue spread; |
+ NullableCSSValue style; |
+ NullableCSSValue color; |
bool allowX; |
bool allowY; |
@@ -5313,8 +5313,8 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseShadow(CSSParserVal |
return nullptr; |
// A length is allowed here. Construct the value and add it. |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> length = createPrimitiveNumericValue(val); |
- context.commitLength(length.release()); |
+ CSSPrimitiveValue length = createPrimitiveNumericValue(val); |
+ context.commitLength(length); |
} else if (val->id == CSSValueInset) { |
if (!context.allowStyle) |
return nullptr; |
@@ -5325,11 +5325,11 @@ PassRefPtrWillBeRawPtr<CSSValueList> CSSPropertyParser::parseShadow(CSSParserVal |
return nullptr; |
// The only other type of value that's ok is a color value. |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> parsedColor = parseColor(val); |
+ NullableCSSValue parsedColor = parseColor(val); |
if (!parsedColor) |
return nullptr; |
- context.commitColor(parsedColor.release()); |
+ context.commitColor(toCSSPrimitiveValue(*parsedColor)); |
} |
} |
@@ -5348,7 +5348,7 @@ NullableCSSValue CSSPropertyParser::parseReflect() |
// Direction comes first. |
CSSParserValue* val = m_valueList->current(); |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> direction = nullptr; |
+ NullableCSSValue direction; |
switch (val->id) { |
case CSSValueAbove: |
case CSSValueBelow: |
@@ -5362,7 +5362,7 @@ NullableCSSValue CSSPropertyParser::parseReflect() |
// The offset comes next. |
val = m_valueList->next(); |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> offset = nullptr; |
+ NullableCSSValue offset; |
if (!val) |
offset = cssValuePool().createValue(0, CSSPrimitiveValue::CSS_PX); |
else { |
@@ -5380,7 +5380,7 @@ NullableCSSValue CSSPropertyParser::parseReflect() |
return nullptr; |
} |
- return CSSReflectValue::create(direction.get(), offset.get(), mask); |
+ return CSSReflectValue::create(toCSSPrimitiveValue(*direction), toCSSPrimitiveValue(*offset), mask); |
} |
static bool isFlexBasisMiddleArg(double flexGrow, double flexShrink, double unsetValue, int argSize) |
@@ -5395,7 +5395,7 @@ bool CSSPropertyParser::parseFlex(CSSParserValueList* args, bool important) |
static const double unsetValue = -1; |
double flexGrow = unsetValue; |
double flexShrink = unsetValue; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> flexBasis = nullptr; |
+ NullableCSSValue flexBasis; |
while (CSSParserValue* arg = args->current()) { |
if (validUnit(arg, FNumber | FNonNeg)) { |
@@ -5428,7 +5428,7 @@ bool CSSPropertyParser::parseFlex(CSSParserValueList* args, bool important) |
addProperty(CSSPropertyFlexGrow, cssValuePool().createValue(clampTo<float>(flexGrow), CSSPrimitiveValue::CSS_NUMBER), important); |
addProperty(CSSPropertyFlexShrink, cssValuePool().createValue(clampTo<float>(flexShrink), CSSPrimitiveValue::CSS_NUMBER), important); |
- addProperty(CSSPropertyFlexBasis, flexBasis, important); |
+ addProperty(CSSPropertyFlexBasis, *flexBasis, important); |
return true; |
} |
@@ -5440,7 +5440,7 @@ NullableCSSValue CSSPropertyParser::parsePosition(CSSParserValueList* valueList) |
if (!xValue || !yValue) |
return nullptr; |
- return createPrimitiveValuePair(toCSSPrimitiveValue(xValue), toCSSPrimitiveValue(yValue), Pair::KeepIdenticalValues); |
+ return createPrimitiveValuePair(toCSSPrimitiveValue(*xValue), toCSSPrimitiveValue(*yValue), Pair::KeepIdenticalValues); |
} |
// Parses a list of comma separated positions. i.e., <position># |
@@ -5531,7 +5531,7 @@ public: |
m_allowWidth = false; |
} |
} |
- void commitBorderWidth(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> width) |
+ void commitBorderWidth(CSSPrimitiveValue width) |
{ |
m_borderWidth = width; |
m_canAdvance = true; |
@@ -5543,7 +5543,7 @@ public: |
m_allowImage = !m_image; |
m_allowRepeat = !m_repeat; |
} |
- void commitBorderOutset(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> outset) |
+ void commitBorderOutset(CSSPrimitiveValue outset) |
{ |
m_outset = outset; |
m_canAdvance = true; |
@@ -5570,7 +5570,7 @@ public: |
CSSValue commitCSSValue() |
{ |
- return createBorderImageValue(m_image, m_imageSlice.get(), m_borderWidth.get(), m_outset.get(), m_repeat); |
+ return createBorderImageValue(m_image, m_imageSlice.get(), m_borderWidth, m_outset, m_repeat); |
} |
bool m_canAdvance; |
@@ -5586,8 +5586,8 @@ public: |
NullableCSSValue m_image; |
RefPtrWillBeMember<CSSBorderImageSliceValue> m_imageSlice; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_borderWidth; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_outset; |
+ NullableCSSValue m_borderWidth; |
+ NullableCSSValue m_outset; |
NullableCSSValue m_repeat; |
}; |
@@ -5633,15 +5633,15 @@ bool CSSPropertyParser::buildBorderImageParseContext(CSSPropertyID propId, Borde |
} |
if (!context.canAdvance() && context.allowWidth()) { |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> borderWidth = nullptr; |
+ NullableCSSValue borderWidth; |
if (parseBorderImageWidth(borderWidth)) |
- context.commitBorderWidth(borderWidth.release()); |
+ context.commitBorderWidth(toCSSPrimitiveValue(*borderWidth)); |
} |
if (!context.canAdvance() && context.requireOutset()) { |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> borderOutset = nullptr; |
+ NullableCSSValue borderOutset; |
if (parseBorderImageOutset(borderOutset)) |
- context.commitBorderOutset(borderOutset.release()); |
+ context.commitBorderOutset(toCSSPrimitiveValue(*borderOutset)); |
} |
if (!context.canAdvance()) |
@@ -5669,15 +5669,15 @@ bool CSSPropertyParser::parseBorderImageShorthand(CSSPropertyID propId, bool imp |
case CSSPropertyWebkitMaskBoxImage: |
commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageSource, context.m_image, important); |
commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageSlice, context.m_imageSlice.get(), important); |
- commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageWidth, context.m_borderWidth.get(), important); |
- commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageOutset, context.m_outset.get(), important); |
+ commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageWidth, context.m_borderWidth, important); |
+ commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageOutset, context.m_outset, important); |
commitBorderImageProperty(CSSPropertyWebkitMaskBoxImageRepeat, context.m_repeat, important); |
return true; |
case CSSPropertyBorderImage: |
commitBorderImageProperty(CSSPropertyBorderImageSource, context.m_image, important); |
commitBorderImageProperty(CSSPropertyBorderImageSlice, context.m_imageSlice.get(), important); |
- commitBorderImageProperty(CSSPropertyBorderImageWidth, context.m_borderWidth.get(), important); |
- commitBorderImageProperty(CSSPropertyBorderImageOutset, context.m_outset.get(), important); |
+ commitBorderImageProperty(CSSPropertyBorderImageWidth, context.m_borderWidth, important); |
+ commitBorderImageProperty(CSSPropertyBorderImageOutset, context.m_outset, important); |
commitBorderImageProperty(CSSPropertyBorderImageRepeat, context.m_repeat, important); |
return true; |
default: |
@@ -5704,8 +5704,8 @@ static bool isBorderImageRepeatKeyword(int id) |
bool CSSPropertyParser::parseBorderImageRepeat(NullableCSSValue& result) |
{ |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> firstValue = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> secondValue = nullptr; |
+ NullableCSSValue firstValue; |
+ NullableCSSValue secondValue; |
CSSParserValue* val = m_valueList->current(); |
if (!val) |
return false; |
@@ -5730,7 +5730,7 @@ bool CSSPropertyParser::parseBorderImageRepeat(NullableCSSValue& result) |
} else |
secondValue = firstValue; |
- result = createPrimitiveValuePair(firstValue, secondValue); |
+ result = createPrimitiveValuePair(toCSSPrimitiveValue(*firstValue), toCSSPrimitiveValue(*secondValue)); |
return true; |
} |
@@ -5747,9 +5747,9 @@ public: |
bool allowNumber() const { return m_allowNumber; } |
bool allowFill() const { return m_allowFill; } |
bool allowFinalCommit() const { return m_allowFinalCommit; } |
- CSSPrimitiveValue* top() const { return m_top.get(); } |
+ NullableCSSValue top() const { return m_top; } |
- void commitNumber(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) |
+ void commitNumber(CSSPrimitiveValue val) |
{ |
if (!m_top) |
m_top = val; |
@@ -5786,10 +5786,10 @@ public: |
// Now build a rect value to hold all four of our primitive values. |
RefPtrWillBeRawPtr<Quad> quad = Quad::create(); |
- quad->setTop(m_top); |
- quad->setRight(m_right); |
- quad->setBottom(m_bottom); |
- quad->setLeft(m_left); |
+ quad->setTop(toCSSPrimitiveValue(*m_top)); |
+ quad->setRight(toCSSPrimitiveValue(*m_right)); |
+ quad->setBottom(toCSSPrimitiveValue(*m_bottom)); |
+ quad->setLeft(toCSSPrimitiveValue(*m_left)); |
// Make our new border image value now. |
return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.release()), m_fill); |
@@ -5800,10 +5800,10 @@ private: |
bool m_allowFill; |
bool m_allowFinalCommit; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_top; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_right; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_bottom; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_left; |
+ NullableCSSValue m_top; |
+ NullableCSSValue m_right; |
+ NullableCSSValue m_bottom; |
+ NullableCSSValue m_left; |
bool m_fill; |
}; |
@@ -5853,9 +5853,9 @@ public: |
bool allowNumber() const { return m_allowNumber; } |
bool allowFinalCommit() const { return m_allowFinalCommit; } |
- CSSPrimitiveValue* top() const { return m_top.get(); } |
+ NullableCSSValue top() const { return m_top; } |
- void commitNumber(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) |
+ void commitNumber(CSSPrimitiveValue val) |
{ |
if (!m_top) |
m_top = val; |
@@ -5872,9 +5872,9 @@ public: |
m_allowFinalCommit = true; |
} |
- void setTop(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> val) { m_top = val; } |
+ void setTop(CSSPrimitiveValue val) { m_top = val; } |
- PassRefPtrWillBeRawPtr<CSSPrimitiveValue> commitBorderImageQuad() |
+ CSSPrimitiveValue commitBorderImageQuad() |
{ |
// We need to clone and repeat values for any omissions. |
ASSERT(m_top); |
@@ -5892,10 +5892,10 @@ public: |
// Now build a quad value to hold all four of our primitive values. |
RefPtrWillBeRawPtr<Quad> quad = Quad::create(); |
- quad->setTop(m_top); |
- quad->setRight(m_right); |
- quad->setBottom(m_bottom); |
- quad->setLeft(m_left); |
+ quad->setTop(toCSSPrimitiveValue(*m_top)); |
+ quad->setRight(toCSSPrimitiveValue(*m_right)); |
+ quad->setBottom(toCSSPrimitiveValue(*m_bottom)); |
+ quad->setLeft(toCSSPrimitiveValue(*m_left)); |
// Make our new value now. |
return cssValuePool().createValue(quad.release()); |
@@ -5905,13 +5905,13 @@ private: |
bool m_allowNumber; |
bool m_allowFinalCommit; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_top; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_right; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_bottom; |
- RefPtrWillBeMember<CSSPrimitiveValue> m_left; |
+ NullableCSSValue m_top; |
+ NullableCSSValue m_right; |
+ NullableCSSValue m_bottom; |
+ NullableCSSValue m_left; |
}; |
-bool CSSPropertyParser::parseBorderImageQuad(Units validUnits, RefPtrWillBeRawPtr<CSSPrimitiveValue>& result) |
+bool CSSPropertyParser::parseBorderImageQuad(Units validUnits, NullableCSSValue& result) |
{ |
BorderImageQuadParseContext context; |
for (CSSParserValue* val = m_valueList->current(); val; val = m_valueList->next()) { |
@@ -5938,12 +5938,12 @@ bool CSSPropertyParser::parseBorderImageQuad(Units validUnits, RefPtrWillBeRawPt |
return false; |
} |
-bool CSSPropertyParser::parseBorderImageWidth(RefPtrWillBeRawPtr<CSSPrimitiveValue>& result) |
+bool CSSPropertyParser::parseBorderImageWidth(NullableCSSValue& result) |
{ |
return parseBorderImageQuad(FLength | FNumber | FNonNeg | FPercent, result); |
} |
-bool CSSPropertyParser::parseBorderImageOutset(RefPtrWillBeRawPtr<CSSPrimitiveValue>& result) |
+bool CSSPropertyParser::parseBorderImageOutset(NullableCSSValue& result) |
{ |
return parseBorderImageQuad(FLength | FNumber | FNonNeg, result); |
} |
@@ -5955,7 +5955,7 @@ bool CSSPropertyParser::parseBorderRadius(CSSPropertyID unresolvedProperty, bool |
return false; |
ShorthandScope scope(this, unresolvedProperty); |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> radii[2][4]; |
+ NullableCSSValue radii[2][4]; |
#if ENABLE(OILPAN) |
// Zero initialize the array of raw pointers. |
memset(&radii, 0, sizeof(radii)); |
@@ -5982,7 +5982,7 @@ bool CSSPropertyParser::parseBorderRadius(CSSPropertyID unresolvedProperty, bool |
if (!validUnit(value, FLength | FPercent | FNonNeg)) |
return false; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> radius = createPrimitiveNumericValue(value); |
+ CSSPrimitiveValue radius = createPrimitiveNumericValue(value); |
if (!indexAfterSlash) { |
radii[0][i] = radius; |
@@ -5992,8 +5992,9 @@ bool CSSPropertyParser::parseBorderRadius(CSSPropertyID unresolvedProperty, bool |
indexAfterSlash = 1; |
completeBorderRadii(radii[0]); |
} |
- } else |
- radii[1][i - indexAfterSlash] = radius.release(); |
+ } else { |
+ radii[1][i - indexAfterSlash] = radius; |
+ } |
} |
if (!indexAfterSlash) { |
@@ -6004,10 +6005,10 @@ bool CSSPropertyParser::parseBorderRadius(CSSPropertyID unresolvedProperty, bool |
completeBorderRadii(radii[1]); |
ImplicitScope implicitScope(this); |
- addProperty(CSSPropertyBorderTopLeftRadius, createPrimitiveValuePair(radii[0][0].release(), radii[1][0].release()), important); |
- addProperty(CSSPropertyBorderTopRightRadius, createPrimitiveValuePair(radii[0][1].release(), radii[1][1].release()), important); |
- addProperty(CSSPropertyBorderBottomRightRadius, createPrimitiveValuePair(radii[0][2].release(), radii[1][2].release()), important); |
- addProperty(CSSPropertyBorderBottomLeftRadius, createPrimitiveValuePair(radii[0][3].release(), radii[1][3].release()), important); |
+ addProperty(CSSPropertyBorderTopLeftRadius, createPrimitiveValuePair(toCSSPrimitiveValue(*radii[0][0]), toCSSPrimitiveValue(*radii[1][0])), important); |
+ addProperty(CSSPropertyBorderTopRightRadius, createPrimitiveValuePair(toCSSPrimitiveValue(*radii[0][1]), toCSSPrimitiveValue(*radii[1][1])), important); |
+ addProperty(CSSPropertyBorderBottomRightRadius, createPrimitiveValuePair(toCSSPrimitiveValue(*radii[0][2]), toCSSPrimitiveValue(*radii[1][2])), important); |
+ addProperty(CSSPropertyBorderBottomLeftRadius, createPrimitiveValuePair(toCSSPrimitiveValue(*radii[0][3]), toCSSPrimitiveValue(*radii[1][3])), important); |
return true; |
} |
@@ -6019,7 +6020,7 @@ NullableCSSValue CSSPropertyParser::parseCounter(int defaultValue) |
CSSParserValue* val = m_valueList->current(); |
if (val->unit != CSSPrimitiveValue::CSS_IDENT) |
return nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> counterName = createPrimitiveCustomIdentValue(val); |
+ CSSPrimitiveValue counterName = createPrimitiveCustomIdentValue(val); |
m_valueList->next(); |
val = m_valueList->current(); |
@@ -6029,7 +6030,7 @@ NullableCSSValue CSSPropertyParser::parseCounter(int defaultValue) |
m_valueList->next(); |
} |
- list->append(createPrimitiveValuePair(counterName.release(), |
+ list->append(createPrimitiveValuePair(counterName, |
cssValuePool().createValue(i, CSSPrimitiveValue::CSS_NUMBER))); |
} |
@@ -6039,9 +6040,9 @@ NullableCSSValue CSSPropertyParser::parseCounter(int defaultValue) |
} |
// This should go away once we drop support for -webkit-gradient |
-static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> parseDeprecatedGradientPoint(CSSParserValue* a, bool horizontal) |
+static NullableCSSValue parseDeprecatedGradientPoint(CSSParserValue* a, bool horizontal) |
{ |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> result = nullptr; |
+ NullableCSSValue result; |
if (a->unit == CSSPrimitiveValue::CSS_IDENT) { |
if ((a->id == CSSValueLeft && horizontal) |
|| (a->id == CSSValueTop && !horizontal)) |
@@ -6153,10 +6154,10 @@ bool CSSPropertyParser::parseDeprecatedGradient(CSSParserValueList* valueList, N |
a = args->current(); |
if (!a) |
return false; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> point = parseDeprecatedGradientPoint(a, true); |
+ NullableCSSValue point = parseDeprecatedGradientPoint(a, true); |
if (!point) |
return false; |
- result->setFirstX(point.release()); |
+ result->setFirstX(point); |
// First Y. It can be top, bottom, number or percent. |
a = args->next(); |
@@ -6165,7 +6166,7 @@ bool CSSPropertyParser::parseDeprecatedGradient(CSSParserValueList* valueList, N |
point = parseDeprecatedGradientPoint(a, false); |
if (!point) |
return false; |
- result->setFirstY(point.release()); |
+ result->setFirstY(*point); |
// Comma after the first point. |
args->next(); |
@@ -6193,7 +6194,7 @@ bool CSSPropertyParser::parseDeprecatedGradient(CSSParserValueList* valueList, N |
point = parseDeprecatedGradientPoint(a, true); |
if (!point) |
return false; |
- result->setSecondX(point.release()); |
+ result->setSecondX(*point); |
// Second Y. It can be top, bottom, number or percent. |
a = args->next(); |
@@ -6202,7 +6203,7 @@ bool CSSPropertyParser::parseDeprecatedGradient(CSSParserValueList* valueList, N |
point = parseDeprecatedGradientPoint(a, false); |
if (!point) |
return false; |
- result->setSecondY(point.release()); |
+ result->setSecondY(*point); |
args->next(); |
// For radial gradients only, we now expect the second radius. |
@@ -6244,7 +6245,7 @@ bool CSSPropertyParser::parseDeprecatedGradient(CSSParserValueList* valueList, N |
return true; |
} |
-static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueFromSideKeyword(CSSParserValue* a, bool& isHorizontal) |
+static NullableCSSValue valueFromSideKeyword(CSSParserValue* a, bool& isHorizontal) |
{ |
if (a->unit != CSSPrimitiveValue::CSS_IDENT) |
return nullptr; |
@@ -6286,10 +6287,10 @@ bool CSSPropertyParser::parseDeprecatedLinearGradient(CSSParserValueList* valueL |
expectComma = true; |
} else { |
// Look one or two optional keywords that indicate a side or corner. |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> startX = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> startY = nullptr; |
+ NullableCSSValue startX; |
+ NullableCSSValue startY; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> location = nullptr; |
+ NullableCSSValue location; |
bool isHorizontal = false; |
if ((location = valueFromSideKeyword(a, isHorizontal))) { |
if (isHorizontal) |
@@ -6320,8 +6321,8 @@ bool CSSPropertyParser::parseDeprecatedLinearGradient(CSSParserValueList* valueL |
if (!startX && !startY) |
startY = cssValuePool().createIdentifierValue(CSSValueTop); |
- result->setFirstX(startX.release()); |
- result->setFirstY(startY.release()); |
+ result->setFirstX(startX); |
+ result->setFirstY(startY); |
} |
if (!parseGradientColorStops(args, result.get(), expectComma)) |
@@ -6362,14 +6363,14 @@ bool CSSPropertyParser::parseDeprecatedRadialGradient(CSSParserValueList* valueL |
if (!a) |
return false; |
- result->setFirstX(toCSSPrimitiveValue(centerX)); |
- result->setSecondX(toCSSPrimitiveValue(centerX)); |
+ result->setFirstX(centerX); |
+ result->setSecondX(centerX); |
// CSS3 radial gradients always share the same start and end point. |
- result->setFirstY(toCSSPrimitiveValue(centerY)); |
- result->setSecondY(toCSSPrimitiveValue(centerY)); |
+ result->setFirstY(centerY); |
+ result->setSecondY(centerY); |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> shapeValue = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> sizeValue = nullptr; |
+ NullableCSSValue shapeValue; |
+ NullableCSSValue sizeValue; |
// Optional shape and/or size in any order. |
for (int i = 0; i < 2; ++i) { |
@@ -6409,8 +6410,8 @@ bool CSSPropertyParser::parseDeprecatedRadialGradient(CSSParserValueList* valueL |
result->setSizingBehavior(sizeValue); |
// Or, two lengths or percentages |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalSize = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalSize = nullptr; |
+ NullableCSSValue horizontalSize; |
+ NullableCSSValue verticalSize; |
if (!shapeValue && !sizeValue) { |
if (validUnit(a, FLength | FPercent)) { |
@@ -6472,9 +6473,9 @@ bool CSSPropertyParser::parseLinearGradient(CSSParserValueList* valueList, Nulla |
if (!a) |
return false; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> endX = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> endY = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> location = nullptr; |
+ NullableCSSValue endX; |
+ NullableCSSValue endY; |
+ NullableCSSValue location; |
bool isHorizontal = false; |
location = valueFromSideKeyword(a, isHorizontal); |
@@ -6506,8 +6507,8 @@ bool CSSPropertyParser::parseLinearGradient(CSSParserValueList* valueList, Nulla |
} |
expectComma = true; |
- result->setFirstX(endX.release()); |
- result->setFirstY(endY.release()); |
+ result->setFirstX(endX); |
+ result->setFirstY(endY); |
} |
if (!parseGradientColorStops(args, result.get(), expectComma)) |
@@ -6534,10 +6535,10 @@ bool CSSPropertyParser::parseRadialGradient(CSSParserValueList* valueList, Nulla |
bool expectComma = false; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> shapeValue = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> sizeValue = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> horizontalSize = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> verticalSize = nullptr; |
+ NullableCSSValue shapeValue; |
+ NullableCSSValue sizeValue; |
+ NullableCSSValue horizontalSize; |
+ NullableCSSValue verticalSize; |
// First part of grammar, the size/shape clause: |
// [ circle || <length> ] | |
@@ -6596,13 +6597,13 @@ bool CSSPropertyParser::parseRadialGradient(CSSParserValueList* valueList, Nulla |
if (sizeValue && horizontalSize) |
return false; |
// Circles must have 0 or 1 lengths. |
- if (shapeValue && shapeValue->getValueID() == CSSValueCircle && verticalSize) |
+ if (shapeValue && toCSSPrimitiveValue(*shapeValue).getValueID() == CSSValueCircle && verticalSize) |
return false; |
// Ellipses must have 0 or 2 length/percentages. |
- if (shapeValue && shapeValue->getValueID() == CSSValueEllipse && horizontalSize && !verticalSize) |
+ if (shapeValue && toCSSPrimitiveValue(*shapeValue).getValueID() == CSSValueEllipse && horizontalSize && !verticalSize) |
return false; |
// If there's only one size, it must be a length. |
- if (!verticalSize && horizontalSize && horizontalSize->isPercentage()) |
+ if (!verticalSize && horizontalSize && toCSSPrimitiveValue(*horizontalSize).isPercentage()) |
return false; |
result->setShape(shapeValue); |
@@ -6626,11 +6627,11 @@ bool CSSPropertyParser::parseRadialGradient(CSSParserValueList* valueList, Nulla |
a = args->current(); |
if (!a) |
return false; |
- result->setFirstX(toCSSPrimitiveValue(centerX)); |
- result->setFirstY(toCSSPrimitiveValue(centerY)); |
+ result->setFirstX(centerX); |
+ result->setFirstY(centerY); |
// Right now, CSS radial gradients have the same start and end centers. |
- result->setSecondX(toCSSPrimitiveValue(centerX)); |
- result->setSecondY(toCSSPrimitiveValue(centerY)); |
+ result->setSecondX(centerX); |
+ result->setSecondY(centerY); |
} |
if (shapeValue || sizeValue || horizontalSize || centerX || centerY) |
@@ -6788,7 +6789,7 @@ bool CSSPropertyParser::parseCrossfade(CSSParserValueList* valueList, NullableCS |
return false; |
// The third argument is the crossfade value. It is a percentage or a fractional number. |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> percentage = nullptr; |
+ NullableCSSValue percentage; |
CSSParserValue* value = args->current(); |
if (!value) |
return false; |
@@ -6801,7 +6802,7 @@ bool CSSPropertyParser::parseCrossfade(CSSParserValueList* valueList, NullableCS |
return false; |
RefPtrWillBeRawPtr<CSSCrossfadeValue> result = CSSCrossfadeValue::create(*fromImageValue, *toImageValue); |
- result->setPercentage(percentage); |
+ result->setPercentage(toCSSPrimitiveValue(*percentage)); |
crossfade = result; |
@@ -7237,8 +7238,8 @@ bool CSSPropertyParser::parseTextDecoration(CSSPropertyID propId, bool important |
NullableCSSValue CSSPropertyParser::parseTextEmphasisStyle() |
{ |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> fill = nullptr; |
- RefPtrWillBeRawPtr<CSSPrimitiveValue> shape = nullptr; |
+ NullableCSSValue fill; |
+ NullableCSSValue shape; |
for (CSSParserValue* value = m_valueList->current(); value; value = m_valueList->next()) { |
if (value->unit == CSSPrimitiveValue::CSS_STRING) { |
@@ -7270,14 +7271,14 @@ NullableCSSValue CSSPropertyParser::parseTextEmphasisStyle() |
if (fill && shape) { |
RefPtrWillBeRawPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated(); |
- parsedValues->append(fill.release()); |
- parsedValues->append(shape.release()); |
+ parsedValues->append(*fill); |
+ parsedValues->append(*shape); |
return parsedValues.release(); |
} |
if (fill) |
- return fill.release(); |
+ return fill; |
if (shape) |
- return shape.release(); |
+ return shape; |
return nullptr; |
} |