Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1573)

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2755493004: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ (Closed)
Patch Set: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 6227c6d6293da1a0824d170335fb272c5a04f007..929200527dd4113b933ac10aa8b0b438396b9b22 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -121,7 +121,7 @@ static CSSValueList* createPositionListForLayer(CSSPropertyID propertyID,
positionList->append(
*zoomAdjustedPixelValueForLength(layer.xPosition(), style));
if (layer.isBackgroundYOriginSet()) {
- ASSERT(propertyID == CSSPropertyBackgroundPosition ||
+ DCHECK(propertyID == CSSPropertyBackgroundPosition ||
propertyID == CSSPropertyWebkitMaskPosition);
positionList->append(
*CSSIdentifierValue::create(layer.backgroundYOrigin()));
@@ -519,7 +519,7 @@ static CSSValueList* valueForItemPositionWithOverflowAlignment(
if (data.position() >= ItemPositionCenter &&
data.overflow() != OverflowAlignmentDefault)
result->append(*CSSIdentifierValue::create(data.overflow()));
- ASSERT(result->length() <= 2);
+ DCHECK_LE(result->length(), static_cast<unsigned>(2));
return result;
}
@@ -534,7 +534,7 @@ static CSSValueList* valuesForGridShorthand(
const CSSValue* value = ComputedStyleCSSValueMapping::get(
shorthand.properties()[i], style, layoutObject, styledNode,
allowVisitedStyle);
- ASSERT(value);
+ DCHECK(value);
list->append(*value);
}
return list;
@@ -551,7 +551,7 @@ static CSSValueList* valuesForShorthandProperty(
const CSSValue* value = ComputedStyleCSSValueMapping::get(
shorthand.properties()[i], style, layoutObject, styledNode,
allowVisitedStyle);
- ASSERT(value);
+ DCHECK(value);
list->append(*value);
}
return list;
@@ -600,7 +600,7 @@ static CSSValue* valuesForFontVariantProperty(const ComputedStyle& style,
const CSSValue* value = ComputedStyleCSSValueMapping::get(
fontVariantShorthand().properties()[i], style, layoutObject,
styledNode, allowVisitedStyle);
- ASSERT(value);
+ DCHECK(value);
if (value->isIdentifierValue() &&
toCSSIdentifierValue(value)->getValueID() == CSSValueNone) {
list->append(*expandNoneLigaturesValue());
@@ -632,7 +632,7 @@ static CSSValueList* valuesForBackgroundShorthand(
const CSSValue* value = ComputedStyleCSSValueMapping::get(
CSSPropertyBackgroundColor, style, layoutObject, styledNode,
allowVisitedStyle);
- ASSERT(value);
+ DCHECK(value);
beforeSlash->append(*value);
}
beforeSlash->append(currLayer->image()
@@ -673,8 +673,10 @@ valueForContentPositionAndDistributionWithOverflowAlignment(
data.distribution() != ContentDistributionDefault) &&
data.overflow() != OverflowAlignmentDefault)
result->append(*CSSIdentifierValue::create(data.overflow()));
- ASSERT(result->length() > 0);
- ASSERT(result->length() <= 3);
+ DCHECK(result->length() >
+ 0); // DCHECK_GT giving error for const unsigned long and const int
Srirama 2017/03/16 14:22:24 remove comment here and add in review comment.
+ DCHECK(result->length() <=
Srirama 2017/03/16 14:22:24 ditto
+ 3); // DCHECK_LE giving error for const unsigned long and const int
return result;
}
@@ -892,7 +894,7 @@ static CSSValue* specifiedValueForGridTrackSize(const GridTrackSize& trackSize,
return fitContentTrackBreadth;
}
}
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return nullptr;
}
@@ -1129,7 +1131,7 @@ static CSSValue* valueForTextDecorationStyle(
return CSSIdentifierValue::create(CSSValueWavy);
}
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return CSSInitialValue::create();
}
@@ -1171,7 +1173,7 @@ static CSSValue* touchActionFlagsToCSSValue(TouchAction touchAction) {
list->append(*CSSIdentifierValue::create(CSSValuePinchZoom));
}
- ASSERT(list->length());
+ DCHECK(list->length());
return list;
}
@@ -1216,7 +1218,7 @@ static CSSValue* valueForAnimationDirection(
case Timing::PlaybackDirection::ALTERNATE_REVERSE:
return CSSIdentifierValue::create(CSSValueAlternateReverse);
default:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return nullptr;
}
}
@@ -1246,7 +1248,7 @@ static CSSValue* valueForAnimationFillMode(Timing::FillMode fillMode) {
case Timing::FillMode::BOTH:
return CSSIdentifierValue::create(CSSValueBoth);
default:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return nullptr;
}
}
@@ -1261,7 +1263,7 @@ static CSSValue* valueForAnimationIterationCount(double iterationCount) {
static CSSValue* valueForAnimationPlayState(EAnimPlayState playState) {
if (playState == AnimPlayStatePlaying)
return CSSIdentifierValue::create(CSSValueRunning);
- ASSERT(playState == AnimPlayStatePaused);
+ DCHECK_EQ(playState, AnimPlayStatePaused);
return CSSIdentifierValue::create(CSSValuePaused);
}
@@ -1288,7 +1290,7 @@ static CSSValue* createTimingFunctionValue(
valueId = CSSValueEaseInOut;
break;
default:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return nullptr;
}
return CSSIdentifierValue::create(valueId);
@@ -1449,7 +1451,7 @@ static CSSValue* createTransitionPropertyValue(
return CSSIdentifierValue::create(CSSValueNone);
if (property.propertyType == CSSTransitionData::TransitionUnknownProperty)
return CSSCustomIdentValue::create(property.propertyString);
- ASSERT(property.propertyType == CSSTransitionData::TransitionKnownProperty);
+ DCHECK_EQ(property.propertyType, CSSTransitionData::TransitionKnownProperty);
return CSSCustomIdentValue::create(
getPropertyNameAtomicString(property.unresolvedProperty));
}
@@ -1478,7 +1480,7 @@ CSSValueID valueForQuoteType(const QuoteType quoteType) {
case OPEN_QUOTE:
return CSSValueOpenQuote;
}
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return CSSValueInvalid;
}
@@ -1489,7 +1491,7 @@ static CSSValue* valueForContentData(const ComputedStyle& style) {
if (contentData->isCounter()) {
const CounterContent* counter =
toCounterContentData(contentData)->counter();
- ASSERT(counter);
+ DCHECK(counter);
CSSCustomIdentValue* identifier =
CSSCustomIdentValue::create(counter->identifier());
CSSStringValue* separator = CSSStringValue::create(counter->separator());
@@ -1505,7 +1507,7 @@ static CSSValue* valueForContentData(const ComputedStyle& style) {
list->append(*CSSCounterValue::create(identifier, listStyle, separator));
} else if (contentData->isImage()) {
const StyleImage* image = toImageContentData(contentData)->image();
- ASSERT(image);
+ DCHECK(image);
list->append(*image->computedCSSValue());
} else if (contentData->isText()) {
list->append(
@@ -1514,7 +1516,7 @@ static CSSValue* valueForContentData(const ComputedStyle& style) {
const QuoteType quoteType = toQuoteContentData(contentData)->quote();
list->append(*CSSIdentifierValue::create(valueForQuoteType(quoteType)));
} else {
- ASSERT_NOT_REACHED();
+ NOTREACHED();
}
}
return list;
@@ -1560,7 +1562,7 @@ static CSSValue* valueForShape(const ComputedStyle& style,
return CSSIdentifierValue::create(CSSValueNone);
}
- ASSERT(shapeValue->type() == ShapeValue::Shape);
+ DCHECK_EQ(shapeValue->type(), ShapeValue::Shape);
CSSValueList* list = CSSValueList::createSpaceSeparated();
list->append(*valueForBasicShape(style, shapeValue->shape()));
@@ -1689,7 +1691,7 @@ static CSSValue* paintOrderToCSSValueList(const SVGComputedStyle& svgStyle) {
break;
case PT_NONE:
default:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
break;
}
}
@@ -1839,7 +1841,7 @@ CSSValue* ComputedStyleCSSValueMapping::valueForFilter(
break;
}
default:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
break;
}
list->append(*filterValue);
@@ -2432,7 +2434,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
list->append(*CSSIdentifierValue::create(CSSValueColumn));
break;
default:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
}
switch (style.getGridAutoFlow()) {
@@ -2490,7 +2492,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
styledNode, allowVisitedStyle);
case CSSPropertyGridTemplateAreas:
if (!style.namedGridAreaRowCount()) {
- ASSERT(!style.namedGridAreaColumnCount());
+ DCHECK(!style.namedGridAreaColumnCount());
return CSSIdentifierValue::create(CSSValueNone);
}
@@ -2781,7 +2783,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
case TextEmphasisMarkCustom:
return CSSStringValue::create(style.textEmphasisCustomMark());
case TextEmphasisMarkAuto:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
// Fall through
case TextEmphasisMarkDot:
case TextEmphasisMarkCircle:
@@ -2856,7 +2858,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
return zoomAdjustedPixelValueForLength(style.getVerticalAlignLength(),
style);
}
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return nullptr;
case CSSPropertyVisibility:
return CSSIdentifierValue::create(style.visibility());
@@ -3418,7 +3420,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
case CSSPropertyWebkitMinLogicalHeight:
case CSSPropertyWebkitMaxLogicalWidth:
case CSSPropertyWebkitMaxLogicalHeight:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return nullptr;
// Unimplemented @font-face properties.
@@ -3540,7 +3542,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
return zoomAdjustedPixelValueForLength(svgStyle.baselineShiftValue(),
style);
}
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return nullptr;
}
case CSSPropertyBufferedRendering:
@@ -3665,19 +3667,19 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
list->append(*CSSIdentifierValue::create(CSSValuePaint));
if (style.containsSize())
list->append(*CSSIdentifierValue::create(CSSValueSize));
- ASSERT(list->length());
+ DCHECK(list->length());
return list;
}
case CSSPropertyVariable:
// Variables are retrieved via get(AtomicString).
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return nullptr;
case CSSPropertyAll:
return nullptr;
default:
break;
}
- ASSERT_NOT_REACHED();
+ NOTREACHED();
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698