Make inline property setter and remover stop touching `Selection` directly
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox105 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 2 open bugs)
Details
Attachments
(12 files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
Bug 1781994 - part 4: Make `HTMLEditor::RemoveInlinePropertyInternal` use `AutoRangeArray` r=m_kato!
(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 |
Currently, it modifies Selection
a lot and multiple updates of the DOM tree refers Selection
, so the nested for
loops in it is stateful and hard to understand.
I think that I can refactor it much simpler than now with the new helper classes and methods.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
I've already made a caller of HTMLEditor::ClearStyleAt
,
HTMLEditor::CreateStyleForInsertText
, in bug 1770877, so this fixes a bug of
the patch.
HTMLEditor::ClearStyleAt
is still updates Selection
only in some cases.
And one of the caller has not handle the Selection
update. Therefore, once
it completely stop touching Selection
, ComputeEditingHost
will fail and
the other paths update Selection
, so it should do it too. (Without the
change, test_dragdrop.html
fails.)
Finally, we don't need EditResult
anymore because we have
Result<EditorDOMPoint, nsresult>
.
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D154343
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D154344
Assignee | ||
Comment 4•2 years ago
|
||
I'd like to get rid of AutoSelectionRangeArray
and AutoRestoreSelection
,
and I'd like to make it stop touching Selection
while it is removing style
of each content nodes in the range. Therefore, this patch rewrites it with
AutoRangeArray
. Then, we can reduce the indent level of the nested for
loops.
Note that it creates AutoEditSubActionNotifier
, so it's a sub-edit action
handler. Therefore, this patch renames it.
Depends on D154345
Assignee | ||
Comment 5•2 years ago
|
||
This is a pre-fix for bug 1735608. Currently, the loop assumes that collected
nodes are always right node, but it'll be changed, therefore, it creates
new array for the follow up loops handle expected nodes.
Depends on D154346
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D154347
Assignee | ||
Comment 7•2 years ago
|
||
I think that HTMLEditor::SetInlinePropertyAsSubAction
and
HTMLEditor::RemoveInlinePropertyAsSubAction
should not be called multiple
times in one edit action. Therefore, I'd like to make them take multiple
styles once. Then, we could collect all targets before touching the DOM tree
in the future.
Depends on D154348
Assignee | ||
Comment 8•2 years ago
|
||
Depends on D154349
Assignee | ||
Comment 9•2 years ago
|
||
HTMLEditor::RelativeFontChange()
and its helpers are based on
SetInlinePropertiesAsSubAction()
and its helpers. Therefore, they may have
similar problem to switch join/split direction. Therefore, this and the
following patches clean them up too.
Depends on D154350
Assignee | ||
Comment 10•2 years ago
|
||
They are renamed to SetFontSizeWithBigOrSmallElement
and
SetFontSizeOfFontElementChildren
.
Depends on D154351
Assignee | ||
Comment 11•2 years ago
|
||
It should use AutoRangeArray
to stop using AutoSelectionRestorer
.
Depends on D154352
Assignee | ||
Comment 12•2 years ago
|
||
It's a Gecko specific feature, and it sets background color of parent block
elements of selection ranges. This does similar things to
SetInlinePropertiesAsSubAction
, but still refers Selection
directly and
uses AutoSelectionRestorer
. For consistency between similar methods, this
patch makes it use AutoRangeArray
.
Depends on D154353
Comment 13•2 years ago
|
||
Comment 14•2 years ago
|
||
Comment 15•2 years ago
|
||
Comment 16•2 years ago
|
||
Comment 17•2 years ago
|
||
Comment 18•2 years ago
|
||
Comment 19•2 years ago
|
||
Comment 20•2 years ago
|
||
Comment 21•2 years ago
|
||
Comment 22•2 years ago
|
||
Comment 23•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c2c295e5a3ff
https://hg.mozilla.org/mozilla-central/rev/52f5e6c77f78
https://hg.mozilla.org/mozilla-central/rev/46ae9281c1b2
https://hg.mozilla.org/mozilla-central/rev/99211597b4ee
https://hg.mozilla.org/mozilla-central/rev/4f7f2298561e
https://hg.mozilla.org/mozilla-central/rev/2001ca2b890e
https://hg.mozilla.org/mozilla-central/rev/81b5e7d21c52
Comment 24•2 years ago
|
||
bugherder |
Description
•