Deleting all list items in list element at least one of their list item is not empty shouldn't remove the list
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
When selection range boundaries are start of a <li>
element and end of a <li>
element, we extend the range with climbing up current block boundaries.
https://searchfox.org/mozilla-central/rev/ff85081e3b05f89f9a5921b489b6e01ed4a88c25/editor/libeditor/HTMLEditSubActionHandler.cpp#10875-10892,10908-10945
Then, we delete only <li>
elements and if that's all of the <ul>
or <ol>
element, we create empty <ul>
or <ol>
element and put caret in it. According to the other browsers' behavior, we should stop climbing up with crossing list item boundaries.
Assignee | ||
Comment 1•4 years ago
|
||
The behavior difference is really serious if editor supports list elements without handling by themselves:
Assignee | ||
Comment 2•3 years ago
|
||
Some contenteditable="false"
inclusing cases do not pass on Blink too, though.
Assignee | ||
Comment 3•3 years ago
|
||
And this renames the method to ExtendOrShrinkRangeToDelete
for alining to
new behavior changed by the following patch.
Depends on D125028
Assignee | ||
Comment 4•3 years ago
|
||
When a list element has non-empty list item element, even if the list element is
selected, deleting operation should make the list element empty first (i.e.,
making the list element has only one empty list item element). Then, another
deleting operation/command can delete it completely. This is Blink compat
behavior in most cases except when the list has non-editable list item element
as first and/or last child of it.
Note that the new failures of the browserscpe are not compatible with the
new behavior, that is, it wants a list element is deleted when the last
list item is deleted.
https://searchfox.org/mozilla-central/rev/08c493902519265d570250c8e7ce575c8cd6f5b5/editor/libeditor/tests/browserscope/lib/richtext2/richtext2/tests/delete.py#161-164
https://searchfox.org/mozilla-central/rev/08c493902519265d570250c8e7ce575c8cd6f5b5/editor/libeditor/tests/browserscope/lib/richtext2/richtext2/tests/forwarddelete.py#146-149
Here is same test in the WPT:
https://searchfox.org/mozilla-central/rev/08c493902519265d570250c8e7ce575c8cd6f5b5/testing/web-platform/tests/input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html#386-402
And only Gecko failed in this case:
https://searchfox.org/mozilla-central/rev/08c493902519265d570250c8e7ce575c8cd6f5b5/testing/web-platform/meta/input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html.ini#1449-1450
https://searchfox.org/mozilla-central/rev/08c493902519265d570250c8e7ce575c8cd6f5b5/testing/web-platform/meta/input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html.ini#1937-1938
https://searchfox.org/mozilla-central/rev/08c493902519265d570250c8e7ce575c8cd6f5b5/testing/web-platform/meta/input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html.ini#425-426
https://searchfox.org/mozilla-central/rev/08c493902519265d570250c8e7ce575c8cd6f5b5/testing/web-platform/meta/input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html.ini#787-788
https://wpt.fyi/results/input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html%3FDelete,ol?run_id=5734231113203712&run_id=6263979761467392&run_id=5750388243300352&run_id=5090688355008512
https://wpt.fyi/results/input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html%3FDelete,ul?run_id=5734231113203712&run_id=6263979761467392&run_id=5750388243300352&run_id=5090688355008512
https://wpt.fyi/results/input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html%3FBackspace,ol?run_id=5734231113203712&run_id=6263979761467392&run_id=5750388243300352&run_id=5090688355008512
https://wpt.fyi/results/input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html%3FBackspace,ul?run_id=5734231113203712&run_id=6263979761467392&run_id=5750388243300352&run_id=5090688355008512
Therefore, the new failures are expected result.
Depends on D125029
Assignee | ||
Updated•3 years ago
|
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/e88bc0e4b9d4 part 1: Add some edge cases into input-events-get-target-ranges-deleting-in-list-items.tentative.html r=m_kato https://hg.mozilla.org/integration/autoland/rev/14625acf6197 part 2: Rewrite `HTMLEditor::AutoDeleteRangesHandler::ExtendRangeToIncludeInvisibleNodes()` with modern helper classes r=m_kato https://hg.mozilla.org/integration/autoland/rev/b8e8fed16b1e part 3: Make `ExtendOrShrinkRangeToDelete()` selects all contents in all list items if a list element is selected or all list items in a list element is selected r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/30572 for changes under testing/web-platform/tests
Comment 8•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e88bc0e4b9d4
https://hg.mozilla.org/mozilla-central/rev/14625acf6197
https://hg.mozilla.org/mozilla-central/rev/b8e8fed16b1e
Upstream PR merged by moz-wptsync-bot
Description
•