Changeset 116927 in webkit


Ignore:
Timestamp:
May 14, 2012 12:49:59 AM (12 years ago)
Author:
morrita@google.com
Message:

Should have Node::inDetach() for assertion purposes.
https://bugs.webkit.org/show_bug.cgi?id=86157

Reviewed by Darin Adler.

Implemented Node::inDetach() and added an assertio in Document::setFocusedNode().
This is a follow up of r116644 which removes inDetach() checking.

No new tests. Just adding an asssertion.

  • dom/Document.cpp:

(WebCore::Document::setFocusedNode):

  • dom/Node.cpp:

(WebCore):
(WebCore::Node::inDetach):
(WebCore::Node::detach):

  • dom/Node.h:

(Node):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116924 r116927  
     12012-05-14  MORITA Hajime  <morrita@google.com>
     2
     3        Should have Node::inDetach() for assertion purposes.
     4        https://bugs.webkit.org/show_bug.cgi?id=86157
     5
     6        Reviewed by Darin Adler.
     7
     8        Implemented Node::inDetach() and added an assertio in Document::setFocusedNode().
     9        This is a follow up of r116644 which removes inDetach() checking.
     10
     11        No new tests. Just adding an asssertion.
     12
     13        * dom/Document.cpp:
     14        (WebCore::Document::setFocusedNode):
     15        * dom/Node.cpp:
     16        (WebCore):
     17        (WebCore::Node::inDetach):
     18        (WebCore::Node::detach):
     19        * dom/Node.h:
     20        (Node):
     21
    1222012-05-13  Noel Gordon  <noel.gordon@gmail.com>
    223
  • trunk/Source/WebCore/dom/Document.cpp

    r116798 r116927  
    36563656    // Remove focus from the existing focus node (if any)
    36573657    if (oldFocusedNode) {
     3658        ASSERT(!oldFocusedNode->inDetach());
     3659
    36583660        if (oldFocusedNode->active())
    36593661            oldFocusedNode->setActive(false);
  • trunk/Source/WebCore/dom/Node.cpp

    r116814 r116927  
    13401340}
    13411341
     1342#ifndef NDEBUG
     1343static Node* detachingNode;
     1344
     1345bool Node::inDetach() const
     1346{
     1347    return detachingNode == this;
     1348}
     1349#endif
     1350
    13421351void Node::detach()
    13431352{
     1353#ifndef NDEBUG
     1354    ASSERT(!detachingNode);
     1355    detachingNode = this;
     1356#endif
     1357
    13441358    if (renderer())
    13451359        renderer()->destroyAndCleanupAnonymousWrappers();
     
    13561370    clearFlag(InActiveChainFlag);
    13571371    clearFlag(IsAttachedFlag);
     1372
     1373#ifndef NDEBUG
     1374    detachingNode = 0;
     1375#endif
    13581376}
    13591377
  • trunk/Source/WebCore/dom/Node.h

    r116798 r116927  
    497497    virtual void detach();
    498498
     499#ifndef NDEBUG
     500    bool inDetach() const;
     501#endif
     502
    499503    void reattach();
    500504    void reattachIfAttached();
Note: See TracChangeset for help on using the changeset viewer.