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

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: Fix windows maybe Created 4 years, 10 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/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 0a11d478cbcf30c71db9e5a9fcda4d510565e784..89e899739c569150b665d741bc87dd0c3db4fc71 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -3372,6 +3372,13 @@ CSSStyleDeclaration* Element::style()
return &ensureElementRareData().ensureInlineCSSStyleDeclaration(this);
}
+StylePropertyMap* Element::styleMap()
+{
+ if (!isStyledElement())
+ return nullptr;
+ return &ensureElementRareData().ensureInlineStylePropertyMap(this);
+}
+
MutableStylePropertySet& Element::ensureMutableInlineStyle()
{
ASSERT(isStyledElement());
@@ -3467,6 +3474,14 @@ bool Element::setInlineStyleProperty(CSSPropertyID propertyID, const String& val
return changes;
}
+bool Element::setInlineStyleProperty(CSSPropertyID propertyID, const PassRefPtrWillBeRawPtr<CSSValue> value, bool important)
+{
+ ASSERT(isStyledElement());
+ ensureMutableInlineStyle().setProperty(propertyID, value);
+ inlineStyleChanged();
+ return true;
+}
+
bool Element::removeInlineStyleProperty(CSSPropertyID propertyID)
{
ASSERT(isStyledElement());
@@ -3496,6 +3511,20 @@ void Element::updatePresentationAttributeStyle()
elementData.m_presentationAttributeStyle = computePresentationAttributeStyle(*this);
}
+void Element::invalidateInlineStylePropertyMap()
+{
+ if (!hasRareData())
+ return;
+ ElementRareData* rareData = elementRareData();
+ InlineStylePropertyMap* inlineStylePropertyMap = rareData->inlineStylePropertyMap();
+ if (!inlineStylePropertyMap) {
+ // If it doesn't exist, it isn't being used, so nothing to do.
+ return;
+ }
+
+ inlineStylePropertyMap->invalidate();
+}
+
void Element::addPropertyToPresentationAttributeStyle(MutableStylePropertySet* style, CSSPropertyID propertyID, CSSValueID identifier)
{
ASSERT(isStyledElement());

Powered by Google App Engine
This is Rietveld 408576698