Get rid of `mNewBlockElement`
Categories
(Core :: DOM: Editor, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox105 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Attachments
(21 files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
It's used only for ensuring caret in the block at the post-processing of top level edit sub-actions. First, the name is hard to understand the meaning, and this runs as stateful so that it may change selection after sub-action handlers explicitly collapsing Selection
.
So I think that each sub-action handler should manage Selection
instead.
Assignee | ||
Comment 1•2 years ago
|
||
The following patches touch the logic to restore selection after handling
commands. However, it seems that they are not tested because I found some
regressions by manual testing, but didn't cause orange on tryserver.
outdent-preserving-selection.tentative.html
causes a crash due to the
MOZ_ASSERTION
in HTMLEditor::HandleOutdentAtSelectionInternal
. It means
that I misunderstand the logic and had put the assertion. I should fix it
later with reading the complicated code again. For now, I just change it
to NS_WARNING_ASSERTION
instead.
And also test_cmd_absPos.html
is the first test to check toggling position
between static
and absolute
. Therefore, it detects wrong MOZ_ASSERT
s
which test whether EditActionData
or TopLevelEditSubActionData
is created
or not before they create them by themselves. So, this patch removes the
wrong assertions.
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D152962
Assignee | ||
Comment 3•2 years ago
|
||
They set TopLevelEditSubActionData::mNewBlockElement
and their root callers
in edit sub-action level are only InsertParagraphSeparatorAsSubAction
and
FormatBlockContainerAsSubAction
, and they are called each other. Therefore,
this patch changes these 3 methods once.
Depends on D152963
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D152964
Assignee | ||
Comment 5•2 years ago
|
||
It oddly retrieve an ancestor list element which contains one range in the
selection ranges. So, working it with AutoRangeArray
which is initialized
with Selection
makes HTMLEditor
smaller...
Depends on D152965
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D152966
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D152967
Assignee | ||
Comment 8•2 years ago
|
||
With taking an AutoRangeArray
which is initialized with Selection
, it can
restore selection and check if it's collapsed and if collapsed in the expected
list element. Then, its caller can apply the returned range to Selection
because it's an edit sub-action handler.
Depends on D152968
Assignee | ||
Comment 9•2 years ago
|
||
And also this patch makes it and an its caller stop computing editing host
with the latest Selection
.
Depends on D152969
Assignee | ||
Comment 10•2 years ago
|
||
Depends on D152970
Assignee | ||
Comment 11•2 years ago
|
||
It's called only by HTMLEditor::HandleCSSIndentAtSelection
which is called
only by HTMLEditor::HandleIndentAtSelection
. They don't touch Selection
after calling it. Therefore, we can make it adjust collapsing selection point
by itself.
Depends on D152971
Assignee | ||
Comment 12•2 years ago
|
||
The change of expected assertion count in the crash test is caused by that the
test calls execCommand
recursively from the legacy mutation event listeners.
Therefore, stopping updating Selection
for each DOM tree change causes that
the target range in the nested edit action is changed. However, the nested
handling has already been disabled by default, so this should not be a problem
for the users.
Depends on D152972
Assignee | ||
Comment 13•2 years ago
|
||
Depends on D152973
Assignee | ||
Comment 14•2 years ago
|
||
Depends on D152974
Assignee | ||
Comment 15•2 years ago
|
||
Depends on D152975
Assignee | ||
Comment 16•2 years ago
|
||
Depends on D152976
Assignee | ||
Comment 17•2 years ago
|
||
It's only caller is HTMLEditor::AlignContentsAtSelection
which is called only
by HTMLEditor::AlignAsSubAction
at almost last of it. Therefore, it's safe
to handle mNewBlockElement
at the caller of
AlignContentsAtSelectionWithEmptyDivElement
is safe.
Depends on D152977
Assignee | ||
Comment 18•2 years ago
|
||
Depends on D152978
Assignee | ||
Comment 19•2 years ago
|
||
For doing that, this patch also making HTMLEditor::AlignContentsAtSelection
which the only caller of HTMLEditor::AlignNodesAndDescendants
handle
Selection
with AutoRangeArray
because it uses AutoSelectionRestorer
and
we need to adjust Selection
after restored.
Depends on D152979
Assignee | ||
Comment 20•2 years ago
|
||
Depends on D152980
Assignee | ||
Comment 21•2 years ago
|
||
Depends on D152981
Assignee | ||
Updated•2 years ago
|
Comment 22•2 years ago
|
||
Comment 24•2 years ago
|
||
Comment 25•2 years ago
|
||
Comment 26•2 years ago
|
||
Comment 27•2 years ago
|
||
Comment 28•2 years ago
|
||
Comment 29•2 years ago
|
||
Comment 30•2 years ago
|
||
Comment 31•2 years ago
|
||
Comment 32•2 years ago
|
||
Comment 33•2 years ago
|
||
Comment 34•2 years ago
|
||
Comment 35•2 years ago
|
||
Comment 36•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d554ca7850eb
https://hg.mozilla.org/mozilla-central/rev/b9a3b6f27a8d
https://hg.mozilla.org/mozilla-central/rev/bb54603e50c7
https://hg.mozilla.org/mozilla-central/rev/9893b8c357a2
https://hg.mozilla.org/mozilla-central/rev/d61ac9d43588
https://hg.mozilla.org/mozilla-central/rev/310cd44cff95
https://hg.mozilla.org/mozilla-central/rev/23d50b5617de
Comment 37•2 years ago
|
||
Comment 38•2 years ago
|
||
Comment 39•2 years ago
|
||
Comment 40•2 years ago
|
||
Comment 41•2 years ago
|
||
Comment 42•2 years ago
|
||
Comment 43•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Comment 44•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/32d794b2a45a
https://hg.mozilla.org/mozilla-central/rev/661e25343a15
https://hg.mozilla.org/mozilla-central/rev/80ed14c716a2
https://hg.mozilla.org/mozilla-central/rev/695d708318a5
https://hg.mozilla.org/mozilla-central/rev/1e9e0b9b8536
https://hg.mozilla.org/mozilla-central/rev/f9d7d41f5043
https://hg.mozilla.org/mozilla-central/rev/3efbfdf889b4
https://hg.mozilla.org/mozilla-central/rev/511a7e64402c
https://hg.mozilla.org/mozilla-central/rev/808c433c7774
https://hg.mozilla.org/mozilla-central/rev/27d5779ea393
https://hg.mozilla.org/mozilla-central/rev/7f56b90bd017
https://hg.mozilla.org/mozilla-central/rev/a0dd784acd4c
https://hg.mozilla.org/mozilla-central/rev/8896439912aa
https://hg.mozilla.org/mozilla-central/rev/3ea6eaf0dc16
Comment 46•2 years ago
|
||
== Change summary for alert #35027 (as of Sat, 06 Aug 2022 07:46:45 GMT) ==
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
3% | google-slides LastVisualChange | macosx1015-64-shippable-qr | bytecode-cached fission warm webrender | 1,805.00 -> 1,753.33 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=35027
Updated•2 years ago
|
Description
•