Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Node.h |
| diff --git a/third_party/WebKit/Source/core/dom/Node.h b/third_party/WebKit/Source/core/dom/Node.h |
| index 9db76ee08e46e351d3bf6db6cf55660e2507b22a..12aebc414bd8bee0aff37a35ed195d260c8f20a4 100644 |
| --- a/third_party/WebKit/Source/core/dom/Node.h |
| +++ b/third_party/WebKit/Source/core/dom/Node.h |
| @@ -522,7 +522,7 @@ public: |
| // Note that if a Node has a layoutObject, it's parentNode is guaranteed to have one as well. |
| LayoutObject* layoutObject() const |
| { |
| - if (hasRareData()) |
| + if (hasRareData() && hasLayoutObject()) |
|
sashab
2016/07/06 04:22:02
Why the additional hasLayoutObject() here?
Bugs Nash
2016/07/06 04:30:42
this isn't necessary
nainar
2016/07/06 04:51:53
To make sure that we only read the LayoutObject in
nainar
2016/07/06 04:51:53
See above.
Bugs Nash
2016/07/06 05:00:21
it shouldn't ever return garbage anyway - it shoul
Bugs Nash
2016/07/06 05:04:44
oh nvm about the last comment - that's not part of
sashab
2016/07/06 05:10:40
I think you want if (hasRareData() && m_data.m_rar
Bugs Nash
2016/07/06 05:19:06
I think just hasRareData() is sufficient
|
| return m_data.m_rareData->layoutObject(); |
| return hasLayoutObject() ? m_data.m_layoutObject : nullptr; |
| } |
| @@ -569,6 +569,7 @@ public: |
| // Wrapper for nodes that don't have a layoutObject, but still cache the style (like HTMLOptionElement). |
| ComputedStyle* mutableComputedStyle() const; |
| const ComputedStyle* computedStyle() const; |
| + void setComputedStyle(PassRefPtr<ComputedStyle>); |
| const ComputedStyle* parentComputedStyle() const; |
| const ComputedStyle& computedStyleRef() const; |