Make `WSRunScanner::ReachedCurrentBlockBoundary` never lie
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox127 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
When it's true, it may not reach current block boundary. This is really annoying when you want to check whether it reaches current block boundary.
| Assignee | ||
Comment 1•2 years ago
|
||
This case should never happen because nobody can check proper editable state
in uncomposed tree unless the uncomposed tree has its own editing host.
Therefore, this patch adds assertions into the scanning methods too.
| Assignee | ||
Comment 2•2 years ago
|
||
Currently, it checks whether mContent is nullptr or not even if the scanner
reached something. However, this makes the users of this object check whether
it has reasonable content or not and that makes the users messy. Therefore,
the scanning method should guarantee that it's always error if it does not reach
any content.
Depends on D207681
| Assignee | ||
Comment 3•2 years ago
|
||
Different from the comment around setter of WSType::CurrentBlockBoundary,
neither HTMLEditUtils::GetNextLeafContentOrNextBlockElement nor
HTMLEditUtils::GetPreviousLeafContentOrPreviousBlockElement returns
nullptr when it reaches non-editable element, and the setters always set
mContent to aEditableBlockParentOrTopmostEditableInlineElement. Therefore,
mContent is always an editable element when ReachedCurrentBlockBoundary()
returns true.
Depends on D207682
| Assignee | ||
Comment 4•2 years ago
|
||
When WSScanResult::ReachedCurrentBlockBoundary() returns true, it may have
reached inline editing host rather than editable block. Therefore, the
method name is definitely error-prone. This patch adds new state and all
users of WSType::CurrentBlockBoundary keeps checking the new type too for
keeping current behavior.
I think that we should make WSRunScanner aware of inline editing host next
to block boundary before removing odd check of
ReachedInlineEditingHostBoundary(), StartsFromInlineEditingHostBoundary()
and EndsByInlineEditingHostBoundary() to avoid unexpected regressions in the
wild.
Depends on D207683
Comment 6•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/1f48c21f0456
https://hg.mozilla.org/mozilla-central/rev/fa3afe35b103
https://hg.mozilla.org/mozilla-central/rev/6ead0f52b128
https://hg.mozilla.org/mozilla-central/rev/218ae793cdd8
Description
•