Bug 119520

Summary: REGRESSION(r139282): Old caret sometimes gets "stuck" (not repainted) in contenteditable elements.
Product: WebKit Reporter: Andreas Kling <kling>
Component: HTML EditingAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, buildbot, enrica, kling, rniwa, simon.fraser
Priority: P2 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
simon.fraser: review+, buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2
none
Patch for landing (hopefully)
buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion
none
Patch for landing perhaps.
none
Archive of layout-test-results from webkit-ews-15 for mac-mountainlion-wk2
none
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2 none

Description Andreas Kling 2013-08-06 06:53:47 PDT
<rdar://problem/14658929>
Comment 1 Andreas Kling 2013-08-06 06:54:21 PDT
Trivial to reproduce:

1. Open a page with a contenteditable element e.g: data:text/html,<div contenteditable>
2. Focus the editable element and insert two newlines.
3. Move the caret to the first line.
4. Enter a character, e.g 'x'.
5. Press backspace to delete the character again.
6. Look at the blinking caret.
7. Press the return key when the caret is "visible".

The caret will still be visible on the first line, but blinking only on the second.
Comment 2 Andreas Kling 2013-08-06 06:58:29 PDT
Created attachment 208187 [details]
Patch
Comment 3 Build Bot 2013-08-06 07:46:05 PDT
Comment on attachment 208187 [details]
Patch

Attachment 208187 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/1354190

New failing tests:
fast/repaint/caret-jump-between-nodes.html
Comment 4 Build Bot 2013-08-06 07:46:06 PDT
Created attachment 208191 [details]
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-09  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.4
Comment 5 Andreas Kling 2013-08-07 09:00:08 PDT
Created attachment 208272 [details]
Patch for landing (hopefully)
Comment 6 Build Bot 2013-08-07 10:06:53 PDT
Comment on attachment 208272 [details]
Patch for landing (hopefully)

Attachment 208272 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/1384303

New failing tests:
fast/repaint/caret-jump-between-nodes.html
Comment 7 Build Bot 2013-08-07 10:06:55 PDT
Created attachment 208278 [details]
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-04  Port: mac-mountainlion  Platform: Mac OS X 10.8.4
Comment 8 Andreas Kling 2013-08-07 10:42:29 PDT
Created attachment 208282 [details]
Patch for landing perhaps.
Comment 9 Build Bot 2013-08-07 12:28:56 PDT
Comment on attachment 208282 [details]
Patch for landing perhaps.

Attachment 208282 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/1384342

New failing tests:
fast/repaint/caret-jump-between-nodes.html
Comment 10 Build Bot 2013-08-07 12:28:58 PDT
Created attachment 208291 [details]
Archive of layout-test-results from webkit-ews-15 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-15  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.4
Comment 11 Build Bot 2013-08-07 19:48:12 PDT
Comment on attachment 208272 [details]
Patch for landing (hopefully)

Attachment 208272 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/1432006

New failing tests:
fast/repaint/caret-jump-between-nodes.html
Comment 12 Build Bot 2013-08-07 19:48:14 PDT
Created attachment 208309 [details]
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-09  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.4
Comment 13 Andreas Kling 2013-08-08 00:15:45 PDT
Comment on attachment 208282 [details]
Patch for landing perhaps.

Clearing flags on attachment: 208282

Committed r153815: <http://trac.webkit.org/changeset/153815>
Comment 14 Andreas Kling 2013-08-08 00:15:52 PDT
All reviewed patches have been landed.  Closing bug.
Comment 15 Andreas Kling 2013-08-08 00:16:44 PDT
Last EWS failure diff didn't match the expected results in my patch. Will deal with any fallout on bots manually.
Comment 17 Ryosuke Niwa 2013-08-12 14:55:43 PDT
--- /Volumes/Data/slave/mountainlion-release-tests-wk1/build/layout-test-results/fast/repaint/caret-jump-between-nodes-expected.txt
+++ /Volumes/Data/slave/mountainlion-release-tests-wk1/build/layout-test-results/fast/repaint/caret-jump-between-nodes-actual.txt
@@ -5,7 +5,6 @@
   (rect 8 44 100 100)
   (rect 8 44 100 100)
   (rect 3 39 110 110)
-  (rect 8 44 1 18)
   (rect 8 44 1 18)
   (rect 3 39 110 110)
   (rect -5 -5 5 610)
Comment 18 Alexey Proskuryakov 2013-08-13 13:10:27 PDT
Landed the change to make expectations match Mac in <http://trac.webkit.org/r154017>. Earlier, Zan landed platform specific results for Gtk in r153996.

Andreas, this was making bots red for 5 days. Can you please look into why tests results are different, and platform dependent? Perhaps you could use a cross-platofrm font like such as Ahem?
Comment 19 Alexey Proskuryakov 2013-08-14 11:35:45 PDT
Looks like this fixed WK1, but broke WK2 bots.
Comment 20 Andreas Kling 2013-08-14 12:53:06 PDT
I got cross-platform metrics working in <http://trac.webkit.org/r154062> but the caret still blinks an inconsistent number of times per run. Removed the test in <http://trac.webkit.org/r154065> to stop flaky redness on bots.

I suspect this is not (100% reliably) testable with the current testing framework.