[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:29:25 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 293cbd449d6f80a10cb36e663557c2965bbc44c5
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 27 13:51:15 2010 +0000

    2010-01-27  Tony Chang  <tony at 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 at 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

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e485959..109c344 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2010-01-27  Tony Chang  <tony at 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 at webkit.org>
 
         [Qt] Qt port doesn't need platform dependent expected file anymore
diff --git a/LayoutTests/fast/css/background-currentcolor-expected.txt b/LayoutTests/editing/execCommand/indent-block-in-list-expected.txt
similarity index 100%
copy from LayoutTests/fast/css/background-currentcolor-expected.txt
copy to LayoutTests/editing/execCommand/indent-block-in-list-expected.txt
diff --git a/LayoutTests/editing/execCommand/indent-block-in-list.html b/LayoutTests/editing/execCommand/indent-block-in-list.html
new file mode 100644
index 0000000..63c5f6a
--- /dev/null
+++ b/LayoutTests/editing/execCommand/indent-block-in-list.html
@@ -0,0 +1,15 @@
+<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>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 78e9c06..3a30ec4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-01-27  Tony Chang  <tony at 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 at nokia.com>
 
         Reviewed by Tor Arne Vestbø.
diff --git a/WebCore/editing/IndentOutdentCommand.cpp b/WebCore/editing/IndentOutdentCommand.cpp
index 5e6f339..0f3975b 100644
--- a/WebCore/editing/IndentOutdentCommand.cpp
+++ b/WebCore/editing/IndentOutdentCommand.cpp
@@ -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;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list