Selection after inserting paragraph at `abc<span>[def</span>]ghi` is wrong
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
People
(Reporter: masayuki, Assigned: masayuki)
References
(Regression, )
Details
(Keywords: regression)
Attachments
(1 file)
STR
Actual Result
Caret appears at end of the line
Expected Result
Caret should appear between "c" and "g".
This is reproducible even in ESR 91.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
The regression range is:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=7a3f514cf8490d271ee373a1d2999e4ea4dee2d7&tochange=b043233ec04f06768d59dcdfb9e928142280f3cc
Perhaps, regression of bug 1297414.
Updated•2 years ago
|
Comment 2•2 years ago
|
||
Set release status flags based on info from the regressing bug 1297414
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
When selection is abc<b>[def</b>]ghi
, insertParagraph
command will delete
the <b>
element first, then, Selection
becomes abc{}ghi
. Then,
HTMLEditor::InsertParagraphSeparatorAsSubAction
wraps all of the line in
the default paragraph, <div>
, with
HTMLEditor::FormatBlockContainerWithTransaction
(although this is incompatible
behavior with the other browsers). At this time, new <div>
is inserted before
the first text node and then, move the text nodes into the new <div>
.
However, RangeUpdater::DidMoveNode
just slides the offsets if containers of
registered DOM points are the ex-parent of the moving nodes. Therefore, the
tracked selection range in HTMLEditor::FormatBlockContainerWithTransaction
become <div></div>abc{}def
, then, <div>abcdef</div>{}
, but the expected
behavior is of course, <div>abc{}def</div>
, then, split the new <div>
.
So the problem is, DidMoveNode
assumes that DOM points won't point the moving
content node. If the node is pointed, it should keep pointing in the new
parent.
Note that the expectations of new tests are based on Chrome, therefore, the
new known failures are incompatible with Chrome.
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/713c1697c555 Make `SelectionState::DidMoveNode` track DOM points having pointed the moved content correctly r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/35870 for changes under testing/web-platform/tests
Comment 6•2 years ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Updated•2 years ago
|
Description
•