Title: [139681] trunk/Source/WebCore
Revision
139681
Author
rn...@webkit.org
Date
2013-01-14 15:57:39 -0800 (Mon, 14 Jan 2013)

Log Message

Move functions from NodeRareData to ElementRareData and other classes
https://bugs.webkit.org/show_bug.cgi?id=106679

Reviewed by Benjamin Poulain.

Moved tab index related functions from NodeRareData to ElementRareData since only
HTMLElement uses them, and moved related functions on Node to Element accordingly.

Also replaced transientMutationObserverRegistry and ensureTransientMutationObserverRegistry
by ensureMutationObserverData, and moved micro-data related member functions into
NodeMicroDataTokenLists, and moved NodeMutationObserverData and NodeMicroDataTokenLists
out of NodeRareData as they're used outside of NodeRareData now.

The intention is to move more code into NodeMutationObserverData and NodeMicroDataTokenLists
in the follow up patches so that they can detect the removability of NodeRareData.

No new tests are added since there should be no behavior changes.

* dom/Element.cpp:
(WebCore::Element::clearTabIndexExplicitlyIfNeeded):
(WebCore::Element::setTabIndexExplicitly):
(WebCore::Element::tabIndex):
(WebCore::Element::supportsFocus):
* dom/Element.h:
(Element):
* dom/ElementRareData.h:
(ElementRareData):
(WebCore::ElementRareData::tabIndex):
(WebCore::ElementRareData::setTabIndexExplicitly):
(WebCore::ElementRareData::tabIndexSetExplicitly):
(WebCore::ElementRareData::clearTabIndexExplicitly):
* dom/Node.cpp:
(WebCore::Node::tabIndex):
(WebCore::Node::supportsFocus):
(WebCore::Node::mutationObserverRegistry):
(WebCore::Node::transientMutationObserverRegistry):
(WebCore::Node::registerMutationObserver):
(WebCore::Node::registerTransientMutationObserver):
(WebCore::Node::itemProp):
(WebCore::Node::setItemProp):
(WebCore::Node::itemRef):
(WebCore::Node::setItemRef):
(WebCore::Node::itemType):
(WebCore::Node::setItemType):
* dom/Node.h:
(Node):
* dom/NodeRareData.h:
(NodeMutationObserverData):
(WebCore::NodeMutationObserverData::create):
(NodeMicroDataTokenLists):
(WebCore::NodeMicroDataTokenLists::create):
(WebCore::NodeMicroDataTokenLists::itemProp):
(WebCore::NodeMicroDataTokenLists::itemRef):
(WebCore::NodeMicroDataTokenLists::itemType):
(NodeRareData):
(WebCore::NodeRareData::mutationObserverData):
(WebCore::NodeRareData::ensureMutationObserverData):
(WebCore::NodeRareData::ensureMicroDataTokenLists):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseAttribute):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (139680 => 139681)


--- trunk/Source/WebCore/ChangeLog	2013-01-14 23:53:51 UTC (rev 139680)
+++ trunk/Source/WebCore/ChangeLog	2013-01-14 23:57:39 UTC (rev 139681)
@@ -1,3 +1,66 @@
+2013-01-11  Ryosuke Niwa  <rn...@webkit.org>
+
+        Move functions from NodeRareData to ElementRareData and other classes
+        https://bugs.webkit.org/show_bug.cgi?id=106679
+
+        Reviewed by Benjamin Poulain.
+
+        Moved tab index related functions from NodeRareData to ElementRareData since only
+        HTMLElement uses them, and moved related functions on Node to Element accordingly.
+
+        Also replaced transientMutationObserverRegistry and ensureTransientMutationObserverRegistry
+        by ensureMutationObserverData, and moved micro-data related member functions into
+        NodeMicroDataTokenLists, and moved NodeMutationObserverData and NodeMicroDataTokenLists
+        out of NodeRareData as they're used outside of NodeRareData now.
+
+        The intention is to move more code into NodeMutationObserverData and NodeMicroDataTokenLists
+        in the follow up patches so that they can detect the removability of NodeRareData.
+
+        No new tests are added since there should be no behavior changes.
+
+        * dom/Element.cpp:
+        (WebCore::Element::clearTabIndexExplicitlyIfNeeded):
+        (WebCore::Element::setTabIndexExplicitly):
+        (WebCore::Element::tabIndex):
+        (WebCore::Element::supportsFocus):
+        * dom/Element.h:
+        (Element):
+        * dom/ElementRareData.h:
+        (ElementRareData):
+        (WebCore::ElementRareData::tabIndex):
+        (WebCore::ElementRareData::setTabIndexExplicitly):
+        (WebCore::ElementRareData::tabIndexSetExplicitly):
+        (WebCore::ElementRareData::clearTabIndexExplicitly):
+        * dom/Node.cpp:
+        (WebCore::Node::tabIndex):
+        (WebCore::Node::supportsFocus):
+        (WebCore::Node::mutationObserverRegistry):
+        (WebCore::Node::transientMutationObserverRegistry):
+        (WebCore::Node::registerMutationObserver):
+        (WebCore::Node::registerTransientMutationObserver):
+        (WebCore::Node::itemProp):
+        (WebCore::Node::setItemProp):
+        (WebCore::Node::itemRef):
+        (WebCore::Node::setItemRef):
+        (WebCore::Node::itemType):
+        (WebCore::Node::setItemType):
+        * dom/Node.h:
+        (Node):
+        * dom/NodeRareData.h:
+        (NodeMutationObserverData):
+        (WebCore::NodeMutationObserverData::create):
+        (NodeMicroDataTokenLists):
+        (WebCore::NodeMicroDataTokenLists::create):
+        (WebCore::NodeMicroDataTokenLists::itemProp):
+        (WebCore::NodeMicroDataTokenLists::itemRef):
+        (WebCore::NodeMicroDataTokenLists::itemType):
+        (NodeRareData):
+        (WebCore::NodeRareData::mutationObserverData):
+        (WebCore::NodeRareData::ensureMutationObserverData):
+        (WebCore::NodeRareData::ensureMicroDataTokenLists):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::parseAttribute):
+
 2013-01-14  Ojan Vafai  <o...@chromium.org>
 
         Remove unnecessary setNeedsLayoutAndPrefWidthsRecalc from RenderTable

Modified: trunk/Source/WebCore/dom/Element.cpp (139680 => 139681)


--- trunk/Source/WebCore/dom/Element.cpp	2013-01-14 23:53:51 UTC (rev 139680)
+++ trunk/Source/WebCore/dom/Element.cpp	2013-01-14 23:57:39 UTC (rev 139681)
@@ -228,6 +228,27 @@
     return adoptPtr(new ElementRareData());
 }
 
+void Element::clearTabIndexExplicitlyIfNeeded()
+{
+    if (hasRareData())
+        elementRareData()->clearTabIndexExplicitly();
+}
+
+void Element::setTabIndexExplicitly(short tabIndex)
+{
+    ensureElementRareData()->setTabIndexExplicitly(tabIndex);
+}
+
+bool Element::supportsFocus() const
+{
+    return hasRareData() && elementRareData()->tabIndexSetExplicitly();
+}
+
+short Element::tabIndex() const
+{
+    return hasRareData() ? elementRareData()->tabIndex() : 0;
+}
+
 DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, blur);
 DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, error);
 DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, focus);

Modified: trunk/Source/WebCore/dom/Element.h (139680 => 139681)


--- trunk/Source/WebCore/dom/Element.h	2013-01-14 23:53:51 UTC (rev 139680)
+++ trunk/Source/WebCore/dom/Element.h	2013-01-14 23:57:39 UTC (rev 139681)
@@ -515,6 +515,11 @@
     virtual bool shouldRegisterAsNamedItem() const { return false; }
     virtual bool shouldRegisterAsExtraNamedItem() const { return false; }
 
+    void clearTabIndexExplicitlyIfNeeded();    
+    void setTabIndexExplicitly(short);
+    virtual bool supportsFocus() const OVERRIDE;
+    virtual short tabIndex() const OVERRIDE;
+
     PassRefPtr<HTMLCollection> ensureCachedHTMLCollection(CollectionType);
     HTMLCollection* cachedHTMLCollection(CollectionType);
 

Modified: trunk/Source/WebCore/dom/ElementRareData.h (139680 => 139681)


--- trunk/Source/WebCore/dom/ElementRareData.h	2013-01-14 23:53:51 UTC (rev 139680)
+++ trunk/Source/WebCore/dom/ElementRareData.h	2013-01-14 23:57:39 UTC (rev 139681)
@@ -44,6 +44,11 @@
 
     void resetComputedStyle();
     void resetDynamicRestyleObservations();
+    
+    short tabIndex() const { return m_tabIndex; }
+    void setTabIndexExplicitly(short index) { m_tabIndex = index; m_tabIndexWasSetExplicitly = true; }
+    bool tabIndexSetExplicitly() const { return m_tabIndexWasSetExplicitly; }
+    void clearTabIndexExplicitly() { m_tabIndex = 0; m_tabIndexWasSetExplicitly = false; }
 
     bool needsFocusAppearanceUpdateSoonAfterAttach() const { return m_needsFocusAppearanceUpdateSoonAfterAttach; }
     void setNeedsFocusAppearanceUpdateSoonAfterAttach(bool needs) { m_needsFocusAppearanceUpdateSoonAfterAttach = needs; }
@@ -124,7 +129,36 @@
 #endif
 
 private:
-    // Many fields are in NodeRareData for better packing.
+    short m_tabIndex;
+    unsigned short m_childIndex;
+    unsigned m_tabIndexWasSetExplicitly : 1;
+    unsigned m_needsFocusAppearanceUpdateSoonAfterAttach : 1;
+    unsigned m_styleAffectedByEmpty : 1;
+    unsigned m_isInCanvasSubtree : 1;
+#if ENABLE(FULLSCREEN_API)
+    unsigned m_containsFullScreenElement : 1;
+#endif
+#if ENABLE(DIALOG_ELEMENT)
+    unsigned m_isInTopLayer : 1;
+#endif
+#if ENABLE(SVG)
+    unsigned m_hasPendingResources : 1;
+#endif
+    unsigned m_childrenAffectedByHover : 1;
+    unsigned m_childrenAffectedByActive : 1;
+    unsigned m_childrenAffectedByDrag : 1;
+    // Bits for dynamic child matching.
+    // We optimize for :first-child and :last-child. The other positional child selectors like nth-child or
+    // *-child-of-type, we will just give up and re-evaluate whenever children change at all.
+    unsigned m_childrenAffectedByFirstChildRules : 1;
+    unsigned m_childrenAffectedByLastChildRules : 1;
+    unsigned m_childrenAffectedByDirectAdjacentRules : 1;
+    unsigned m_childrenAffectedByForwardPositionalRules : 1;
+    unsigned m_childrenAffectedByBackwardPositionalRules : 1;
+#if ENABLE(VIDEO_TRACK)
+    unsigned m_webVTTNodeType : 2; // WebVTTNodeType
+#endif
+
     LayoutSize m_minimumSizeForResizing;
     RefPtr<RenderStyle> m_computedStyle;
 
@@ -148,7 +182,33 @@
 }
 
 inline ElementRareData::ElementRareData()
-    : m_minimumSizeForResizing(defaultMinimumSizeForResizing())
+    : m_tabIndex(0)
+    , m_childIndex(0)
+    , m_tabIndexWasSetExplicitly(false)
+    , m_needsFocusAppearanceUpdateSoonAfterAttach(false)
+    , m_styleAffectedByEmpty(false)
+    , m_isInCanvasSubtree(false)
+#if ENABLE(FULLSCREEN_API)
+    , m_containsFullScreenElement(false)
+#endif
+#if ENABLE(DIALOG_ELEMENT)
+    , m_isInTopLayer(false)
+#endif
+#if ENABLE(SVG)
+    , m_hasPendingResources(false)
+#endif
+    , m_childrenAffectedByHover(false)
+    , m_childrenAffectedByActive(false)
+    , m_childrenAffectedByDrag(false)
+    , m_childrenAffectedByFirstChildRules(false)
+    , m_childrenAffectedByLastChildRules(false)
+    , m_childrenAffectedByDirectAdjacentRules(false)
+    , m_childrenAffectedByForwardPositionalRules(false)
+    , m_childrenAffectedByBackwardPositionalRules(false)
+#if ENABLE(VIDEO_TRACK)
+    , m_webVTTNodeType(WebVTTNodeTypeNone)
+#endif
+    , m_minimumSizeForResizing(defaultMinimumSizeForResizing())
 {
 }
 

Modified: trunk/Source/WebCore/dom/Node.cpp (139680 => 139681)


--- trunk/Source/WebCore/dom/Node.cpp	2013-01-14 23:53:51 UTC (rev 139680)
+++ trunk/Source/WebCore/dom/Node.cpp	2013-01-14 23:57:39 UTC (rev 139681)
@@ -492,19 +492,9 @@
 
 short Node::tabIndex() const
 {
-    return hasRareData() ? rareData()->tabIndex() : 0;
+    return 0;
 }
-    
-void Node::setTabIndexExplicitly(short i)
-{
-    ensureRareData()->setTabIndexExplicitly(i);
-}
 
-void Node::clearTabIndexExplicitly()
-{
-    ensureRareData()->clearTabIndexExplicitly();
-}
-
 String Node::nodeValue() const
 {
     return String();
@@ -863,7 +853,7 @@
 
 bool Node::supportsFocus() const
 {
-    return hasRareData() && rareData()->tabIndexSetExplicitly();
+    return false;
 }
     
 bool Node::isFocusable() const
@@ -2192,12 +2182,22 @@
 
 Vector<OwnPtr<MutationObserverRegistration> >* Node::mutationObserverRegistry()
 {
-    return hasRareData() ? rareData()->mutationObserverRegistry() : 0;
+    if (!hasRareData())
+        return 0;
+    NodeMutationObserverData* data = ""
+    if (!data)
+        return 0;
+    return &data->registry;
 }
 
 HashSet<MutationObserverRegistration*>* Node::transientMutationObserverRegistry()
 {
-    return hasRareData() ? rareData()->transientMutationObserverRegistry() : 0;
+    if (!hasRareData())
+        return 0;
+    NodeMutationObserverData* data = ""
+    if (!data)
+        return 0;
+    return &data->transientRegistry;
 }
 
 template<typename Registry>
@@ -2230,17 +2230,17 @@
 void Node::registerMutationObserver(MutationObserver* observer, MutationObserverOptions options, const HashSet<AtomicString>& attributeFilter)
 {
     MutationObserverRegistration* registration = 0;
-    Vector<OwnPtr<MutationObserverRegistration> >* registry = ensureRareData()->ensureMutationObserverRegistry();
-    for (size_t i = 0; i < registry->size(); ++i) {
-        if (registry->at(i)->observer() == observer) {
-            registration = registry->at(i).get();
+    Vector<OwnPtr<MutationObserverRegistration> >& registry = ensureRareData()->ensureMutationObserverData()->registry;
+    for (size_t i = 0; i < registry.size(); ++i) {
+        if (registry[i]->observer() == observer) {
+            registration = registry[i].get();
             registration->resetObservation(options, attributeFilter);
         }
     }
 
     if (!registration) {
-        registry->append(MutationObserverRegistration::create(observer, this, options, attributeFilter));
-        registration = registry->last().get();
+        registry.append(MutationObserverRegistration::create(observer, this, options, attributeFilter));
+        registration = registry.last().get();
     }
 
     document()->addMutationObserverTypes(registration->mutationTypes());
@@ -2263,7 +2263,7 @@
 
 void Node::registerTransientMutationObserver(MutationObserverRegistration* registration)
 {
-    ensureRareData()->ensureTransientMutationObserverRegistry()->add(registration);
+    ensureRareData()->ensureMutationObserverData()->transientRegistry.add(registration);
 }
 
 void Node::unregisterTransientMutationObserver(MutationObserverRegistration* registration)
@@ -2518,32 +2518,32 @@
 #if ENABLE(MICRODATA)
 DOMSettableTokenList* Node::itemProp()
 {
-    return ensureRareData()->itemProp();
+    return ensureRareData()->ensureMicroDataTokenLists()->itemProp();
 }
 
 void Node::setItemProp(const String& value)
 {
-    ensureRareData()->setItemProp(value);
+    ensureRareData()->ensureMicroDataTokenLists()->itemProp()->setValue(value);
 }
 
 DOMSettableTokenList* Node::itemRef()
 {
-    return ensureRareData()->itemRef();
+    return ensureRareData()->ensureMicroDataTokenLists()->itemRef();
 }
 
 void Node::setItemRef(const String& value)
 {
-    ensureRareData()->setItemRef(value);
+    ensureRareData()->ensureMicroDataTokenLists()->itemRef()->setValue(value);
 }
 
 DOMSettableTokenList* Node::itemType()
 {
-    return ensureRareData()->itemType();
+    return ensureRareData()->ensureMicroDataTokenLists()->itemType();
 }
 
 void Node::setItemType(const String& value)
 {
-    ensureRareData()->setItemType(value);
+    ensureRareData()->ensureMicroDataTokenLists()->itemType()->setValue(value);
 }
 
 PassRefPtr<PropertyNodeList> Node::propertyNodeList(const String& name)

Modified: trunk/Source/WebCore/dom/Node.h (139680 => 139681)


--- trunk/Source/WebCore/dom/Node.h	2013-01-14 23:53:51 UTC (rev 139680)
+++ trunk/Source/WebCore/dom/Node.h	2013-01-14 23:57:39 UTC (rev 139681)
@@ -748,9 +748,7 @@
     virtual void didMoveToNewDocument(Document* oldDocument);
     
     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const { }
-    void setTabIndexExplicitly(short);
-    void clearTabIndexExplicitly();
-    
+
     bool hasRareData() const { return getFlag(HasRareDataFlag); }
 
     NodeRareData* rareData() const;

Modified: trunk/Source/WebCore/dom/NodeRareData.cpp (139680 => 139681)


--- trunk/Source/WebCore/dom/NodeRareData.cpp	2013-01-14 23:53:51 UTC (rev 139680)
+++ trunk/Source/WebCore/dom/NodeRareData.cpp	2013-01-14 23:57:39 UTC (rev 139681)
@@ -40,8 +40,6 @@
 
 struct SameSizeAsNodeRareData {
     void* m_pointer[4];
-    unsigned m_indicesAndBitfields[2];
-
 #if ENABLE(MICRODATA)
     void* m_microData;
 #endif

Modified: trunk/Source/WebCore/dom/NodeRareData.h (139680 => 139681)


--- trunk/Source/WebCore/dom/NodeRareData.h	2013-01-14 23:53:51 UTC (rev 139680)
+++ trunk/Source/WebCore/dom/NodeRareData.h	2013-01-14 23:57:39 UTC (rev 139681)
@@ -226,61 +226,63 @@
     TagNodeListCacheNS m_tagNodeListCacheNS;
 };
 
-class NodeRareData : public NodeRareDataBase {
-    WTF_MAKE_NONCOPYABLE(NodeRareData); WTF_MAKE_FAST_ALLOCATED;
+class NodeMutationObserverData {
+    WTF_MAKE_NONCOPYABLE(NodeMutationObserverData); WTF_MAKE_FAST_ALLOCATED;
+public:
+    Vector<OwnPtr<MutationObserverRegistration> > registry;
+    HashSet<MutationObserverRegistration*> transientRegistry;
 
-    struct NodeMutationObserverData {
-        Vector<OwnPtr<MutationObserverRegistration> > m_registry;
-        HashSet<MutationObserverRegistration*> m_transientRegistry;
+    static PassOwnPtr<NodeMutationObserverData> create() { return adoptPtr(new NodeMutationObserverData); }
 
-        static PassOwnPtr<NodeMutationObserverData> create() { return adoptPtr(new NodeMutationObserverData); }
-    };
+private:
+    NodeMutationObserverData() { }
+};
 
 #if ENABLE(MICRODATA)
-    struct NodeMicroDataTokenLists {
-        RefPtr<DOMSettableTokenList> m_itemProp;
-        RefPtr<DOMSettableTokenList> m_itemRef;
-        RefPtr<DOMSettableTokenList> m_itemType;
+class NodeMicroDataTokenLists {
+    WTF_MAKE_NONCOPYABLE(NodeMicroDataTokenLists); WTF_MAKE_FAST_ALLOCATED;
+public:
+    static PassOwnPtr<NodeMicroDataTokenLists> create() { return adoptPtr(new NodeMicroDataTokenLists); }
 
-        static PassOwnPtr<NodeMicroDataTokenLists> create() { return adoptPtr(new NodeMicroDataTokenLists); }
-    };
-#endif
+    DOMSettableTokenList* itemProp() const
+    {
+        if (!m_itemProp)
+            m_itemProp = DOMSettableTokenList::create();
+        return m_itemProp.get();
+    }
 
-public:    
-    NodeRareData()
-        : m_tabIndex(0)
-        , m_childIndex(0)
-        , m_tabIndexWasSetExplicitly(false)
-        , m_needsFocusAppearanceUpdateSoonAfterAttach(false)
-        , m_styleAffectedByEmpty(false)
-        , m_isInCanvasSubtree(false)
-#if ENABLE(FULLSCREEN_API)
-        , m_containsFullScreenElement(false)
-#endif
-#if ENABLE(DIALOG_ELEMENT)
-        , m_isInTopLayer(false)
-#endif
-#if ENABLE(SVG)
-        , m_hasPendingResources(false)
-#endif
-        , m_childrenAffectedByHover(false)
-        , m_childrenAffectedByActive(false)
-        , m_childrenAffectedByDrag(false)
-        , m_childrenAffectedByFirstChildRules(false)
-        , m_childrenAffectedByLastChildRules(false)
-        , m_childrenAffectedByDirectAdjacentRules(false)
-        , m_childrenAffectedByForwardPositionalRules(false)
-        , m_childrenAffectedByBackwardPositionalRules(false)
-#if ENABLE(VIDEO_TRACK)
-        , m_webVTTNodeType(WebVTTNodeTypeNone)
-#endif
+    DOMSettableTokenList* itemRef() const
     {
+        if (!m_itemRef)
+            m_itemRef = DOMSettableTokenList::create();
+        return m_itemRef.get();
     }
 
-    virtual ~NodeRareData()
+    DOMSettableTokenList* itemType() const
     {
+        if (!m_itemType)
+            m_itemType = DOMSettableTokenList::create();
+        return m_itemType.get();
     }
 
+private:
+    DOMSettableTokenList() { }
+
+    mutable RefPtr<DOMSettableTokenList> m_itemProp;
+    mutable RefPtr<DOMSettableTokenList> m_itemRef;
+    mutable RefPtr<DOMSettableTokenList> m_itemType;
+};
+#endif
+
+class NodeRareData : public NodeRareDataBase {
+    WTF_MAKE_NONCOPYABLE(NodeRareData); WTF_MAKE_FAST_ALLOCATED;
+public:    
+    NodeRareData()
+    { }
+
+    virtual ~NodeRareData()
+    { }
+
     void clearNodeLists() { m_nodeLists.clear(); }
     NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); }
     NodeListsNodeData* ensureNodeLists()
@@ -290,27 +292,14 @@
         return m_nodeLists.get();
     }
 
-    short tabIndex() const { return m_tabIndex; }
-    void setTabIndexExplicitly(short index) { m_tabIndex = index; m_tabIndexWasSetExplicitly = true; }
-    bool tabIndexSetExplicitly() const { return m_tabIndexWasSetExplicitly; }
-    void clearTabIndexExplicitly() { m_tabIndex = 0; m_tabIndexWasSetExplicitly = false; }
-
-    Vector<OwnPtr<MutationObserverRegistration> >* mutationObserverRegistry() { return m_mutationObserverData ? &m_mutationObserverData->m_registry : 0; }
-    Vector<OwnPtr<MutationObserverRegistration> >* ensureMutationObserverRegistry()
+    NodeMutationObserverData* mutationObserverData() { return m_mutationObserverData.get(); }
+    NodeMutationObserverData* ensureMutationObserverData()
     {
         if (!m_mutationObserverData)
             m_mutationObserverData = NodeMutationObserverData::create();
-        return &m_mutationObserverData->m_registry;
+        return m_mutationObserverData.get();
     }
 
-    HashSet<MutationObserverRegistration*>* transientMutationObserverRegistry() { return m_mutationObserverData ? &m_mutationObserverData->m_transientRegistry : 0; }
-    HashSet<MutationObserverRegistration*>* ensureTransientMutationObserverRegistry()
-    {
-        if (!m_mutationObserverData)
-            m_mutationObserverData = NodeMutationObserverData::create();
-        return &m_mutationObserverData->m_transientRegistry;
-    }
-
 #if ENABLE(MICRODATA)
     NodeMicroDataTokenLists* ensureMicroDataTokenLists() const
     {
@@ -318,89 +307,10 @@
             m_microDataTokenLists = NodeMicroDataTokenLists::create();
         return m_microDataTokenLists.get();
     }
-
-    DOMSettableTokenList* itemProp() const
-    {
-        if (!ensureMicroDataTokenLists()->m_itemProp)
-            m_microDataTokenLists->m_itemProp = DOMSettableTokenList::create();
-
-        return m_microDataTokenLists->m_itemProp.get();
-    }
-
-    void setItemProp(const String& value)
-    {
-        if (!ensureMicroDataTokenLists()->m_itemProp)
-            m_microDataTokenLists->m_itemProp = DOMSettableTokenList::create();
-
-        m_microDataTokenLists->m_itemProp->setValue(value);
-    }
-
-    DOMSettableTokenList* itemRef() const
-    {
-        if (!ensureMicroDataTokenLists()->m_itemRef)
-            m_microDataTokenLists->m_itemRef = DOMSettableTokenList::create();
-
-        return m_microDataTokenLists->m_itemRef.get();
-    }
-
-    void setItemRef(const String& value)
-    {
-        if (!ensureMicroDataTokenLists()->m_itemRef)
-            m_microDataTokenLists->m_itemRef = DOMSettableTokenList::create();
-
-        m_microDataTokenLists->m_itemRef->setValue(value);
-    }
-
-    DOMSettableTokenList* itemType() const
-    {
-        if (!ensureMicroDataTokenLists()->m_itemType)
-            m_microDataTokenLists->m_itemType = DOMSettableTokenList::create();
-
-        return m_microDataTokenLists->m_itemType.get();
-    }
-
-    void setItemType(const String& value)
-    {
-        if (!ensureMicroDataTokenLists()->m_itemType)
-            m_microDataTokenLists->m_itemType = DOMSettableTokenList::create();
-
-        m_microDataTokenLists->m_itemType->setValue(value);
-    }
 #endif
 
     virtual void reportMemoryUsage(MemoryObjectInfo*) const;
 
-protected:
-    short m_tabIndex;
-    unsigned short m_childIndex;
-    unsigned m_tabIndexWasSetExplicitly : 1;
-    unsigned m_needsFocusAppearanceUpdateSoonAfterAttach : 1;
-    unsigned m_styleAffectedByEmpty : 1;
-    unsigned m_isInCanvasSubtree : 1;
-#if ENABLE(FULLSCREEN_API)
-    unsigned m_containsFullScreenElement : 1;
-#endif
-#if ENABLE(DIALOG_ELEMENT)
-    unsigned m_isInTopLayer : 1;
-#endif
-#if ENABLE(SVG)
-    unsigned m_hasPendingResources : 1;
-#endif
-    unsigned m_childrenAffectedByHover : 1;
-    unsigned m_childrenAffectedByActive : 1;
-    unsigned m_childrenAffectedByDrag : 1;
-    // Bits for dynamic child matching.
-    // We optimize for :first-child and :last-child. The other positional child selectors like nth-child or
-    // *-child-of-type, we will just give up and re-evaluate whenever children change at all.
-    unsigned m_childrenAffectedByFirstChildRules : 1;
-    unsigned m_childrenAffectedByLastChildRules : 1;
-    unsigned m_childrenAffectedByDirectAdjacentRules : 1;
-    unsigned m_childrenAffectedByForwardPositionalRules : 1;
-    unsigned m_childrenAffectedByBackwardPositionalRules : 1;
-#if ENABLE(VIDEO_TRACK)
-    unsigned m_webVTTNodeType : 2; // WebVTTNodeType
-#endif
-
 private:
     OwnPtr<NodeListsNodeData> m_nodeLists;
     OwnPtr<NodeMutationObserverData> m_mutationObserverData;

Modified: trunk/Source/WebCore/html/HTMLElement.cpp (139680 => 139681)


--- trunk/Source/WebCore/html/HTMLElement.cpp	2013-01-14 23:53:51 UTC (rev 139680)
+++ trunk/Source/WebCore/html/HTMLElement.cpp	2013-01-14 23:57:39 UTC (rev 139681)
@@ -223,7 +223,7 @@
     else if (name == tabindexAttr) {
         int tabindex = 0;
         if (value.isEmpty())
-            clearTabIndexExplicitly();
+            clearTabIndexExplicitlyIfNeeded();
         else if (parseHTMLInteger(value, tabindex)) {
             // Clamp tabindex to the range of 'short' to match Firefox's behavior.
             setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to