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

Side by Side Diff: third_party/WebKit/Source/core/dom/ElementRareData.h

Issue 2814603002: Move LayoutObject to satellite NodeLayoutData that hangs from a Node. (Closed)
Patch Set: esprehn comments 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 26 matching lines...) Expand all
37 #include "core/dom/PseudoElementData.h" 37 #include "core/dom/PseudoElementData.h"
38 #include "core/dom/custom/CustomElementDefinition.h" 38 #include "core/dom/custom/CustomElementDefinition.h"
39 #include "core/dom/custom/V0CustomElementDefinition.h" 39 #include "core/dom/custom/V0CustomElementDefinition.h"
40 #include "core/dom/shadow/ElementShadow.h" 40 #include "core/dom/shadow/ElementShadow.h"
41 #include "core/html/ClassList.h" 41 #include "core/html/ClassList.h"
42 #include "platform/heap/Handle.h" 42 #include "platform/heap/Handle.h"
43 #include "platform/wtf/HashSet.h" 43 #include "platform/wtf/HashSet.h"
44 44
45 namespace blink { 45 namespace blink {
46 46
47 class LayoutObject;
48 class CompositorProxiedPropertySet; 47 class CompositorProxiedPropertySet;
49 class ResizeObservation; 48 class ResizeObservation;
50 class ResizeObserver; 49 class ResizeObserver;
51 50
52 class ElementRareData : public NodeRareData { 51 class ElementRareData : public NodeRareData {
53 public: 52 public:
54 static ElementRareData* Create(LayoutObject* layout_object) { 53 static ElementRareData* Create(NodeLayoutData* node_layout_data) {
55 return new ElementRareData(layout_object); 54 return new ElementRareData(node_layout_data);
56 } 55 }
57 56
58 ~ElementRareData(); 57 ~ElementRareData();
59 58
60 void SetPseudoElement(PseudoId, PseudoElement*); 59 void SetPseudoElement(PseudoId, PseudoElement*);
61 PseudoElement* GetPseudoElement(PseudoId) const; 60 PseudoElement* GetPseudoElement(PseudoId) const;
62 61
63 void SetTabIndexExplicitly() { 62 void SetTabIndexExplicitly() {
64 SetElementFlag(kTabIndexWasSetExplicitly, true); 63 SetElementFlag(kTabIndexWasSetExplicitly, true);
65 } 64 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 218
220 RefPtr<ComputedStyle> computed_style_; 219 RefPtr<ComputedStyle> computed_style_;
221 // TODO(davaajav):remove this field when v0 custom elements are deprecated 220 // TODO(davaajav):remove this field when v0 custom elements are deprecated
222 Member<V0CustomElementDefinition> v0_custom_element_definition_; 221 Member<V0CustomElementDefinition> v0_custom_element_definition_;
223 Member<CustomElementDefinition> custom_element_definition_; 222 Member<CustomElementDefinition> custom_element_definition_;
224 223
225 Member<PseudoElementData> pseudo_element_data_; 224 Member<PseudoElementData> pseudo_element_data_;
226 225
227 Member<AccessibleNode> accessible_node_; 226 Member<AccessibleNode> accessible_node_;
228 227
229 explicit ElementRareData(LayoutObject*); 228 explicit ElementRareData(NodeLayoutData*);
230 }; 229 };
231
232 DEFINE_TRAIT_FOR_TRACE_WRAPPERS(ElementRareData); 230 DEFINE_TRAIT_FOR_TRACE_WRAPPERS(ElementRareData);
233 231
234 inline LayoutSize DefaultMinimumSizeForResizing() { 232 inline LayoutSize DefaultMinimumSizeForResizing() {
235 return LayoutSize(LayoutUnit::Max(), LayoutUnit::Max()); 233 return LayoutSize(LayoutUnit::Max(), LayoutUnit::Max());
236 } 234 }
237 235
238 inline ElementRareData::ElementRareData(LayoutObject* layout_object) 236 inline ElementRareData::ElementRareData(NodeLayoutData* node_layout_data)
239 : NodeRareData(layout_object), 237 : NodeRareData(node_layout_data),
240 minimum_size_for_resizing_(DefaultMinimumSizeForResizing()), 238 minimum_size_for_resizing_(DefaultMinimumSizeForResizing()),
241 class_list_(nullptr) { 239 class_list_(nullptr) {
242 is_element_rare_data_ = true; 240 is_element_rare_data_ = true;
243 } 241 }
244 242
245 inline ElementRareData::~ElementRareData() { 243 inline ElementRareData::~ElementRareData() {
246 DCHECK(!pseudo_element_data_); 244 DCHECK(!pseudo_element_data_);
247 } 245 }
248 246
249 inline bool ElementRareData::HasPseudoElements() const { 247 inline bool ElementRareData::HasPseudoElements() const {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 inline CompositorProxiedPropertySet& 284 inline CompositorProxiedPropertySet&
287 ElementRareData::EnsureCompositorProxiedPropertySet() { 285 ElementRareData::EnsureCompositorProxiedPropertySet() {
288 if (!proxied_properties_) 286 if (!proxied_properties_)
289 proxied_properties_ = CompositorProxiedPropertySet::Create(); 287 proxied_properties_ = CompositorProxiedPropertySet::Create();
290 return *proxied_properties_; 288 return *proxied_properties_;
291 } 289 }
292 290
293 } // namespace blink 291 } // namespace blink
294 292
295 #endif // ElementRareData_h 293 #endif // ElementRareData_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698