Chromium Code Reviews| 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(); } |