Closed Bug 1258711 Opened 4 years ago Closed 4 years ago

[OSX] Visual artifacts visible while scrolling on a certain page with scrollbars set to always visible

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set

Tracking

()

VERIFIED FIXED
mozilla48
Tracking Status
firefox45 --- wontfix
firefox46 --- wontfix
firefox47 --- verified
firefox48 --- verified

People

(Reporter: petruta.rasa, Assigned: kats)

References

()

Details

(Keywords: regression, Whiteboard: [gfx-noted])

Attachments

(2 files)

[Note]:
- follow-up from bug 1214261 affecting OSX

[Affected versions]:
- latest Nightly 48.0a1 2016-03-21
- latest Aurora 47.0a2 2016-03-22
- Firefox 46 beta 4 with e10s and APZ enabled

[Affected platforms]:
- OSX 10.9.5

[Steps to reproduce]:
1. Open http://www.sjsu.edu/openuniversity/schedule/ in a new tab
2. Scroll up and down using the mouse wheel

[Expected results]:
- Scrolling is smooth, no visual artifacts

[Actual results]:
- Sometimes a black vertical line covers the right side of the table or the elements are not aligned: http://i.imgur.com/T07W4Qk.png, http://i.imgur.com/FuYNVcA.png 

[Regression range]:
- https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=c33f30666b37dbceffb9fbe5089a668db8893a85&tochange=359f86fecbc2a6531d9018fb81a74fd26502f5a1

In this pushlog, beside bug 1214261, there are 3 more issues regarding scrolling: bug 1234877, bug 1236040 and bug 1199468

[Additional notes]:
- I couldn't reproduce it on Win 7 64-bit and Ubuntu 14.04 64-bit
This looks an awful lot like bug 1237154 / bug 1243000, except it didn't get fixed by bug 1238564. Markus, any thoughts?

Regardless it's a transient issue during scrolling/checkerboarding so we aren't going to uplift any fixes to 46.
Blocks: apz-desktop
Whiteboard: [gfx-noted]
This page seems to be broken in more ways than one. I don't see a scrollbar in the iframe at all, but I see zero-margin-style checkerboarding when the iframe has a display port and I scroll up and down in the root scroll frame.
Assignee: nobody → bugmail.mozilla
I don't know what's going on with the scrollbar, but the patches in bug 1251638 seem to help with the checkerboarding.
Depends on: 1251638
Petruta, can you check if this is still reproducible on the latest Nightly? I'm expecting bug 1251638 to have helped with it somewhat, although it may not have fixed it entirely. Please also indicate if the visual artifacts are transient (they go away by themselves as you scroll) or if they stick around for a while. Thanks!
Flags: needinfo?(petruta.rasa)
Kats, this is still reproducible with Nightly 48.0a1 2016-04-04, the artifacts are _not_ transient. I can make a screencast if necessary.
Flags: needinfo?(petruta.rasa)
Hm, I'm still not able to reproduce this, either with or without bug 1259593.
I checked on other machines too. OS X 10.10.5 and 10.11 also have the issue, while it doesn't reproduce on 10.8.5.
I'm on OS X 10.11.3 so I should be able to repro. Are you using a Retina or non-Retina screen Mac? A screencast might also be helpful.
Attached video artifacts.mov
It happens on retina and non-retina. Usually it reproduces after scrolling for just a few seconds, but sometimes it needs intensive scrolling.
Thanks for the video! It seems like you have the OS X scrollbars set to always visible, and when I enable that option, I can reproduce the issue as well. The garbage on the right is where the scrollbar should be showing up. I'll investigate more.
Summary: [OSX] Visual artifacts visible while scrolling on a certain page → [OSX] Visual artifacts visible while scrolling on a certain page with scrollbars set to always visible
So I can actually reproduce this without e10s or APZ as well. It seems to have to do with the enormous height on the iframe, which results in a giant height on the scrollbar. Bringing the iframe height down to 33348 or so (from the initial 199500) fixes the issue, so it looks like we're running into a ~32k limit somewhere in the code.
No longer blocks: apz-desktop
With some help from Markus we traced this into nsNativeThemeCocoa.mm, where there is a BITMAP_MAX_AREA which caps the size of things that we ask CoreUI to draw. The scrollbar track and thumb are hitting that cap, and so we don't draw them. The cap is in place to avoid allocating an intermediate buffer that is too large, but for the scrollbar we should be able to hack the code to draw it anyway since we know it won't be allocating the buffer.
Component: Panning and Zooming → Widget: Cocoa
I filed bug 1262968 to investigate removing or increasing this check, but I'll together a workaround for this bug.
I'm going to wait a day to see if Jesse has any comments on bug 1262968, but here's a try push with this patch to keep y'all entertained in the meantime:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=09a4b6120ec9
Comment on attachment 8739175 [details] [diff] [review]
Skip the area check on scrollbar track/thumb

Try push is clean, no word from Jesse yet.
Attachment #8739175 - Flags: review?(mstange)
Attachment #8739175 - Flags: review?(mstange) → review+
https://hg.mozilla.org/mozilla-central/rev/6729b99051e4
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Comment on attachment 8739175 [details] [diff] [review]
Skip the area check on scrollbar track/thumb

Approval Request Comment
[Feature/regressing bug #]: Unsure, it appears to go back a few releases at least.
[User impact if declined]: On OS X, if the user has set their system scrollbar setting to "always visible" (which is not the default), then on some pages we might show garbage instead of a scrollbar.
[Describe test coverage new/current, TreeHerder]: Tested using Nightly on OS X 10.11 and 10.6
[Risks and why]: Should be fairly low risk. The code was originally added to guard against OOM/crash when drawing native OS widgets, but shouldn't be needed for the scrollbar case.
[String/UUID change made/needed]: none
Attachment #8739175 - Flags: approval-mozilla-beta?
Attachment #8739175 - Flags: approval-mozilla-aurora?
Petruta, can you verify this fix before we uplift to beta?  

Kats, I'm uncertain whether uplifting this is worth the risk in late beta. We do have beta 11 building on Thursday then the RC on Monday. There isn't a lot of time in between beta 11 and RC to figure out if we are seeing new OOM crashes though.
Flags: needinfo?(petruta.rasa)
I'd be ok with just uplifting this to aurora and not beta. I don't think it's a very widespread issue and we already shipped it in 45.
I confirm the artifacts are no longer visible on latest Nightly 48.0a1 under Mac OS X 10.11.1.

Now, a vertical scrollbar is shown on the right side. Kats, I suppose this is expected, right?
Flags: needinfo?(petruta.rasa)
Yes, that is the expected behaviour. Thanks for verifying!
Comment on attachment 8739175 [details] [diff] [review]
Skip the area check on scrollbar track/thumb

Too late for beta, but please uplift to aurora.
Attachment #8739175 - Flags: approval-mozilla-beta?
Attachment #8739175 - Flags: approval-mozilla-beta-
Attachment #8739175 - Flags: approval-mozilla-aurora?
Attachment #8739175 - Flags: approval-mozilla-aurora+
QA Contact: petruta.rasa
Verified as fixed with Firefox 47 beta 9 and latest Aurora 48.0a2 under Mac OS X 10.9.5.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.