| OLD | NEW |
| 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, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #ifndef SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_ | 22 #ifndef SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_ |
| 23 #define SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_ | 23 #define SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_ |
| 24 | 24 |
| 25 #include "sky/engine/core/animation/ActiveAnimations.h" | 25 #include "sky/engine/core/animation/ActiveAnimations.h" |
| 26 #include "sky/engine/core/dom/DOMTokenList.h" |
| 26 #include "sky/engine/core/dom/NodeRareData.h" | 27 #include "sky/engine/core/dom/NodeRareData.h" |
| 27 #include "sky/engine/core/dom/custom/CustomElementDefinition.h" | 28 #include "sky/engine/core/dom/custom/CustomElementDefinition.h" |
| 28 #include "sky/engine/core/dom/shadow/ElementShadow.h" | 29 #include "sky/engine/core/dom/shadow/ElementShadow.h" |
| 29 #include "sky/engine/core/html/ClassList.h" | |
| 30 #include "sky/engine/core/html/ime/InputMethodContext.h" | 30 #include "sky/engine/core/html/ime/InputMethodContext.h" |
| 31 #include "sky/engine/core/rendering/style/StyleInheritedData.h" | 31 #include "sky/engine/core/rendering/style/StyleInheritedData.h" |
| 32 #include "sky/engine/wtf/OwnPtr.h" | 32 #include "sky/engine/wtf/OwnPtr.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class HTMLElement; | 36 class HTMLElement; |
| 37 | 37 |
| 38 class ElementRareData : public NodeRareData { | 38 class ElementRareData : public NodeRareData { |
| 39 public: | 39 public: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 66 { | 66 { |
| 67 if (!m_shadow) | 67 if (!m_shadow) |
| 68 m_shadow = ElementShadow::create(); | 68 m_shadow = ElementShadow::create(); |
| 69 return *m_shadow; | 69 return *m_shadow; |
| 70 } | 70 } |
| 71 | 71 |
| 72 RenderStyle* computedStyle() const { return m_computedStyle.get(); } | 72 RenderStyle* computedStyle() const { return m_computedStyle.get(); } |
| 73 void setComputedStyle(PassRefPtr<RenderStyle> computedStyle) { m_computedSty
le = computedStyle; } | 73 void setComputedStyle(PassRefPtr<RenderStyle> computedStyle) { m_computedSty
le = computedStyle; } |
| 74 void clearComputedStyle() { m_computedStyle = nullptr; } | 74 void clearComputedStyle() { m_computedStyle = nullptr; } |
| 75 | 75 |
| 76 ClassList* classList() const { return m_classList.get(); } | 76 DOMTokenList* classList() const { return m_classList.get(); } |
| 77 void setClassList(PassOwnPtr<ClassList> classList) { m_classList = classList
; } | 77 void setClassList(PassOwnPtr<DOMTokenList> classList) { m_classList = classL
ist; } |
| 78 | 78 |
| 79 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; } | 79 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; } |
| 80 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si
ze; } | 80 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si
ze; } |
| 81 | 81 |
| 82 ActiveAnimations* activeAnimations() { return m_activeAnimations.get(); } | 82 ActiveAnimations* activeAnimations() { return m_activeAnimations.get(); } |
| 83 void setActiveAnimations(PassOwnPtr<ActiveAnimations> activeAnimations) | 83 void setActiveAnimations(PassOwnPtr<ActiveAnimations> activeAnimations) |
| 84 { | 84 { |
| 85 m_activeAnimations = activeAnimations; | 85 m_activeAnimations = activeAnimations; |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool hasInputMethodContext() const { return m_inputMethodContext; } | 88 bool hasInputMethodContext() const { return m_inputMethodContext; } |
| 89 InputMethodContext& ensureInputMethodContext(HTMLElement* element) | 89 InputMethodContext& ensureInputMethodContext(HTMLElement* element) |
| 90 { | 90 { |
| 91 if (!m_inputMethodContext) | 91 if (!m_inputMethodContext) |
| 92 m_inputMethodContext = InputMethodContext::create(element); | 92 m_inputMethodContext = InputMethodContext::create(element); |
| 93 return *m_inputMethodContext; | 93 return *m_inputMethodContext; |
| 94 } | 94 } |
| 95 | 95 |
| 96 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } | 96 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } |
| 97 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } | 97 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 short m_tabindex; | 100 short m_tabindex; |
| 101 | 101 |
| 102 IntSize m_savedLayerScrollOffset; | 102 IntSize m_savedLayerScrollOffset; |
| 103 | 103 |
| 104 OwnPtr<ClassList> m_classList; | 104 OwnPtr<DOMTokenList> m_classList; |
| 105 OwnPtr<ElementShadow> m_shadow; | 105 OwnPtr<ElementShadow> m_shadow; |
| 106 OwnPtr<InputMethodContext> m_inputMethodContext; | 106 OwnPtr<InputMethodContext> m_inputMethodContext; |
| 107 OwnPtr<ActiveAnimations> m_activeAnimations; | 107 OwnPtr<ActiveAnimations> m_activeAnimations; |
| 108 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; | 108 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; |
| 109 | 109 |
| 110 RefPtr<RenderStyle> m_computedStyle; | 110 RefPtr<RenderStyle> m_computedStyle; |
| 111 RefPtr<CustomElementDefinition> m_customElementDefinition; | 111 RefPtr<CustomElementDefinition> m_customElementDefinition; |
| 112 | 112 |
| 113 explicit ElementRareData(RenderObject*); | 113 explicit ElementRareData(RenderObject*); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 inline ElementRareData::ElementRareData(RenderObject* renderer) | 116 inline ElementRareData::ElementRareData(RenderObject* renderer) |
| 117 : NodeRareData(renderer) | 117 : NodeRareData(renderer) |
| 118 , m_tabindex(0) | 118 , m_tabindex(0) |
| 119 { | 119 { |
| 120 m_isElementRareData = true; | 120 m_isElementRareData = true; |
| 121 } | 121 } |
| 122 | 122 |
| 123 inline ElementRareData::~ElementRareData() | 123 inline ElementRareData::~ElementRareData() |
| 124 { | 124 { |
| 125 #if !ENABLE(OILPAN) | 125 #if !ENABLE(OILPAN) |
| 126 ASSERT(!m_shadow); | 126 ASSERT(!m_shadow); |
| 127 #endif | 127 #endif |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace | 130 } // namespace |
| 131 | 131 |
| 132 #endif // SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_ | 132 #endif // SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_ |
| OLD | NEW |