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

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

Issue 2813563005: Remove fast path checks that look into the Groups in ComputedStyle (Closed)
Patch Set: Reintroduce comparison of objects Created 3 years, 8 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 d0ee8a6e2523a6946908c339f58cf6fc054cf7c1..a60069546e37cabb3fe403d5508fbe773a19a2c3 100644
--- a/third_party/WebKit/Source/core/dom/Node.h
+++ b/third_party/WebKit/Source/core/dom/Node.h
@@ -97,21 +97,36 @@ enum class SlotChangeType {
kChained,
};
-class NodeRareDataBase {
+class NodeLayoutData {
public:
+ explicit NodeLayoutData(LayoutObject* layout_object)
+ : layout_object_(layout_object) {}
+
LayoutObject* GetLayoutObject() const { return layout_object_; }
void SetLayoutObject(LayoutObject* layout_object) {
layout_object_ = layout_object;
}
+ private:
+ LayoutObject* layout_object_;
+};
+
+class NodeRareDataBase {
+ public:
+ LayoutObject* GetLayoutObject() const {
+ return layout_data_->GetLayoutObject();
+ }
+ void SetLayoutObject(LayoutObject* layout_object) {
+ layout_data_->SetLayoutObject(layout_object);
+ }
+
protected:
- NodeRareDataBase(LayoutObject* layout_object)
- : layout_object_(layout_object) {}
+ NodeRareDataBase(LayoutObject* layout_object) {
+ layout_data_ = new NodeLayoutData(layout_object);
+ }
protected:
- // LayoutObjects are fully owned by their DOM node. See LayoutObject's
- // LIFETIME documentation section.
- LayoutObject* layout_object_;
+ NodeLayoutData* layout_data_;
};
class Node;
@@ -564,13 +579,13 @@ class CORE_EXPORT Node : public EventTarget {
// have one as well.
LayoutObject* GetLayoutObject() const {
return HasRareData() ? data_.rare_data_->GetLayoutObject()
- : data_.layout_object_;
+ : data_.layout_data_->GetLayoutObject();
}
void SetLayoutObject(LayoutObject* layout_object) {
if (HasRareData())
data_.rare_data_->SetLayoutObject(layout_object);
else
- data_.layout_object_ = layout_object;
+ data_.layout_data_->SetLayoutObject(layout_object);
}
// Use these two methods with caution.
@@ -925,10 +940,10 @@ class CORE_EXPORT Node : public EventTarget {
Member<Node> next_;
// When a node has rare data we move the layoutObject into the rare data.
union DataUnion {
- DataUnion() : layout_object_(nullptr) {}
+ DataUnion() { layout_data_ = new NodeLayoutData(nullptr); }
// LayoutObjects are fully owned by their DOM node. See LayoutObject's
// LIFETIME documentation section.
- LayoutObject* layout_object_;
+ NodeLayoutData* layout_data_;
NodeRareDataBase* rare_data_;
} data_;
};
« 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