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

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

Issue 2001453002: Set ComputedStyle on Node and use that in buildOwnLayout() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@storage
Patch Set: Initial review Created 4 years, 5 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/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;

Powered by Google App Engine
This is Rietveld 408576698