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

Side by Side Diff: sky/engine/core/dom/ElementRareData.h

Issue 871203005: Remove ElementFlags system. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/core/dom/Element.cpp ('k') | sky/engine/core/dom/NodeRareData.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 25 matching lines...) Expand all
36 class ElementRareData : public NodeRareData { 36 class ElementRareData : public NodeRareData {
37 public: 37 public:
38 static ElementRareData* create(RenderObject* renderer) 38 static ElementRareData* create(RenderObject* renderer)
39 { 39 {
40 return new ElementRareData(renderer); 40 return new ElementRareData(renderer);
41 } 41 }
42 42
43 ~ElementRareData(); 43 ~ElementRareData();
44 44
45 short tabIndex() const { return m_tabindex; } 45 short tabIndex() const { return m_tabindex; }
46 bool hasTabIndex() const { return m_hasTabIndex; }
46 47
47 void setTabIndexExplicitly(short index) 48 void setTabIndex(short index)
48 { 49 {
49 m_tabindex = index; 50 m_tabindex = index;
50 setElementFlag(TabIndexWasSetExplicitly, true); 51 m_hasTabIndex = true;
51 } 52 }
52 53
53 void clearTabIndexExplicitly() 54 void clearTabIndex()
54 { 55 {
55 m_tabindex = 0; 56 m_tabindex = 0;
56 clearElementFlag(TabIndexWasSetExplicitly); 57 m_hasTabIndex = false;
57 } 58 }
58 59
59 CSSStyleDeclaration& ensureInlineCSSStyleDeclaration(Element* ownerElement); 60 CSSStyleDeclaration& ensureInlineCSSStyleDeclaration(Element* ownerElement);
60 61
61 void clearShadow() { m_shadow = nullptr; } 62 void clearShadow() { m_shadow = nullptr; }
62 ElementShadow* shadow() const { return m_shadow.get(); } 63 ElementShadow* shadow() const { return m_shadow.get(); }
63 ElementShadow& ensureShadow() 64 ElementShadow& ensureShadow()
64 { 65 {
65 if (!m_shadow) 66 if (!m_shadow)
66 m_shadow = ElementShadow::create(); 67 m_shadow = ElementShadow::create();
(...skipping 10 matching lines...) Expand all
77 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; } 78 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; }
78 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si ze; } 79 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si ze; }
79 80
80 ActiveAnimations* activeAnimations() { return m_activeAnimations.get(); } 81 ActiveAnimations* activeAnimations() { return m_activeAnimations.get(); }
81 void setActiveAnimations(PassOwnPtr<ActiveAnimations> activeAnimations) 82 void setActiveAnimations(PassOwnPtr<ActiveAnimations> activeAnimations)
82 { 83 {
83 m_activeAnimations = activeAnimations; 84 m_activeAnimations = activeAnimations;
84 } 85 }
85 86
86 private: 87 private:
87 short m_tabindex; 88 unsigned m_tabindex : 16;
89 unsigned m_hasTabIndex : 1;
88 90
89 IntSize m_savedLayerScrollOffset; 91 IntSize m_savedLayerScrollOffset;
90 92
91 OwnPtr<DOMTokenList> m_classList; 93 OwnPtr<DOMTokenList> m_classList;
92 OwnPtr<ElementShadow> m_shadow; 94 OwnPtr<ElementShadow> m_shadow;
93 OwnPtr<ActiveAnimations> m_activeAnimations; 95 OwnPtr<ActiveAnimations> m_activeAnimations;
94 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; 96 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper;
95 97
96 RefPtr<RenderStyle> m_computedStyle; 98 RefPtr<RenderStyle> m_computedStyle;
97 99
98 explicit ElementRareData(RenderObject*); 100 explicit ElementRareData(RenderObject*);
99 }; 101 };
100 102
101 inline ElementRareData::ElementRareData(RenderObject* renderer) 103 inline ElementRareData::ElementRareData(RenderObject* renderer)
102 : NodeRareData(renderer) 104 : NodeRareData(renderer)
103 , m_tabindex(0) 105 , m_tabindex(0)
106 , m_hasTabIndex(false)
104 { 107 {
105 m_isElementRareData = true; 108 m_isElementRareData = true;
106 } 109 }
107 110
108 inline ElementRareData::~ElementRareData() 111 inline ElementRareData::~ElementRareData()
109 { 112 {
110 #if !ENABLE(OILPAN) 113 #if !ENABLE(OILPAN)
111 ASSERT(!m_shadow); 114 ASSERT(!m_shadow);
112 #endif 115 #endif
113 } 116 }
114 117
115 } // namespace 118 } // namespace
116 119
117 #endif // SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_ 120 #endif // SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Element.cpp ('k') | sky/engine/core/dom/NodeRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698