Changeset 95017 in webkit


Ignore:
Timestamp:
Sep 12, 2011 10:57:30 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Crashes in WebCore::InsertListCommand::unlistifyParagraph.
https://bugs.webkit.org/show_bug.cgi?id=67918

Patch by Shinya Kawanaka <shinyak@google.com> on 2011-09-12
Reviewed by Ryosuke Niwa.

Source/WebCore:

execCommand("InsertUnorderedList") was crashing if the parent node of the target is
a kind of list element and it is not contenteditable.
This patch checks the parent node is contenteditable.

Test: editing/execCommand/insert-list-in-noneditable-list-parent.html

  • editing/htmlediting.cpp:

(WebCore::enclosingListChild): Checks the parent node is contenteditable.

LayoutTests:

Added tests.

  • editing/execCommand/insert-list-in-noneditable-list-parent-expected.txt: Added.
  • editing/execCommand/insert-list-in-noneditable-list-parent.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95014 r95017  
     12011-09-12  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Crashes in WebCore::InsertListCommand::unlistifyParagraph.
     4        https://bugs.webkit.org/show_bug.cgi?id=67918
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added tests.
     9
     10        * editing/execCommand/insert-list-in-noneditable-list-parent-expected.txt: Added.
     11        * editing/execCommand/insert-list-in-noneditable-list-parent.html: Added.
     12
    1132011-09-12  Sheriff Bot  <webkit.review.bot@gmail.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r95014 r95017  
     12011-09-12  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Crashes in WebCore::InsertListCommand::unlistifyParagraph.
     4        https://bugs.webkit.org/show_bug.cgi?id=67918
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        execCommand("InsertUnorderedList") was crashing if the parent node of the target is
     9        a kind of list element and it is not contenteditable.
     10        This patch checks the parent node is contenteditable.
     11
     12        Test: editing/execCommand/insert-list-in-noneditable-list-parent.html
     13
     14        * editing/htmlediting.cpp:
     15        (WebCore::enclosingListChild): Checks the parent node is contenteditable.
     16
    1172011-09-12  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/Source/WebCore/editing/htmlediting.cpp

    r94832 r95017  
    667667    // FIXME: This function is inappropriately named if it starts with node instead of node->parentNode()
    668668    for (Node* n = node; n && n->parentNode(); n = n->parentNode()) {
    669         if (n->hasTagName(liTag) || isListElement(n->parentNode()))
     669        if (n->hasTagName(liTag) || (isListElement(n->parentNode()) && n != root))
    670670            return n;
    671671        if (n == root || isTableCell(n))
Note: See TracChangeset for help on using the changeset viewer.