Closed Bug 1671252 Opened 4 years ago Closed 3 years ago

[Windows 10+] 1px at bottom cut off in non-maximized windows when coloured title bars and window borders are enabled

Categories

(Core :: Widget: Win32, defect)

Firefox 81
Desktop
Windows 10
defect

Tracking

()

VERIFIED FIXED
96 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox-esr91 --- verified
firefox81 --- wontfix
firefox82 --- wontfix
firefox83 --- wontfix
firefox94 --- wontfix
firefox95 --- verified
firefox96 - verified

People

(Reporter: rechdshraipfelehr, Assigned: emilio)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(4 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0

Steps to reproduce:

  1. Open a website with a 1px border, like this one:

<style>
body {
margin: 0;
height: 100%;
border: 1px solid red;
box-sizing: border-box;
}
</style>

  1. Make the window smaller so it's not maximized anymore (I don't know how this is called)

I'm using Firefox 81.0.2 on Windows 10 1909.

Actual results:

The border at the bottom is not visible. See attached screenshot.

Expected results:

The border at the bottom should be visible.

I can reproduce the issue on Nightly83.0a1 Windows10 if browser.tabs.drawInTitlebar = true.
The problem appears since Firefox72.

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Component: Untriaged → Widget: Win32
Ever confirmed: true
Keywords: regression
OS: Unspecified → Windows 10
Product: Firefox → Core
Hardware: Unspecified → Desktop

Brendan, any idea what is going on here?

(moving out of widget because I think this is either a frontend or layout issue)

Component: Widget: Win32 → General
Flags: needinfo?(bdahl)
Product: Core → Firefox

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Win32' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: General → Widget: Win32
Product: Firefox → Core

Bad bugbug, no botsnack for you.

Component: Widget: Win32 → General
Product: Core → Firefox

[Tracking Requested - why for this release]: due to regression of bug 1492582, bottom 1px of content is cut off.

(In reply to Alice0775 White from comment #6)

[Tracking Requested - why for this release]: due to regression of bug 1492582, bottom 1px of content is cut off.

Can you clarify how to reproduce this? I can't seem to reproduce (Windows 10 21H1, 19043.1288). I've tried with different display scaling (100%, 200%, 150%) and the red bottom border is always visible. I restore the window by doubleclicking an empty bit of tabstrip. Tried with Nightly 95 and beta 94, same result for both.

Flags: needinfo?(alice0775)
Attached image screenshot

mm, There are no special steps.
My environment,
Windows10 Home 19043.1288
Windows Settings, 140% in text scale, 100% in DPI scale.

Str:

  1. Start Firefox w/ new profile
  2. Open data:text/html,<style>body {margin: 0;height: 100%;border: 1px solid red;box-sizing: border-box;}</style>

Actual:
Red bottom border is not visible.

Flags: needinfo?(alice0775)
Attached image WFM

Bizarre. I don't see this, even with exactly the same scaling settings.

Emilio, do you have ideas on how to gather more data here / figure out what's happening?

Flags: needinfo?(emilio)

On vmware, guest: Windows 10 Pro for Workstations 19043.1288, 100% in text scale, 100% in DPI scale.
I can also reproduce the issue.

Can't repro locally either... It seems likely to be a windows-specific off-by-one, probably similar to bug 1609129?

Flags: needinfo?(emilio)
See Also: → 1609129

Maybe bugbug was right after all...

Component: General → Widget: Win32
Product: Firefox → Core

Okay, I found the trigger that causes the problem in the Windows10 Settings.

Start > Settings > Personalization >
 Colors > Turn on "Title bars and window borders"

:Gijs, can you reproduce this when the above Windows10 Settings?

Flags: needinfo?(gijskruitbosch+bugs)

Thanks. Yes, with that option enabled I can reproduce the issue. I expect it's related to the fact that we put a border-top on the <html> DOM node, coloured with the accent colour, as instructed by that system pref. What I don't quite follow is why that causes this bug - everything else is using flexbox so should "just" resize accordingly, not end up slightly off-screen. Emilio, with now-solid STR, do you have any idea? I suspect some kind of rounding-related layout issue but I don't really know how to go looking for it.

Flags: needinfo?(gijskruitbosch+bugs)
Flags: needinfo?(emilio)
Flags: needinfo?(bdahl)
Summary: 1px at bottom cut off in non-maximized windows → [Windows 10+] 1px at bottom cut off in non-maximized windows when coloured title bars and window borders are enabled
Flags: needinfo?(emilio)

This works correctly. On the root it seems we hit this codepath:

https://searchfox.org/mozilla-central/rev/df18dd52da04ee2bad434b0ba2d9fcb196d4d15e/layout/xul/nsBoxFrame.cpp#514-525

And end up with an slightly-bigger-than-needed box. I haven't dug into what
changing this may entail, but given the root frame is special anyways (because
it affects window constraints etc) it's probably safer to do this.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

It's not a rounding issue (if I set the border-width to 100px then we push stuff 100px to the bottom).

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/220f3305e900
Move Windows accent border to #navigator-toolbox. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch

Seems like a pretty trivial patch - did you want to nominate this for Beta/ESR approval?

Flags: needinfo?(emilio)

Comment on attachment 9251214 [details]
Bug 1671252 - Move Windows accent border to #navigator-toolbox. r=Gijs

Beta/Release Uplift Approval Request

  • User impact if declined: comment 0
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 13
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): We're using the same border on win7/8.
  • String changes made/needed: none

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Trivial ui fix.
  • User impact if declined: see above
  • Fix Landed on Version: 96
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): see above.
  • String or UUID changes made by this patch: none
Flags: needinfo?(emilio)
Attachment #9251214 - Flags: approval-mozilla-esr91?
Attachment #9251214 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Comment on attachment 9251214 [details]
Bug 1671252 - Move Windows accent border to #navigator-toolbox. r=Gijs

Approved for our last 95 beta, thanks.

Attachment #9251214 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified as fixed on Windows 10 x64 on Firefox Nightly 96.0a1.

Reverting accidental change to fx95 status flag to ensure this gets verified on beta too once builds are available.

Attachment #9251214 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+

Verified as fixed on Firefox Beta 95.b12 and on Firefox 91.4.0esr on Windows 10 x64.

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

Creator:
Created:
Updated:
Size: