WebCore:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jul 2006 00:20:57 +0000 (00:20 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jul 2006 00:20:57 +0000 (00:20 +0000)
2006-07-13  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Justin.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
        REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus

        * dom/Document.cpp:
        (WebCore::Document::updateSelection):
        Don't return early if the selection is empty.

LayoutTests:

2006-07-13  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Justin.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
        REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus

        * editing/selection/clear-selection-expected.checksum: Added.
        * editing/selection/clear-selection-expected.png: Added.
        * editing/selection/clear-selection-expected.txt: Added.
        * editing/selection/clear-selection.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15397 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/editing/selection/clear-selection-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/clear-selection-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/clear-selection-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/clear-selection.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/Document.cpp

index 7bd38e15e103ba010b97cb5ae58d1f1d0f3f8f26..626117adccb0036e3212b1249a31ab22b1590830 100644 (file)
@@ -1,3 +1,15 @@
+2006-07-13  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Justin.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
+        REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
+
+        * editing/selection/clear-selection-expected.checksum: Added.
+        * editing/selection/clear-selection-expected.png: Added.
+        * editing/selection/clear-selection-expected.txt: Added.
+        * editing/selection/clear-selection.html: Added.
+
 2006-07-12  David Kilzer  <ddkilzer@kilzer.net>
 
         Reviewed by NOBODY (layout test fix).
diff --git a/LayoutTests/editing/selection/clear-selection-expected.checksum b/LayoutTests/editing/selection/clear-selection-expected.checksum
new file mode 100644 (file)
index 0000000..af80ca4
--- /dev/null
@@ -0,0 +1 @@
+675958ca1760e67d565768737724a7ed
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/clear-selection-expected.png b/LayoutTests/editing/selection/clear-selection-expected.png
new file mode 100644 (file)
index 0000000..023a664
Binary files /dev/null and b/LayoutTests/editing/selection/clear-selection-expected.png differ
diff --git a/LayoutTests/editing/selection/clear-selection-expected.txt b/LayoutTests/editing/selection/clear-selection-expected.txt
new file mode 100644 (file)
index 0000000..c9b91ad
--- /dev/null
@@ -0,0 +1,11 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 755x36
+          text run at (0,0) width 755: "This tests that window.getSelection().clear() clears the selection correctly. If this test is successful, this text should not be"
+          text run at (0,18) width 54: "selected."
diff --git a/LayoutTests/editing/selection/clear-selection.html b/LayoutTests/editing/selection/clear-selection.html
new file mode 100644 (file)
index 0000000..892c5c9
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+<head>
+    <script>
+        function runTest() {
+            var d = document.getElementById('d');
+            window.getSelection().setBaseAndExtent(d, 0, d, 1);            
+            window.getSelection().empty();
+        }
+    </script>
+</head>
+<body onload="runTest()">
+    <div id="d">This tests that window.getSelection().clear() clears the selection correctly. If this test is successful, this text should not be selected.</div>
+<body>
+</html>
index b991846c06535e12d2a0560bbea07d1b8212ffda..e2d40a0e8baf6399191a435f2811735036b93be3 100644 (file)
@@ -1,3 +1,14 @@
+2006-07-13  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Justin.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
+        REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
+        
+        * dom/Document.cpp:
+        (WebCore::Document::updateSelection):
+        Don't return early if the selection is empty.
+
 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by Adele.
index fbd421d57aa1737aee1dd8b92028df5c4ebf46b0..cb86630bbb4340c361f3985f2da27c8a8d707ef4 100644 (file)
@@ -1067,8 +1067,6 @@ void Document::updateSelection()
     
     RenderView *canvas = static_cast<RenderView*>(renderer());
     SelectionController s = frame()->selection();
-    if (s.isNone())
-        return;
         
     if (!s.isRange())
         canvas->clearSelection();