LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Oct 2006 00:28:37 +0000 (00:28 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Oct 2006 00:28:37 +0000 (00:28 +0000)
        Reviewed by harrison

        <rdar://problem/4776665>
        REGRESSION: In Mail, caret is visible when the message body isn't focused

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

WebCore:

        Reviewed by harrison

        <rdar://problem/4776665>
        REGRESSION: In Mail, caret is visible when the message body isn't focused

        * page/Frame.cpp:
        (WebCore::Frame::paintCaret): If a caret blink timer is ever on in error
        (like when the frame that contains the caret isn't focused) then we don't
        want to paint the caret.  We should eventually move to using a single bool
        for caret painting.

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

LayoutTests/ChangeLog
LayoutTests/editing/selection/4776665-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/4776665-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/4776665-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/4776665.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/Frame.cpp

index ec28d0d6c8aa56e754a83291b690bb465f2bb931..04157a0fb2d6f120eb7b49bbfe1867fecedabdea 100644 (file)
@@ -1,3 +1,15 @@
+2006-10-17  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by harrison
+
+        <rdar://problem/4776665>
+        REGRESSION: In Mail, caret is visible when the message body isn't focused
+
+        * editing/selection/4776665-expected.checksum: Added.
+        * editing/selection/4776665-expected.png: Added.
+        * editing/selection/4776665-expected.txt: Added.
+        * editing/selection/4776665.html: Added.
+
 2006-10-17  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
diff --git a/LayoutTests/editing/selection/4776665-expected.checksum b/LayoutTests/editing/selection/4776665-expected.checksum
new file mode 100644 (file)
index 0000000..4a9dc5f
--- /dev/null
@@ -0,0 +1 @@
+0b88232a1e7d0bcc3891054d861f116b
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/4776665-expected.png b/LayoutTests/editing/selection/4776665-expected.png
new file mode 100644 (file)
index 0000000..6897bb8
Binary files /dev/null and b/LayoutTests/editing/selection/4776665-expected.png differ
diff --git a/LayoutTests/editing/selection/4776665-expected.txt b/LayoutTests/editing/selection/4776665-expected.txt
new file mode 100644 (file)
index 0000000..f95b59e
--- /dev/null
@@ -0,0 +1,18 @@
+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 {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 585x18
+          text run at (0,0) width 217: "This tests for a caret painting bug. "
+          text run at (217,0) width 368: "You should not see a caret in the editable subframe below."
+      RenderBlock (anonymous) at (0,34) size 784x150
+        RenderPartObject {IFRAME} at (0,0) size 300x150
+          layer at (0,0) size 300x150
+            RenderView at (0,0) size 300x150
+          layer at (0,0) size 300x150
+            RenderBlock {HTML} at (0,0) size 300x150
+              RenderBody {BODY} at (8,8) size 284x134 [bgcolor=#FFFFE0]
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/editing/selection/4776665.html b/LayoutTests/editing/selection/4776665.html
new file mode 100644 (file)
index 0000000..22bd4b2
--- /dev/null
@@ -0,0 +1,20 @@
+<p>This tests for a caret painting bug.  You should not see a caret in the editable subframe below.</p>
+<iframe src="../resources/contenteditable-iframe-src.html"></iframe>
+
+<script>
+if (window.layoutTestController)
+    window.layoutTestController.waitUntilDone();
+    
+// Wait for the frame to load.
+window.setTimeout(runTest, 200);
+
+function runTest() {
+    var frame = frames[0];
+    var doc = frame.document;
+    var body = doc.body;
+    var sel = frame.getSelection();
+    sel.setPosition(body, 0);
+    if (window.layoutTestController)
+        window.layoutTestController.notifyDone();
+}
+</script>
\ No newline at end of file
index 0dc8fa51418341b7a14063803a71fc30a4c4d5ea..25a5389bc3a8bdbdd76eb6ed1e1f80b2bffa0cb4 100644 (file)
@@ -1,3 +1,16 @@
+2006-10-17  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by harrison
+        
+        <rdar://problem/4776665>
+        REGRESSION: In Mail, caret is visible when the message body isn't focused
+
+        * page/Frame.cpp:
+        (WebCore::Frame::paintCaret): If a caret blink timer is ever on in error
+        (like when the frame that contains the caret isn't focused) then we don't 
+        want to paint the caret.  We should eventually move to using a single bool
+        for caret painting.
+
 2006-10-17  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
index 8b134449d83421b5ddf59e5a949c6c45ed4a94b7..e85692fba82a9c35967d8b140279437da335daed 100644 (file)
@@ -1410,7 +1410,7 @@ void Frame::caretBlinkTimerFired(Timer<Frame>*)
 
 void Frame::paintCaret(GraphicsContext* p, const IntRect& rect) const
 {
-    if (d->m_caretPaint)
+    if (d->m_caretPaint && d->m_caretVisible)
         selectionController()->paintCaret(p, rect);
 }