Bug 69889

Summary: Selection is not collapsed in some WK2 editing tests
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: REOPENED ---    
Severity: Normal CC: ap, cshu, enrica, jberlin, rniwa, simon.fraser, webkit.review.bot
Priority: P2 Keywords: MakingBotsRed
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch 1 none

Description Simon Fraser (smfr) 2011-10-11 17:38:57 PDT
These tests, and some others, are failing in WK2 because the selection is not collapsed at the end of the test:

editing/pasteboard/drag-drop-iframe-refresh-crash.html: pretty diff
editing/selection/caret-ltr-right.html: pretty diff
editing/selection/caret-rtl-right.html: pretty diff
editing/selection/select-across-readonly-input-2.html: pretty diff
editing/selection/select-across-readonly-input-3.html: pretty diff
editing/selection/select-across-readonly-input-4.html: pretty diff
editing/selection/select-across-readonly-input-5.html: pretty diff
Comment 1 Simon Fraser (smfr) 2011-10-11 17:45:31 PDT
Also
editing/inserting/caret-position.html
Comment 2 Ryosuke Niwa 2011-10-11 21:39:56 PDT
Maybe it's something to do with eventSender in WK2?
Comment 3 Chang Shu 2011-10-12 06:18:55 PDT
editing/inserting/caret-position.html is calling textInputController.firstRectForCharacterRange(0, 0).
But it's not supported yet in WK2. There must be other unsupported textInputController functions used in these tests.
Comment 4 Simon Fraser (smfr) 2011-10-12 07:59:38 PDT
I skipped editing/inserting/caret-position.html in WK2 already. The other tests still have the problem described.
Comment 5 Chang Shu 2011-10-12 08:36:58 PDT
I believe the failures are related to missing drag-n-drop support in WK2 EventSender.
https://bugs.webkit.org/show_bug.cgi?id=68552.
Comment 6 Simon Fraser (smfr) 2011-10-12 09:10:10 PDT
But not all those tests involve D&D
Comment 7 Chang Shu 2011-10-12 10:12:49 PDT
I think these tests are new and never passed in WK2. We should simply skip them for now. Understanding the cause of the failures will help us to put them in the right category. D&D and textInputController are two root causes I have identified so far.
Comment 8 Simon Fraser (smfr) 2011-10-12 10:26:59 PDT
D&D and textInputController tests have already been skipped. These tests are using neither (but do rely on event sender).
Comment 9 Ryosuke Niwa 2011-10-12 10:35:03 PDT
(In reply to comment #7)
> I think these tests are new and never passed in WK2. We should simply skip them for now. Understanding the cause of the failures will help us to put them in the right category. D&D and textInputController are two root causes I have identified so far.

caret-ltr-right and caret-rtl-right should be passing on WK2.
Comment 10 Chang Shu 2011-10-12 10:41:14 PDT
(In reply to comment #8)
> D&D and textInputController tests have already been skipped. These tests are using neither (but do rely on event sender).

LayoutTests/editing/selection/resources/select-across-readonly-input.js should depend on D&D:
        moveMouseToMiddleOfElement(document.getElementById('from'));
        eventSender.mouseDown();

        eventSender.leapForward(200);

        moveMouseToMiddleOfElement(document.getElementById('to'));
        eventSender.mouseUp();

and LayoutTests/editing/inserting/caret-position.html should depend on textInputController.firstRectForCharacterRange:

function testCaretPosition(elementId, caretPosition)
{
    e = document.getElementById(elementId, caretPosition);
    e.focus();
    if (window.textInputController) {
        var caretRect = textInputController.firstRectForCharacterRange(0, 0);
        assertEqual(elementId, caretRect[0], caretPosition);
    }  
}
Comment 11 Simon Fraser (smfr) 2011-10-12 10:43:07 PDT
Chang: please make a patch to disable the appropriate tests then.
Comment 12 Chang Shu 2011-10-12 10:46:56 PDT
(In reply to comment #11)
> Chang: please make a patch to disable the appropriate tests then.

No problem.
Comment 13 Chang Shu 2011-10-12 11:31:10 PDT
Created attachment 110712 [details]
patch 1

Added failed tests to Skip list. I put them into platform-dependent Skipped file instead of the common one because the fix should be platform-dependent.
Comment 14 WebKit Review Bot 2011-10-12 13:50:32 PDT
Comment on attachment 110712 [details]
patch 1

Clearing flags on attachment: 110712

Committed r97297: <http://trac.webkit.org/changeset/97297>
Comment 15 WebKit Review Bot 2011-10-12 13:50:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 16 Ryosuke Niwa 2011-10-12 13:51:34 PDT
Reopen the bug because the patch didn't really fix the tests.
Comment 18 Jessie Berlin 2012-03-15 16:22:25 PDT
Added failing expected results for mac-wk2 in http://trac.webkit.org/changeset/110906