Changeset 116644 in webkit


Ignore:
Timestamp:
May 10, 2012 7:43:27 AM (12 years ago)
Author:
morrita@google.com
Message:

Node::InDetachFlag could be removed.
https://bugs.webkit.org/show_bug.cgi?id=85963

Reviewed by Antti Koivisto.

Removed Node::inDetach() since it can never true
on the only call site setFocusedNode().

No new test. Covered by existing tests.

  • dom/Document.cpp:

(WebCore::Document::setFocusedNode):

  • dom/Node.cpp:

(WebCore::Node::detach):

  • dom/Node.h:

(WebCore):
(Node):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116642 r116644  
     12012-05-10  MORITA Hajime <morrita@google.com>
     2
     3        Node::InDetachFlag could be removed.
     4        https://bugs.webkit.org/show_bug.cgi?id=85963
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Removed Node::inDetach() since it can never true
     9        on the only call site setFocusedNode().
     10
     11        No new test. Covered by existing tests.
     12
     13        * dom/Document.cpp:
     14        (WebCore::Document::setFocusedNode):
     15        * dom/Node.cpp:
     16        (WebCore::Node::detach):
     17        * dom/Node.h:
     18        (WebCore):
     19        (Node):
     20
    1212012-05-10  Keishi Hattori  <keishi@webkit.org>
    222
  • trunk/Source/WebCore/dom/Document.cpp

    r116629 r116644  
    36473647
    36483648    // Remove focus from the existing focus node (if any)
    3649     if (oldFocusedNode && !oldFocusedNode->inDetach()) {
     3649    if (oldFocusedNode) {
    36503650        if (oldFocusedNode->active())
    36513651            oldFocusedNode->setActive(false);
  • trunk/Source/WebCore/dom/Node.cpp

    r116629 r116644  
    13451345void Node::detach()
    13461346{
    1347     setFlag(InDetachFlag);
    1348 
    13491347    if (renderer())
    13501348        renderer()->destroyAndCleanupAnonymousWrappers();
     
    13611359    clearFlag(InActiveChainFlag);
    13621360    clearFlag(IsAttachedFlag);
    1363 
    1364     clearFlag(InDetachFlag);
    13651361}
    13661362
  • trunk/Source/WebCore/dom/Node.h

    r116629 r116644  
    9292typedef int ExceptionCode;
    9393
    94 const int nodeStyleChangeShift = 21;
     94const int nodeStyleChangeShift = 20;
    9595
    9696// SyntheticStyleChange means that we need to go through the entire style change logic even though
     
    299299    bool hasID() const;
    300300    bool hasClass() const;
    301    
     301
    302302    bool active() const { return getFlag(IsActiveFlag); }
    303303    bool inActiveChain() const { return getFlag(InActiveChainFlag); }
    304     bool inDetach() const { return getFlag(InDetachFlag); }
    305304    bool hovered() const { return getFlag(IsHoveredFlag); }
    306305    bool focused() const { return hasRareData() ? rareDataFocused() : false; }
     
    665664        IsHoveredFlag = 1 << 11,
    666665        InActiveChainFlag = 1 << 12,
    667         InDetachFlag = 1 << 13,
    668         HasRareDataFlag = 1 << 14,
    669         IsShadowRootFlag = 1 << 15,
     666        HasRareDataFlag = 1 << 13,
     667        IsShadowRootFlag = 1 << 14,
    670668
    671669        // These bits are used by derived classes, pulled up here so they can
    672670        // be stored in the same memory word as the Node bits above.
    673         IsParsingChildrenFinishedFlag = 1 << 16, // Element
    674         IsStyleAttributeValidFlag = 1 << 17, // StyledElement
     671        IsParsingChildrenFinishedFlag = 1 << 15, // Element
     672        IsStyleAttributeValidFlag = 1 << 16, // StyledElement
    675673#if ENABLE(SVG)
    676         AreSVGAttributesValidFlag = 1 << 18, // Element
    677         IsSynchronizingSVGAttributesFlag = 1 << 19, // SVGElement
    678         HasSVGRareDataFlag = 1 << 20, // SVGElement
     674        AreSVGAttributesValidFlag = 1 << 17, // Element
     675        IsSynchronizingSVGAttributesFlag = 1 << 18, // SVGElement
     676        HasSVGRareDataFlag = 1 << 19, // SVGElement
    679677#endif
    680678
    681679        StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1),
    682680
    683         SelfOrAncestorHasDirAutoFlag = 1 << 23,
    684         HasCustomWillOrDidRecalcStyleFlag = 1 << 24,
    685         HasCustomStyleForRendererFlag = 1 << 25,
    686 
    687         HasNameFlag = 1 << 26,
    688 
    689         AttributeStyleDirtyFlag = 1 << 27,
     681        SelfOrAncestorHasDirAutoFlag = 1 << 22,
     682        HasCustomWillOrDidRecalcStyleFlag = 1 << 23,
     683        HasCustomStyleForRendererFlag = 1 << 24,
     684
     685        HasNameFlag = 1 << 25,
     686
     687        AttributeStyleDirtyFlag = 1 << 26,
    690688
    691689#if ENABLE(SVG)
     
    694692        DefaultNodeFlags = IsParsingChildrenFinishedFlag | IsStyleAttributeValidFlag,
    695693#endif
    696         InNamedFlowFlag = 1 << 29,
    697         HasAttrListFlag = 1 << 30,
    698         IsFrameOwnerElementFlag = 1 << 31
     694        InNamedFlowFlag = 1 << 28,
     695        HasAttrListFlag = 1 << 29,
     696        IsFrameOwnerElementFlag = 1 << 30
    699697    };
    700698
    701     // 1 bits remaining
     699    // 2 bits remaining
    702700
    703701    bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
Note: See TracChangeset for help on using the changeset viewer.