Get rid of implicit conversion of `EditorDOMPointBase`
Categories
(Core :: DOM: Editor, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox101 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(7 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 | |
Bug 1765018 - part 6: Make `TypeInState::OnSelectionChange` stop using `EditorRawDOMPoint` r=m_kato!
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
Assignee | ||
Comment 1•3 years ago
|
||
The implicit copy constructors and operator=
makes it harder to realize
that implicit conversion wastes the runtime cost. Therefore, this patch
replaces them with a template method to convert the EditorDOMPointBase
type.
Depends on D143817
Assignee | ||
Comment 2•3 years ago
|
||
This avoids unnecessary conversion at the callers' side, although they should be
omitted by the complier.
Depends on D143878
Assignee | ||
Comment 3•3 years ago
|
||
To avoid the unnecessary conversion between EditorDOMPoint
and
EditorRawDOMPoint
, it should be a template method which can take/return either
EditorDOMPoint
or EditorRawDOMPoint
.
Depends on D143879
Assignee | ||
Comment 4•3 years ago
|
||
In theory, methods which touch the DOM tree should take EditorDOMPoint
rather
than EditorRawDOMPoint
. And now, we can return meaningful value if it
succeeded, with Result
.
Therefore, this patch makes it return Result<EditorDOMPoint, nsresult>
instead
of taking an out argument, and take only EditorDOMPoint
rather than taking any
type of EditorDOMPointBase
since it's always converted to EditorDOMPoint
.
Depends on D143880
Assignee | ||
Comment 5•3 years ago
|
||
Aligning to EditorBase::InsertTextWithTransaction
, these methods should return
Result<EditorDOMPoint, nsresult>
rather than taking an out param.
Depends on D143881
Assignee | ||
Comment 6•3 years ago
|
||
Using EditorRawDOMPoint
in it just wastes conversion cost to EditorDOMPoint
.
Depends on D143882
Assignee | ||
Comment 7•3 years ago
|
||
For avoiding to use To<EditorDOMPoint>()
etc from temporary object, such
methods should be templated.
Depends on D143883
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5b708efff09c
https://hg.mozilla.org/mozilla-central/rev/f18b4a048939
https://hg.mozilla.org/mozilla-central/rev/8cdcc0cc8380
https://hg.mozilla.org/mozilla-central/rev/6b1ea907c72d
https://hg.mozilla.org/mozilla-central/rev/1c84876d94e5
https://hg.mozilla.org/mozilla-central/rev/28aaacf1cf54
https://hg.mozilla.org/mozilla-central/rev/48bf136c4911
Description
•