Closed Bug 802440 Opened 12 years ago Closed 12 years ago

Some elements are invalidated when other elements are scrolled off the screen


(Core :: Layout, defect)

18 Branch
Not set



Tracking Status
firefox17 --- unaffected
firefox18 + fixed
firefox19 + fixed
firefox20 --- verified


(Reporter: jwatt, Assigned: jwatt)



(Keywords: perf, regression)


(3 files, 1 obsolete file)

Attached file testcase
Related to bug 802321, and with the two patches from that bug applied, I'm seeing invalidation of transformed elements when scrolling down as the items are scrolled off the top of the screen. Specifically, in this testcase, as the bottom of the top circle is just disappearing off/appearing on the screen, we seem to invalidate an area bounding all five circles. Scrolling up and down by about one pixel at that position shows the bug. It seems really undesirable to be invalidating content that is scrolling _off_ the screen.

This testcase is a reduction of more severe invalidation that I'm seeing in with the two patches from bug 802321 applied. If the fix for this testcase doesn't fix invalidation of the top/bottom rows when scrolling them on/off screen let me know and I'll make more reduced testcases.
Blocks: dlbi
Keywords: perf
Attached image simpler testcase
With this testcase it's pretty clear that when the first line is scrolled out of view we invalidate the area of the second line.
The problem is that ContainerLayerProperties::ComputeChangeInternal will invalidate children at a given index if they are not the same object in both the old and new list. As a result, when we scroll an item off the screen (causing it to be removed from the new list), then all subsequent siblings will be invalidated.
Blocks: 801949
Version: 17 Branch → 18 Branch
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → jwatt
Attachment #683819 - Flags: review?(roc)
Attached patch patchSplinter Review
Attachment #683819 - Attachment is obsolete: true
Attachment #683819 - Flags: review?(roc)
Attachment #683822 - Flags: review?(roc)
Comment on attachment 683822 [details] [diff] [review]

Review of attachment 683822 [details] [diff] [review]:

::: gfx/layers/LayerTreeInvalidation.cpp
@@ +223,4 @@
>      for (Layer* child = container->GetFirstChild(); child; child = child->GetNextSibling()) {
> +      bool invalidateChildsCurrentArea = false;
> +      if (i < mChildren.Length()) {
> +        uint32_t childs_old_index;

Attachment #683822 - Flags: review?(roc) → review+
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Summary: Transformed elements invalidating while scrolling off the screen → Some elements are invalidated when other elements are scrolled off the screen
OS: Mac OS X → All
Hardware: x86 → All
Comment on attachment 683822 [details] [diff] [review]

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 539356
User impact if declined: performance regressions, particularly when scrolling
Testing completed (on m-c, etc.): baked on m-c for several days
Risk to taking this patch (and alternatives if risky): none
String or UUID changes made by this patch: none
Attachment #683822 - Flags: approval-mozilla-beta?
Attachment #683822 - Flags: approval-mozilla-aurora?
Keywords: regression
Comment on attachment 683822 [details] [diff] [review]

DLBI regression - let's land on branches.
Attachment #683822 - Flags: approval-mozilla-beta?
Attachment #683822 - Flags: approval-mozilla-beta+
Attachment #683822 - Flags: approval-mozilla-aurora?
Attachment #683822 - Flags: approval-mozilla-aurora+
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 Firefox/20.0
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0

Verified as fixed based on test cases from comment 0 and comment 1 on Firefox 20.0 (buildId: 20130326150557)
You need to log in before you can comment on or make changes to this bug.