Closed Bug 516885 Opened 15 years ago Closed 15 years ago

Scrolling inside a div containing block elements with margins leaves visual glitches

Categories

(Core :: Web Painting, defect, P2)

1.9.2 Branch
x86
All
defect

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta2-fixed
status1.9.1 --- unaffected

People

(Reporter: nirvn.asia, Assigned: roc)

References

Details

(Whiteboard: [sg:critical?])

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a2pre) Gecko/20090915 Namoroka/3.6a2pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a2pre) Gecko/20090915 Namoroka/3.6a2pre

Scrolling inside a div containing block elements with margins leaves visual glitches in between blocks.

Reproducible: Always

Steps to Reproduce:
1. Open the test case attached to this bug
2. Scroll the div region with the mouse wheel back and forth

Actual Results:  
Visual glitches appears in between the p elements

Expected Results:  
No visual glitches.

Disabling smooth scrolling makes it easier to see glitches.
Attached file test case
Version: unspecified → 1.9.2 Branch
Attached image screenshot of test case
Confirmed on Windows Vista with latest trunk. Not reproducible on Shiretoko.
These kinds of bugs are currently mostly for :roc.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2a2pre) Gecko/20090911 Namoroka/3.6a2pre

Also visible on linux builds.
Flags: blocking1.9.2?
Assignee: nobody → roc
Flags: blocking1.9.2? → blocking1.9.2+
Priority: -- → P2
Attached patch fixSplinter Review
The immediately problem was confusion over the interpretation of aVisibleRegion in ComputeVisibility. The underlying problem is that we're overloading aVisibleRegion to mean the union of the visible region before scrolling and the visible region after scrolling, but not doing it consistently, which is partly because that overloading is just really confusing.

This patch simplifies the code (I think) by passing two regions: aVisibleRegion for the region visible after the move, and aVisibleRegionBeforeMove for the region visible before the move. All the ComputeVisibility methods are updated to deal with both regions --- I think the resulting logic is clearer --- and this bug goes away.
Attachment #404752 - Flags: review?(dbaron)
Whiteboard: [needs review]
-> NEW (since there's a patch)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 404752 [details] [diff] [review]
fix

+  // If we're analyzing moving content, then it doesn't really matter
+  // what we set mNeedAlpha to, so let's conservatively set it to true so
+  // we don't have to worry about getting it "correct" for the moving case.

So analyzing moving content is always separate from painting (i.e.,
different display lists)?

(I'm a little rusty on this...)

Should you assert in ComputeVisibility (which?) that
aVisibleRegionBeforeMove being non-null is equivalent to
aBuilder->HasMovingFrames()?  Or are they equivalent?

Also, I'm a little worried about null references getting passed to
AccumulateVisibleRegionOfMovingContent; have you checked that that can't
happen?


I like these changes; I think they make things clearer.  Sorry for the delay in getting to them.  r=dbaron
Attachment #404752 - Flags: review?(dbaron) → review+
(In reply to comment #7)
> (From update of attachment 404752 [details] [diff] [review])
> +  // If we're analyzing moving content, then it doesn't really matter
> +  // what we set mNeedAlpha to, so let's conservatively set it to true so
> +  // we don't have to worry about getting it "correct" for the moving case.
> 
> So analyzing moving content is always separate from painting (i.e.,
> different display lists)?

That is currently true, yes. In principle we could make scrolling a bit more efficient by reusing the list for painting, but I don't expect to do that anytime soon. Note that setting mNeedAlpha to true wouldn't break that usage, just be a tiny deoptimization.

> Should you assert in ComputeVisibility (which?) that
> aVisibleRegionBeforeMove being non-null is equivalent to
> aBuilder->HasMovingFrames()?  Or are they equivalent?

They should be equivalent. I'll assert this in every ComputeVisibility implementation.

> Also, I'm a little worried about null references getting passed to
> AccumulateVisibleRegionOfMovingContent; have you checked that that can't
> happen?

There are only two call sites. The one in nsDisplayList::ComputeVisibility passes in local regions, so they can't be null. The one in nsDisplayClip::ComputeVisibility dereferences *aVisibleRegionBeforeMove, which can't be null because we're guarded by if (aBuilder->HasMovingFrames()).
Whiteboard: [needs review] → [needs landing]
http://hg.mozilla.org/mozilla-central/rev/e95541e43a26
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs landing] → [needs 192 landing]
nsDisplayTransform incorrectly passes a non-null aVisibleRegionBeforeMove even in non-scrolling situations. This is harmless but triggers assertions.
Attachment #409183 - Flags: review?(dbaron)
Depends on: 525375
Comment on attachment 409183 [details] [diff] [review]
fix assertion due to nsDisplayTransform

r=dbaron (but maybe wrap at less than 80 characters?)
Attachment #409183 - Flags: review?(dbaron) → review+
Whiteboard: [needs 192 landing][sg:critical?]
Whiteboard: [needs 192 landing][sg:critical?] → [needs landing][sg:critical?]
I landed the assertion fix on mozilla-central:
http://hg.mozilla.org/mozilla-central/rev/c69a51243e06

We should probably land it on 1.9.2 as well, perhaps?
Whiteboard: [needs landing][sg:critical?] → [sg:critical?]
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: