New issue
Advanced search Search tips

Issue 702792 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

InsertListCommand creates different ordered lists when selecting several list items

Project Member Reported by jfernan...@igalia.com, Mar 17 2017

Issue description

What 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.

 
Owner: jfernan...@igalia.com
Status: Started (was: Untriaged)
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. 
There's no attachment...
I have implemented a preliminary approach at https://crrev.com/2757563004
Project Member

Comment 5 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)
This bug should be FIXED now.

Sign in to add a comment