Closed Bug 1688899 Opened 4 years ago Closed 4 years ago

Leftover lines under menu items after hovering in the new AppMenu.

Categories

(Core :: Graphics, defect)

defect

Tracking

()

VERIFIED FIXED
87 Branch
Tracking Status
firefox87 --- wontfix
firefox88 --- verified

People

(Reporter: bwinton, Assigned: mstange)

References

(Blocks 1 open bug)

Details

(Whiteboard: [proton-hamburger-menu])

Attachments

(2 files)

As shown in the screenshot…

This looks like an invalidation bug to me. Hey jrmuizel, do you know what the best way of approaching this problem would be?

Component: Menus → Graphics
Flags: needinfo?(jmuizelaar)
Product: Firefox → Core
Severity: -- → S3

What platform is this on? Is this a regression?

Flags: needinfo?(jmuizelaar) → needinfo?(bwinton)

MacOS 11.1 Big Sur, 2018 MacBook Pro.

I don't know whether it's a regression or not, because the highlights are new. (Added in https://bugzilla.mozilla.org/show_bug.cgi?id=1688744 I think. Mike would know better.)

Mossop (cc-ed) also saw it, perhaps on a different platform.

Flags: needinfo?(bwinton)

Yeah, I'd say bug 1688744 is where we added the CSS where we first started noticing this. Frustratingly, I can't seem to reproduce this reliably on a new profile.

I'm also noticing it on my macOS 10.15.7 Catalina MBP. I think I've only seen it when the window is on the Retina display, but I can't say for certain.

Is dark mode needed to reproduce the problem?

I have also only noticed this with dark mode, so... potentially? But we're not sure.

To get the CSS applied from the bug I referred to, create and set: browser.proton.appmenu.enabled to true, then restart. Note that just a few days ago, "Library" was removed from that menu, but both "Bookmarks" and "History" are there, and I've been able to see the lines within those submenus as well.

I just reproduced it on the Light theme with 87.0a1 (2021-01-28) (64-bit), so I don't think it's dark-mode only.

(In reply to Jeff Muizelaar [:jrmuizel] from comment #6)

Is dark mode needed to reproduce the problem?

I do not run with dark mode.

I can't reproduce it on 10.15.6

I can reproduce this. Needinfo'ing myself to debug it.

Flags: needinfo?(mstange.moz)

This happens when the popup opens at a fractional position in terms of "logical coordinates". I can only get it to reproduce when I have the Proton tab bar enabled, which causes the toolbar to be located at a different fractional position than before.

We try to open the popup widget at a Y position of, say, 120.5. For window positions and sizes, macOS only allows integer "logical" coordinates. So this code makes us round the widget position to an integer (121) and we end up with a mViewToWidgetOffset of (0, 0.5).

From now on we have a confusion between these three spaces: LayerManager space, view space, and widget space:

  • Invalidation thinks LayerManager space == view space.
  • Some places during painting think LayerManager space == widget DrawTarget space == widget space.

So the invalidated rect is shifted by 0.5 logical pixels (== 1 device pixel) compared to the painted rect. The shifting happens between the InvalidateViewNoSuppression call and the nsChildView::Invalidate call, in InvalidateWidgetArea.

Questions:

  • Do we want to have a non-zero mViewToWidgetOffset in this case, or should we snap the view position together with the widget position? Would that have other bad effects?
  • Should LayerManager space match widget space or view space?

In an ideal world, nsViews would not exist and there would be no "view to widget offset".

Flags: needinfo?(mstange.moz) → needinfo?(tnikkel)
Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED
Attachment #9200781 - Attachment description: Bug 1688899 - Avoid painting artifacts in fractionally-positioned menupopups by trieting the invalid region as being relative to the widget. r=tnikkel → Bug 1688899 - Avoid painting artifacts in fractionally-positioned menupopups by treating the invalid region as being relative to the widget. r=tnikkel

(In reply to Markus Stange [:mstange] from comment #13)

  • Do we want to have a non-zero mViewToWidgetOffset in this case, or should we snap the view position together with the widget position? Would that have other bad effects?
  • Should LayerManager space match widget space or view space?

Without paging all of this back into my head my initial answers would be mViewToWidgetOffset should be non-zero in this case and having the view dims different from the frame dims is not what we want.

We do snapping in layer manager space, so it has to be widget space, no?

In an ideal world, nsViews would not exist and there would be no "view to widget offset".

I think we might need a 'frame to widget offset' or something similar to solve the same problem as the view to widget offset, although I'm not 100% sure.

Flags: needinfo?(tnikkel)
Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/ecdc9c2a8a20 Avoid painting artifacts in fractionally-positioned menupopups by treating the invalid region as being relative to the widget. r=tnikkel
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Flags: qe-verify+

I was able to reproduce the issue on Firefox 87.0a1 (2021-01-28) under macOS 11.2.3.

The issue is no longer reproducible on Firefox 88.0a1 (2021-03-21). Tests were performed on macOS 11.2.3, Ubuntu 20.04, and Windows 10.

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

Attachment

General

Created:
Updated:
Size: