⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 203210 in webkit


Ignore:
Timestamp:
Jul 13, 2016, 8:43:07 PM (10 years ago)
Author:
Chris Dumez
Message:

Drop unnecessary check from ContainerNode::removeChild()
https://bugs.webkit.org/show_bug.cgi?id=159747

Reviewed by Andreas Kling.

Drop unnecessary check from ContainerNode::removeChild() to make sure that
the parent of the node being removed is |this|. We already do this check
a few lines above. The only thing that happens in between is the ref'ing
of the node, which does not cause any JS execution.

This check was introduced in r55783 because there used to be a call to
document()->removeFocusedNodeOfSubtree(child.get());
between the two checks. However, this call has been removed since then
and the extra parentNode() check was left in.

  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::removeChild): Deleted.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r203187 r203210  
     12016-07-13  Chris Dumez  <cdumez@apple.com>
     2
     3        Drop unnecessary check from ContainerNode::removeChild()
     4        https://bugs.webkit.org/show_bug.cgi?id=159747
     5
     6        Reviewed by Andreas Kling.
     7
     8        Drop unnecessary check from ContainerNode::removeChild() to make sure that
     9        the parent of the node being removed is |this|. We already do this check
     10        a few lines above. The only thing that happens in between is the ref'ing
     11        of the node, which does not cause any JS execution.
     12
     13        This check was introduced in r55783 because there used to be a call to
     14        document()->removeFocusedNodeOfSubtree(child.get());
     15        between the two checks. However, this call has been removed since then
     16        and the extra parentNode() check was left in.
     17
     18        * dom/ContainerNode.cpp:
     19        (WebCore::ContainerNode::removeChild): Deleted.
     20
    1212016-07-12  Ryosuke Niwa  <rniwa@webkit.org>
    222
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r202358 r203210  
    525525    Ref<Node> child(oldChild);
    526526
    527     // Events fired when blurring currently focused node might have moved this
    528     // child into a different parent.
    529     if (child->parentNode() != this) {
    530         ec = NOT_FOUND_ERR;
    531         return false;
    532     }
    533 
    534527    willRemoveChild(*this, child);
    535528
Note: See TracChangeset for help on using the changeset viewer.