Closed Bug 1859355 Opened 2 years ago Closed 2 years ago

EditorEventListener::HandleEvent should stop handling event when certain conditions are met

Categories

(Core :: DOM: Selection, defect, P3)

defect

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox118 --- wontfix
firefox119 --- wontfix
firefox120 --- wontfix
firefox121 --- fixed

People

(Reporter: sefeng211, Assigned: exactlyajay.chauhan, Mentored)

References

(Regression)

Details

(Keywords: good-first-bug, regression, Whiteboard: [lang=c++])

Attachments

(1 file, 1 obsolete file)

Basically we should stop handling this event when

  • originalEventTargetNode is null
  • internalEvent->mMessage is eFocus
  • aEvent->GetCurrentTarget is a RootWindow()

To verify the fix, one can run editor/libeditor/crashtests/1424450.html can confirm the following warnings doesn't appear anymore.

 0:28.64 GECKO(1202335) [Child 1203360, Main Thread] WARNING: '!originalEventTargetNode', file /home/sefeng/.local/workspace/mozilla/mozilla-unified2/editor/libeditor/EditorEventListener.cpp:1152
 0:28.64 GECKO(1202335) [Child 1203360, Main Thread] WARNING: EditorEventListener::Focus() failed: 'NS_SUCCEEDED(rv)', file /home/sefeng/.local/workspace/mozilla/mozilla-unified2/editor/libeditor/EditorEventListener.cpp:473

Set release status flags based on info from the regressing bug 1817723

This relates to a warning message, updating the flags accordingly.

Hello, Sean Feng [:sefeng]
I attempted to replicate the warning by executing the command ./mach test editor/libeditor/crashtests/1424450.html but couldn't. Additionally, I adjusted the 'mozconfig' to activate debug mode.

This is the result I got: https://pastebin.mozilla.org/DPmLvzzQ

Can I see your mozconfig? This doesn't look like a debug build https://pastebin.mozilla.org/DPmLvzzQ#L73

mozconfig: https://pastebin.mozilla.org/SysoLDpa

https://firefox-source-docs.mozilla.org/setup/configuring_build_options.html

I created a blank mozconfig file in the source dir (mozilla-unified/mozconfig) and added this line to it ac_add_options --enable-debug

That looks correct. You need to build and run with that config file. I can't tell what's wrong. Maybe do something like

env MOZCONFIG=/path/to/that/mozconfig/file ./mach build 

env MOZCONFIG=/path/to/that/mozconfig/file ./mach test  editor/libeditor/crashtests/1424450.html

and see if this fixes it?

Assignee: nobody → exactlyajay.chauhan
Status: NEW → ASSIGNED

Thanks. After a clean build, I was able to replicate the warning.

Attachment #9359385 - Attachment description: Bug 1859355 - EditorEventListener::HandleEvent to stop handling event if the originalEventTargetNode is null, internalEvent->mMessage is eFocus or aEvent->GetCurrentTarget is a RootWindow r?sefeng → Bug 1859355 - EditorEventListener::HandleEvent to stop handling event if the originalEventTargetNode is null, internalEvent->mMessage is eFocus or aEvent->GetCurrentTarget is a RootWindow(). r?sefeng
Attachment #9359340 - Attachment is obsolete: true
Attachment #9359385 - Attachment description: Bug 1859355 - EditorEventListener::HandleEvent to stop handling event if the originalEventTargetNode is null, internalEvent->mMessage is eFocus or aEvent->GetCurrentTarget is a RootWindow(). r?sefeng → Bug 1859355 - Exit EditorEventListener::HandleEvent early when the event can't be handled
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ba7e57fccd2a Exit EditorEventListener::HandleEvent early when the event can't be handled r=sefeng
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch

The patch landed in nightly and beta is affected.
:exactlyajay.chauhan, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox120 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(exactlyajay.chauhan)

This just fixes some warnings. No need to uplift

Flags: needinfo?(exactlyajay.chauhan)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: