| 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_;
|
| };
|
|
|