Commit 1d23c496 authored by eric@webkit.org's avatar eric@webkit.org

2010-01-27 Tony Chang <tony@chromium.org>

        Reviewed by Eric Seidel.

        Fix a crash when trying to indent a block element that was contained
        in a list.  This was happening because enclosingBlock() in
        htmlediting.cpp can return the current the same Node when a block
        element (like an <hr> or a <table>) is passed in.  This causes
        the indent command to think that it is not in a list item.

        Work around this by checking to see if enclosingBlock returned the
        same Node.

        https://bugs.webkit.org/show_bug.cgi?id=32390

        * editing/execCommand/indent-block-in-list-expected.txt: Added.
        * editing/execCommand/indent-block-in-list.html: Added.
2010-01-27  Tony Chang  <tony@chromium.org>

        Reviewed by Eric Seidel.

        Fix a crash when trying to indent a block element that was contained
        in a list.  This was happening because enclosingBlock() in
        htmlediting.cpp can return the current the same Node when a block
        element (like an <hr> or a <table>) is passed in.  This causes
        the indent command to think that it is not in a list item.

        Work around this by checking to see if enclosingBlock returned the
        same Node.

        https://bugs.webkit.org/show_bug.cgi?id=32390

        Test: editing/execCommand/indent-block-in-list.html

        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::tryIndentingAsListItem):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 37834224
2010-01-27 Tony Chang <tony@chromium.org>
Reviewed by Eric Seidel.
Fix a crash when trying to indent a block element that was contained
in a list. This was happening because enclosingBlock() in
htmlediting.cpp can return the current the same Node when a block
element (like an <hr> or a <table>) is passed in. This causes
the indent command to think that it is not in a list item.
Work around this by checking to see if enclosingBlock returned the
same Node.
https://bugs.webkit.org/show_bug.cgi?id=32390
* editing/execCommand/indent-block-in-list-expected.txt: Added.
* editing/execCommand/indent-block-in-list.html: Added.
2010-01-27 Csaba Osztrogonác <ossy@webkit.org>
[Qt] Qt port doesn't need platform dependent expected file anymore
<body>
</body>
<SCRIPT>
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
document.designMode = "on";
document.execCommand("SelectAll", false, null);
document.execCommand("InsertUnorderedList", false, null);
document.execCommand("inserthorizontalrule");
// This was triggering an assert because we weren't properly indenting
// block elements in lists.
document.execCommand("indent");
document.execCommand("inserthtml", false, "PASSED");
</SCRIPT>
2010-01-27 Tony Chang <tony@chromium.org>
Reviewed by Eric Seidel.
Fix a crash when trying to indent a block element that was contained
in a list. This was happening because enclosingBlock() in
htmlediting.cpp can return the current the same Node when a block
element (like an <hr> or a <table>) is passed in. This causes
the indent command to think that it is not in a list item.
Work around this by checking to see if enclosingBlock returned the
same Node.
https://bugs.webkit.org/show_bug.cgi?id=32390
Test: editing/execCommand/indent-block-in-list.html
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::tryIndentingAsListItem):
2010-01-27 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Tor Arne Vestbø.
......@@ -76,7 +76,12 @@ bool IndentOutdentCommand::tryIndentingAsListItem(const VisiblePosition& endOfCu
return false;
// Find the list item enclosing the current paragraph
Element* selectedListItem = static_cast<Element*>(enclosingBlock(endOfCurrentParagraph.deepEquivalent().node()));
Element* selectedListItem = static_cast<Element*>(enclosingBlock(lastNodeInSelectedParagraph));
// FIXME: enclosingBlock shouldn't return the passed in element. See the
// comment on the function about how to fix rather than having to adjust here.
if (selectedListItem == lastNodeInSelectedParagraph)
selectedListItem = static_cast<Element*>(enclosingBlock(lastNodeInSelectedParagraph->parentNode()));
// FIXME: we need to deal with the case where there is no li (malformed HTML)
if (!selectedListItem->hasTagName(liTag))
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment