[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf

enrica at apple.com enrica at apple.com
Tue Jan 5 23:46:52 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 5784c5f989d25bb7511c304631c67f79e5fffdc4
Author: enrica at apple.com <enrica at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 10 22:59:04 2009 +0000

    REGRESSION(4.0.4-42a12): With 2 highlighted lines of text in gmail/hotmail selecting Bold selects other 2 edit buttons automatically.
    <rdar://problem/7442065>
    https://bugs.webkit.org/show_bug.cgi?id=32285
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    When examining the styles of the nodes after the first in a range selection, we take into
    cosideration differences in style of txt nodes only.
    
    Test: editing/execCommand/queryCommandState-02.html
    
    * editing/Editor.cpp:
    (WebCore::Editor::selectionHasStyle):
    
    LayoutTests:
    
    * editing/execCommand/queryCommandState-02-expected.txt: Added.
    * editing/execCommand/queryCommandState-02.html: Added.
    * editing/execCommand/script-tests/toggle-compound-styles.js: Fixed typo in text.
    * platform/mac/editing/execCommand/toggle-compound-styles-expected.txt: Fixed typo in text.
    * platform/qt/editing/execCommand/toggle-compound-styles-expected.txt: Fixed typo in text.
    * platform/win/editing/execCommand/toggle-compound-styles-expected.txt: Fixed typo in text.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51965 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e80ae62..d883cfa 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2009-12-10  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Darin Adler.
+
+        REGRESSION(4.0.4-42a12): With 2 highlighted lines of text in gmail/hotmail selecting Bold selects other 2 edit buttons automatically.
+        <rdar://problem/7442065>
+        https://bugs.webkit.org/show_bug.cgi?id=32285
+
+        * editing/execCommand/queryCommandState-02-expected.txt: Added.
+        * editing/execCommand/queryCommandState-02.html: Added.
+        * editing/execCommand/script-tests/toggle-compound-styles.js: Fixed typo in text.
+        * platform/mac/editing/execCommand/toggle-compound-styles-expected.txt: Fixed typo in text.
+        * platform/qt/editing/execCommand/toggle-compound-styles-expected.txt: Fixed typo in text.
+        * platform/win/editing/execCommand/toggle-compound-styles-expected.txt: Fixed typo in text.
+
 2009-12-10  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Unreviewed, fixing layout test mishap.
diff --git a/LayoutTests/editing/execCommand/queryCommandState-02-expected.txt b/LayoutTests/editing/execCommand/queryCommandState-02-expected.txt
new file mode 100644
index 0000000..7ee0ba8
--- /dev/null
+++ b/LayoutTests/editing/execCommand/queryCommandState-02-expected.txt
@@ -0,0 +1,12 @@
+This tests queryCommandState.
+Bug 32285 
+Radar 7442065
+
+one
+two
+Success
+Success
+Success
+Success
+Success
+Success
diff --git a/LayoutTests/editing/execCommand/queryCommandState-02.html b/LayoutTests/editing/execCommand/queryCommandState-02.html
new file mode 100644
index 0000000..9212552
--- /dev/null
+++ b/LayoutTests/editing/execCommand/queryCommandState-02.html
@@ -0,0 +1,50 @@
+<html>
+<body>
+This tests queryCommandState.
+<p>
+<a href="https://bugs.webkit.org/show_bug.cgi?id=32285">Bug 32285</a>
+<br>
+<a href="rdar://problem/7442387"> Radar 7442065</a>
+</p>
+<div id="e" contenteditable="true">
+    one
+    <div>two</div>
+</div>
+<ul id="console"></ul>
+
+<script type="text/javascript">
+
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+}
+var elem = document.getElementById("e");
+var selection = window.getSelection();
+selection.setPosition(elem, 0);
+
+document.execCommand("SelectAll");
+document.execCommand("Bold");
+assert(document.queryCommandState("Bold"));
+assert(!document.queryCommandState("Italic"));
+document.execCommand("Italic");
+assert(document.queryCommandState("Bold"));
+assert(document.queryCommandState("Italic"));
+document.execCommand("Bold", false);
+assert(!document.queryCommandState("Bold"));
+assert(document.queryCommandState("Italic"));
+
+function log(str) {
+    var li = document.createElement("li");
+    li.appendChild(document.createTextNode(str));
+    var console = document.getElementById("console");
+    console.appendChild(li);
+}
+
+function assert(bool) {
+    if (!bool)
+        log("Failure");
+    else
+        log("Success");
+}
+</script>
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js b/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
index 52bd06c..45c4c5c 100644
--- a/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
+++ b/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
@@ -17,13 +17,13 @@ function testSingleToggle(toggleCommand, initialContents, expectedContents, depe
         testFailed("one " + toggleCommand + " command converted " + initialContents + " to " + testContainer.innerHTML + ", expected " + expectedContents);
 }
 
-debug('PLATFORM-DEPENDNET TESTS');
+debug('PLATFORM-DEPENDENT TESTS');
 testSingleToggle("bold", "<u><b>hello</b> world</u>");
 testSingleToggle("bold", "<b>hello </b>world");
 testSingleToggle("bold", "<u><b>hello </b></u>world");
 testSingleToggle("italic", "<i>hello</i> <img>");
 testSingleToggle("italic", "<s><b>hello<i> world</i></b></s>");
-debug('PLATFORM-INDEPENDNET TESTS');
+debug('PLATFORM-INDEPENDENT TESTS');
 testSingleToggle("bold", "<u><span id='test'><b>hello</b></span><b>world</b></u>", '<u><span id="test">hello</span>world</u>');
 testSingleToggle("bold", "<span id='test' style='font-weight:normal;'><b>hello</b></span>", '<span id="test">hello</span>');
 testSingleToggle("bold", "<div><b>hello</b><br><br><b>world</b></div>", "<div>hello<br><br>world</div>");
diff --git a/LayoutTests/platform/mac/editing/execCommand/toggle-compound-styles-expected.txt b/LayoutTests/platform/mac/editing/execCommand/toggle-compound-styles-expected.txt
index 24b39f9..b989b76 100644
--- a/LayoutTests/platform/mac/editing/execCommand/toggle-compound-styles-expected.txt
+++ b/LayoutTests/platform/mac/editing/execCommand/toggle-compound-styles-expected.txt
@@ -3,13 +3,13 @@ Test to make sure we can toggle text decorations correctly. The first three test
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PLATFORM-DEPENDNET TESTS
+PLATFORM-DEPENDENT TESTS
 one bold command converted <u><b>hello</b> world</u> to <u>hello world</u>
 one bold command converted <b>hello </b>world to hello world
 one bold command converted <u><b>hello </b></u>world to <u>hello </u>world
 one italic command converted <i>hello</i> <img> to hello <img>
 one italic command converted <s><b>hello<i> world</i></b></s> to <s><b><i>hello world</i></b></s>
-PLATFORM-INDEPENDNET TESTS
+PLATFORM-INDEPENDENT TESTS
 PASS one bold command converted <u><span id='test'><b>hello</b></span><b>world</b></u> to <u><span id="test">hello</span>world</u>
 PASS one bold command converted <span id='test' style='font-weight:normal;'><b>hello</b></span> to <span id="test">hello</span>
 PASS one bold command converted <div><b>hello</b><br><br><b>world</b></div> to <div>hello<br><br>world</div>
diff --git a/LayoutTests/platform/qt/editing/execCommand/toggle-compound-styles-expected.txt b/LayoutTests/platform/qt/editing/execCommand/toggle-compound-styles-expected.txt
index 6c94fb9..98f7000 100644
--- a/LayoutTests/platform/qt/editing/execCommand/toggle-compound-styles-expected.txt
+++ b/LayoutTests/platform/qt/editing/execCommand/toggle-compound-styles-expected.txt
@@ -3,13 +3,13 @@ Test to make sure we can toggle text decorations correctly. The first three test
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PLATFORM-DEPENDNET TESTS
+PLATFORM-DEPENDENT TESTS
 one bold command converted <u><b>hello</b> world</u> to <u><b>hello world</b></u>
 one bold command converted <b>hello </b>world to <b>hello world</b>
 one bold command converted <u><b>hello </b></u>world to <u><b>hello </b></u><b>world</b>
 one italic command converted <i>hello</i> <img> to <i>hello <img></i>
 one italic command converted <s><b>hello<i> world</i></b></s> to <s><b><i>hello world</i></b></s>
-PLATFORM-INDEPENDNET TESTS
+PLATFORM-INDEPENDENT TESTS
 PASS one bold command converted <u><span id='test'><b>hello</b></span><b>world</b></u> to <u><span id="test">hello</span>world</u>
 PASS one bold command converted <span id='test' style='font-weight:normal;'><b>hello</b></span> to <span id="test">hello</span>
 PASS one bold command converted <div><b>hello</b><br><br><b>world</b></div> to <div>hello<br><br>world</div>
diff --git a/LayoutTests/platform/win/editing/execCommand/toggle-compound-styles-expected.txt b/LayoutTests/platform/win/editing/execCommand/toggle-compound-styles-expected.txt
index 6c94fb9..98f7000 100644
--- a/LayoutTests/platform/win/editing/execCommand/toggle-compound-styles-expected.txt
+++ b/LayoutTests/platform/win/editing/execCommand/toggle-compound-styles-expected.txt
@@ -3,13 +3,13 @@ Test to make sure we can toggle text decorations correctly. The first three test
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PLATFORM-DEPENDNET TESTS
+PLATFORM-DEPENDENT TESTS
 one bold command converted <u><b>hello</b> world</u> to <u><b>hello world</b></u>
 one bold command converted <b>hello </b>world to <b>hello world</b>
 one bold command converted <u><b>hello </b></u>world to <u><b>hello </b></u><b>world</b>
 one italic command converted <i>hello</i> <img> to <i>hello <img></i>
 one italic command converted <s><b>hello<i> world</i></b></s> to <s><b><i>hello world</i></b></s>
-PLATFORM-INDEPENDNET TESTS
+PLATFORM-INDEPENDENT TESTS
 PASS one bold command converted <u><span id='test'><b>hello</b></span><b>world</b></u> to <u><span id="test">hello</span>world</u>
 PASS one bold command converted <span id='test' style='font-weight:normal;'><b>hello</b></span> to <span id="test">hello</span>
 PASS one bold command converted <div><b>hello</b><br><br><b>world</b></div> to <div>hello<br><br>world</div>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 810c510..e2287ed 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-12-10  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Darin Adler.
+
+        REGRESSION(4.0.4-42a12): With 2 highlighted lines of text in gmail/hotmail selecting Bold selects other 2 edit buttons automatically.
+        <rdar://problem/7442065>
+        https://bugs.webkit.org/show_bug.cgi?id=32285
+
+        When examining the styles of the nodes after the first in a range selection, we take into
+        cosideration differences in style of txt nodes only.
+        
+        Test: editing/execCommand/queryCommandState-02.html
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::selectionHasStyle):
+
 2009-12-10  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index d81b088..0744fd6 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -832,7 +832,7 @@ TriState Editor::selectionHasStyle(CSSStyleDeclaration* style) const
                 TriState nodeState = triStateOfStyleInComputedStyle(style, nodeStyle.get(), !node->isTextNode());
                 if (node == m_frame->selection()->start().node())
                     state = nodeState;
-                else if (state != nodeState) {
+                else if (state != nodeState && node->isTextNode()) {
                     state = MixedTriState;
                     break;
                 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list