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

Changeset 106715 in webkit


Ignore:
Timestamp:
Feb 3, 2012, 5:22:38 PM (15 years ago)
Author:
rniwa@webkit.org
Message:

Crash in Node::dispatchSubtreeModifiedEvent
https://bugs.webkit.org/show_bug.cgi?id=77449

Reviewed by Alexey Proskuryakov.

Source/WebCore:

The bug was caused by appendChild not retaining this pointer.
This is normally okay because there's another owner within JSC/V8 binding code that
holds onto the node but this isn't the case when nodes are created as a part
of setting document.title. Fixed the crash by retaining the pointer as needed.

Test: fast/dom/remove-body-during-title-creation.html

  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::appendChild):

LayoutTests:

Add a regression test for the crash.

  • fast/dom/remove-body-during-title-creation-expected.txt: Added.
  • fast/dom/remove-body-during-title-creation.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106705 r106715  
     12012-02-03  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Crash in Node::dispatchSubtreeModifiedEvent
     4        https://bugs.webkit.org/show_bug.cgi?id=77449
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Add a regression test for the crash.
     9
     10        * fast/dom/remove-body-during-title-creation-expected.txt: Added.
     11        * fast/dom/remove-body-during-title-creation.html: Added.
     12
    1132012-02-03  Joshua Bell  <jsbell@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r106711 r106715  
     12012-02-03  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Crash in Node::dispatchSubtreeModifiedEvent
     4        https://bugs.webkit.org/show_bug.cgi?id=77449
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        The bug was caused by appendChild not retaining this pointer.
     9        This is normally okay because there's another owner within JSC/V8 binding code that
     10        holds onto the node but this isn't the case when nodes are created as a part
     11        of setting document.title. Fixed the crash by retaining the pointer as needed.
     12
     13        Test: fast/dom/remove-body-during-title-creation.html
     14
     15        * dom/ContainerNode.cpp:
     16        (WebCore::ContainerNode::appendChild):
     17
    1182012-02-03  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r106418 r106715  
    605605bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bool shouldLazyAttach)
    606606{
     607    RefPtr<ContainerNode> protector(this);
     608
    607609    // Check that this node is not "floating".
    608610    // If it is, it can be deleted as a side effect of sending mutation events.
Note: See TracChangeset for help on using the changeset viewer.