Closed Bug 1919301 Opened 4 months ago Closed 4 months ago

The context menu from several sub-dialogs from Preferences displays a lot of unnecessary options

Categories

(Firefox :: Settings UI, defect)

Firefox 132
defect

Tracking

()

VERIFIED FIXED
132 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox130 --- wontfix
firefox131 --- verified
firefox132 --- verified

People

(Reporter: cbadau, Assigned: rsafaeian)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached image issue.png

Found in

  • Firefox 131.0b7

Affected versions

  • Nightly 132.0a1 (2024-09-16)
  • Firefox 131.0b7
  • Firefox 130.0.1

Tested platforms

  • Affected platforms: Windows 11, Windows 10, macOS 12, Ubuntu 24.04
  • Unaffected platforms: none

Steps to reproduce

  1. Go to about:preferences#privacy
  2. Click on the "Manage Exceptions..." button from Enhanced Tracking Protection.
  3. Right click on "Address of website" and observe the options from the context menu.

Expected result
The following specific options are displayed in the context menu: Undo, Redo, Cut, Copy, Paste, Delete, Select All, This Frame, Check Spelling, Inspect.

Actual result
A lot of unnecessary options are displayed in the context menu. Please see attachment "issue.png".

Regression range

  • I will provide one as soon as possible. For the reference, Firefox 129.0.2 is not affected.

Additional notes

  • The issue is also reproducible on the following sub-dialogs from about:preferences#privacy:
    • "Cookies and Site Data" -> "Manage Data" and "Manage Exeptions..." sub-dialogs
    • "Passwords" -> "Exceptions..." sub-dialog

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=ad57df08b5385f1b5d44c77f14231c3d5108832c&tochange=6a254993ba42e4cee3cdf1548effc51f30d574e4

Browser console shows the following error:

Uncaught TypeError: can't access property "defaultView", this.ownerDoc is undefined
    setContext chrome://browser/content/nsContextMenu.sys.mjs:268
    nsContextMenu chrome://browser/content/nsContextMenu.sys.mjs:99
    <anonymous> chrome://browser/content/browser-context.js:304
nsContextMenu.sys.mjs:268:7
    setContext chrome://browser/content/nsContextMenu.sys.mjs:268
    nsContextMenu chrome://browser/content/nsContextMenu.sys.mjs:99
    <anonymous> chrome://browser/content/browser-context.js:304

Error: createFromDocumentRoot: aDocumentRoot must be an HTMLHtmlElement FormLikeFactory.sys.mjs:55:13

Uncaught TypeError: can't access property "hiding", gContextMenu is null
    <anonymous> chrome://browser/content/browser-context.js:319
browser-context.js:319:7
    <anonymous> chrome://browser/content/browser-context.js:319
Regressed by: 1900009

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

:rsafaeian, since you are the author of the regressor, bug 1900009, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(rsafaeian)
Assignee: nobody → rsafaeian
Status: NEW → ASSIGNED
Pushed by rsafaeian@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/08b2387f2f1c Throw error in createFromDocumentRoot only when aDocumentRoot is null. r=credential-management-reviewers,issammani
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
Flags: needinfo?(rsafaeian)

Please nominate this for Beta uplift also.

Flags: needinfo?(rsafaeian)

For HTML documents, createFromDocumentRoot would normally never throw an error, since the root element for an HTML document is always HTMLHtmlElement, however, for any non-empty XML document, the root element is not any specific type. This caused createFromDocumentRoot to throw an error in the context menu.

Original Revision: https://phabricator.services.mozilla.com/D222621

Attachment #9426003 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Cluttered context menu when clicking on input
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Steps are outlined in the bug description since QA found the bug.
  • Risk associated with taking this patch: None
  • Explanation of risk level: N/A
  • String changes made/needed: No
  • Is Android affected?: no
Flags: qe-verify+

[:rsafaeian] the beta patch does not apply cleanly. Please fix conflicts on toolkit/modules/FormLikeFactory.sys.mj on a rebased patch

QA Whiteboard: [qa-triaged]

Verified fixed on Windows 10, Windows 11, macOS 13 and Ubuntu 22 using latest Nightly 132.0a1 (buildID: 20240920090503).

I rebased the patch. It should be good now.

Flags: needinfo?(rsafaeian)
Attachment #9426003 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified fixed on Windows 10, Windows 11, macOS 13 and Ubuntu 22 using Firefox 131 Beta build from Treeherder.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: