Changeset 139681 in webkit


Ignore:
Timestamp:
Jan 14, 2013, 3:57:39 PM (12 years ago)
Author:
rniwa@webkit.org
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):

Location:
trunk/Source/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r139680 r139681  
     12013-01-11  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Move functions from NodeRareData to ElementRareData and other classes
     4        https://bugs.webkit.org/show_bug.cgi?id=106679
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Moved tab index related functions from NodeRareData to ElementRareData since only
     9        HTMLElement uses them, and moved related functions on Node to Element accordingly.
     10
     11        Also replaced transientMutationObserverRegistry and ensureTransientMutationObserverRegistry
     12        by ensureMutationObserverData, and moved micro-data related member functions into
     13        NodeMicroDataTokenLists, and moved NodeMutationObserverData and NodeMicroDataTokenLists
     14        out of NodeRareData as they're used outside of NodeRareData now.
     15
     16        The intention is to move more code into NodeMutationObserverData and NodeMicroDataTokenLists
     17        in the follow up patches so that they can detect the removability of NodeRareData.
     18
     19        No new tests are added since there should be no behavior changes.
     20
     21        * dom/Element.cpp:
     22        (WebCore::Element::clearTabIndexExplicitlyIfNeeded):
     23        (WebCore::Element::setTabIndexExplicitly):
     24        (WebCore::Element::tabIndex):
     25        (WebCore::Element::supportsFocus):
     26        * dom/Element.h:
     27        (Element):
     28        * dom/ElementRareData.h:
     29        (ElementRareData):
     30        (WebCore::ElementRareData::tabIndex):
     31        (WebCore::ElementRareData::setTabIndexExplicitly):
     32        (WebCore::ElementRareData::tabIndexSetExplicitly):
     33        (WebCore::ElementRareData::clearTabIndexExplicitly):
     34        * dom/Node.cpp:
     35        (WebCore::Node::tabIndex):
     36        (WebCore::Node::supportsFocus):
     37        (WebCore::Node::mutationObserverRegistry):
     38        (WebCore::Node::transientMutationObserverRegistry):
     39        (WebCore::Node::registerMutationObserver):
     40        (WebCore::Node::registerTransientMutationObserver):
     41        (WebCore::Node::itemProp):
     42        (WebCore::Node::setItemProp):
     43        (WebCore::Node::itemRef):
     44        (WebCore::Node::setItemRef):
     45        (WebCore::Node::itemType):
     46        (WebCore::Node::setItemType):
     47        * dom/Node.h:
     48        (Node):
     49        * dom/NodeRareData.h:
     50        (NodeMutationObserverData):
     51        (WebCore::NodeMutationObserverData::create):
     52        (NodeMicroDataTokenLists):
     53        (WebCore::NodeMicroDataTokenLists::create):
     54        (WebCore::NodeMicroDataTokenLists::itemProp):
     55        (WebCore::NodeMicroDataTokenLists::itemRef):
     56        (WebCore::NodeMicroDataTokenLists::itemType):
     57        (NodeRareData):
     58        (WebCore::NodeRareData::mutationObserverData):
     59        (WebCore::NodeRareData::ensureMutationObserverData):
     60        (WebCore::NodeRareData::ensureMicroDataTokenLists):
     61        * html/HTMLElement.cpp:
     62        (WebCore::HTMLElement::parseAttribute):
     63
    1642013-01-14  Ojan Vafai  <ojan@chromium.org>
    265
  • trunk/Source/WebCore/dom/Element.cpp

    r139659 r139681  
    229229}
    230230
     231void Element::clearTabIndexExplicitlyIfNeeded()
     232{
     233    if (hasRareData())
     234        elementRareData()->clearTabIndexExplicitly();
     235}
     236
     237void Element::setTabIndexExplicitly(short tabIndex)
     238{
     239    ensureElementRareData()->setTabIndexExplicitly(tabIndex);
     240}
     241
     242bool Element::supportsFocus() const
     243{
     244    return hasRareData() && elementRareData()->tabIndexSetExplicitly();
     245}
     246
     247short Element::tabIndex() const
     248{
     249    return hasRareData() ? elementRareData()->tabIndex() : 0;
     250}
     251
    231252DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, blur);
    232253DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, error);
  • trunk/Source/WebCore/dom/Element.h

    r139639 r139681  
    516516    virtual bool shouldRegisterAsExtraNamedItem() const { return false; }
    517517
     518    void clearTabIndexExplicitlyIfNeeded();   
     519    void setTabIndexExplicitly(short);
     520    virtual bool supportsFocus() const OVERRIDE;
     521    virtual short tabIndex() const OVERRIDE;
     522
    518523    PassRefPtr<HTMLCollection> ensureCachedHTMLCollection(CollectionType);
    519524    HTMLCollection* cachedHTMLCollection(CollectionType);
  • trunk/Source/WebCore/dom/ElementRareData.h

    r139639 r139681  
    4545    void resetComputedStyle();
    4646    void resetDynamicRestyleObservations();
     47   
     48    short tabIndex() const { return m_tabIndex; }
     49    void setTabIndexExplicitly(short index) { m_tabIndex = index; m_tabIndexWasSetExplicitly = true; }
     50    bool tabIndexSetExplicitly() const { return m_tabIndexWasSetExplicitly; }
     51    void clearTabIndexExplicitly() { m_tabIndex = 0; m_tabIndexWasSetExplicitly = false; }
    4752
    4853    bool needsFocusAppearanceUpdateSoonAfterAttach() const { return m_needsFocusAppearanceUpdateSoonAfterAttach; }
     
    125130
    126131private:
    127     // Many fields are in NodeRareData for better packing.
     132    short m_tabIndex;
     133    unsigned short m_childIndex;
     134    unsigned m_tabIndexWasSetExplicitly : 1;
     135    unsigned m_needsFocusAppearanceUpdateSoonAfterAttach : 1;
     136    unsigned m_styleAffectedByEmpty : 1;
     137    unsigned m_isInCanvasSubtree : 1;
     138#if ENABLE(FULLSCREEN_API)
     139    unsigned m_containsFullScreenElement : 1;
     140#endif
     141#if ENABLE(DIALOG_ELEMENT)
     142    unsigned m_isInTopLayer : 1;
     143#endif
     144#if ENABLE(SVG)
     145    unsigned m_hasPendingResources : 1;
     146#endif
     147    unsigned m_childrenAffectedByHover : 1;
     148    unsigned m_childrenAffectedByActive : 1;
     149    unsigned m_childrenAffectedByDrag : 1;
     150    // Bits for dynamic child matching.
     151    // We optimize for :first-child and :last-child. The other positional child selectors like nth-child or
     152    // *-child-of-type, we will just give up and re-evaluate whenever children change at all.
     153    unsigned m_childrenAffectedByFirstChildRules : 1;
     154    unsigned m_childrenAffectedByLastChildRules : 1;
     155    unsigned m_childrenAffectedByDirectAdjacentRules : 1;
     156    unsigned m_childrenAffectedByForwardPositionalRules : 1;
     157    unsigned m_childrenAffectedByBackwardPositionalRules : 1;
     158#if ENABLE(VIDEO_TRACK)
     159    unsigned m_webVTTNodeType : 2; // WebVTTNodeType
     160#endif
     161
    128162    LayoutSize m_minimumSizeForResizing;
    129163    RefPtr<RenderStyle> m_computedStyle;
     
    149183
    150184inline ElementRareData::ElementRareData()
    151     : m_minimumSizeForResizing(defaultMinimumSizeForResizing())
     185    : m_tabIndex(0)
     186    , m_childIndex(0)
     187    , m_tabIndexWasSetExplicitly(false)
     188    , m_needsFocusAppearanceUpdateSoonAfterAttach(false)
     189    , m_styleAffectedByEmpty(false)
     190    , m_isInCanvasSubtree(false)
     191#if ENABLE(FULLSCREEN_API)
     192    , m_containsFullScreenElement(false)
     193#endif
     194#if ENABLE(DIALOG_ELEMENT)
     195    , m_isInTopLayer(false)
     196#endif
     197#if ENABLE(SVG)
     198    , m_hasPendingResources(false)
     199#endif
     200    , m_childrenAffectedByHover(false)
     201    , m_childrenAffectedByActive(false)
     202    , m_childrenAffectedByDrag(false)
     203    , m_childrenAffectedByFirstChildRules(false)
     204    , m_childrenAffectedByLastChildRules(false)
     205    , m_childrenAffectedByDirectAdjacentRules(false)
     206    , m_childrenAffectedByForwardPositionalRules(false)
     207    , m_childrenAffectedByBackwardPositionalRules(false)
     208#if ENABLE(VIDEO_TRACK)
     209    , m_webVTTNodeType(WebVTTNodeTypeNone)
     210#endif
     211    , m_minimumSizeForResizing(defaultMinimumSizeForResizing())
    152212{
    153213}
  • trunk/Source/WebCore/dom/Node.cpp

    r139541 r139681  
    493493short Node::tabIndex() const
    494494{
    495     return hasRareData() ? rareData()->tabIndex() : 0;
    496 }
    497    
    498 void Node::setTabIndexExplicitly(short i)
    499 {
    500     ensureRareData()->setTabIndexExplicitly(i);
    501 }
    502 
    503 void Node::clearTabIndexExplicitly()
    504 {
    505     ensureRareData()->clearTabIndexExplicitly();
     495    return 0;
    506496}
    507497
     
    864854bool Node::supportsFocus() const
    865855{
    866     return hasRareData() && rareData()->tabIndexSetExplicitly();
     856    return false;
    867857}
    868858   
     
    21932183Vector<OwnPtr<MutationObserverRegistration> >* Node::mutationObserverRegistry()
    21942184{
    2195     return hasRareData() ? rareData()->mutationObserverRegistry() : 0;
     2185    if (!hasRareData())
     2186        return 0;
     2187    NodeMutationObserverData* data = rareData()->mutationObserverData();
     2188    if (!data)
     2189        return 0;
     2190    return &data->registry;
    21962191}
    21972192
    21982193HashSet<MutationObserverRegistration*>* Node::transientMutationObserverRegistry()
    21992194{
    2200     return hasRareData() ? rareData()->transientMutationObserverRegistry() : 0;
     2195    if (!hasRareData())
     2196        return 0;
     2197    NodeMutationObserverData* data = rareData()->mutationObserverData();
     2198    if (!data)
     2199        return 0;
     2200    return &data->transientRegistry;
    22012201}
    22022202
     
    22312231{
    22322232    MutationObserverRegistration* registration = 0;
    2233     Vector<OwnPtr<MutationObserverRegistration> >* registry = ensureRareData()->ensureMutationObserverRegistry();
    2234     for (size_t i = 0; i < registry->size(); ++i) {
    2235         if (registry->at(i)->observer() == observer) {
    2236             registration = registry->at(i).get();
     2233    Vector<OwnPtr<MutationObserverRegistration> >& registry = ensureRareData()->ensureMutationObserverData()->registry;
     2234    for (size_t i = 0; i < registry.size(); ++i) {
     2235        if (registry[i]->observer() == observer) {
     2236            registration = registry[i].get();
    22372237            registration->resetObservation(options, attributeFilter);
    22382238        }
     
    22402240
    22412241    if (!registration) {
    2242         registry->append(MutationObserverRegistration::create(observer, this, options, attributeFilter));
    2243         registration = registry->last().get();
     2242        registry.append(MutationObserverRegistration::create(observer, this, options, attributeFilter));
     2243        registration = registry.last().get();
    22442244    }
    22452245
     
    22642264void Node::registerTransientMutationObserver(MutationObserverRegistration* registration)
    22652265{
    2266     ensureRareData()->ensureTransientMutationObserverRegistry()->add(registration);
     2266    ensureRareData()->ensureMutationObserverData()->transientRegistry.add(registration);
    22672267}
    22682268
     
    25192519DOMSettableTokenList* Node::itemProp()
    25202520{
    2521     return ensureRareData()->itemProp();
     2521    return ensureRareData()->ensureMicroDataTokenLists()->itemProp();
    25222522}
    25232523
    25242524void Node::setItemProp(const String& value)
    25252525{
    2526     ensureRareData()->setItemProp(value);
     2526    ensureRareData()->ensureMicroDataTokenLists()->itemProp()->setValue(value);
    25272527}
    25282528
    25292529DOMSettableTokenList* Node::itemRef()
    25302530{
    2531     return ensureRareData()->itemRef();
     2531    return ensureRareData()->ensureMicroDataTokenLists()->itemRef();
    25322532}
    25332533
    25342534void Node::setItemRef(const String& value)
    25352535{
    2536     ensureRareData()->setItemRef(value);
     2536    ensureRareData()->ensureMicroDataTokenLists()->itemRef()->setValue(value);
    25372537}
    25382538
    25392539DOMSettableTokenList* Node::itemType()
    25402540{
    2541     return ensureRareData()->itemType();
     2541    return ensureRareData()->ensureMicroDataTokenLists()->itemType();
    25422542}
    25432543
    25442544void Node::setItemType(const String& value)
    25452545{
    2546     ensureRareData()->setItemType(value);
     2546    ensureRareData()->ensureMicroDataTokenLists()->itemType()->setValue(value);
    25472547}
    25482548
  • trunk/Source/WebCore/dom/Node.h

    r138811 r139681  
    749749   
    750750    virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const { }
    751     void setTabIndexExplicitly(short);
    752     void clearTabIndexExplicitly();
    753    
     751
    754752    bool hasRareData() const { return getFlag(HasRareDataFlag); }
    755753
  • trunk/Source/WebCore/dom/NodeRareData.cpp

    r138879 r139681  
    4141struct SameSizeAsNodeRareData {
    4242    void* m_pointer[4];
    43     unsigned m_indicesAndBitfields[2];
    44 
    4543#if ENABLE(MICRODATA)
    4644    void* m_microData;
  • trunk/Source/WebCore/dom/NodeRareData.h

    r139639 r139681  
    227227};
    228228
     229class NodeMutationObserverData {
     230    WTF_MAKE_NONCOPYABLE(NodeMutationObserverData); WTF_MAKE_FAST_ALLOCATED;
     231public:
     232    Vector<OwnPtr<MutationObserverRegistration> > registry;
     233    HashSet<MutationObserverRegistration*> transientRegistry;
     234
     235    static PassOwnPtr<NodeMutationObserverData> create() { return adoptPtr(new NodeMutationObserverData); }
     236
     237private:
     238    NodeMutationObserverData() { }
     239};
     240
     241#if ENABLE(MICRODATA)
     242class NodeMicroDataTokenLists {
     243    WTF_MAKE_NONCOPYABLE(NodeMicroDataTokenLists); WTF_MAKE_FAST_ALLOCATED;
     244public:
     245    static PassOwnPtr<NodeMicroDataTokenLists> create() { return adoptPtr(new NodeMicroDataTokenLists); }
     246
     247    DOMSettableTokenList* itemProp() const
     248    {
     249        if (!m_itemProp)
     250            m_itemProp = DOMSettableTokenList::create();
     251        return m_itemProp.get();
     252    }
     253
     254    DOMSettableTokenList* itemRef() const
     255    {
     256        if (!m_itemRef)
     257            m_itemRef = DOMSettableTokenList::create();
     258        return m_itemRef.get();
     259    }
     260
     261    DOMSettableTokenList* itemType() const
     262    {
     263        if (!m_itemType)
     264            m_itemType = DOMSettableTokenList::create();
     265        return m_itemType.get();
     266    }
     267
     268private:
     269    DOMSettableTokenList() { }
     270
     271    mutable RefPtr<DOMSettableTokenList> m_itemProp;
     272    mutable RefPtr<DOMSettableTokenList> m_itemRef;
     273    mutable RefPtr<DOMSettableTokenList> m_itemType;
     274};
     275#endif
     276
    229277class NodeRareData : public NodeRareDataBase {
    230278    WTF_MAKE_NONCOPYABLE(NodeRareData); WTF_MAKE_FAST_ALLOCATED;
    231 
    232     struct NodeMutationObserverData {
    233         Vector<OwnPtr<MutationObserverRegistration> > m_registry;
    234         HashSet<MutationObserverRegistration*> m_transientRegistry;
    235 
    236         static PassOwnPtr<NodeMutationObserverData> create() { return adoptPtr(new NodeMutationObserverData); }
    237     };
    238 
    239 #if ENABLE(MICRODATA)
    240     struct NodeMicroDataTokenLists {
    241         RefPtr<DOMSettableTokenList> m_itemProp;
    242         RefPtr<DOMSettableTokenList> m_itemRef;
    243         RefPtr<DOMSettableTokenList> m_itemType;
    244 
    245         static PassOwnPtr<NodeMicroDataTokenLists> create() { return adoptPtr(new NodeMicroDataTokenLists); }
    246     };
    247 #endif
    248 
    249279public:   
    250280    NodeRareData()
    251         : m_tabIndex(0)
    252         , m_childIndex(0)
    253         , m_tabIndexWasSetExplicitly(false)
    254         , m_needsFocusAppearanceUpdateSoonAfterAttach(false)
    255         , m_styleAffectedByEmpty(false)
    256         , m_isInCanvasSubtree(false)
    257 #if ENABLE(FULLSCREEN_API)
    258         , m_containsFullScreenElement(false)
    259 #endif
    260 #if ENABLE(DIALOG_ELEMENT)
    261         , m_isInTopLayer(false)
    262 #endif
    263 #if ENABLE(SVG)
    264         , m_hasPendingResources(false)
    265 #endif
    266         , m_childrenAffectedByHover(false)
    267         , m_childrenAffectedByActive(false)
    268         , m_childrenAffectedByDrag(false)
    269         , m_childrenAffectedByFirstChildRules(false)
    270         , m_childrenAffectedByLastChildRules(false)
    271         , m_childrenAffectedByDirectAdjacentRules(false)
    272         , m_childrenAffectedByForwardPositionalRules(false)
    273         , m_childrenAffectedByBackwardPositionalRules(false)
    274 #if ENABLE(VIDEO_TRACK)
    275         , m_webVTTNodeType(WebVTTNodeTypeNone)
    276 #endif
    277     {
    278     }
     281    { }
    279282
    280283    virtual ~NodeRareData()
    281     {
    282     }
     284    { }
    283285
    284286    void clearNodeLists() { m_nodeLists.clear(); }
     
    291293    }
    292294
    293     short tabIndex() const { return m_tabIndex; }
    294     void setTabIndexExplicitly(short index) { m_tabIndex = index; m_tabIndexWasSetExplicitly = true; }
    295     bool tabIndexSetExplicitly() const { return m_tabIndexWasSetExplicitly; }
    296     void clearTabIndexExplicitly() { m_tabIndex = 0; m_tabIndexWasSetExplicitly = false; }
    297 
    298     Vector<OwnPtr<MutationObserverRegistration> >* mutationObserverRegistry() { return m_mutationObserverData ? &m_mutationObserverData->m_registry : 0; }
    299     Vector<OwnPtr<MutationObserverRegistration> >* ensureMutationObserverRegistry()
     295    NodeMutationObserverData* mutationObserverData() { return m_mutationObserverData.get(); }
     296    NodeMutationObserverData* ensureMutationObserverData()
    300297    {
    301298        if (!m_mutationObserverData)
    302299            m_mutationObserverData = NodeMutationObserverData::create();
    303         return &m_mutationObserverData->m_registry;
    304     }
    305 
    306     HashSet<MutationObserverRegistration*>* transientMutationObserverRegistry() { return m_mutationObserverData ? &m_mutationObserverData->m_transientRegistry : 0; }
    307     HashSet<MutationObserverRegistration*>* ensureTransientMutationObserverRegistry()
    308     {
    309         if (!m_mutationObserverData)
    310             m_mutationObserverData = NodeMutationObserverData::create();
    311         return &m_mutationObserverData->m_transientRegistry;
     300        return m_mutationObserverData.get();
    312301    }
    313302
     
    319308        return m_microDataTokenLists.get();
    320309    }
    321 
    322     DOMSettableTokenList* itemProp() const
    323     {
    324         if (!ensureMicroDataTokenLists()->m_itemProp)
    325             m_microDataTokenLists->m_itemProp = DOMSettableTokenList::create();
    326 
    327         return m_microDataTokenLists->m_itemProp.get();
    328     }
    329 
    330     void setItemProp(const String& value)
    331     {
    332         if (!ensureMicroDataTokenLists()->m_itemProp)
    333             m_microDataTokenLists->m_itemProp = DOMSettableTokenList::create();
    334 
    335         m_microDataTokenLists->m_itemProp->setValue(value);
    336     }
    337 
    338     DOMSettableTokenList* itemRef() const
    339     {
    340         if (!ensureMicroDataTokenLists()->m_itemRef)
    341             m_microDataTokenLists->m_itemRef = DOMSettableTokenList::create();
    342 
    343         return m_microDataTokenLists->m_itemRef.get();
    344     }
    345 
    346     void setItemRef(const String& value)
    347     {
    348         if (!ensureMicroDataTokenLists()->m_itemRef)
    349             m_microDataTokenLists->m_itemRef = DOMSettableTokenList::create();
    350 
    351         m_microDataTokenLists->m_itemRef->setValue(value);
    352     }
    353 
    354     DOMSettableTokenList* itemType() const
    355     {
    356         if (!ensureMicroDataTokenLists()->m_itemType)
    357             m_microDataTokenLists->m_itemType = DOMSettableTokenList::create();
    358 
    359         return m_microDataTokenLists->m_itemType.get();
    360     }
    361 
    362     void setItemType(const String& value)
    363     {
    364         if (!ensureMicroDataTokenLists()->m_itemType)
    365             m_microDataTokenLists->m_itemType = DOMSettableTokenList::create();
    366 
    367         m_microDataTokenLists->m_itemType->setValue(value);
    368     }
    369310#endif
    370311
    371312    virtual void reportMemoryUsage(MemoryObjectInfo*) const;
    372 
    373 protected:
    374     short m_tabIndex;
    375     unsigned short m_childIndex;
    376     unsigned m_tabIndexWasSetExplicitly : 1;
    377     unsigned m_needsFocusAppearanceUpdateSoonAfterAttach : 1;
    378     unsigned m_styleAffectedByEmpty : 1;
    379     unsigned m_isInCanvasSubtree : 1;
    380 #if ENABLE(FULLSCREEN_API)
    381     unsigned m_containsFullScreenElement : 1;
    382 #endif
    383 #if ENABLE(DIALOG_ELEMENT)
    384     unsigned m_isInTopLayer : 1;
    385 #endif
    386 #if ENABLE(SVG)
    387     unsigned m_hasPendingResources : 1;
    388 #endif
    389     unsigned m_childrenAffectedByHover : 1;
    390     unsigned m_childrenAffectedByActive : 1;
    391     unsigned m_childrenAffectedByDrag : 1;
    392     // Bits for dynamic child matching.
    393     // We optimize for :first-child and :last-child. The other positional child selectors like nth-child or
    394     // *-child-of-type, we will just give up and re-evaluate whenever children change at all.
    395     unsigned m_childrenAffectedByFirstChildRules : 1;
    396     unsigned m_childrenAffectedByLastChildRules : 1;
    397     unsigned m_childrenAffectedByDirectAdjacentRules : 1;
    398     unsigned m_childrenAffectedByForwardPositionalRules : 1;
    399     unsigned m_childrenAffectedByBackwardPositionalRules : 1;
    400 #if ENABLE(VIDEO_TRACK)
    401     unsigned m_webVTTNodeType : 2; // WebVTTNodeType
    402 #endif
    403313
    404314private:
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r137221 r139681  
    224224        int tabindex = 0;
    225225        if (value.isEmpty())
    226             clearTabIndexExplicitly();
     226            clearTabIndexExplicitlyIfNeeded();
    227227        else if (parseHTMLInteger(value, tabindex)) {
    228228            // Clamp tabindex to the range of 'short' to match Firefox's behavior.
Note: See TracChangeset for help on using the changeset viewer.