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

Unified Diff: Source/core/css/StylePropertySerializer.cpp

Issue 216803002: Implement all shorthand property. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated css-properties-as-js-properties-expected.txt 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
Index: Source/core/css/StylePropertySerializer.cpp
diff --git a/Source/core/css/StylePropertySerializer.cpp b/Source/core/css/StylePropertySerializer.cpp
index 489527ff68ed9749d3c74d15df57866d0680d099..161d2554dcea7d384c6354564c2fd7e607da1961 100644
--- a/Source/core/css/StylePropertySerializer.cpp
+++ b/Source/core/css/StylePropertySerializer.cpp
@@ -67,6 +67,15 @@ String StylePropertySerializer::asText() const
BitArray<numCSSProperties> shorthandPropertyAppeared;
unsigned size = m_propertySet.propertyCount();
+
+ // FIXME: need to support "unset".
+ // 'all' property: http://dev.w3.org/csswg/css-cascade/#all-shorthand
+ // 'unset" value: http://dev.w3.org/csswg/css-cascade/#unset
+ if (size == allShorthand().length() && shorthandHasOnlyInitialOrInheritedValue(allShorthand())) {
+ StylePropertySet::PropertyReference property = m_propertySet.propertyAt(0);
+ return getPropertyText(CSSPropertyAll, getCommonValue(allShorthand()), property.isImportant(), false);
+ }
+
unsigned numDecls = 0;
for (unsigned n = 0; n < size; ++n) {
StylePropertySet::PropertyReference property = m_propertySet.propertyAt(n);

Powered by Google App Engine
This is Rietveld 408576698