| 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/DOMTokenList.h" |
| 27 #include "sky/engine/core/dom/NodeRareData.h" | 27 #include "sky/engine/core/dom/NodeRareData.h" |
| 28 #include "sky/engine/core/dom/custom/CustomElementDefinition.h" | 28 #include "sky/engine/core/dom/custom/CustomElementDefinition.h" |
| 29 #include "sky/engine/core/dom/shadow/ElementShadow.h" | 29 #include "sky/engine/core/dom/shadow/ElementShadow.h" |
| 30 #include "sky/engine/core/html/ime/InputMethodContext.h" | |
| 31 #include "sky/engine/core/rendering/style/StyleInheritedData.h" | 30 #include "sky/engine/core/rendering/style/StyleInheritedData.h" |
| 32 #include "sky/engine/wtf/OwnPtr.h" | 31 #include "sky/engine/wtf/OwnPtr.h" |
| 33 | 32 |
| 34 namespace blink { | 33 namespace blink { |
| 35 | 34 |
| 36 class HTMLElement; | 35 class HTMLElement; |
| 37 | 36 |
| 38 class ElementRareData : public NodeRareData { | 37 class ElementRareData : public NodeRareData { |
| 39 public: | 38 public: |
| 40 static ElementRareData* create(RenderObject* renderer) | 39 static ElementRareData* create(RenderObject* renderer) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 77 |
| 79 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; } | 78 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; } |
| 80 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si
ze; } | 79 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si
ze; } |
| 81 | 80 |
| 82 ActiveAnimations* activeAnimations() { return m_activeAnimations.get(); } | 81 ActiveAnimations* activeAnimations() { return m_activeAnimations.get(); } |
| 83 void setActiveAnimations(PassOwnPtr<ActiveAnimations> activeAnimations) | 82 void setActiveAnimations(PassOwnPtr<ActiveAnimations> activeAnimations) |
| 84 { | 83 { |
| 85 m_activeAnimations = activeAnimations; | 84 m_activeAnimations = activeAnimations; |
| 86 } | 85 } |
| 87 | 86 |
| 88 bool hasInputMethodContext() const { return m_inputMethodContext; } | |
| 89 InputMethodContext& ensureInputMethodContext(HTMLElement* element) | |
| 90 { | |
| 91 if (!m_inputMethodContext) | |
| 92 m_inputMethodContext = InputMethodContext::create(element); | |
| 93 return *m_inputMethodContext; | |
| 94 } | |
| 95 | |
| 96 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } | 87 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } |
| 97 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } | 88 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } |
| 98 | 89 |
| 99 private: | 90 private: |
| 100 short m_tabindex; | 91 short m_tabindex; |
| 101 | 92 |
| 102 IntSize m_savedLayerScrollOffset; | 93 IntSize m_savedLayerScrollOffset; |
| 103 | 94 |
| 104 OwnPtr<DOMTokenList> m_classList; | 95 OwnPtr<DOMTokenList> m_classList; |
| 105 OwnPtr<ElementShadow> m_shadow; | 96 OwnPtr<ElementShadow> m_shadow; |
| 106 OwnPtr<InputMethodContext> m_inputMethodContext; | |
| 107 OwnPtr<ActiveAnimations> m_activeAnimations; | 97 OwnPtr<ActiveAnimations> m_activeAnimations; |
| 108 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; | 98 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; |
| 109 | 99 |
| 110 RefPtr<RenderStyle> m_computedStyle; | 100 RefPtr<RenderStyle> m_computedStyle; |
| 111 RefPtr<CustomElementDefinition> m_customElementDefinition; | 101 RefPtr<CustomElementDefinition> m_customElementDefinition; |
| 112 | 102 |
| 113 explicit ElementRareData(RenderObject*); | 103 explicit ElementRareData(RenderObject*); |
| 114 }; | 104 }; |
| 115 | 105 |
| 116 inline ElementRareData::ElementRareData(RenderObject* renderer) | 106 inline ElementRareData::ElementRareData(RenderObject* renderer) |
| 117 : NodeRareData(renderer) | 107 : NodeRareData(renderer) |
| 118 , m_tabindex(0) | 108 , m_tabindex(0) |
| 119 { | 109 { |
| 120 m_isElementRareData = true; | 110 m_isElementRareData = true; |
| 121 } | 111 } |
| 122 | 112 |
| 123 inline ElementRareData::~ElementRareData() | 113 inline ElementRareData::~ElementRareData() |
| 124 { | 114 { |
| 125 #if !ENABLE(OILPAN) | 115 #if !ENABLE(OILPAN) |
| 126 ASSERT(!m_shadow); | 116 ASSERT(!m_shadow); |
| 127 #endif | 117 #endif |
| 128 } | 118 } |
| 129 | 119 |
| 130 } // namespace | 120 } // namespace |
| 131 | 121 |
| 132 #endif // SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_ | 122 #endif // SKY_ENGINE_CORE_DOM_ELEMENTRAREDATA_H_ |
| OLD | NEW |