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

Unified Diff: third_party/WebKit/Source/core/dom/ElementRareData.h

Issue 2293713002: Made ElementRareData store ComputedStyle on LayoutObject if possible. (Closed)
Patch Set: Added unit test Created 4 years, 3 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/BUILD.gn ('k') | third_party/WebKit/Source/core/dom/ElementRareDataTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ElementRareData.h
diff --git a/third_party/WebKit/Source/core/dom/ElementRareData.h b/third_party/WebKit/Source/core/dom/ElementRareData.h
index fe196fb89ed539bba4cafc5fc5375e87f58407c6..957344a9724c4b7b2933a24f5389573374bc4d7f 100644
--- a/third_party/WebKit/Source/core/dom/ElementRareData.h
+++ b/third_party/WebKit/Source/core/dom/ElementRareData.h
@@ -91,8 +91,19 @@ public:
NamedNodeMap* attributeMap() const { return m_attributeMap.get(); }
void setAttributeMap(NamedNodeMap* attributeMap) { m_attributeMap = attributeMap; }
- ComputedStyle* computedStyle() const { return m_computedStyle.get(); }
- void setComputedStyle(PassRefPtr<ComputedStyle> computedStyle) { m_computedStyle = computedStyle; }
+ ComputedStyle* computedStyle() const
+ {
Timothy Loh 2016/09/07 04:56:07 Maybe DCHECK(!(layoutObject() && m_computedStyle))
Bugs Nash 2016/09/13 21:46:55 Done.
+ if (layoutObject())
+ return layoutObject()->mutableStyle();
+ return m_computedStyle.get();
+ }
+ void setComputedStyle(PassRefPtr<ComputedStyle> computedStyle)
+ {
+ if (layoutObject())
+ layoutObject()->setStyleInternal(computedStyle);
+ else
+ m_computedStyle = computedStyle;
+ }
void clearComputedStyle() { m_computedStyle = nullptr; }
Timothy Loh 2016/09/07 04:56:07 OK for now but at some point we should work out if
Bugs Nash 2016/09/13 21:46:55 As per offline conversation the usage of this meth
ClassList* classList() const { return m_classList.get(); }
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/dom/ElementRareDataTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698