diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:32 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:32 -0800 |
commit | 635860845790a19bf50bbc51ba8fb66a96dde068 (patch) | |
tree | ef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebCore/dom/NodeRareData.h | |
parent | 8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff) | |
download | external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2 |
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebCore/dom/NodeRareData.h')
-rw-r--r-- | WebCore/dom/NodeRareData.h | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/WebCore/dom/NodeRareData.h b/WebCore/dom/NodeRareData.h index acad86c..bbcfca8 100644 --- a/WebCore/dom/NodeRareData.h +++ b/WebCore/dom/NodeRareData.h @@ -1,6 +1,5 @@ -/** - * - * Copyright (C) 2008 Apple Computer, Inc. +/* + * Copyright (C) 2008 Apple Inc. All rights reserved. * Copyright (C) 2008 David Smith <catfish.man@gmail.com> * * This library is free software; you can redistribute it and/or @@ -24,7 +23,10 @@ #define NodeRareData_h #include "DynamicNodeList.h" +#include "EventListener.h" +#include "RegisteredEventListener.h" #include "StringHash.h" +#include "QualifiedName.h" #include <wtf/HashSet.h> #include <wtf/OwnPtr.h> @@ -40,10 +42,14 @@ struct NodeListsNodeData { CacheMap m_classNodeListCaches; CacheMap m_nameNodeListCaches; + typedef HashMap<QualifiedName, DynamicNodeList::Caches*> TagCacheMap; + TagCacheMap m_tagNodeListCaches; + ~NodeListsNodeData() { deleteAllValues(m_classNodeListCaches); deleteAllValues(m_nameNodeListCaches); + deleteAllValues(m_tagNodeListCaches); } void invalidateCaches(); @@ -54,9 +60,9 @@ struct NodeListsNodeData { class NodeRareData { public: NodeRareData() - : m_focused(false) - , m_tabIndex(0) - , m_tabIndexSetExplicitly(false) + : m_tabIndex(0) + , m_tabIndexWasSetExplicitly(false) + , m_isFocused(false) , m_needsFocusAppearanceUpdateSoonAfterAttach(false) { } @@ -79,18 +85,34 @@ public: NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); } short tabIndex() const { return m_tabIndex; } - void setTabIndexExplicitly(short index) { m_tabIndex = index; m_tabIndexSetExplicitly = true; } - bool tabIndexSetExplicitly() const { return m_tabIndexSetExplicitly; } - - bool m_focused : 1; + void setTabIndexExplicitly(short index) { m_tabIndex = index; m_tabIndexWasSetExplicitly = true; } + bool tabIndexSetExplicitly() const { return m_tabIndexWasSetExplicitly; } + + RegisteredEventListenerVector* listeners() { return m_eventListeners.get(); } + RegisteredEventListenerVector& ensureListeners() + { + if (!m_eventListeners) + m_eventListeners.set(new RegisteredEventListenerVector); + return *m_eventListeners; + } + + bool isFocused() const { return m_isFocused; } + void setFocused(bool focused) { m_isFocused = focused; } + +protected: + // for ElementRareData + bool needsFocusAppearanceUpdateSoonAfterAttach() const { return m_needsFocusAppearanceUpdateSoonAfterAttach; } + void setNeedsFocusAppearanceUpdateSoonAfterAttach(bool needs) { m_needsFocusAppearanceUpdateSoonAfterAttach = needs; } private: OwnPtr<NodeListsNodeData> m_nodeLists; + OwnPtr<RegisteredEventListenerVector > m_eventListeners; short m_tabIndex; - bool m_tabIndexSetExplicitly : 1; -public: - bool m_needsFocusAppearanceUpdateSoonAfterAttach : 1; //for ElementRareData + bool m_tabIndexWasSetExplicitly : 1; + bool m_isFocused : 1; + bool m_needsFocusAppearanceUpdateSoonAfterAttach : 1; }; + } //namespace #endif |