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

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

Issue 216803002: Implement all shorthand property. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/StylePropertyShorthandCustom.cpp
diff --git a/Source/core/css/StylePropertyShorthandCustom.cpp b/Source/core/css/StylePropertyShorthandCustom.cpp
index b157746c8b99736ec302206f380d2deb93dc3e79..d561e94a435344f30fa436e5cb3cdee9a13600f0 100644
--- a/Source/core/css/StylePropertyShorthandCustom.cpp
+++ b/Source/core/css/StylePropertyShorthandCustom.cpp
@@ -113,6 +113,22 @@ bool isExpandedShorthand(CSSPropertyID id)
return shorthandForProperty(id).length();
}
+bool isExpandedShorthandForAll(CSSPropertyID propertyId)
+{
+ // FIXME: isExpandedShorthand says "font" is not an expanded shorthand,
+ // but font is expanded to font-family, font-size, and so on.
+ // StylePropertySerializer::asText should not generate css text like
+ // "font: initial; font-family: initial;...". To avoid this, we need to
+ // treat "font" as an expanded shorthand.
+ // And while applying "all" property, we cannot apply "font" property
+ // directly. This causes ASSERT crash, because StyleBuilder assume that
+ // all given properties are not expanded shorthands.
+ // "marker" has the same issue.
+ if (propertyId == CSSPropertyMarker || propertyId == CSSPropertyFont)
+ return true;
+ return shorthandForProperty(propertyId).length();
+}
+
unsigned indexOfShorthandForLonghand(CSSPropertyID shorthandID, const Vector<StylePropertyShorthand, 4>& shorthands)
{
for (unsigned i = 0; i < shorthands.size(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698