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

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

Issue 1372393008: Move border-spacing related properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 5 years, 2 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/parser/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index 61ca343eec6fe5b8633d9085eca7b6d654f4afa3..8d4a1d8431d6d933f8e953af5627b2b2bc82b5ff 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -661,6 +661,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty
return consumeLineHeight(m_range, m_context.mode());
case CSSPropertyRotate:
return consumeRotation(m_range);
+ case CSSPropertyWebkitBorderHorizontalSpacing:
+ case CSSPropertyWebkitBorderVerticalSpacing:
+ return consumeLength(m_range, m_context.mode(), ValueRangeNonNegative);
default:
return nullptr;
}
@@ -890,6 +893,21 @@ bool CSSPropertyParser::consumeFont(bool important)
return m_range.atEnd();
}
+bool CSSPropertyParser::consumeBorderSpacing(bool important)
+{
+ RefPtrWillBeRawPtr<CSSValue> horizontalSpacing = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Allow);
+ if (!horizontalSpacing)
+ return false;
+ RefPtrWillBeRawPtr<CSSValue> verticalSpacing = horizontalSpacing;
+ if (!m_range.atEnd())
+ verticalSpacing = consumeLength(m_range, m_context.mode(), ValueRangeNonNegative, UnitlessQuirk::Allow);
+ if (!verticalSpacing || !m_range.atEnd())
+ return false;
+ addProperty(CSSPropertyWebkitBorderHorizontalSpacing, horizontalSpacing.release(), important);
+ addProperty(CSSPropertyWebkitBorderVerticalSpacing, verticalSpacing.release(), important);
+ return true;
+}
+
bool CSSPropertyParser::parseShorthand(CSSPropertyID propId, bool important)
{
m_range.consumeWhitespace();
@@ -941,6 +959,8 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID propId, bool important)
return consumeSystemFont(important);
return consumeFont(important);
}
+ case CSSPropertyBorderSpacing:
+ return consumeBorderSpacing(important);
default:
m_currentShorthand = oldShorthand;
return false;

Powered by Google App Engine
This is Rietveld 408576698