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

Unified Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 203413006: [CSS Shapes] shape-outside: ellipse(50% 50% at) causes crash (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « LayoutTests/fast/shapes/parsing/parsing-test-utils.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 89f31400a1c047514cc60219657d6f2a1bcab1c2..44d4a11799e1f3955d745b6643d136329b31d4bf 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -4150,7 +4150,7 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeCircle(C
ASSERT(args);
// circle(radius)
- // circle(radius at <position>
+ // circle(radius at <position>)
// circle(at <position>)
// where position defines centerX and centerY using a CSS <position> data type.
RefPtrWillBeRawPtr<CSSBasicShapeCircle> shape = CSSBasicShapeCircle::create();
@@ -4171,10 +4171,9 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeCircle(C
return nullptr;
}
- if (argument->id == CSSValueAt) {
+ if (argument->id == CSSValueAt && args->next()) {
RefPtrWillBeRawPtr<CSSValue> centerX;
RefPtrWillBeRawPtr<CSSValue> centerY;
- args->next(); // set list to start of position center
parseFillPosition(args, centerX, centerY);
if (centerX && centerY && !args->current()) {
ASSERT(centerX->isPrimitiveValue());
@@ -4247,9 +4246,9 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeEllipse(
ASSERT(args);
// ellipse(radiusX)
- // ellipse(radiusX at <position>
+ // ellipse(radiusX at <position>)
// ellipse(radiusX radiusY)
- // ellipse(radiusX radiusY at <position>
+ // ellipse(radiusX radiusY at <position>)
// ellipse(at <position>)
// where position defines centerX and centerY using a CSS <position> data type.
RefPtrWillBeRawPtr<CSSBasicShapeEllipse> shape = CSSBasicShapeEllipse::create();
@@ -4273,11 +4272,10 @@ PassRefPtrWillBeRawPtr<CSSBasicShape> CSSPropertyParser::parseBasicShapeEllipse(
return nullptr;
}
- if (argument->id != CSSValueAt)
+ if (argument->id != CSSValueAt || !args->next()) // expecting ellipse(.. at <position>)
return nullptr;
RefPtrWillBeRawPtr<CSSValue> centerX;
RefPtrWillBeRawPtr<CSSValue> centerY;
- args->next(); // set list to start of position center
parseFillPosition(args, centerX, centerY);
if (!centerX || !centerY || args->current())
return nullptr;
« no previous file with comments | « LayoutTests/fast/shapes/parsing/parsing-test-utils.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698