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

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

Issue 2378573002: Revert of Made ElementRareData store ComputedStyle on LayoutObject if possible. (Closed)
Patch Set: Fixed conflicts (nainar) Created 4 years, 2 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
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 ElementShadow& ensureShadow() 85 ElementShadow& ensureShadow()
86 { 86 {
87 if (!m_shadow) 87 if (!m_shadow)
88 m_shadow = ElementShadow::create(); 88 m_shadow = ElementShadow::create();
89 return *m_shadow; 89 return *m_shadow;
90 } 90 }
91 91
92 NamedNodeMap* attributeMap() const { return m_attributeMap.get(); } 92 NamedNodeMap* attributeMap() const { return m_attributeMap.get(); }
93 void setAttributeMap(NamedNodeMap* attributeMap) { m_attributeMap = attribut eMap; } 93 void setAttributeMap(NamedNodeMap* attributeMap) { m_attributeMap = attribut eMap; }
94 94
95 ComputedStyle* computedStyle() const 95 ComputedStyle* computedStyle() const { return m_computedStyle.get(); }
96 { 96 void setComputedStyle(PassRefPtr<ComputedStyle> computedStyle) { m_computedS tyle = computedStyle; }
97 DCHECK(!(layoutObject() && m_computedStyle)); 97 void clearComputedStyle() { m_computedStyle = nullptr; }
98 if (layoutObject())
99 return layoutObject()->mutableStyle();
100 return m_computedStyle.get();
101 }
102 void setComputedStyle(PassRefPtr<ComputedStyle> computedStyle)
103 {
104 if (layoutObject())
105 layoutObject()->setStyleInternal(std::move(computedStyle));
106 else
107 m_computedStyle = computedStyle;
108 }
109 void clearComputedStyleIfNoLayoutObject()
110 {
111 DCHECK(!(layoutObject() && m_computedStyle));
112 m_computedStyle = nullptr;
113 }
114 98
115 ClassList* classList() const { return m_classList.get(); } 99 ClassList* classList() const { return m_classList.get(); }
116 void setClassList(ClassList* classList) { m_classList = classList; } 100 void setClassList(ClassList* classList) { m_classList = classList; }
117 void clearClassListValueForQuirksMode() 101 void clearClassListValueForQuirksMode()
118 { 102 {
119 if (!m_classList) 103 if (!m_classList)
120 return; 104 return;
121 m_classList->clearValueForQuirksMode(); 105 m_classList->clearValueForQuirksMode();
122 } 106 }
123 107
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 inline CompositorProxiedPropertySet& ElementRareData::ensureCompositorProxiedPro pertySet() 248 inline CompositorProxiedPropertySet& ElementRareData::ensureCompositorProxiedPro pertySet()
265 { 249 {
266 if (!m_proxiedProperties) 250 if (!m_proxiedProperties)
267 m_proxiedProperties = CompositorProxiedPropertySet::create(); 251 m_proxiedProperties = CompositorProxiedPropertySet::create();
268 return *m_proxiedProperties; 252 return *m_proxiedProperties;
269 } 253 }
270 254
271 } // namespace blink 255 } // namespace blink
272 256
273 #endif // ElementRareData_h 257 #endif // ElementRareData_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/ElementRareDataTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698