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

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: Remove spurious file Created 4 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: 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 960c8a3a28a5fbb1221c8bacf4be72b22c6b0fcc..42c912f2bf0466bf8ec15e4d1c25448ea61055f0 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -3419,6 +3419,13 @@ CSSStyleDeclaration* Element::style()
return &ensureElementRareData().ensureInlineCSSStyleDeclaration(this);
}
+StylePropertyMap* Element::styleMap()
+{
+ if (!isStyledElement())
+ return nullptr;
+ return &ensureElementRareData().ensureInlineStylePropertyMap(this);
+}
+
MutableStylePropertySet& Element::ensureMutableInlineStyle()
{
ASSERT(isStyledElement());
@@ -3514,6 +3521,14 @@ bool Element::setInlineStyleProperty(CSSPropertyID propertyID, const String& val
return changes;
}
+bool Element::setInlineStyleProperty(CSSPropertyID propertyID, const PassRefPtrWillBeRawPtr<CSSValue> value, bool important)
Timothy Loh 2016/03/23 03:45:09 To save some copy paste and make this patch a litt
meade_UTC10 2016/03/29 06:27:37 Done.
+{
+ ASSERT(isStyledElement());
+ ensureMutableInlineStyle().setProperty(propertyID, value);
Timothy Loh 2016/03/23 03:45:09 Missing important argument
meade_UTC10 2016/03/29 06:27:37 Done.
+ inlineStyleChanged();
+ return true;
+}
+
bool Element::removeInlineStyleProperty(CSSPropertyID propertyID)
{
ASSERT(isStyledElement());
@@ -3543,6 +3558,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