`TextEditor` becomes not available if reframing the text control in a `beforeinput`/`textInput` event listener
Categories
(Core :: DOM: Editor, defect)
Tracking
()
People
(Reporter: masayuki, Assigned: masayuki)
References
()
Details
(Keywords: webcompat:platform-bug)
User Story
user-impact-score:1050
Attachments
(4 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
Found while I investigating bug 1989331. If a beforeinput/textInput event listener reframes the text control frame, the TextEditor is destroyed. Then, the text control won't be reinitialized properly with new TextEditor. So, the text control can get focus but never work.
This is caused by the same root cause of bug 448784, bug 1339052 and bug1620050. We should keep using TextEditor in the TextControlState even after reframing.
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 1•4 months ago
|
||
Once the editor is destroyed while dispatching beforeinput event,
e.g., by a reframe of the text control frame, AutoEditActionDataSetter
marks "the editor has destroyed during my lifetime". Then, nested
EditActions always fail because the parent AutoEditActionDataSetter
thinks the editor is not available.
However, the editor can be reinitialized immediately. Then, the nested
EditActions should work (note that it does not mean that another user
input is handled, AutoEditActionDataSetter is used by some query
methods too). Therefore, this patch adds a new bool member to store
whether the editor is initialized again.
I think we could reset mEditorWasDestroyedDuringHandlingEditAction,
but I'm afraid to do that because it forgets the destroyed thing
completely and some features may need to abort handling something even
if the editor is restored since the editable nodes are recreated.
Therefore, this patch adds a new bool member for making this change
safer and anybody can access the details of the state.
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Comment 3•4 months ago
|
||
| bugherder | ||
| Assignee | ||
Comment 4•4 months ago
|
||
Once the editor is destroyed while dispatching beforeinput event,
e.g., by a reframe of the text control frame, AutoEditActionDataSetter
marks "the editor has destroyed during my lifetime". Then, nested
EditActions always fail because the parent AutoEditActionDataSetter
thinks the editor is not available.
However, the editor can be reinitialized immediately. Then, the nested
EditActions should work (note that it does not mean that another user
input is handled, AutoEditActionDataSetter is used by some query
methods too). Therefore, this patch adds a new bool member to store
whether the editor is initialized again.
I think we could reset mEditorWasDestroyedDuringHandlingEditAction,
but I'm afraid to do that because it forgets the destroyed thing
completely and some features may need to abort handling something even
if the editor is restored since the editable nodes are recreated.
Therefore, this patch adds a new bool member for making this change
safer and anybody can access the details of the state.
Original Revision: https://phabricator.services.mozilla.com/D271559
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
| Assignee | ||
Comment 8•4 months ago
|
||
Once the editor is destroyed while dispatching beforeinput event,
e.g., by a reframe of the text control frame, AutoEditActionDataSetter
marks "the editor has destroyed during my lifetime". Then, nested
EditActions always fail because the parent AutoEditActionDataSetter
thinks the editor is not available.
However, the editor can be reinitialized immediately. Then, the nested
EditActions should work (note that it does not mean that another user
input is handled, AutoEditActionDataSetter is used by some query
methods too). Therefore, this patch adds a new bool member to store
whether the editor is initialized again.
I think we could reset mEditorWasDestroyedDuringHandlingEditAction,
but I'm afraid to do that because it forgets the destroyed thing
completely and some features may need to abort handling something even
if the editor is restored since the editable nodes are recreated.
Therefore, this patch adds a new bool member for making this change
safer and anybody can access the details of the state.
Original Revision: https://phabricator.services.mozilla.com/D271559
Updated•4 months ago
|
| Assignee | ||
Comment 9•4 months ago
|
||
Once the editor is destroyed while dispatching beforeinput event,
e.g., by a reframe of the text control frame, AutoEditActionDataSetter
marks "the editor has destroyed during my lifetime". Then, nested
EditActions always fail because the parent AutoEditActionDataSetter
thinks the editor is not available.
However, the editor can be reinitialized immediately. Then, the nested
EditActions should work (note that it does not mean that another user
input is handled, AutoEditActionDataSetter is used by some query
methods too). Therefore, this patch adds a new bool member to store
whether the editor is initialized again.
I think we could reset mEditorWasDestroyedDuringHandlingEditAction,
but I'm afraid to do that because it forgets the destroyed thing
completely and some features may need to abort handling something even
if the editor is restored since the editable nodes are recreated.
Therefore, this patch adds a new bool member for making this change
safer and anybody can access the details of the state.
Original Revision: https://phabricator.services.mozilla.com/D271559
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Comment 10•4 months ago
|
||
| uplift | ||
Updated•4 months ago
|
Updated•4 months ago
|
Comment 11•4 months ago
|
||
| uplift | ||
Description
•