Get rid of member variables of `HTMLEditRules`
Categories
(Core :: DOM: Editor, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(13 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Most members in HTMLEditRules
are cache required between BeforeEdit()
and AfterEdit()
. So, we can move them into EditorBase::AutoEditActionDataSetter
.
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Most member variables of HTMLEditRules
are temporary used while between
BeforeEdit()
and AfterEdit()
are called or WillDoAction()
and
DidDoAction()
are called.
The former means the data should be stored during top-level edit sub-action
is set. Therefore, this patch creates a struct, TopLevelEditSubActionData
and make it a member of AutoEditActionDataSetter
. Then, makes
EditorBase::TopLevelEditActionDataRef()
return reference of it.
And also this patch moves HTMLEditRules::mDidDeleteSelection
into it.
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
Assignee | ||
Comment 7•5 years ago
|
||
For avoiding allocation cost of RangeItem
, it should be stored by HTMLEditor
and reused by all TopLevelEditSubActionData
instances for the editor instance.
Assignee | ||
Comment 8•5 years ago
|
||
This patch makes StyleCache
not inherit ItemProp
because MOZ_COUNT_CTOR
and MOZ_COUNT_DTOR
do not work well with AutoTArray
and there is no reason
to do that since nobody treat StyleCache
instance with ItemProp
pointer.
Assignee | ||
Comment 9•5 years ago
|
||
Assignee | ||
Comment 10•5 years ago
|
||
HTMLEditRules::mUtilRange
is used only for the argument of
HTMLEditRules::UpdateDocChangeRange()
. However, it does not need to be
a range instance since it compares its start and
TopLevelEditSubAction::mChangedRange->StartRef()
, and its end and
TopLevelEditSubAction::mChangedRange->EndRef()
. Therefore, with rewriting
it as taking 2 EditorRawDOMPoint
s, we don't need mUtilRange
.
Assignee | ||
Comment 11•5 years ago
|
||
The members of HTMLEditRules
which are used only while WillDoAction()
and
DidDoAction()
are called should be moved to specific stack only struct
EditorBase::EditSubActionData
.
Assignee | ||
Comment 12•5 years ago
|
||
This patch includes a logic change. HTMLEditRules::mListenerEnabled
is used
for storing 2 state. One is that whether HTMLEditRules
can handle the legacy
listener methods (they came from nsIEditActionListener
) with mHTMLEditor
or
not. The other is that whether current edit sub-action handler temporarily
disables the listeners for performance or not.
For the former, we can check same result with HTMLEditRules::mInitialized
and HTMLEditRules::mHTMLEditor
.
However, the latter, current design is obviously wrong. Currently,
HTMLEditRules::mListenerEnabled
is set only to false
temporarily from
WillInsertText()
, but the state will be affected to other edit sub-actions
which are nested by mutation event listeners. So, currently,
HTMLEditRules::mDocChangeRange
may not contain modified range caused by
nested edit sub-actions.
For solving this bug, this patch moves it into EditSubActionData
rather
than HTMLEditor
and TopLevelEditSubActionData
.
Assignee | ||
Comment 13•5 years ago
|
||
HTMLEditRules::mReturnInEmptyLIKillsList
stores value of
editor.html.typing.returnInEmptyListItemClosesList
at construction, and it's
set to true unless the pref value is "false"
. However, this pref isn't
registered in anywhere (all.js, firefox.js, etc) nor used in comm-central
and BlueGriffon.
Even if I search the pref in the web, I don't see any information so that
this hidden pref must not be used anybody. Therefore, this patch just removes
this member.
Comment 14•5 years ago
|
||
Comment 15•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4707a5e44d23
https://hg.mozilla.org/mozilla-central/rev/de4d785d8268
https://hg.mozilla.org/mozilla-central/rev/35e9843249ad
https://hg.mozilla.org/mozilla-central/rev/fb3f0029026a
https://hg.mozilla.org/mozilla-central/rev/9db84872dfb4
https://hg.mozilla.org/mozilla-central/rev/bb657e30fe2a
https://hg.mozilla.org/mozilla-central/rev/72900ea22020
https://hg.mozilla.org/mozilla-central/rev/a7453a2a1713
https://hg.mozilla.org/mozilla-central/rev/e07b7a1a595b
https://hg.mozilla.org/mozilla-central/rev/193653b7d3f2
https://hg.mozilla.org/mozilla-central/rev/6de55c5b5f8d
https://hg.mozilla.org/mozilla-central/rev/7ac5164efa3e
https://hg.mozilla.org/mozilla-central/rev/df563a5f853a
Description
•