Bug 130393 - Applying ordered list followed by unordered to a selected all content selection disappears.
Summary: Applying ordered list followed by unordered to a selected all content selecti...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-18 05:57 PDT by Sudarshan C P
Modified: 2014-03-21 09:57 PDT (History)
3 users (show)

See Also:


Attachments
Test Case (548 bytes, text/html)
2014-03-18 05:57 PDT, Sudarshan C P
no flags Details
Patch (4.61 KB, patch)
2014-03-18 23:02 PDT, Sudarshan C P
darin: review-
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion (602.80 KB, application/zip)
2014-03-18 23:41 PDT, Build Bot
no flags Details
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 (519.09 KB, application/zip)
2014-03-19 03:14 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sudarshan C P 2014-03-18 05:57:24 PDT
Created attachment 227041 [details]
Test Case

1.Fetch attached test case.
2.type some text
3.select all (ctrl+A)
4.click ordered list and then unordered list

Actual behavior :
Selection disappears.

Expected behavior :
Selection should retains.
Comment 1 Sudarshan C P 2014-03-18 23:02:25 PDT
Created attachment 227155 [details]
Patch
Comment 2 Build Bot 2014-03-18 23:41:07 PDT
Comment on attachment 227155 [details]
Patch

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

New failing tests:
editing/execCommand/insert-list-nested-with-orphaned.html
Comment 3 Build Bot 2014-03-18 23:41:55 PDT
Created attachment 227158 [details]
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-07  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 4 Build Bot 2014-03-19 03:12:24 PDT
Comment on attachment 227155 [details]
Patch

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

New failing tests:
editing/execCommand/insert-list-nested-with-orphaned.html
Comment 5 Build Bot 2014-03-19 03:14:02 PDT
Created attachment 227172 [details]
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-16  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 6 Sudarshan C P 2014-03-19 23:52:24 PDT
In the current fix we are placing the cursor at the end of applied list item,so failed case is because of cursor poistion, but actual issue is that "This tests hang when listifying nested lists with an orphaned list child in between", actual test case works fine Please review this patch.
Comment 7 Darin Adler 2014-03-21 09:57:40 PDT
Comment on attachment 227155 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227155&action=review

> Source/WebCore/editing/InsertListCommand.cpp:246
> -            setEndingSelection(VisiblePosition(firstPositionInNode(newList.get())));
> +            setEndingSelection(VisibleSelection(firstPositionInNode(newList.get()), lastPositionInNode(newList.get()), endingSelection().isDirectional()));

Why select the whole list when the list type is changed? That seems almost as bad as the old rule (put the selection at the start of the first list element). What is the desired selection change in a case like this? Before we implement it we need to clearly state what we want? Do we want to preserve the existing selection? Or something else?

I think that when making a new list we want to put the insertion point in the list, ready to type into that list.

> LayoutTests/editing/execCommand/selectall-ol-ul-expected.txt:12
> +After Applying Orderedlist:
> +| <ol>
> +|   <li>
> +|     "<#selection-anchor>orderlist text to display<#selection-focus>"
> +|     <br>
> +
> +After Applying UnOrderedList:
> +| <ul>
> +|   <li>
> +|     "<#selection-anchor>orderlist text to display<#selection-focus>"

This test makes it look like the command preserves the selection. But what it actually does is select the entire contents of the list. I don’t think that’s right.

The test needs to show what happens when the contents of the list isn’t all selected. For example, what if just the word "text" was selected? What if the insertion point was after the word "display"?