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

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

Issue 2093143002: Revert of Storage of ComputedStyle separate from LayoutObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | third_party/WebKit/Source/core/dom/Node.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/Node.h
diff --git a/third_party/WebKit/Source/core/dom/Node.h b/third_party/WebKit/Source/core/dom/Node.h
index a61a350790518ede3bb6aac6a95b7fdf28320e2b..fedf63e639b20271dd49a9d7fb12d86cfa38f785 100644
--- a/third_party/WebKit/Source/core/dom/Node.h
+++ b/third_party/WebKit/Source/core/dom/Node.h
@@ -90,7 +90,7 @@
class Text;
class TouchEvent;
-const int nodeStyleChangeShift = 20;
+const int nodeStyleChangeShift = 19;
enum StyleChangeType {
NoStyleChange = 0,
@@ -519,22 +519,13 @@
// As layoutObject() includes a branch you should avoid calling it repeatedly in hot code paths.
// Note that if a Node has a layoutObject, it's parentNode is guaranteed to have one as well.
- LayoutObject* layoutObject() const
- {
- if (hasRareData())
- return m_data.m_rareData->layoutObject();
- return hasLayoutObject() ? m_data.m_layoutObject : nullptr;
- }
+ LayoutObject* layoutObject() const { return hasRareData() ? m_data.m_rareData->layoutObject() : m_data.m_layoutObject; }
void setLayoutObject(LayoutObject* layoutObject)
{
if (hasRareData())
m_data.m_rareData->setLayoutObject(layoutObject);
else
m_data.m_layoutObject = layoutObject;
- if (layoutObject)
- setFlag(HasLayoutObjectFlag);
- else
- clearFlag(HasLayoutObjectFlag);
}
// Use these two methods with caution.
@@ -702,58 +693,57 @@
private:
enum NodeFlags {
- HasLayoutObjectFlag = 1,
- HasRareDataFlag = 1 << 1,
+ HasRareDataFlag = 1,
// Node type flags. These never change once created.
- IsTextFlag = 1 << 2,
- IsContainerFlag = 1 << 3,
- IsElementFlag = 1 << 4,
- IsHTMLFlag = 1 << 5,
- IsSVGFlag = 1 << 6,
- IsDocumentFragmentFlag = 1 << 7,
- IsInsertionPointFlag = 1 << 8,
+ IsTextFlag = 1 << 1,
+ IsContainerFlag = 1 << 2,
+ IsElementFlag = 1 << 3,
+ IsHTMLFlag = 1 << 4,
+ IsSVGFlag = 1 << 5,
+ IsDocumentFragmentFlag = 1 << 6,
+ IsInsertionPointFlag = 1 << 7,
// Changes based on if the element should be treated like a link,
// ex. When setting the href attribute on an <a>.
- IsLinkFlag = 1 << 9,
+ IsLinkFlag = 1 << 8,
// Changes based on :hover, :active and :focus state.
- IsUserActionElementFlag = 1 << 10,
+ IsUserActionElementFlag = 1 << 9,
// Tree state flags. These change when the element is added/removed
// from a DOM tree.
- InDocumentFlag = 1 << 11,
- IsInShadowTreeFlag = 1 << 12,
+ InDocumentFlag = 1 << 10,
+ IsInShadowTreeFlag = 1 << 11,
// Set by the parser when the children are done parsing.
- IsFinishedParsingChildrenFlag = 1 << 13,
+ IsFinishedParsingChildrenFlag = 1 << 12,
// Flags related to recalcStyle.
- SVGFilterNeedsLayerUpdateFlag = 1 << 14,
- HasCustomStyleCallbacksFlag = 1 << 15,
- ChildNeedsStyleInvalidationFlag = 1 << 16,
- NeedsStyleInvalidationFlag = 1 << 17,
- ChildNeedsDistributionRecalcFlag = 1 << 18,
- ChildNeedsStyleRecalcFlag = 1 << 19,
+ SVGFilterNeedsLayerUpdateFlag = 1 << 13,
+ HasCustomStyleCallbacksFlag = 1 << 14,
+ ChildNeedsStyleInvalidationFlag = 1 << 15,
+ NeedsStyleInvalidationFlag = 1 << 16,
+ ChildNeedsDistributionRecalcFlag = 1 << 17,
+ ChildNeedsStyleRecalcFlag = 1 << 18,
StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1),
- CustomElementFlag = 1 << 22,
- CustomElementCustomFlag = 1 << 23,
-
- HasNameOrIsEditingTextFlag = 1 << 24,
- HasWeakReferencesFlag = 1 << 25,
- V8CollectableDuringMinorGCFlag = 1 << 26,
- HasEventTargetDataFlag = 1 << 27,
- AlreadySpellCheckedFlag = 1 << 28,
-
- V0CustomElementFlag = 1 << 29,
- V0CustomElementUpgradedFlag = 1 << 30,
+ CustomElementFlag = 1 << 21,
+ CustomElementCustomFlag = 1 << 22,
+
+ HasNameOrIsEditingTextFlag = 1 << 23,
+ HasWeakReferencesFlag = 1 << 24,
+ V8CollectableDuringMinorGCFlag = 1 << 25,
+ HasEventTargetDataFlag = 1 << 26,
+ AlreadySpellCheckedFlag = 1 << 27,
+
+ V0CustomElementFlag = 1 << 28,
+ V0CustomElementUpgradedFlag = 1 << 29,
DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleChange
};
- // 1 bit remaining.
+ // 3 bits remaining.
bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
void setFlag(bool f, NodeFlags mask) { m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); }
@@ -785,7 +775,6 @@
static void reattachWhitespaceSiblingsIfNeeded(Text* start);
- bool hasLayoutObject() const { return getFlag(HasLayoutObjectFlag); }
bool hasRareData() const { return getFlag(HasRareDataFlag); }
NodeRareData* rareData() const;
@@ -844,7 +833,6 @@
// When a node has rare data we move the layoutObject into the rare data.
union DataUnion {
DataUnion() : m_layoutObject(nullptr) { }
- ComputedStyle* m_computedStyle;
// LayoutObjects are fully owned by their DOM node. See LayoutObject's
// LIFETIME documentation section.
LayoutObject* m_layoutObject;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698