InsertListCommand creates different ordered lists when selecting several list items |
||
Issue descriptionWhat steps will reproduce the problem? (1) Load the attached test case. (2) Click on the "OL" button. What is the expected result? Element 2 and 3 should be part of the same ordered list. What happens instead? Item 2 and 3 are numbered as 1- in their respective newly created lists.
,
Mar 17 2017
Note that the issue is not reproducible when selecting from Item 1. After some preliminary analysis I came to the conclusion that the root cause is how we select the insertion point of the new ordered list for the first selected item. This happens when such item is not the first one of the list we are manipulating.
,
Mar 17 2017
There's no attachment...
,
Mar 17 2017
I have implemented a preliminary approach at https://crrev.com/2757563004
,
Mar 24 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ce9fb22d90743b6b08b1a1baa00202d781673269 commit ce9fb22d90743b6b08b1a1baa00202d781673269 Author: jfernandez <jfernandez@igalia.com> Date: Fri Mar 24 16:06:44 2017 Adjust insertion point when listifying unordered list items During the process of listifying a selection of unordered lists items the insertion point of the first element is incorretcly selected. The issue appears when the selection start at an intermediate list item and ending in a different list item. Since the process is defined to act on single paragraphs, the firts item splits the list first and then it removes the intermediate item. This logic, implemented in 'unlistifyParagraph', causes that 2 independent lists are created with a <span> element in the middle. Then, an algorithm implemented in 'listifyParagraph' looks for an insertion point for the new ordered list item. Since there is a previous sibling which represents a 'visually distinct position', the <span> temporary created during the 'unlistifyParagraph' logic is selected. The incorrectly selected insertion point leads to the subsequent doApplyForSingleParagraph executions to consider the rest of the list items in the selection to be part of a different ordered list. BUG= 702792 Review-Url: https://codereview.chromium.org/2757563004 Cr-Commit-Position: refs/heads/master@{#459442} [add] https://crrev.com/ce9fb22d90743b6b08b1a1baa00202d781673269/third_party/WebKit/LayoutTests/editing/execCommand/insert-list-items-inside-another-list.html [modify] https://crrev.com/ce9fb22d90743b6b08b1a1baa00202d781673269/third_party/WebKit/LayoutTests/external/wpt/editing/run/insertorderedlist-expected.txt [modify] https://crrev.com/ce9fb22d90743b6b08b1a1baa00202d781673269/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
,
Mar 27 2017
This bug should be FIXED now. |
||
►
Sign in to add a comment |
||
Comment 1 by jfernan...@igalia.com
, Mar 17 2017Status: Started (was: Untriaged)