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

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

Issue 2917323003: Move AddProperty to a helper class. (Closed)
Patch Set: Changed the wrapper function name to AddParsedProperty. Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h ('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/CSSPropertyParserHelpers.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
index 9a507a3893c44883644fdc262fdded61f0a5c292..6545768c8512fc11967f0797ad653a3de0a61e7e 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -4,6 +4,7 @@
#include "core/css/parser/CSSPropertyParserHelpers.h"
+#include "core/StylePropertyShorthand.h"
#include "core/css/CSSCalculationValue.h"
#include "core/css/CSSColorValue.h"
#include "core/css/CSSCrossfadeValue.h"
@@ -1458,6 +1459,32 @@ CSSIdentifierValue* ConsumeShapeBox(CSSParserTokenRange& range) {
CSSValueMarginBox>(range);
}
+void AddProperty(CSSPropertyID resolved_property,
+ CSSPropertyID current_shorthand,
+ const CSSValue& value,
+ bool important,
+ bool implicit,
+ HeapVector<CSSProperty, 256>& properties) {
+ DCHECK(!isPropertyAlias(resolved_property));
+
+ int shorthand_index = 0;
+ bool set_from_shorthand = false;
+
+ if (current_shorthand) {
+ Vector<StylePropertyShorthand, 4> shorthands;
+ getMatchingShorthandsForLonghand(resolved_property, &shorthands);
+ set_from_shorthand = true;
+ if (shorthands.size() > 1) {
+ shorthand_index =
+ indexOfShorthandForLonghand(current_shorthand, shorthands);
+ }
+ }
+
+ properties.push_back(CSSProperty(resolved_property, value, important,
+ set_from_shorthand, shorthand_index,
+ implicit));
+}
+
} // namespace CSSPropertyParserHelpers
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698