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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1590193002: Partial implementation of inline StylePropertyMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maps
Patch Set: Created 4 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 | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index f7134fd8dc86fe9274d0fc8a430b9c933fc41c9d..e6ea1367784cc7749b2c307b7f81929ed7f372a4 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -3437,6 +3437,13 @@ CSSStyleDeclaration* Element::style()
return &ensureElementRareData().ensureInlineCSSStyleDeclaration(this);
}
+StylePropertyMap* Element::styleMap()
+{
+ if (!isStyledElement())
+ return nullptr;
+ return &ensureElementRareData().ensureInlineStylePropertyMap(this);
+}
+
MutableStylePropertySet& Element::ensureMutableInlineStyle()
{
DCHECK(isStyledElement());
@@ -3507,20 +3514,21 @@ void Element::inlineStyleChanged()
InspectorInstrumentation::didInvalidateStyleAttr(this);
}
-bool Element::setInlineStyleProperty(CSSPropertyID propertyID, CSSValueID identifier, bool important)
+void Element::setInlineStyleProperty(CSSPropertyID propertyID, CSSValueID identifier, bool important)
{
- DCHECK(isStyledElement());
- ensureMutableInlineStyle().setProperty(propertyID, cssValuePool().createIdentifierValue(identifier), important);
- inlineStyleChanged();
- return true;
+ setInlineStyleProperty(propertyID, cssValuePool().createIdentifierValue(identifier), important);
+}
+
+void Element::setInlineStyleProperty(CSSPropertyID propertyID, double value, CSSPrimitiveValue::UnitType unit, bool important)
+{
+ setInlineStyleProperty(propertyID, cssValuePool().createValue(value, unit), important);
}
-bool Element::setInlineStyleProperty(CSSPropertyID propertyID, double value, CSSPrimitiveValue::UnitType unit, bool important)
+void Element::setInlineStyleProperty(CSSPropertyID propertyID, CSSValue* value, bool important)
{
DCHECK(isStyledElement());
- ensureMutableInlineStyle().setProperty(propertyID, cssValuePool().createValue(value, unit), important);
+ ensureMutableInlineStyle().setProperty(propertyID, value, important);
inlineStyleChanged();
- return true;
}
bool Element::setInlineStyleProperty(CSSPropertyID propertyID, const String& value, bool important)
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698