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

Unified Diff: sky/engine/core/css/parser/CSSPropertyParser.cpp

Issue 1078883003: remove 'page' and 'size' since those are for printing, and that's obsolete in our world now (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: merge with trunk Created 5 years, 8 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 | « sky/engine/core/css/parser/CSSPropertyParser.h ('k') | sky/engine/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/parser/CSSPropertyParser.cpp
diff --git a/sky/engine/core/css/parser/CSSPropertyParser.cpp b/sky/engine/core/css/parser/CSSPropertyParser.cpp
index 2647d8324346f7b7d80d080913373238def945b6..190f3aa71c8adb2dcfb5ab089d4b4a74856387ab 100644
--- a/sky/engine/core/css/parser/CSSPropertyParser.cpp
+++ b/sky/engine/core/css/parser/CSSPropertyParser.cpp
@@ -448,8 +448,6 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId)
RefPtr<CSSValue> parsedValue = nullptr;
switch (propId) {
- case CSSPropertySize: // <length>{1,2} | auto | [ <page-size> || [ portrait | landscape] ]
- return parseSize(propId);
case CSSPropertyClip: // <shape> | auto | inherit
if (id == CSSValueAuto)
@@ -1075,8 +1073,6 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId)
return parseTransitionShorthand(propId);
case CSSPropertyInvalid:
return false;
- case CSSPropertyPage:
- return parsePage(propId);
// CSS Text Layout Module Level 3: Vertical writing support
case CSSPropertyWebkitTextEmphasis:
return parseShorthand(propId, webkitTextEmphasisShorthand());
@@ -1553,101 +1549,6 @@ bool CSSPropertyParser::parse4Values(CSSPropertyID propId, const CSSPropertyID *
return true;
}
-// auto | <identifier>
-bool CSSPropertyParser::parsePage(CSSPropertyID propId)
-{
- ASSERT(propId == CSSPropertyPage);
-
- if (m_valueList->size() != 1)
- return false;
-
- CSSParserValue* value = m_valueList->current();
- if (!value)
- return false;
-
- if (value->id == CSSValueAuto) {
- addProperty(propId, cssValuePool().createIdentifierValue(value->id));
- return true;
- } else if (value->id == 0 && value->unit == CSSPrimitiveValue::CSS_IDENT) {
- addProperty(propId, createPrimitiveStringValue(value));
- return true;
- }
- return false;
-}
-
-// <length>{1,2} | auto | [ <page-size> || [ portrait | landscape] ]
-bool CSSPropertyParser::parseSize(CSSPropertyID propId)
-{
- ASSERT(propId == CSSPropertySize);
-
- if (m_valueList->size() > 2)
- return false;
-
- CSSParserValue* value = m_valueList->current();
- if (!value)
- return false;
-
- RefPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated();
-
- // First parameter.
- SizeParameterType paramType = parseSizeParameter(parsedValues.get(), value, None);
- if (paramType == None)
- return false;
-
- // Second parameter, if any.
- value = m_valueList->next();
- if (value) {
- paramType = parseSizeParameter(parsedValues.get(), value, paramType);
- if (paramType == None)
- return false;
- }
-
- addProperty(propId, parsedValues.release());
- return true;
-}
-
-CSSPropertyParser::SizeParameterType CSSPropertyParser::parseSizeParameter(CSSValueList* parsedValues, CSSParserValue* value, SizeParameterType prevParamType)
-{
- switch (value->id) {
- case CSSValueAuto:
- if (prevParamType == None) {
- parsedValues->append(cssValuePool().createIdentifierValue(value->id));
- return Auto;
- }
- return None;
- case CSSValueLandscape:
- case CSSValuePortrait:
- if (prevParamType == None || prevParamType == PageSize) {
- parsedValues->append(cssValuePool().createIdentifierValue(value->id));
- return Orientation;
- }
- return None;
- case CSSValueA3:
- case CSSValueA4:
- case CSSValueA5:
- case CSSValueB4:
- case CSSValueB5:
- case CSSValueLedger:
- case CSSValueLegal:
- case CSSValueLetter:
- if (prevParamType == None || prevParamType == Orientation) {
- // Normalize to Page Size then Orientation order by prepending.
- // This is not specified by the CSS3 Paged Media specification, but for simpler processing later (StyleResolver::applyPageSizeProperty).
- parsedValues->prepend(cssValuePool().createIdentifierValue(value->id));
- return PageSize;
- }
- return None;
- case 0:
- if (validUnit(value, FLength | FNonNeg) && (prevParamType == None || prevParamType == Length)) {
- parsedValues->append(createPrimitiveNumericValue(value));
- return Length;
- }
- return None;
- default:
- return None;
- }
-}
-
PassRefPtr<CSSValue> CSSPropertyParser::parseAttr(CSSParserValueList* args)
{
if (args->size() != 1)
« no previous file with comments | « sky/engine/core/css/parser/CSSPropertyParser.h ('k') | sky/engine/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698