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

Unified Diff: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp

Issue 1523803002: Move justify-content/align-content properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 11 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 | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
index bf18f11b32e18f5cee022e0f740b0fbf00b1b93e..2e69dc96d9f592273f910d5ebb22a52b4112f7af 100644
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
@@ -28,7 +28,6 @@
#include "core/StylePropertyShorthand.h"
#include "core/css/CSSBorderImage.h"
-#include "core/css/CSSContentDistributionValue.h"
#include "core/css/CSSCrossfadeValue.h"
#include "core/css/CSSCustomIdentValue.h"
#include "core/css/CSSFunctionValue.h"
@@ -400,10 +399,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::legacyParseValue(CSSProperty
ASSERT(RuntimeEnabledFeatures::cssFontSizeAdjustEnabled());
validPrimitive = (id == CSSValueNone) ? true : validUnit(value, FNumber | FNonNeg);
break;
- case CSSPropertyJustifyContent:
- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
- parsedValue = parseContentDistributionOverflowPosition();
- break;
+
case CSSPropertyJustifySelf:
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
parsedValue = parseItemPositionOverflowPosition();
@@ -446,9 +442,6 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::legacyParseValue(CSSProperty
parsedValue = parseGridTemplateAreas();
break;
- case CSSPropertyAlignContent:
- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
- parsedValue = parseContentDistributionOverflowPosition();
break;
case CSSPropertyAlignSelf:
@@ -2167,19 +2160,6 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridAutoFlow(CSSParserV
return parsedValues;
}
-static bool isContentDistributionKeyword(CSSValueID id)
-{
- return id == CSSValueSpaceBetween || id == CSSValueSpaceAround
- || id == CSSValueSpaceEvenly || id == CSSValueStretch;
-}
-
-static bool isContentPositionKeyword(CSSValueID id)
-{
- return id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter
- || id == CSSValueFlexStart || id == CSSValueFlexEnd
- || id == CSSValueLeft || id == CSSValueRight;
-}
-
static bool isBaselinePositionKeyword(CSSValueID id)
{
return id == CSSValueBaseline || id == CSSValueLastBaseline;
@@ -2221,55 +2201,6 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseLegacyPosition()
return CSSValuePair::create(cssValuePool().createIdentifierValue(CSSValueLegacy), cssValuePool().createIdentifierValue(value->id), CSSValuePair::DropIdenticalValues);
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseContentDistributionOverflowPosition()
-{
- // auto | <baseline-position> | <content-distribution> || [ <overflow-position>? && <content-position> ]
- // <baseline-position> = baseline | last-baseline;
- // <content-distribution> = space-between | space-around | space-evenly | stretch;
- // <content-position> = center | start | end | flex-start | flex-end | left | right;
- // <overflow-position> = true | safe
-
- // auto | <baseline-position>
- CSSParserValue* value = m_valueList->current();
- if (value->id == CSSValueAuto || isBaselinePositionKeyword(value->id)) {
- m_valueList->next();
- return CSSContentDistributionValue::create(CSSValueInvalid, value->id, CSSValueInvalid);
- }
-
- CSSValueID distribution = CSSValueInvalid;
- CSSValueID position = CSSValueInvalid;
- CSSValueID overflow = CSSValueInvalid;
- while (value) {
- if (isContentDistributionKeyword(value->id)) {
- if (distribution != CSSValueInvalid)
- return nullptr;
- distribution = value->id;
- } else if (isContentPositionKeyword(value->id)) {
- if (position != CSSValueInvalid)
- return nullptr;
- position = value->id;
- } else if (isAlignmentOverflowKeyword(value->id)) {
- if (overflow != CSSValueInvalid)
- return nullptr;
- overflow = value->id;
- } else {
- return nullptr;
- }
- value = m_valueList->next();
- }
-
- // The grammar states that we should have at least <content-distribution> or
- // <content-position> ( <content-distribution> || <content-position> ).
- if (position == CSSValueInvalid && distribution == CSSValueInvalid)
- return nullptr;
-
- // The grammar states that <overflow-position> must be associated to <content-position>.
- if (overflow != CSSValueInvalid && position == CSSValueInvalid)
- return nullptr;
-
- return CSSContentDistributionValue::create(distribution, position, overflow);
-}
-
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseItemPositionOverflowPosition()
{
// auto | stretch | <baseline-position> | [<item-position> && <overflow-position>? ]
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698