Missing window controls (minimize, maximize and close buttons) on a window opened via window.open() with "toolbar", without "menubar", when the menu bar is configured as always shown

RESOLVED FIXED in Firefox 67

Status

()

P2
normal
RESOLVED FIXED
2 months ago
12 days ago

People

(Reporter: yuki, Assigned: yuki)

Tracking

({regression})

Trunk
Firefox 67
regression
Points:
---

Firefox Tracking Flags

(firefox-esr60 unaffected, firefox64 unaffected, firefox65 wontfix, firefox66 wontfix, firefox67 fixed)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

2 months ago

Steps to reproduce:

  1. Start Firefox on a Windows PC.
  2. Right-click on the toolbar and check "Menu Bar" to show it always.
  3. Hit Ctrl-Shift-K to open the Web Console.
  4. Input window.open('about:blank','_blank','toolbar') and hit Enter key.
  5. The popup is blocked by Firefox's popup blocker, thus click the "allow to open
    the requested window.

Actual result:

A browser window is opened without window controls.
(See the attached screenshot: missing-window-controls.png)

Expected result:

A browser window is opened with window controls.

Envrionment:

  • Confirmed versions of Firefox
    • Firefox 65.0b12 (build ID: 20190117232427)
    • Nightly 66.0a1 (build ID: 20190121175139)
  • Confirmed platform
    • Windows 7
    • Windows 10

Additional information:

  • If you uncheck the "Menu Bar" to show it on demand, the opened window has window controls. This problem appears only with always-shown menu bar.
  • On Firefox 64 or older versions, window controls become unclickable if you use the Classic theme of Windows 7, because the #tabbrowser-tab with z-index:2 [1] covers #titlebar-buttonbox with z-index:1 [2].

[1]https://dxr.mozilla.org/mozilla-esr60/source/browser/themes/windows/browser.css#206
[2]https://dxr.mozilla.org/mozilla-esr60/source/browser/themes/windows/browser.css#305

(Assignee)

Comment 1

2 months ago

I've filed the bug 1521692 for a similar probelm on currently released Firefox.

(Assignee)

Comment 2

2 months ago
Posted patch Patch (WIP) (obsolete) — Splinter Review

Initial version patch, without automated test.

I have a question: is there the suitable location to place automated test? I've found possible related tests under:

Assignee: nobody → yuki
(Assignee)

Updated

2 months ago
status-firefox64: --- → unaffected
status-firefox65: --- → affected
status-firefox-esr60: --- → unaffected

(In reply to YUKI "Piro" Hiroshi from comment #2)

Created attachment 9038164 [details] [diff] [review]
Patch (WIP)

Initial version patch, without automated test.

I have a question: is there the suitable location to place automated test?

https://searchfox.org/mozilla-central/source/browser/base/content/test/popups/browser_popupUI.js

Priority: -- → P2
(Assignee)

Comment 4

2 months ago

(In reply to Dão Gottwald [::dao] from comment #3)

(In reply to YUKI "Piro" Hiroshi from comment #2)

I have a question: is there the suitable location to place automated test?

https://searchfox.org/mozilla-central/source/browser/base/content/test/popups/browser_popupUI.js

Thanks!

Now I'm trying to write tests. Here is a list of conditions thought as need to be tested:

  • browser.tabs.drawInTitlebar (on/off)
  • window.open() flags
    • (no feature)
    • toolbar
    • menubar
    • toolbar,menubar
  • View => Toolbars => Menu Bar (on/off)

I think https://searchfox.org/mozilla-central/source/toolkit/components/windowwatcher/test/browser_new_content_window_chromeflags.js looks an example for testing with combinations of conditions.

(Assignee)

Updated

2 months ago
Attachment #9038450 - Flags: review?(dao+bmo)
Attachment #9038450 - Flags: review?(dao+bmo)
Attachment #9038450 - Attachment description: Bug 1521688 - Show titlebar buttons when drawInTitlebar=true, window.open with features="toolbar", View => Toolbars => Menu Bar=checked → Bug 1521688 - Fix eslint failures
Attachment #9038450 - Attachment description: Bug 1521688 - Fix eslint failures → Bug 1521688 - Detect visibility of titlebar buttons based on their rendered width
Attachment #9038450 - Attachment description: Bug 1521688 - Detect visibility of titlebar buttons based on their rendered width → Bug 1521688 - Show titlebar buttons when drawInTitlebar=true, window.open with features="toolbar", View => Toolbars => Menu Bar=checked
Attachment #9038450 - Attachment description: Bug 1521688 - Show titlebar buttons when drawInTitlebar=true, window.open with features="toolbar", View => Toolbars => Menu Bar=checked → Bug 1521688 - Fix eslint failures
Attachment #9038450 - Attachment description: Bug 1521688 - Fix eslint failures → Bug 1521688 - Detect visibility of titlebar buttons based on their rendered width
Attachment #9038450 - Attachment description: Bug 1521688 - Detect visibility of titlebar buttons based on their rendered width → Bug 1521688 - Detect visibility of titlebar buttons based on both rendered size and visibility of ancestor element
Attachment #9038450 - Attachment description: Bug 1521688 - Detect visibility of titlebar buttons based on both rendered size and visibility of ancestor element → Bug 1521688 - Show titlebar buttons when drawInTitlebar=true, window.open with features="toolbar", View => Toolbars => Menu Bar=checked
Blocks: 1356920
Keywords: regression
Status: NEW → ASSIGNED
status-firefox65: affected → wontfix
status-firefox66: affected → fix-optional
(Assignee)

Updated

a month ago
Whiteboard: checkin-needed

Comment 6

a month ago
Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7d8248d94084
Show titlebar buttons when drawInTitlebar=true, window.open with features="toolbar", View => Toolbars => Menu Bar=checked r=dao
Whiteboard: checkin-needed

Comment 7

a month ago
bugherder
Status: ASSIGNED → RESOLVED
Last Resolved: a month ago
status-firefox67: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
status-firefox66: fix-optional → wontfix
You need to log in before you can comment on or make changes to this bug.