Change style property in editor from nsAtom to nsStaticAtom (and clean up TypeInState and PropItem)
Categories
(Core :: DOM: Editor, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(10 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 |
nsStaticAtom
instances are alive until shutting down and our editor do not use dynamic atoms to handle style. Therefore, we can make all of them use nsStaticAtom
instead.
Assignee | ||
Comment 1•2 years ago
|
||
And I'll refactor TypeInState
and PropItem
for making what they do clearer because I always try to understand again and again what they do due to unclear names.
Assignee | ||
Comment 2•2 years ago
|
||
It's always a pointer to nsStaticAtom
instance or nullptr
. Therefore,
it can be nsStaticAtom*
and we can make its users treat nsStaticAtom
instead of nsAtom
.
Additionally, this patch changes some pointer parameters to references if
they are never nullptr
.
Assignee | ||
Comment 3•2 years ago
|
||
It's currently no problem to manage it with a raw pointer because it may be
set to a dynamic atom only when nsIHTMLEditor.insertLinkAroundSelection
is
called with unknown attribute, but comm-central uses it only with href
attribute.
I think that we should change the API just to take href
value in the future,
but for now, it should be RefPtr<nsAtom>
.
Depends on D155310
Assignee | ||
Comment 4•2 years ago
|
||
According to the debug, its value can be CSS property value if in the CSS mode.
For making the value meaning easier to understand, this renames it to
mAttributeValueOrCSSValue.
Depends on D155311
Assignee | ||
Comment 5•2 years ago
|
||
Only the value member needs to be updated when setting the prop multiple times.
Therefore, we cannot change all members to constants.
Depends on D155312
Assignee | ||
Comment 6•2 years ago
|
||
It's ugly to manage them as raw pointer especially when deleting the instances.
We should make it use UniquePtr
.
Depends on D155313
Assignee | ||
Comment 7•2 years ago
|
||
I usually retry to understand what they mean. Therefore, I'd like to give new
names for them (and rename TypeInState
class in a following patch).
Depends on D155314
Assignee | ||
Comment 8•2 years ago
|
||
For consistency with the previous patch, we should rename them too. Then, we're
getting rid of unclear word "Prop" from the public methods.
Depends on D155315
Assignee | ||
Comment 9•2 years ago
|
||
Depends on D155316
Assignee | ||
Comment 10•2 years ago
|
||
Additionally,
PropItem
->PendingStyle
StyleCache
->PendingStyleCache
AutoStyleCacheArray
->AutoPendingStyleCacheArray
And finally, PendingStyle
(formally PropItem
) is changed to class
and
its members are encapsuled.
Depends on D155317
Assignee | ||
Comment 11•2 years ago
|
||
Depends on D155318
Assignee | ||
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Comment 13•2 years ago
|
||
Comment 14•2 years ago
|
||
Comment 15•2 years ago
|
||
Comment 16•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/61b5b71feb21
https://hg.mozilla.org/mozilla-central/rev/8b0d988cfcdb
https://hg.mozilla.org/mozilla-central/rev/c60a519079f1
https://hg.mozilla.org/mozilla-central/rev/1bb446d79840
https://hg.mozilla.org/mozilla-central/rev/16ef13574d67
https://hg.mozilla.org/mozilla-central/rev/7f2a4bf264e7
https://hg.mozilla.org/mozilla-central/rev/6be885417efd
https://hg.mozilla.org/mozilla-central/rev/bf35b554c9e6
https://hg.mozilla.org/mozilla-central/rev/dace560a5e6d
https://hg.mozilla.org/mozilla-central/rev/0dacbbae333e
Description
•