| 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, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #ifndef ElementRareData_h | 22 #ifndef ElementRareData_h |
| 23 #define ElementRareData_h | 23 #define ElementRareData_h |
| 24 | 24 |
| 25 #include "core/animation/ActiveAnimations.h" | 25 #include "core/animation/ActiveAnimations.h" |
| 26 #include "core/dom/NodeRareData.h" | 26 #include "core/dom/NodeRareData.h" |
| 27 #include "core/dom/custom/CustomElementDefinition.h" | 27 #include "core/dom/custom/CustomElementDefinition.h" |
| 28 #include "core/dom/shadow/ElementShadow.h" | 28 #include "core/dom/shadow/ElementShadow.h" |
| 29 #include "core/html/ClassList.h" | 29 #include "core/html/ClassList.h" |
| 30 #include "core/html/ime/InputMethodContext.h" | 30 #include "core/html/ime/InputMethodContext.h" |
| 31 #include "core/rendering/style/StyleInheritedData.h" | 31 #include "core/rendering/style/StyleInheritedData.h" |
| 32 #include "platform/heap/Handle.h" | |
| 33 #include "wtf/OwnPtr.h" | 32 #include "wtf/OwnPtr.h" |
| 34 | 33 |
| 35 namespace blink { | 34 namespace blink { |
| 36 | 35 |
| 37 class HTMLElement; | 36 class HTMLElement; |
| 38 | 37 |
| 39 class ElementRareData : public NodeRareData { | 38 class ElementRareData : public NodeRareData { |
| 40 public: | 39 public: |
| 41 static ElementRareData* create(RenderObject* renderer) | 40 static ElementRareData* create(RenderObject* renderer) |
| 42 { | 41 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 70 return *m_shadow; | 69 return *m_shadow; |
| 71 } | 70 } |
| 72 | 71 |
| 73 RenderStyle* computedStyle() const { return m_computedStyle.get(); } | 72 RenderStyle* computedStyle() const { return m_computedStyle.get(); } |
| 74 void setComputedStyle(PassRefPtr<RenderStyle> computedStyle) { m_computedSty
le = computedStyle; } | 73 void setComputedStyle(PassRefPtr<RenderStyle> computedStyle) { m_computedSty
le = computedStyle; } |
| 75 void clearComputedStyle() { m_computedStyle = nullptr; } | 74 void clearComputedStyle() { m_computedStyle = nullptr; } |
| 76 | 75 |
| 77 ClassList* classList() const { return m_classList.get(); } | 76 ClassList* classList() const { return m_classList.get(); } |
| 78 void setClassList(PassOwnPtr<ClassList> classList) { m_classList = classList
; } | 77 void setClassList(PassOwnPtr<ClassList> classList) { m_classList = classList
; } |
| 79 | 78 |
| 80 LayoutSize minimumSizeForResizing() const { return m_minimumSizeForResizing;
} | |
| 81 void setMinimumSizeForResizing(LayoutSize size) { m_minimumSizeForResizing =
size; } | |
| 82 | |
| 83 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; } | 79 IntSize savedLayerScrollOffset() const { return m_savedLayerScrollOffset; } |
| 84 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si
ze; } | 80 void setSavedLayerScrollOffset(IntSize size) { m_savedLayerScrollOffset = si
ze; } |
| 85 | 81 |
| 86 ActiveAnimations* activeAnimations() { return m_activeAnimations.get(); } | 82 ActiveAnimations* activeAnimations() { return m_activeAnimations.get(); } |
| 87 void setActiveAnimations(PassOwnPtr<ActiveAnimations> activeAnimations) | 83 void setActiveAnimations(PassOwnPtr<ActiveAnimations> activeAnimations) |
| 88 { | 84 { |
| 89 m_activeAnimations = activeAnimations; | 85 m_activeAnimations = activeAnimations; |
| 90 } | 86 } |
| 91 | 87 |
| 92 bool hasInputMethodContext() const { return m_inputMethodContext; } | 88 bool hasInputMethodContext() const { return m_inputMethodContext; } |
| 93 InputMethodContext& ensureInputMethodContext(HTMLElement* element) | 89 InputMethodContext& ensureInputMethodContext(HTMLElement* element) |
| 94 { | 90 { |
| 95 if (!m_inputMethodContext) | 91 if (!m_inputMethodContext) |
| 96 m_inputMethodContext = InputMethodContext::create(element); | 92 m_inputMethodContext = InputMethodContext::create(element); |
| 97 return *m_inputMethodContext; | 93 return *m_inputMethodContext; |
| 98 } | 94 } |
| 99 | 95 |
| 100 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } | 96 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition> definiti
on) { m_customElementDefinition = definition; } |
| 101 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } | 97 CustomElementDefinition* customElementDefinition() const { return m_customEl
ementDefinition.get(); } |
| 102 | 98 |
| 103 void traceAfterDispatch(Visitor*); | |
| 104 | |
| 105 private: | 99 private: |
| 106 short m_tabindex; | 100 short m_tabindex; |
| 107 | 101 |
| 108 LayoutSize m_minimumSizeForResizing; | |
| 109 IntSize m_savedLayerScrollOffset; | 102 IntSize m_savedLayerScrollOffset; |
| 110 | 103 |
| 111 OwnPtr<ClassList> m_classList; | 104 OwnPtr<ClassList> m_classList; |
| 112 OwnPtr<ElementShadow> m_shadow; | 105 OwnPtr<ElementShadow> m_shadow; |
| 113 OwnPtr<InputMethodContext> m_inputMethodContext; | 106 OwnPtr<InputMethodContext> m_inputMethodContext; |
| 114 OwnPtr<ActiveAnimations> m_activeAnimations; | 107 OwnPtr<ActiveAnimations> m_activeAnimations; |
| 115 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; | 108 OwnPtr<InlineCSSStyleDeclaration> m_cssomWrapper; |
| 116 | 109 |
| 117 RefPtr<RenderStyle> m_computedStyle; | 110 RefPtr<RenderStyle> m_computedStyle; |
| 118 RefPtr<CustomElementDefinition> m_customElementDefinition; | 111 RefPtr<CustomElementDefinition> m_customElementDefinition; |
| 119 | 112 |
| 120 explicit ElementRareData(RenderObject*); | 113 explicit ElementRareData(RenderObject*); |
| 121 }; | 114 }; |
| 122 | 115 |
| 123 inline IntSize defaultMinimumSizeForResizing() | |
| 124 { | |
| 125 return IntSize(LayoutUnit::max(), LayoutUnit::max()); | |
| 126 } | |
| 127 | |
| 128 inline ElementRareData::ElementRareData(RenderObject* renderer) | 116 inline ElementRareData::ElementRareData(RenderObject* renderer) |
| 129 : NodeRareData(renderer) | 117 : NodeRareData(renderer) |
| 130 , m_tabindex(0) | 118 , m_tabindex(0) |
| 131 , m_minimumSizeForResizing(defaultMinimumSizeForResizing()) | |
| 132 { | 119 { |
| 133 m_isElementRareData = true; | 120 m_isElementRareData = true; |
| 134 } | 121 } |
| 135 | 122 |
| 136 inline ElementRareData::~ElementRareData() | 123 inline ElementRareData::~ElementRareData() |
| 137 { | 124 { |
| 138 #if !ENABLE(OILPAN) | 125 #if !ENABLE(OILPAN) |
| 139 ASSERT(!m_shadow); | 126 ASSERT(!m_shadow); |
| 140 #endif | 127 #endif |
| 141 } | 128 } |
| 142 | 129 |
| 143 } // namespace | 130 } // namespace |
| 144 | 131 |
| 145 #endif // ElementRareData_h | 132 #endif // ElementRareData_h |
| OLD | NEW |