Changeset 94841 in webkit


Ignore:
Timestamp:
Sep 9, 2011 2:13:19 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Crashes in WebCore::AppendNodeCommand::create().
https://bugs.webkit.org/show_bug.cgi?id=67767

Patch by Shinya Kawanaka <shinyak@google.com> on 2011-09-09
Reviewed by Darin Adler.

Source/WebCore:

In CompositeEditCommand::closeParagraphUnderNewElement(), lastNode could be a non Element node.
The current code assumes lastNode is an Element node. This patch checks it.

Test: editing/execCommand/ident-crashes-topnode-is-text.html

  • editing/CompositeEditCommand.cpp:

(WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): Added an element node check.

LayoutTests:

Added a crash test case.

  • editing/execCommand/ident-crashes-topnode-is-text-expected.txt: Added.
  • editing/execCommand/ident-crashes-topnode-is-text.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94840 r94841  
     12011-09-09  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Crashes in WebCore::AppendNodeCommand::create().
     4        https://bugs.webkit.org/show_bug.cgi?id=67767
     5
     6        Reviewed by Darin Adler.
     7
     8        Added a crash test case.
     9
     10        * editing/execCommand/ident-crashes-topnode-is-text-expected.txt: Added.
     11        * editing/execCommand/ident-crashes-topnode-is-text.html: Added.
     12
    1132011-09-09  Shinya Kawanaka  <shinyak@google.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r94840 r94841  
     12011-09-09  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Crashes in WebCore::AppendNodeCommand::create().
     4        https://bugs.webkit.org/show_bug.cgi?id=67767
     5
     6        Reviewed by Darin Adler.
     7
     8        In CompositeEditCommand::closeParagraphUnderNewElement(), lastNode could be a non Element node.
     9        The current code assumes lastNode is an Element node. This patch checks it.
     10
     11        Test: editing/execCommand/ident-crashes-topnode-is-text.html
     12
     13        * editing/CompositeEditCommand.cpp:
     14        (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): Added an element node check.
     15
    1162011-09-09  Shinya Kawanaka  <shinyak@google.com>
    217
  • trunk/Source/WebCore/editing/CompositeEditCommand.cpp

    r93134 r94841  
    809809    RefPtr<Node> lastNode = topNode;
    810810
    811     if (start.deprecatedNode() != outerNode) {
     811    if (start.deprecatedNode() != outerNode && lastNode->isElementNode()) {
    812812        Vector<RefPtr<Node> > ancestors;
    813813       
Note: See TracChangeset for help on using the changeset viewer.