border radius causes background of a transformed element to continuously invalidate

RESOLVED DUPLICATE of bug 813124

Status

()

P1
normal
RESOLVED DUPLICATE of bug 813124
6 years ago
6 years ago

People

(Reporter: cjones, Assigned: gal)

Tracking

unspecified
B2G C2 (20nov-10dec)
Points:
---

Firefox Tracking Flags

(blocking-basecamp:+)

Details

Attachments

(3 attachments)

STR
 (1) Open gaia settings app
 (2) Go to "Device Information" -> "More Information" -> "Developer" and enable paint flashing
 (3) Go back to main "Settings" page
 (4) Go to top of page and scroll slowly up and down

Most of the page invalidates and repaints quite nicely, but the "Airplane Mode" and "GPS" checkboxes flash on every paint.
This effect can also be noticed when paint flashing is disabled by panning up and down in the main settings page.  When the checkboxes come into view, the panning noticeably starts to have more friction.
(Assignee)

Comment 2

6 years ago
I don't see this on trunk I think.
(Assignee)

Comment 3

6 years ago
I can see this now. Move the settings down until a checkbox is hidden and then slowly scroll them into view. They flicker and have rendering defects.
(Assignee)

Comment 4

6 years ago
Blacking based on the artifacts.
blocking-basecamp: --- → +
I've seen the artifacts before, but can't seem to reproduce them anymore.
Andreas, can you please verify that you can reproduce artifacts (we cannot with the latest nightly build on an Otoro, though we can reproduce the over-repainting) and, if so, give us precise STR?
Flags: needinfo?(gal)
Assignee: nobody → joe
(Assignee)

Comment 7

6 years ago
Created attachment 674033 [details]
snapshot of the artifacts

This trivially reproduces for me with the STR above on a trunk build.

1. Go to settings app.
2. Scroll switches on top out of view.
3. Scroll them back into view.

Observe constant repainting as you scroll, and the switches are partially painted.

4. After a few seconds we repaint the whole screen and render correctly (not sure why we do that, do we repaint rotated buffers on a timer or something? must be new if we do).
Flags: needinfo?(gal)
(Assignee)

Comment 8

6 years ago
Note: this was on an unagi device.
(Assignee)

Comment 9

6 years ago
Actually I am guessing we layerize the two switches and we reinsert the layers and thats the repaint. So this might be a gpu driver bug of some sort (the artifacts). This is a secondary bug triggered by excessive repainting while scrolling. We probably want to fix both issues here.
Created attachment 674194 [details]
screenshot of the artifacts 2

The artifacts is the background color of the switch. Note in the screenshot the background has also been drawn to a wrong position, near the bottom of the screen.
Kan-Ru, were you also using an Unagi device? (We don't have one here yet AFAIK.)
(In reply to Joe Drew (:JOEDREW! \o/) from comment #11)
> Kan-Ru, were you also using an Unagi device? (We don't have one here yet
> AFAIK.)

Nope, it was on Otoro. Though we Unagi devices here.
I've tried and tried to reproduce but can't. :( Maybe if we fix the repainting it'll at least minimize the black flashing.
(Assignee)

Comment 14

6 years ago
This trivially reproduces on every device I tried it on today, including unagis and otoros across a wide range of builds (weeks old to trunk). At the very least it should be possible to reproduce the fact that we layerize the switch (which I think we shouldn't, right?).
Unfortunately the too-much-drawing problem doesn't happen on my desktop build of B2G — though it *does* have bad-drawing problems.
Actually, I bet the excessive repainting is fixed with DLBI, which means that I can effectively debug the bad drawing with a nightly build.
(Assignee)

Comment 17

6 years ago
DLBI is enabled on B2G and this occurs with DLBI.
Yes, but the excessive painting doesn't happen on mozilla-central, which was where I tested initially for comment 15 and comment 16. (I had forgotten that DLBI landed in time for 18.)

I continue to be completely unable to reproduce bad drawing on mozilla-aurora, but it is easily reproducible on mozilla-central.
I *am* actively working on this, though.
Status: NEW → ASSIGNED
This is, in fact, a general OMTC bug (at least with OpenGL); I can reproduce it on OMTC Nightly on OS X.

It definitely has to do with mask layers, because removing the border-radius makes the problem go away.
Summary: Excessive repainting of checkbox control in gaia settings app → [OMTC] Scrolling border-radius content into view can draw background elements on top
The excessive repainting is still reproducible in aurora, on a cset from late 10-23 ish.  I suspect bug 795674 (re-)fixed this.  Please let's confirm before morphing this bug.
(Assignee)

Comment 22

6 years ago
I just heard Joe is in fact able to reproduce the invalidation via paint flashing. What he can't see is the artifacts. These are really likely two bugs. Joe is working on the invalidation.
Incorrect. I'm working on the artifacts that I can reproduce on desktop using mozilla-central.
This is inside layout drawing code as near as I can tell at this point. Investigation continues.
Here is a printout from nsCSSRendering::PaintBackground at exactly the point things go wrong:

1429 = BACKGROUND
dirty: 840, 5160 1320-120 border: 840, 4440 1320-1320
1430 = BACKGROUND
dirty: 62280, 5340 900-4200 border: 62280, 5160 900-50520

(format = dirty.x, dirty.y dirty.width-dirty.height and similar for border)

Paint 1429 draws the background image on the test case I've got, and paint 1430 draws only the background colour.

Now for me to figure out where the rects are coming from.
Component: Graphics: Layers → Layout
(Assignee)

Comment 26

6 years ago
Whats the status here? This is a basecamp blocker, and we urgently need it fixed.
Priority: -- → P1
(Assignee)

Comment 27

6 years ago
I poked at this some more on the last flight. 

First of all I still see incorrect painting and also overinvalidation (paint flashing flickering) during scrolling with trunk gecko/gaia. The overinvalidation occurs scrolling up and down. The overinvalidation only occurs while the checkboxes are near the very top of the scrollable area. From the coloring of the paint flashing/buffer rotation patterns its clear that we are painting something transparent above or below those checkboxes. This might be the "battery almost empty" status bar which is supposedly not visible but we seem to be painting it to some degree. Once the checkbox leaves that top area, painting is normal.

A couple code observations from code inspection: The frame in question is nsIDOMHTMLInputElement, which uses its own custom background and border painting code instead of the generic paths, which is probably a good guess where this all goes south.
(Assignee)

Comment 28

6 years ago
I forced a battery warning indicator on the device and I am pretty sure thats the region that is affected here.
(Assignee)

Comment 29

6 years ago
bug 790768 contains a useful patch to debug this
(Assignee)

Comment 30

6 years ago
diff --git a/shared/style/switches.css b/shared/style/switches.css
index 655b14f..7acaec6 100644
Disabling the border radius makes the invalidation go away.

--- a/shared/style/switches.css
+++ b/shared/style/switches.css
@@ -64,7 +64,7 @@ label input[type="checkbox"][data-type="switch"] + span {
   height: 2.2rem;
   pointer-events: none;
   border: solid 1px #c2c2c2;
-  border-radius: 5.4rem;
+  /* border-radius: 5.4rem; */
   overflow: hidden;
   background: url(switches/images/switch/handler.png) no-repeat -0.2rem center;
   background-size: auto calc(100% + 2px);
(Assignee)

Comment 31

6 years ago
This is not related to the root element restyle stuff that has been biting reflow performance. em vs rem makes no difference.

diff --git a/shared/style/switches.css b/shared/style/switches.css
index 655b14f..c134703 100644
--- a/shared/style/switches.css
+++ b/shared/style/switches.css
@@ -64,7 +64,7 @@ label input[type="checkbox"][data-type="switch"] + span {
   height: 2.2rem;
   pointer-events: none;
   border: solid 1px #c2c2c2;
-  border-radius: 5.4rem;
+  border-radius: 5.4em;
   overflow: hidden;
   background: url(switches/images/switch/handler.png) no-repeat -0.2rem center;
   background-size: auto calc(100% + 2px);
(Assignee)

Comment 32

6 years ago
Alright, so the problem is actually not the input element. Its an empty span following it that is styled to contain the blue "interior" color and the check mark background. Thats what causing the invalidation. This makes the issue go away:

diff --git a/shared/style/switches.css b/shared/style/switches.css
index 655b14f..871b352 100644
--- a/shared/style/switches.css
+++ b/shared/style/switches.css
@@ -109,3 +109,6 @@ label input[data-type="switch"]:checked + span:after {
   transform: translateX(0);
 }
 
+label input[data-type="switch"] + span:after {
+  visibility: hidden;
+}
(Assignee)

Comment 33

6 years ago
I wonder whether we using clipping masks on the device but not on mac b2g. That would explain why I can't reproduce this with the b2g desktop build.
(Assignee)

Comment 34

6 years ago
For a moment I thought this might be related to clipping mask recycling, but thats not the case. This patch has no effect. Also, we are actually invalidating, so this bug has to originate via the display list and geometries, not the layers tree.

--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -1248,17 +1248,21 @@ already_AddRefed<ImageLayer>
 ContainerState::CreateOrRecycleMaskImageLayerFor(Layer* aLayer)
 {
   nsRefPtr<ImageLayer> result = mRecycledMaskImageLayers.Get(aLayer);
+#if 0
   if (result) {
     mRecycledMaskImageLayers.Remove(aLayer);
     // XXX if we use clip on mask layers, null it out here
   } else {
+#endif
     // Create a new layer
     result = mManager->CreateImageLayer();
     if (!result)
       return nullptr;
     result->SetUserData(&gMaskLayerUserData, new MaskLayerUserData());
     result->SetForceSingleTile(true);
+#if 0
   }
+#endif
(Assignee)

Comment 35

6 years ago
I think this is the part of the display list that bites us:

Painting --- before optimization (dirty 0,0,19200,27600):
        Clip 0x43e8f8e0() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
          Clip 0x43e8f8e0() (0,-4980,19200,21960)(0,0,0,0)(0,0,0,0)
            Clip 0x43e8f8e0() (0,-1320,19200,3600)(0,0,0,0)(0,0,0,0)
              ClipRoundedRect 0x43e8f8e0() (14700,-120,3240,1320)(0,0,0,0)(0,0,0,0)
                WrapList 0x43e8f8e0() (14700,-120,3240,1320)(0,0,0,0)(0,0,0,0)
                  nsDisplayTransform 0x43e8f8e0() (14700,-120,3240,1320)(0,0,0,0)(0,0,0,0) layer=0x43a74400
                    BackgroundColor 0x43e8f8e0() (0,0,3240,1320)(0,0,0,0)(0,0,0,0) uniform layer=0x426e3f60
                    Background 0x43e8f8e0() (300,60,780,1200)(0,0,0,0)(0,0,0,0) layer=0x426e3f60

        Clip 0x43e8f8e0() (0,-4980,19200,21960)(14700,0,3240,1200)(0,0,0,0)
          Clip 0x43e8f8e0() (0,-1320,19200,3600)(14700,0,3240,1200)(0,0,0,0)
            ClipRoundedRect 0x43e8f8e0() (14700,-120,3240,1320)(14700,0,3240,1200)(0,0,0,0)
              nsDisplayTransform 0x43e8f8e0() (14700,-120,3240,1320)(14700,0,3240,1200)(0,0,0,0) layer=0x43a74400
                BackgroundColor 0x43e8f8e0() (0,0,3240,1320)(0,120,3240,1200)(0,0,0,0) uniform layer=0x426e3f60
                Background 0x43e8f8e0() (300,60,780,1200)(300,120,780,1140)(0,0,0,0) layer=0x426e3f60

Painting --- before optimization (dirty 0,0,19200,27600):
        Clip 0x43e8f8e0() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
          Clip 0x43e8f8e0() (0,-4980,19200,21960)(0,0,0,0)(0,0,0,0)
            Clip 0x43e8f8e0() (0,-1320,19200,3600)(0,0,0,0)(0,0,0,0)
              ClipRoundedRect 0x43e8f8e0() (14700,-120,3240,1320)(0,0,0,0)(0,0,0,0)
                WrapList 0x43e8f8e0() (14700,-120,3240,1320)(0,0,0,0)(0,0,0,0)
                  nsDisplayTransform 0x43e8f8e0() (14700,-120,3240,1320)(0,0,0,0)(0,0,0,0) layer=0x43a74400
                    BackgroundColor 0x43e8f8e0() (0,0,3240,1320)(0,0,0,0)(0,0,0,0) uniform layer=0x426e3f60
                    Background 0x43e8f8e0() (300,60,780,1200)(0,0,0,0)(0,0,0,0) layer=0x426e3f60

        Clip 0x43e8f8e0() (0,-4980,19200,21960)(14700,0,3240,1200)(0,0,0,0)
          Clip 0x43e8f8e0() (0,-1320,19200,3600)(14700,0,3240,1200)(0,0,0,0)
            ClipRoundedRect 0x43e8f8e0() (14700,-120,3240,1320)(14700,0,3240,1200)(0,0,0,0)
              nsDisplayTransform 0x43e8f8e0() (14700,-120,3240,1320)(14700,0,3240,1200)(0,0,0,0) layer=0x43a74400
                BackgroundColor 0x43e8f8e0() (0,0,3240,1320)(0,120,3240,1200)(0,0,0,0) uniform layer=0x426e3f60
                Background 0x43e8f8e0() (300,60,780,1200)(300,120,780,1140)(0,0,0,0) layer=0x426e3f60

Painting --- before optimization (dirty 0,0,19200,27600):
        Clip 0x43e8f8e0() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
          Clip 0x43e8f8e0() (0,-4980,19200,21960)(0,0,0,0)(0,0,0,0)
            Clip 0x43e8f8e0() (0,-1320,19200,3600)(0,0,0,0)(0,0,0,0)
              ClipRoundedRect 0x43e8f8e0() (14700,-120,3240,1320)(0,0,0,0)(0,0,0,0)
                WrapList 0x43e8f8e0() (14700,-120,3240,1320)(0,0,0,0)(0,0,0,0)
                  nsDisplayTransform 0x43e8f8e0() (14700,-120,3240,1320)(0,0,0,0)(0,0,0,0) layer=0x43a74400
                    BackgroundColor 0x43e8f8e0() (0,0,3240,1320)(0,0,0,0)(0,0,0,0) uniform layer=0x426e3f60
                    Background 0x43e8f8e0() (300,60,780,1200)(0,0,0,0)(0,0,0,0) layer=0x426e3f60

        Clip 0x43e8f8e0() (0,-4980,19200,21960)(14700,0,3240,1200)(0,0,0,0)
          Clip 0x43e8f8e0() (0,-1320,19200,3600)(14700,0,3240,1200)(0,0,0,0)
            ClipRoundedRect 0x43e8f8e0() (14700,-120,3240,1320)(14700,0,3240,1200)(0,0,0,0)
              nsDisplayTransform 0x43e8f8e0() (14700,-120,3240,1320)(14700,0,3240,1200)(0,0,0,0) layer=0x43a74400
                BackgroundColor 0x43e8f8e0() (0,0,3240,1320)(0,120,3240,1200)(0,0,0,0) uniform layer=0x426e3f60
                Background 0x43e8f8e0() (300,60,780,1200)(300,120,780,1140)(0,0,0,0) layer=0x426e3f60

        Clip 0x43e8f8e0() (0,-4980,19200,21960)(14700,0,3240,1200)(0,0,0,0)
          Clip 0x43e8f8e0() (0,-1320,19200,3600)(14700,0,3240,1200)(0,0,0,0)
            ClipRoundedRect 0x43e8f8e0() (14700,-120,3240,1320)(14700,0,3240,1200)(0,0,0,0)
              nsDisplayTransform 0x43e8f8e0() (14700,-120,3240,1320)(14700,0,3240,1200)(0,0,0,0) layer=0x43a74400
                BackgroundColor 0x43e8f8e0() (0,0,3240,1320)(0,120,3240,1200)(0,0,0,0) uniform layer=0x426e3f60
                Background 0x43e8f8e0() (300,60,780,1200)(300,120,780,1140)(0,0,0,0) layer=0x426e3f60

When painting I see every other paint of that span not happening, but the display list items look superficially identical. Time to annotate the invalidation path a bit.
(Assignee)

Comment 36

6 years ago
nsDisplayTransform does not ever invalidate, so our lucky winner should be either Clip/ClipRoundedRect/WrapList/BackgroundColor or Background. ClipRoundedRect is probably a good starting point since without border radius we don't invalidate.

  virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
                                         const nsDisplayItemGeometry* aGeometry,
                                         nsRegion* aInvalidRegion) MOZ_OVERRIDE
  {
    // We don't need to compute an invalidation region since we have LayerTreeInvalidation                                                                                      
  }
(Assignee)

Comment 37

6 years ago
And here is our lucky winner:

Invalidation BackgroundColor: 18720/2800/360/7380 18720/2835/360/7380
Invalidation BackgroundColor: 18720/2783/360/7380 18720/2800/360/7380
Invalidation BackgroundColor: 18720/2765/360/7380 18720/2783/360/7380
Invalidation BackgroundColor: 18720/2748/360/7380 18720/2765/360/7380
Invalidation BackgroundColor: 18720/2713/360/7380 18720/2748/360/7380
Invalidation BackgroundColor: 18720/2695/360/7380 18720/2713/360/7380
Invalidation BackgroundColor: 18720/2678/360/7380 18720/2695/360/7380
Invalidation BackgroundColor: 18720/2643/360/7380 18720/2678/360/7380
Invalidation BackgroundColor: 18720/2608/360/7380 18720/2643/360/7380
Invalidation BackgroundColor: 18720/2573/360/7380 18720/2608/360/7380
Invalidation BackgroundColor: 18720/2538/360/7380 18720/2573/360/7380
Invalidation BackgroundColor: 18720/2520/360/7380 18720/2538/360/7380
Invalidation BackgroundColor: 18720/2485/360/7380 18720/2520/360/7380
Invalidation BackgroundColor: 18720/2433/360/7380 18720/2485/360/7380
Invalidation BackgroundColor: 18720/2398/360/7380 18720/2433/360/7380

Looks like the y position keeps changing as we scroll. Double-U-Tee-Eff. The nsDisplayGeometry code is supposed to compensate for the scroll offset.
(Assignee)

Comment 38

6 years ago
nsDisplayBackgroundImage and nsDisplayBackgroundColor should behave the same wrt to invalidation, except nsDisplayBackgroundColor doesn't have to worry about background positioning. Though, nsDisplayBackgroundColor doesn't implement ComputeInvalidationRegion, so I am going to try to lift that over and see what happens.
(Assignee)

Comment 39

6 years ago
nsDisplayBackgroundColor doesn't check mBorderRect, only mBounds. Thats the only difference between the base implementation (that nsDisplayBackgroundColor uses) and nsDisplayBackgroundImage. The problem isn't mBorderRect though. The nsDisplayBackgroundColor item is constructed with moving mBounds.
(Assignee)

Comment 40

6 years ago
Mhm, I see this invalidation happening all the time, not just when I see the checkbox flickering. This can't be right.
(Assignee)

Comment 41

6 years ago
On a random note, this is not affected by OOP and happens in process too.
(Assignee)

Comment 42

6 years ago
Ok, got this in gdb:

Breakpoint 4, nsDisplayItem::ComputeInvalidationRegion (this=0x4afe5880, aBuilder=0xbe9ca090, aGeometry=0x474cd400, aInvalidRegion=0xbe9c7a58)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:1420
1420	      nsRect a = GetBounds(aBuilder, &snap);
(gdb) bt 30
#0  nsDisplayItem::ComputeInvalidationRegion (this=0x4afe5880, aBuilder=0xbe9ca090, aGeometry=0x474cd400, aInvalidRegion=0xbe9c7a58)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:1420
#1  0x4083bba8 in InvalidateForLayerChange (this=0xbe9c7f7c, aItem=<value optimized out>, aNewLayer=<value optimized out>, aClip=..., aTopLeft=..., aGeometry=0x47463370)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2287
#2  0x4083ef28 in ProcessDisplayItems (this=0xbe9c7f7c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2163
#3  0x4083f7c2 in mozilla::FrameLayerBuilder::BuildContainerLayerFor (this=<value optimized out>, aBuilder=<value optimized out>, aManager=<value optimized out>, 
    aContainerFrame=0x4b7d8010, aContainerItem=0x4afe59b0, aChildren=..., aParameters=..., aTransform=0x4afe5a38)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2867
#4  0x4085dbe6 in nsDisplayTransform::BuildLayer (this=0x4afe59b0, aBuilder=0xbe9ca090, aManager=0x474bc920, aContainerParameters=...)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:3863
#5  0x4083efb6 in ProcessDisplayItems (this=0xbe9c914c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2081
#6  0x4083e2e6 in ProcessDisplayItems (this=0xbe9c914c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2011
#7  0x4083e2e6 in ProcessDisplayItems (this=0xbe9c914c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2011
#8  0x4083e2e6 in ProcessDisplayItems (this=0xbe9c914c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2011
#9  0x4083f7c2 in mozilla::FrameLayerBuilder::BuildContainerLayerFor (this=<value optimized out>, aBuilder=<value optimized out>, aManager=<value optimized out>, 
    aContainerFrame=0x4803c298, aContainerItem=0x4afe6010, aChildren=..., aParameters=..., aTransform=0x0)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2867
#10 0x4085dcce in nsDisplayOwnLayer::BuildLayer (this=0x4afe6010, aBuilder=0xbe9ca090, aManager=0x474bc920, aContainerParameters=...)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:2796
#11 0x4083efb6 in ProcessDisplayItems (this=0xbe9c9c14, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2081
#12 0x4083e2e6 in ProcessDisplayItems (this=0xbe9c9c14, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2011
#13 0x4083f7c2 in mozilla::FrameLayerBuilder::BuildContainerLayerFor (this=<value optimized out>, aBuilder=<value optimized out>, aManager=<value optimized out>, 
    aContainerFrame=0x46b3a298, aContainerItem=0x0, aChildren=..., aParameters=..., aTransform=0x0) at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2867
#14 0x4085d87c in nsDisplayList::PaintForFrame (this=<value optimized out>, aBuilder=0xbe9ca090, aCtx=0x0, aForFrame=0x46b3a298, aFlags=13)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:1072
#15 0x4085db74 in nsDisplayList::PaintRoot (this=0xbe9ca418, aBuilder=0xbe9ca090, aCtx=0x0, aFlags=13) at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:992
#16 0x4086c6d8 in nsLayoutUtils::PaintFrame (aRenderingContext=<value optimized out>, aFrame=0x46b3a298, aDirtyRegion=<value optimized out>, aBackstop=<value optimized out>, 
    aFlags=772) at /Users/gal/workspace/B2G/gecko/layout/base/nsLayoutUtils.cpp:1857
#17 0x40878a18 in PresShell::Paint (this=0x46f7ad00, aViewToPaint=<value optimized out>, aDirtyRegion=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsPresShell.cpp:5329
#18 0x40a8d29c in nsViewManager::ProcessPendingUpdatesForView (this=0x46f81ca0, aView=0x469b59a0, aFlushDirtyRegion=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/view/src/nsViewManager.cpp:435
#19 0x40a8d33e in nsViewManager::ProcessPendingUpdates (this=<value optimized out>) at /Users/gal/workspace/B2G/gecko/view/src/nsViewManager.cpp:1210
#20 0x4087c30c in nsRefreshDriver::Notify (this=0x426fe1d0, aTimer=<value optimized out>) at /Users/gal/workspace/B2G/gecko/layout/base/nsRefreshDriver.cpp:432
#21 0x40f15304 in nsTimerImpl::Fire (this=0x474cacd0) at /Users/gal/workspace/B2G/gecko/xpcom/threads/nsTimerImpl.cpp:485
#22 0x40f153b2 in nsTimerEvent::Run (this=<value optimized out>) at /Users/gal/workspace/B2G/gecko/xpcom/threads/nsTimerImpl.cpp:565
#23 0x40f134ea in nsThread::ProcessNextEvent (this=0x403078e0, mayWait=<value optimized out>, result=0xbe9ca837) at /Users/gal/workspace/B2G/gecko/xpcom/threads/nsThread.cpp:627
#24 0x40ef378e in NS_ProcessNextEvent_P (thread=0xbe9c7a58, mayWait=false) at /Users/gal/workspace/B2G/objdir-gecko/xpcom/build/nsThreadUtils.cpp:221
#25 0x40e1cbbc in mozilla::ipc::MessagePump::Run (this=0x40303400, aDelegate=0x4030f0c0) at /Users/gal/workspace/B2G/gecko/ipc/glue/MessagePump.cpp:82
#26 0x40f35228 in MessageLoop::RunInternal (this=0x1000000) at /Users/gal/workspace/B2G/gecko/ipc/chromium/src/base/message_loop.cc:215
#27 0x40f352de in MessageLoop::RunHandler (this=0x4030f0c0) at /Users/gal/workspace/B2G/gecko/ipc/chromium/src/base/message_loop.cc:208
---Type <return> to continue, or q <return> to quit---
#28 MessageLoop::Run (this=0x4030f0c0) at /Users/gal/workspace/B2G/gecko/ipc/chromium/src/base/message_loop.cc:182
#29 0x40da8164 in nsBaseAppShell::Run (this=0x42519700) at /Users/gal/workspace/B2G/gecko/widget/xpwidgets/nsBaseAppShell.cpp:163
(More stack frames follow...)
(gdb) up
#1  0x4083bba8 in InvalidateForLayerChange (this=0xbe9c7f7c, aItem=<value optimized out>, aNewLayer=<value optimized out>, aClip=..., aTopLeft=..., aGeometry=0x47463370)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2287
2287	    aItem->ComputeInvalidationRegion(mBuilder, oldGeometry, &combined);
(gdb) l
2282	#endif
2283	  } else {
2284	    // Let the display item check for geometry changes and decide what needs to be
2285	    // repainted.
2286	    oldGeometry->MoveBy(shift);
2287	    aItem->ComputeInvalidationRegion(mBuilder, oldGeometry, &combined);
2288	    oldClip->AddOffsetAndComputeDifference(shift, oldGeometry->ComputeInvalidationRegion(),
2289	                                           aClip, aGeometry->ComputeInvalidationRegion(),
2290	                                           &combined);
2291	
(gdb) p oldGeometry
$1 = (class nsDisplayItemGeometry *) 0x474cd400
(gdb) p *oldGeometry
$2 = {_vptr.nsDisplayItemGeometry = 0x4165c9e0, mBounds = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 18720, y = 1418, width = 360, 
      height = 7380}, <No data fields>}}
(gdb)
(Assignee)

Comment 43

6 years ago
Alright, so I think I see something thats wrong. I will need roc et all to confirm though:

When comparing Y positions, we compensate for the current scroll top:

  nsPoint shift = aTopLeft - data->mLastActiveScrolledRootOrigin;

We are definitely scrolled down right now, however:

Breakpoint 4, nsDisplayItem::ComputeInvalidationRegion (this=0x49ccc6b0, aBuilder=0xbe9ca090, aGeometry=0x474a6580, aInvalidRegion=0xbe9c7a58)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:1420
1420	      nsRect a = GetBounds(aBuilder, &snap);
(gdb) up
#1  0x4083bba8 in InvalidateForLayerChange (this=0xbe9c7f7c, aItem=<value optimized out>, aNewLayer=<value optimized out>, aClip=..., aTopLeft=..., aGeometry=0x474ac7f0)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2287
2287	    aItem->ComputeInvalidationRegion(mBuilder, oldGeometry, &combined);
(gdb) p aTopLeft
$8 = (const nsPoint &) @0xbe9c7e64: {<mozilla::gfx::BasePoint<int, nsPoint>> = {x = 0, y = 0}, <No data fields>}
(gdb) p shift
$9 = {<mozilla::gfx::BasePoint<int, nsPoint>> = {x = 0, y = 0}, <No data fields>}
(gdb) 

If we go up on the stack, I think we get a 0 scroll offset here because:

2036	    if (aFlags & NO_COMPONENT_ALPHA) {
2037	      // When NO_COMPONENT_ALPHA is set, items will be flattened onto the
(gdb) 
2038	      // reference frame. In this case, force the active scrolled root to
2039	      // that frame.
2040	      forceInactive = true;
2041	      activeScrolledRoot = mContainerReferenceFrame;
2042	      topLeft = nsPoint(0, 0);
2043	      isFixed = mBuilder->IsFixedItem(item, nullptr, activeScrolledRoot);
2044	    } else {
2045	      forceInactive = false;
2046	      isFixed = mBuilder->IsFixedItem(item, &activeScrolledRoot);
2047	      if (activeScrolledRoot != lastActiveScrolledRoot) {
(gdb) 
2048	        lastActiveScrolledRoot = activeScrolledRoot;
2049	        topLeft = activeScrolledRoot->GetOffsetToCrossDoc(mContainerReferenceFrame);
2050	      }
2051	    }

aFlags is 0 here, so we take the bottom branch.

(gdb) p mBuilder->IsFixedItem(item, &activeScrolledRoot, 0)
$24 = true

However, nothing in switch.css is position:fixed. So IsFixedItem is messing with us here.
(Assignee)

Comment 44

6 years ago
(gdb) p item.mFrame
$28 = (struct nsIFrame *) 0x4b7d8578
(gdb) p *$28
$29 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x4166cc60}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 2783, width = 360, height = 7380}, <No data fields>}, mContent = 0x47cef060, 
  mStyleContext = 0x4b5b0508, mParent = 0x4b7d8478, mNextSibling = 0x0, mPrevSibling = 0x0, mState = 2305860878425128960, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a $28
0x4b7d8578:	0x4166cc60 <_ZTV16nsButtonBoxFrame+8>
(gdb) 

Hello nsButtonBoxFrame.
(Assignee)

Comment 45

6 years ago
Breakpoint 5, nsDisplayListBuilder::IsFixedItem (this=0xbe9ca090, aItem=0x49ccc6b0, aActiveScrolledRoot=0xbe9c7e7c, aOverrideActiveScrolledRoot=0x0)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:500
500	{
The program being debugged stopped while in a function called from GDB.
Evaluation of the expression containing the function
(nsDisplayListBuilder::IsFixedItem(nsDisplayItem*, nsIFrame const**, nsIFrame const*)) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb) l
495	
496	bool
497	nsDisplayListBuilder::IsFixedItem(nsDisplayItem *aItem,
498	                                  const nsIFrame** aActiveScrolledRoot,
499	                                  const nsIFrame* aOverrideActiveScrolledRoot)
500	{
501	  const nsIFrame* activeScrolledRoot = aOverrideActiveScrolledRoot;
502	  if (!activeScrolledRoot) {
503	    if (aItem->GetType() == nsDisplayItem::TYPE_SCROLL_LAYER) {
504	      nsDisplayScrollLayer* scrollLayerItem =
(gdb) n
502	  if (!activeScrolledRoot) {
(gdb) l
497	nsDisplayListBuilder::IsFixedItem(nsDisplayItem *aItem,
498	                                  const nsIFrame** aActiveScrolledRoot,
499	                                  const nsIFrame* aOverrideActiveScrolledRoot)
500	{
501	  const nsIFrame* activeScrolledRoot = aOverrideActiveScrolledRoot;
502	  if (!activeScrolledRoot) {
503	    if (aItem->GetType() == nsDisplayItem::TYPE_SCROLL_LAYER) {
504	      nsDisplayScrollLayer* scrollLayerItem =
505	        static_cast<nsDisplayScrollLayer*>(aItem);
506	      activeScrolledRoot =
(gdb) p aItem
$33 = (nsDisplayItem *) 0x49ccc6b0
(gdb) p *aItem
$34 = {<nsDisplayItemLink> = {mAbove = 0x49ccc6e8}, _vptr.nsDisplayItem = 0x4165c420, mFrame = 0x4b7d8578, mReferenceFrame = 0x4b7d8010, 
  mToReferenceFrame = {<mozilla::gfx::BasePoint<int, nsPoint>> = {x = 18720, y = 2783}, <No data fields>}, 
  mVisibleRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 18720, y = 2783, width = 360, height = 7380}, <No data fields>}, mPainted = false}
(gdb) x/a aItem
0x49ccc6b0:	0x4165c420 <_ZTV24nsDisplayBackgroundColor+8>
(gdb) n
503	    if (aItem->GetType() == nsDisplayItem::TYPE_SCROLL_LAYER) {
(gdb) p activeScrolledRoot
$35 = (const struct nsIFrame *) 0x0
(gdb) n
510	      activeScrolledRoot = nsLayoutUtils::GetActiveScrolledRootFor(aItem, this);
(gdb) s
nsLayoutUtils::GetActiveScrolledRootFor (aItem=0x49ccc6b0, aBuilder=0xbe9ca090, aShouldFixToViewport=0x0) at /Users/gal/workspace/B2G/gecko/layout/base/nsLayoutUtils.cpp:954
954	{
(gdb) n
955	  nsIFrame* f = aItem->GetUnderlyingFrame();
(gdb) n
956	  if (aShouldFixToViewport) {
(gdb) p f
$36 = (struct nsIFrame *) 0x4b7d8578
(gdb) p *f
$37 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x4166cc60}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 2783, width = 360, height = 7380}, <No data fields>}, mContent = 0x47cef060, 
  mStyleContext = 0x4b5b0508, mParent = 0x4b7d8478, mNextSibling = 0x0, mPrevSibling = 0x0, mState = 2305860878425128960, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a f
0x4b7d8578:	0x4166cc60 <_ZTV16nsButtonBoxFrame+8>
(gdb) n
960	    return nullptr;
(gdb) l
955	  nsIFrame* f = aItem->GetUnderlyingFrame();
956	  if (aShouldFixToViewport) {
957	    *aShouldFixToViewport = false;
958	  }
959	  if (!f) {
960	    return nullptr;
961	  }
962	  if (aItem->ShouldFixToViewport(aBuilder)) {
963	    if (aShouldFixToViewport) {
964	      *aShouldFixToViewport = true;
(gdb) p f
$38 = (struct nsIFrame *) 0x4b7d8578
(gdb) n
959	  if (!f) {
(gdb) n
962	  if (aItem->ShouldFixToViewport(aBuilder)) {
(gdb) p aItem->ShouldFixToViewport(aBuilder)
$39 = false
(gdb) n
975	    return nsLayoutUtils::GetActiveScrolledRootFor(f, aItem->ReferenceFrame());
(gdb) p aItem->mReferenceFrame
$40 = (const struct nsIFrame *) 0x4b7d8010
(gdb) p *aItem->mReferenceFrame
$41 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x41662ed8}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 0, width = 19200, height = 27600}, <No data fields>}, mContent = 0x4b5c19c0, 
  mStyleContext = 0x4b7ed430, mParent = 0x4b5ae350, mNextSibling = 0x0, mPrevSibling = 0x46895010, mState = 274877972752, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a $40
0x4b7d8010:	0x41662ed8 <_ZTV17nsHTMLScrollFrame+8>
(gdb) s
nsLayoutUtils::GetActiveScrolledRootFor (aFrame=<value optimized out>, aStopAtAncestor=<value optimized out>) at /Users/gal/workspace/B2G/gecko/layout/base/nsLayoutUtils.cpp:934
934	{
(gdb) n
935	  nsIFrame* f = aFrame;
(gdb) n
942	    nsIScrollableFrame* sf = do_QueryFrame(parent);
(gdb) l
937	    if (IsPopup(f))
938	      break;
939	    nsIFrame* parent = GetCrossDocParentFrame(f);
940	    if (!parent)
941	      break;
942	    nsIScrollableFrame* sf = do_QueryFrame(parent);
943	    if (sf && sf->IsScrollingActive() && sf->GetScrolledFrame() == f)
944	      break;
945	    f = parent;
946	  }
(gdb) p f
$42 = (struct nsIFrame *) 0x4b7d8578
(gdb) p *f
$43 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x4166cc60}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 2783, width = 360, height = 7380}, <No data fields>}, mContent = 0x47cef060, 
  mStyleContext = 0x4b5b0508, mParent = 0x4b7d8478, mNextSibling = 0x0, mPrevSibling = 0x0, mState = 2305860878425128960, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a f
0x4b7d8578:	0x4166cc60 <_ZTV16nsButtonBoxFrame+8>
(gdb) n
936	  while (f != aStopAtAncestor) {
(gdb) l
931	nsIFrame*
932	nsLayoutUtils::GetActiveScrolledRootFor(nsIFrame* aFrame,
933	                                        const nsIFrame* aStopAtAncestor)
934	{
935	  nsIFrame* f = aFrame;
936	  while (f != aStopAtAncestor) {
937	    if (IsPopup(f))
938	      break;
939	    nsIFrame* parent = GetCrossDocParentFrame(f);
940	    if (!parent)
(gdb) n
937	    if (IsPopup(f))
(gdb) p f
$44 = (struct nsIFrame *) 0x4b7d8578
(gdb) n
939	    nsIFrame* parent = GetCrossDocParentFrame(f);
(gdb) n
940	    if (!parent)
(gdb) p parent
$45 = (struct nsIFrame *) 0x4b7d8478
(gdb) p *parent
$46 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x4166cf48}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 0, width = 360, height = 27120}, <No data fields>}, mContent = 0x4b520fb0, 
  mStyleContext = 0x4b64c7f8, mParent = 0x4b7d81f0, mNextSibling = 0x4b7d85e8, mPrevSibling = 0x0, mState = 17594341916672, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a parent
0x4b7d8478:	0x4166cf48 <_ZTV13nsSliderFrame+8>
(gdb) l
935	  nsIFrame* f = aFrame;
936	  while (f != aStopAtAncestor) {
937	    if (IsPopup(f))
938	      break;
939	    nsIFrame* parent = GetCrossDocParentFrame(f);
940	    if (!parent)
941	      break;
942	    nsIScrollableFrame* sf = do_QueryFrame(parent);
943	    if (sf && sf->IsScrollingActive() && sf->GetScrolledFrame() == f)
944	      break;
(gdb) n
942	    nsIScrollableFrame* sf = do_QueryFrame(parent);
(gdb) n
943	    if (sf && sf->IsScrollingActive() && sf->GetScrolledFrame() == f)
(gdb) p sf
$47 = (struct nsIScrollableFrame *) 0x0
(gdb) l
938	      break;
939	    nsIFrame* parent = GetCrossDocParentFrame(f);
940	    if (!parent)
941	      break;
942	    nsIScrollableFrame* sf = do_QueryFrame(parent);
943	    if (sf && sf->IsScrollingActive() && sf->GetScrolledFrame() == f)
944	      break;
945	    f = parent;
946	  }
947	  return f;
(gdb) p parent
$48 = (struct nsIFrame *) 0x4b7d8478
(gdb) p *parent
$49 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x4166cf48}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 0, width = 360, height = 27120}, <No data fields>}, mContent = 0x4b520fb0, 
  mStyleContext = 0x4b64c7f8, mParent = 0x4b7d81f0, mNextSibling = 0x4b7d85e8, mPrevSibling = 0x0, mState = 17594341916672, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a parent
0x4b7d8478:	0x4166cf48 <_ZTV13nsSliderFrame+8>
(gdb) n
936	  while (f != aStopAtAncestor) {
(gdb) n
937	    if (IsPopup(f))
(gdb) n
939	    nsIFrame* parent = GetCrossDocParentFrame(f);
(gdb) n
940	    if (!parent)
(gdb) p parent
$50 = (struct nsIFrame *) 0x4b7d81f0
(gdb) p *parent
$51 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x4166c780}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 18720, y = 0, width = 480, height = 27600}, <No data fields>}, mContent = 0x4b520e70, 
  mStyleContext = 0x4b64cd48, mParent = 0x4b7d8010, mNextSibling = 0x4b7d8730, mPrevSibling = 0x0, mState = 17594342440960, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a parent
0x4b7d81f0:	0x4166c780 <_ZTV16nsScrollbarFrame+8>
(gdb) p parent
$52 = (struct nsIFrame *) 0x4b7d81f0
(gdb) n
942	    nsIScrollableFrame* sf = do_QueryFrame(parent);
(gdb) n
943	    if (sf && sf->IsScrollingActive() && sf->GetScrolledFrame() == f)
(gdb) p sf
$53 = (struct nsIScrollableFrame *) 0x0
(gdb) n
936	  while (f != aStopAtAncestor) {
(gdb) n
937	    if (IsPopup(f))
(gdb) n
939	    nsIFrame* parent = GetCrossDocParentFrame(f);
(gdb) p f
$54 = (struct nsIFrame *) 0x4b7d81f0
(gdb) n
940	    if (!parent)
(gdb) p parent
$55 = (struct nsIFrame *) 0x4b7d8010
(gdb) p *parent
$56 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x41662ed8}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 0, width = 19200, height = 27600}, <No data fields>}, mContent = 0x4b5c19c0, 
  mStyleContext = 0x4b7ed430, mParent = 0x4b5ae350, mNextSibling = 0x0, mPrevSibling = 0x46895010, mState = 274877972752, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a parent
0x4b7d8010:	0x41662ed8 <_ZTV17nsHTMLScrollFrame+8>
(gdb) n
942	    nsIScrollableFrame* sf = do_QueryFrame(parent);
(gdb) n
943	    if (sf && sf->IsScrollingActive() && sf->GetScrolledFrame() == f)
(gdb) p sf
$57 = (struct nsIScrollableFrame *) 0x4b7d8054
(gdb) p sf->IsScrollingActive()
$58 = true
(gdb) p sf->GetScrolledFrame()
$59 = (struct nsIFrame *) 0x4b7d8730
(gdb) p f
$60 = (struct nsIFrame *) 0x4b7d81f0
(gdb) l
938	      break;
939	    nsIFrame* parent = GetCrossDocParentFrame(f);
940	    if (!parent)
941	      break;
942	    nsIScrollableFrame* sf = do_QueryFrame(parent);
943	    if (sf && sf->IsScrollingActive() && sf->GetScrolledFrame() == f)
944	      break;
945	    f = parent;
946	  }
947	  return f;
(gdb) n
936	  while (f != aStopAtAncestor) {
(gdb) n
948	}
(gdb) p aStopAtAncestor
$61 = (const struct nsIFrame *) 0x4b7d8010
(gdb) p f
No symbol "f" in current context.
(gdb) l
943	    if (sf && sf->IsScrollingActive() && sf->GetScrolledFrame() == f)
944	      break;
945	    f = parent;
946	  }
947	  return f;
948	}
949	
950	nsIFrame*
951	nsLayoutUtils::GetActiveScrolledRootFor(nsDisplayItem* aItem,
952	                                        nsDisplayListBuilder* aBuilder,
(gdb) p f
No symbol "f" in current context.
(gdb) n
nsLayoutUtils::GetActiveScrolledRootFor (aItem=0x49ccc6b0, aBuilder=0xbe9ca090, aShouldFixToViewport=0x0) at /Users/gal/workspace/B2G/gecko/layout/base/nsLayoutUtils.cpp:977
977	}
(gdb) l
972	    NS_ASSERTION(viewportFrame, "no viewport???");
973	    return nsLayoutUtils::GetActiveScrolledRootFor(viewportFrame, aBuilder->FindReferenceFrameFor(viewportFrame));
974	  } else {
975	    return nsLayoutUtils::GetActiveScrolledRootFor(f, aItem->ReferenceFrame());
976	  }
977	}
978	
979	bool
980	nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(const nsIFrame* aActiveScrolledRoot,
981	                                                                   nsDisplayListBuilder* aBuilder)
(gdb) fin
Run till exit from #0  nsLayoutUtils::GetActiveScrolledRootFor (aItem=0x49ccc6b0, aBuilder=0xbe9ca090, aShouldFixToViewport=0x0)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsLayoutUtils.cpp:977
nsDisplayListBuilder::IsFixedItem (this=0xbe9ca090, aItem=0x49ccc6b0, aActiveScrolledRoot=0xbe9c7e7c, aOverrideActiveScrolledRoot=0x0)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:514
514	  if (aActiveScrolledRoot) {
Value returned is $62 = (struct nsIFrame *) 0x4b7d8010
(gdb) l
509	    } else {
510	      activeScrolledRoot = nsLayoutUtils::GetActiveScrolledRootFor(aItem, this);
511	    }
512	  }
513	
514	  if (aActiveScrolledRoot) {
515	    *aActiveScrolledRoot = activeScrolledRoot;
516	  }
517	
518	  return activeScrolledRoot &&
(gdb) p activeScrolledRoot
$63 = (const struct nsIFrame *) 0x4b7d8010
(gdb) p *activeScrolledRoot
$64 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x41662ed8}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 0, width = 19200, height = 27600}, <No data fields>}, mContent = 0x4b5c19c0, 
  mStyleContext = 0x4b7ed430, mParent = 0x4b5ae350, mNextSibling = 0x0, mPrevSibling = 0x46895010, mState = 274877972752, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a activeScrolledRoot
0x4b7d8010:	0x41662ed8 <_ZTV17nsHTMLScrollFrame+8>
(gdb) n
515	    *aActiveScrolledRoot = activeScrolledRoot;
(gdb) l
510	      activeScrolledRoot = nsLayoutUtils::GetActiveScrolledRootFor(aItem, this);
511	    }
512	  }
513	
514	  if (aActiveScrolledRoot) {
515	    *aActiveScrolledRoot = activeScrolledRoot;
516	  }
517	
518	  return activeScrolledRoot &&
519	    !nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(activeScrolledRoot, this);
(gdb) l
520	}
521	
522	static bool ForceVisiblityForFixedItem(nsDisplayListBuilder* aBuilder,
523	                                       nsDisplayItem* aItem)
524	{
525	  return aBuilder->GetDisplayPort() && aBuilder->GetHasFixedItems() &&
526	         aBuilder->IsFixedItem(aItem);
527	}
528	
529	void nsDisplayListBuilder::SetDisplayPort(const nsRect& aDisplayPort)
(gdb) p activeScrolledRoot
$65 = (const struct nsIFrame *) 0x4b7d8010
(gdb) p nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(activeScrolledRoot, this)
Couldn't find method nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling
(gdb) p this
$66 = (nsDisplayListBuilder * const) 0xbe9ca090
(gdb) p IsScrolledByRootContentDocumentDisplayportScrolling(activeScrolledRoot, this)
No symbol "IsScrolledByRootContentDocumentDisplayportScrolling" in current context.
(gdb) s
519	    !nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(activeScrolledRoot, this);
(gdb) s
nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling (aActiveScrolledRoot=0x4b7d8010, aBuilder=0xbe9ca090)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsLayoutUtils.cpp:984
984	          GetToplevelContentDocumentPresContext();
(gdb) l
979	bool
980	nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(const nsIFrame* aActiveScrolledRoot,
981	                                                                   nsDisplayListBuilder* aBuilder)
982	{
983	  nsPresContext* presContext = aActiveScrolledRoot->PresContext()->
984	          GetToplevelContentDocumentPresContext();
985	  if (!presContext)
986	    return false;
987	
988	  nsIFrame* rootScrollFrame = presContext->GetPresShell()->GetRootScrollFrame();
(gdb) n
982	{
(gdb) p presContext
No symbol "presContext" in current context.
(gdb) n
984	          GetToplevelContentDocumentPresContext();
(gdb) n
985	  if (!presContext)
(gdb) p presContext
$67 = <value optimized out>
(gdb) n
988	  nsIFrame* rootScrollFrame = presContext->GetPresShell()->GetRootScrollFrame();
(gdb) n
989	  if (!rootScrollFrame || !nsLayoutUtils::GetDisplayPort(rootScrollFrame->GetContent(), nullptr))
(gdb) p rootScrollFrame
$68 = (struct nsIFrame *) 0x4803cb70
(gdb) p *rootScrollFrame
$69 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x41662ed8}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 0, width = 19200, height = 28800}, <No data fields>}, mContent = 0x480a3ca0, 
  mStyleContext = 0x486c3098, mParent = 0x4803c298, mNextSibling = 0x0, mPrevSibling = 0x0, mState = 262160, mOverflow = {mType = 0, mVisualDeltas = {mLeft = 0 '\000', 
      mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a rootScrollFrame
0x4803cb70:	0x41662ed8 <_ZTV17nsHTMLScrollFrame+8>
(gdb) p nsLayoutUtils::GetDisplayPort(rootScrollFrame->GetContent(), nullptr)
No symbol "nullptr" in current context.
(gdb) p nsLayoutUtils::GetDisplayPort(rootScrollFrame->GetContent(), 0)
Cannot evaluate function -- may be inlined
(gdb) l
984	          GetToplevelContentDocumentPresContext();
985	  if (!presContext)
986	    return false;
987	
988	  nsIFrame* rootScrollFrame = presContext->GetPresShell()->GetRootScrollFrame();
989	  if (!rootScrollFrame || !nsLayoutUtils::GetDisplayPort(rootScrollFrame->GetContent(), nullptr))
990	    return false;
991	  return nsLayoutUtils::IsAncestorFrameCrossDoc(rootScrollFrame, aActiveScrolledRoot);
992	}
993	
(gdb) l
994	// static
995	nsIScrollableFrame*
996	nsLayoutUtils::GetNearestScrollableFrameForDirection(nsIFrame* aFrame,
997	                                                     Direction aDirection)
998	{
999	  NS_ASSERTION(aFrame, "GetNearestScrollableFrameForDirection expects a non-null frame");
1000	  for (nsIFrame* f = aFrame; f; f = nsLayoutUtils::GetCrossDocParentFrame(f)) {
1001	    nsIScrollableFrame* scrollableFrame = do_QueryFrame(f);
1002	    if (scrollableFrame) {
1003	      nsPresContext::ScrollbarStyles ss = scrollableFrame->GetScrollbarStyles();
(gdb) l -50
949	
950	nsIFrame*
951	nsLayoutUtils::GetActiveScrolledRootFor(nsDisplayItem* aItem,
952	                                        nsDisplayListBuilder* aBuilder,
953	                                        bool* aShouldFixToViewport)
954	{
955	  nsIFrame* f = aItem->GetUnderlyingFrame();
956	  if (aShouldFixToViewport) {
957	    *aShouldFixToViewport = false;
958	  }
(gdb) 
959	  if (!f) {
960	    return nullptr;
961	  }
962	  if (aItem->ShouldFixToViewport(aBuilder)) {
963	    if (aShouldFixToViewport) {
964	      *aShouldFixToViewport = true;
965	    }
966	    // Make its active scrolled root be the active scrolled root of
967	    // the enclosing viewport, since it shouldn't be scrolled by scrolled
968	    // frames in its document. InvalidateFixedBackgroundFramesFromList in
(gdb) 
969	    // nsGfxScrollFrame will not repaint this item when scrolling occurs.
970	    nsIFrame* viewportFrame =
971	      nsLayoutUtils::GetClosestFrameOfType(f, nsGkAtoms::viewportFrame);
972	    NS_ASSERTION(viewportFrame, "no viewport???");
973	    return nsLayoutUtils::GetActiveScrolledRootFor(viewportFrame, aBuilder->FindReferenceFrameFor(viewportFrame));
974	  } else {
975	    return nsLayoutUtils::GetActiveScrolledRootFor(f, aItem->ReferenceFrame());
976	  }
977	}
978	
(gdb) 
979	bool
980	nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(const nsIFrame* aActiveScrolledRoot,
981	                                                                   nsDisplayListBuilder* aBuilder)
982	{
983	  nsPresContext* presContext = aActiveScrolledRoot->PresContext()->
984	          GetToplevelContentDocumentPresContext();
985	  if (!presContext)
986	    return false;
987	
988	  nsIFrame* rootScrollFrame = presContext->GetPresShell()->GetRootScrollFrame();
(gdb) 
989	  if (!rootScrollFrame || !nsLayoutUtils::GetDisplayPort(rootScrollFrame->GetContent(), nullptr))
990	    return false;
991	  return nsLayoutUtils::IsAncestorFrameCrossDoc(rootScrollFrame, aActiveScrolledRoot);
992	}
993	
994	// static
995	nsIScrollableFrame*
996	nsLayoutUtils::GetNearestScrollableFrameForDirection(nsIFrame* aFrame,
997	                                                     Direction aDirection)
998	{
(gdb) n
986	    return false;

Executive summary:

nsDisplayListBuilder::IsFixedItem(nsDisplayItem *aItem,
                                  const nsIFrame** aActiveScrolledRoot,
                                  const nsIFrame* aOverrideActiveScrolledRoot)

returns true because

  return activeScrolledRoot &&
!nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(activeScrolledRoot, this);

says we aren't scrolling via the displayport.
(Assignee)

Comment 46

6 years ago
mattwoodrow had this figured out in 20 minutes flat:

gal: mattwoodrow: take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=803910
[9:27pm] mattwoodrow: gal: sure!
[9:28pm] karl left the chat room. (Ping timeout)
[9:28pm] firebot: Bug 803910 nor, P1, ---, joe, ASSI, [OMTC] Scrolling border-radius content into view can draw background elements on top
[9:28pm] gal: its long so I will summarize
[9:28pm] gal: check comment 43
[9:28pm] gal: we keep invalidating because shift is 0, because we think isFixedItem
[9:28pm] gal: the underlying frame is not position:fixed in the CSS sense
[9:29pm] gal: (I assume thats what isFixedItem means here)
[9:29pm] gal: the tail end of comment 45 explains why IsFixedItem says true
[9:29pm] gal:   return activeScrolledRoot &&
[9:29pm] gal: !nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(activeScrolledRoot, this); is false
[9:30pm] gal: am I totally on crack, or are you following?
[9:30pm] mattwoodrow: no, that makes sense so far
[9:31pm] gal: this is a span following an option element in an iframe that we scroll via top from chrome and some sync touch scroll magic
[9:31pm] gal: ok, I can't believe this makes sense, because I am looking at all of this for the first time in my life
[9:31pm] gal: so, is IsFixedItem supposed to say true here?
[9:32pm] mattwoodrow: no, it shouldn't
[9:32pm] gal: ok
[9:32pm] gal: I think the bug is at end of comment 45 then
[9:32pm] gal:   return activeScrolledRoot &&
[9:32pm] gal: !nsLayoutUtils::IsScrolledByRootContentDocumentDisplayportScrolling(activeScrolledRoot, this);
[9:32pm] gal: that doesn't mean fixed
[9:32pm] gal: it just means its not the displayport thats doing the scrolling
[9:33pm] mattwoodrow: oh, is it just the iframe that's scrolling?
[9:33pm] gal: yeah
[9:33pm] mattwoodrow: is everything within the iframe invalidating then?
[9:33pm] gal: no
[9:34pm] gal: for some fucked up reason on a single weird background of a span right of an option/checkbox is
[9:34pm] gal: nsDisplayBackgroundColor
[9:34pm] gal: that thing invalidates
[9:34pm] nrc is now known as nrc|away.
[9:34pm] gal: because we think its IsFixedElement
[9:35pm] gal: the whole parent frame chain is in comment 45
[9:35pm] mattwoodrow: what about the other items within the iframe? Are they returning false for IsFixedItem?
[9:35pm] gal: I didn't check that, I can try to find out
[9:35pm] gal: my best guess is they are IsFixedItem too
[9:35pm] gal: but it doesn't have the same effect on mBounds
[9:35pm] gal: so we don't actually ever ask the question
[9:35pm] gal: or wait, no, we do call it
[9:36pm] gal: it just doesn't affect mBounds the same way
[9:36pm] gal: this is the only invalidation call I am seeing
[9:37pm] mattwoodrow: can you get a dump of the display list please (gfxUtils::sDumpPaintList = 1)
[9:37pm] mattwoodrow: I can't see why IsFixedItem would be different for the items, and if shift == 0, then all items should be invalidating, not only the one
[9:37pm] gal: ok, taking a deep breath
[9:38pm] gal: I having been messing with the state for a while with various calls and rets
[9:38pm] gal: weeeee
[9:38pm] gal: can I set sDumpPaintList from gdb?
[9:38pm] mattwoodrow: yes
[9:39pm] mattwoodrow: but I wouldn't recommend doing it within painting
[9:39pm] gal: I am way past safe operational margins
[9:39pm] mattwoodrow: setting it inside nsLayoutUtils::PaintFrame will crash
[9:40pm] gal: actually I printed it earlier
[9:40pm] gal: comment 35
[9:41pm] gal: can you take a look whether thats enough?
[9:42pm] mattwoodrow: ah
[9:44pm] gal: I will try to capture a full dump in the meantime
[9:44pm] mattwoodrow: so nsDisplayBackgroundColor there always appears to be at 0,0 (which makes sense, since it's relative to the nsDisplayTransform)
[9:44pm] mattwoodrow: wait, this is only happening this rounded clips did you say?
[9:44pm] gal: yeah
[9:44pm] gal: no border radius makes it go away
[9:44pm] mattwoodrow: ah!
[9:44pm] mattwoodrow: ok, I know this one then 
[9:45pm] gal: !!!
[9:45pm] gal: please do share, because I am dying to know 
[9:45pm] mattwoodrow: so it's not actually the item thats being detected as moving, it's the clip that is 'moving'
[9:45pm] mattwoodrow: and the clip we cache/compare is a clip stack of all the clips up
[9:45pm] mattwoodrow: some of which are above the scrolling frame, and some below
[9:46pm] mattwoodrow: thus, any attempt to shift the combined clip by an offset is incorrect
[9:46pm] mattwoodrow: since we really only want to shift some components of the stack
[9:46pm] gal: actually, I know what you mean, which is scary
[9:46pm] cabanier: bas: ping
[9:46pm] Bas: cabanier: pong
[9:46pm] mattwoodrow: rounded clipping makes it worse since instead of only invalidating the Xor, we give up and invalidate the Or
[9:47pm] cabanier: bas: thanks for the review.
[9:47pm] Bas: No problem! 
[9:47pm] mattwoodrow: (that's in AddOffsetAndComputeDifference)
[9:47pm] cabanier: Bas: should I fix those last issues and resubmit?
[9:47pm] gal: why do we care at all about the rounded clip for invalidation?
[9:47pm] gal: we could just go with the outer box
[9:47pm] cabanier: Bas: and have you review it again?
[9:47pm] Bas: cabanier: That would make it easiest when one of us lands, but you can put the r+ in yourself and just say you carried it from my previous r+.
[9:48pm] cabanier: Bas: OK!
[9:48pm] mattwoodrow: gal: That would probably reduce the impact, yeah
[9:48pm] mattwoodrow: try this for now though: http://pastebin.mozilla.org/1947187
[9:48pm] gal: checking
[9:48pm] gal: I can very easily test for you  if you have several ideas
(Assignee)

Comment 47

6 years ago
Patch didn't help.
(Assignee)

Comment 48

6 years ago
Caught again in gdb for mattwoodrow:

(gdb) bt
#0  nsDisplayItem::ComputeInvalidationRegion (this=0x48592810, aBuilder=0xbec12090, aGeometry=0x4723a5b0, aInvalidRegion=0xbec0fa58)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:1420
#1  0x40852ba8 in InvalidateForLayerChange (this=0xbec0ff7c, aItem=<value optimized out>, aNewLayer=<value optimized out>, aClip=..., aTopLeft=..., aGeometry=0x4723a460)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2287
#2  0x40855f28 in ProcessDisplayItems (this=0xbec0ff7c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2163
#3  0x408567c2 in mozilla::FrameLayerBuilder::BuildContainerLayerFor (this=<value optimized out>, aBuilder=<value optimized out>, aManager=<value optimized out>, 
    aContainerFrame=0x4725e010, aContainerItem=0x48592940, aChildren=..., aParameters=..., aTransform=0x485929c8)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2867
#4  0x40874be6 in nsDisplayTransform::BuildLayer (this=0x48592940, aBuilder=0xbec12090, aManager=0x44d6d190, aContainerParameters=...)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:3863
#5  0x40855fb6 in ProcessDisplayItems (this=0xbec1114c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2081
#6  0x408552e6 in ProcessDisplayItems (this=0xbec1114c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2011
#7  0x408552e6 in ProcessDisplayItems (this=0xbec1114c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2011
#8  0x408552e6 in ProcessDisplayItems (this=0xbec1114c, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2011
#9  0x408567c2 in mozilla::FrameLayerBuilder::BuildContainerLayerFor (this=<value optimized out>, aBuilder=<value optimized out>, aManager=<value optimized out>, 
    aContainerFrame=0x47e50298, aContainerItem=0x4264bf70, aChildren=..., aParameters=..., aTransform=0x0)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2867
#10 0x40874cce in nsDisplayOwnLayer::BuildLayer (this=0x4264bf70, aBuilder=0xbec12090, aManager=0x44d6d190, aContainerParameters=...)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:2796
#11 0x40855fb6 in ProcessDisplayItems (this=0xbec11c14, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2081
#12 0x408552e6 in ProcessDisplayItems (this=0xbec11c14, aList=<value optimized out>, aClip=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2011
#13 0x408567c2 in mozilla::FrameLayerBuilder::BuildContainerLayerFor (this=<value optimized out>, aBuilder=<value optimized out>, aManager=<value optimized out>, 
    aContainerFrame=0x4710d298, aContainerItem=0x0, aChildren=..., aParameters=..., aTransform=0x0) at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:2867
#14 0x4087487c in nsDisplayList::PaintForFrame (this=<value optimized out>, aBuilder=0xbec12090, aCtx=0x0, aForFrame=0x4710d298, aFlags=13)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:1072
#15 0x40874b74 in nsDisplayList::PaintRoot (this=0xbec12418, aBuilder=0xbec12090, aCtx=0x0, aFlags=13) at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:992
#16 0x408836d8 in nsLayoutUtils::PaintFrame (aRenderingContext=<value optimized out>, aFrame=0x4710d298, aDirtyRegion=<value optimized out>, aBackstop=<value optimized out>, 
    aFlags=772) at /Users/gal/workspace/B2G/gecko/layout/base/nsLayoutUtils.cpp:1857
#17 0x4088fa18 in PresShell::Paint (this=0x47109200, aViewToPaint=<value optimized out>, aDirtyRegion=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsPresShell.cpp:5329
#18 0x40aa42c4 in nsViewManager::ProcessPendingUpdatesForView (this=0x459dd370, aView=0x46c6ce80, aFlushDirtyRegion=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/view/src/nsViewManager.cpp:435
#19 0x40aa4366 in nsViewManager::ProcessPendingUpdates (this=<value optimized out>) at /Users/gal/workspace/B2G/gecko/view/src/nsViewManager.cpp:1210
#20 0x4089330c in nsRefreshDriver::Notify (this=0x427fe1d0, aTimer=<value optimized out>) at /Users/gal/workspace/B2G/gecko/layout/base/nsRefreshDriver.cpp:432
#21 0x40f2c334 in nsTimerImpl::Fire (this=0x4723afa0) at /Users/gal/workspace/B2G/gecko/xpcom/threads/nsTimerImpl.cpp:485
#22 0x40f2c3e2 in nsTimerEvent::Run (this=<value optimized out>) at /Users/gal/workspace/B2G/gecko/xpcom/threads/nsTimerImpl.cpp:565
#23 0x40f2a51a in nsThread::ProcessNextEvent (this=0x404078e0, mayWait=<value optimized out>, result=0xbec12837) at /Users/gal/workspace/B2G/gecko/xpcom/threads/nsThread.cpp:627
#24 0x40f0a7be in NS_ProcessNextEvent_P (thread=0xbec0fa58, mayWait=false) at /Users/gal/workspace/B2G/objdir-gecko/xpcom/build/nsThreadUtils.cpp:221
#25 0x40e33bec in mozilla::ipc::MessagePump::Run (this=0x40403400, aDelegate=0x4040f0c0) at /Users/gal/workspace/B2G/gecko/ipc/glue/MessagePump.cpp:82
#26 0x40f4c258 in MessageLoop::RunInternal (this=0x1000000) at /Users/gal/workspace/B2G/gecko/ipc/chromium/src/base/message_loop.cc:215
#27 0x40f4c30e in MessageLoop::RunHandler (this=0x4040f0c0) at /Users/gal/workspace/B2G/gecko/ipc/chromium/src/base/message_loop.cc:208
---Type <return> to continue, or q <return> to quit---
#28 MessageLoop::Run (this=0x4040f0c0) at /Users/gal/workspace/B2G/gecko/ipc/chromium/src/base/message_loop.cc:182
#29 0x40dbf194 in nsBaseAppShell::Run (this=0x42619760) at /Users/gal/workspace/B2G/gecko/widget/xpwidgets/nsBaseAppShell.cpp:163
#30 0x40d24b8c in nsAppStartup::Run (this=0x426328e0) at /Users/gal/workspace/B2G/gecko/toolkit/components/startup/nsAppStartup.cpp:290
#31 0x40775f0c in XREMain::XRE_mainRun (this=0xbec129d4) at /Users/gal/workspace/B2G/gecko/toolkit/xre/nsAppRunner.cpp:3823
#32 0x40778010 in XREMain::XRE_main (this=0xbec129d4, argc=<value optimized out>, argv=0xbec14bb4, aAppData=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/toolkit/xre/nsAppRunner.cpp:3890
#33 0x40778154 in XRE_main (argc=1, argv=0xbec14bb4, aAppData=0xa9a4, aFlags=<value optimized out>) at /Users/gal/workspace/B2G/gecko/toolkit/xre/nsAppRunner.cpp:4084
#34 0x0000898a in do_main (argc=1, argv=0xbec14bb4) at /Users/gal/workspace/B2G/gecko/b2g/app/nsBrowserApp.cpp:154
#35 main (argc=1, argv=0xbec14bb4) at /Users/gal/workspace/B2G/gecko/b2g/app/nsBrowserApp.cpp:239
(gdb)
(Assignee)

Comment 49

6 years ago
(gdb) p aClip
$1 = (mozilla::FrameLayerBuilder::Clip &) @0xbec10158: {mClipRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 0, width = 0, 
      height = 0}, <No data fields>}, mRoundedClipRects = warning: can't find linker symbol for virtual table for `nsTArray<mozilla::FrameLayerBuilder::Clip::RoundedRect, nsTArrayDefaultAllocator>' value
warning:   found `EmptyEnumeratorImpl::kInstance' instead
{<nsTArray_base<nsTArrayDefaultAllocator>> = {
      mHdr = 0x417b9b94}, <nsTArray_SafeElementAtHelper<mozilla::FrameLayerBuilder::Clip::RoundedRect, nsTArray<mozilla::FrameLayerBuilder::Clip::RoundedRect, nsTArrayDefaultAllocator> >> = {<No data fields>}, <No data fields>}, mHaveClipRect = false}
(Assignee)

Comment 50

6 years ago
(gdb) p *oldGeometry
$7 = {_vptr.nsDisplayItemGeometry = 0x41673a20, mBounds = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 18720, y = 1523, width = 360, 
      height = 7380}, <No data fields>}}
(gdb) p *aGeometry
$8 = {_vptr.nsDisplayItemGeometry = 0x41673a20, mBounds = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 18720, y = 1803, width = 360, 
      height = 7380}, <No data fields>}}
(gdb) p oldClip
$9 = (mozilla::FrameLayerBuilder::Clip *) 0x484b48f8
(gdb) p *oldClip
$10 = {mClipRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 0, width = 0, height = 0}, <No data fields>}, mRoundedClipRects = warning: can't find linker symbol for virtual table for `nsTArray<mozilla::FrameLayerBuilder::Clip::RoundedRect, nsTArrayDefaultAllocator>' value
warning:   found `EmptyEnumeratorImpl::kInstance' instead

{<nsTArray_base<nsTArrayDefaultAllocator>> = {
      mHdr = 0x417b9b94}, <nsTArray_SafeElementAtHelper<mozilla::FrameLayerBuilder::Clip::RoundedRect, nsTArray<mozilla::FrameLayerBuilder::Clip::RoundedRect, nsTArrayDefaultAllocator> >> = {<No data fields>}, <No data fields>}, mHaveClipRect = false}
(gdb)
(Assignee)

Comment 51

6 years ago
Painting --- before optimization (dirty 0,0,19200,28800):
  SolidColor 0x4710d298() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  BackgroundColor 0x4710d7c0() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  Background 0x4710d7c0() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  BackgroundColor 0x4710d9d0() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  Background 0x4710d9d0() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  Clip 0x4710e938() (0,0,19200,28800)(0,0,0,0)(0,-60,19200,28860)
    OwnLayer 0x47e50298() (0,0,19200,28800)(0,0,0,0)(0,-60,19200,28860) layer=0x49a67c00
      Clip 0x0() (0,0,19200,28800)(0,0,0,0)(0,0,0,0)
        CanvasBackground 0x47e50998() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
      Clip 0x47ba65e8() (0,0,19200,28800)(0,0,0,0)(0,0,0,0)
        WrapList 0x47ba65e8() (0,0,19200,28800)(0,0,0,0)(0,0,0,0)
          BackgroundColor 0x47ba65e8() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
          Background 0x47ba65e8() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) layer=0x49a68000
      Clip 0x49c09d18() (0,0,19200,28800)(0,0,0,0)(144,1620,18696,10920)
        WrapList 0x49c09d18() (0,1200,19200,27600)(0,0,0,0)(144,1620,18696,10920)
          Clip 0x49c09d18() (0,1200,19200,27600)(0,0,0,0)(144,1620,18696,10920)
            Clip 0x0() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0)
              CanvasBackground 0x4af93378() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
            Clip 0x49cbafd8() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0)
              WrapList 0x49cbafd8() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0)
                Opacity 0x49cbafd8() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0) layer=0x49a68000
                  BackgroundColor 0x49cbafd8() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x4721faa0
                  Background 0x49cbafd8() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x4721faa0
            Clip 0x49cbb508() (0,1200,19200,27600)(0,0,0,0)(144,1620,18696,10920)
              WrapList 0x49cbb508() (144,1620,18696,10920)(0,0,0,0)(144,1620,18696,10920)
                WrapList 0x4ad2b2c8() (144,1620,18696,10920)(0,0,0,0)(144,1620,18696,10920)
                  nsDisplayTransform 0x4ad2b2c8() (144,1620,18696,10920)(0,0,0,0)(144,1620,18696,10920) layer=0x49a68000
                    WrapList 0x498da2d0() (360,420,4080,4080)(0,0,0,0)(0,0,0,0)
                      Image 0x498da910() (360,420,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
                    WrapList 0x498da980() (810,4680,3300,960)(0,0,0,0)(810,4440,3300,1620)
                      Clip 0x0() (144,4680,4512,960)(0,0,0,0)(810,4440,3300,1620)
                        Text 0x498dad40() (810,4440,3300,1620)(0,0,0,0)(810,4440,3300,1620) layer=0x4721fc80
                    WrapList 0x498dae18() (5160,420,4080,4080)(0,0,0,0)(0,0,0,0)
                      Image 0x498db010() (5160,420,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
                    WrapList 0x498db080() (5700,4680,3120,960)(0,0,0,0)(5700,4440,3120,1620)
                      Clip 0x0() (4944,4680,4512,960)(0,0,0,0)(5700,4440,3120,1620)
                        Text 0x498db200() (5700,4440,3120,1620)(0,0,0,0)(5700,4440,3120,1620) layer=0x4721fc80
                    WrapList 0x498db308() (9960,420,4080,4080)(0,0,0,0)(0,0,0,0)
                      Image 0x498db4c8() (9960,420,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
                    WrapList 0x498db538() (10140,4680,3840,960)(0,0,0,0)(10140,4440,3840,1620)
                      Clip 0x0() (9744,4680,4512,960)(0,0,0,0)(10140,4440,3840,1620)
                        Text 0x498db6b8() (10140,4440,3840,1620)(0,0,0,0)(10140,4440,3840,1620) layer=0x4721fc80
                    WrapList 0x498db810() (14760,420,4080,4080)(0,0,0,0)(0,0,0,0)
                      Image 0x498db9c0() (14760,420,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
                    WrapList 0x498dba30() (15090,4680,3540,960)(0,0,0,0)(15090,4440,3540,1620)
                      Clip 0x0() (14544,4680,4512,960)(0,0,0,0)(15090,4440,3540,1620)
                        Text 0x498dbbb0() (15090,4440,3540,1620)(0,0,0,0)(15090,4440,3540,1620) layer=0x4721fc80
                    WrapList 0x498dbcd0() (360,6120,4080,4080)(0,0,0,0)(0,0,0,0)
                      Image 0x498dbe80() (360,6120,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
                    WrapList 0x498dbef0() (144,10380,4512,960)(0,0,0,0)(-30,10140,4980,1620)
                      Clip 0x0() (144,10380,4512,960)(0,0,0,0)(-30,10140,4980,1620)
                        Text 0x498dc0b8() (-30,10140,4980,1620)(0,0,0,0)(-30,10140,4980,1620) layer=0x4721fc80
                    WrapList 0x498dc1c0() (5160,6120,4080,4080)(0,0,0,0)(0,0,0,0)
                      Image 0x498dc370() (5160,6120,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
                    WrapList 0x44d8b010() (6030,10380,2460,960)(0,0,0,0)(6030,10140,2460,1620)
                      Clip 0x0() (4944,10380,4512,960)(0,0,0,0)(6030,10140,2460,1620)
                        Text 0x44d8b190() (6030,10140,2460,1620)(0,0,0,0)(6030,10140,2460,1620) layer=0x4721fc80
            Clip 0x49cbb100() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0)
              WrapList 0x49cbb100() (6397,1200,3200,180)(0,0,0,0)(0,0,0,0)
                WrapList 0x49cbb428() (6397,1200,3200,180)(0,0,0,0)(0,0,0,0)
                  nsDisplayTransform 0x49cbb428() (6397,1200,3200,180)(0,0,0,0)(0,0,0,0) layer=0x49a68000
                    BackgroundColor 0x49cbb428() (0,0,3199,180)(0,0,0,0)(0,0,0,0) uniform layer=0x47220f40
                    Background 0x49cbb428() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x47220f40
            Clip 0x49cbb890() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0)
              WrapList 0x49cbb890() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0)
                BackgroundColor 0x49cbb890() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
                Background 0x49cbb890() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0) layer=0x49a68000
                Clip 0x4afb5fc8() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0)
                  WrapList 0x4afb5fc8() (150,24450,4080,4080)(0,0,0,0)(0,0,0,0)
                    Image 0x4afb6530() (150,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
                Clip 0x4afb66e0() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0)
                  WrapList 0x4afb66e0() (4530,24450,4080,4080)(0,0,0,0)(0,0,0,0)
                    Image 0x4afb6858() (4530,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
                Clip 0x4afb6920() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0)
                  WrapList 0x4afb6920() (8910,24450,4080,4080)(0,0,0,0)(0,0,0,0)
                    Image 0x4afb6a98() (8910,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
                Clip 0x4afb6b68() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0)
                  WrapList 0x4afb6b68() (13290,24450,4080,4080)(0,0,0,0)(0,0,0,0)
                    Image 0x4afb6ce0() (13290,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
                Clip 0x4afb6db0() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0)
                  WrapList 0x4afb6db0() (17670,24450,4080,4080)(0,0,0,0)(0,0,0,0)
                    Image 0x4afb6f28() (17670,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
      Clip 0x498c5c10() (0,0,19200,28800)(0,0,0,0)(0,1200,19200,27600)
        WrapList 0x498c5c10() (0,1200,19200,27600)(0,0,0,0)(0,1200,19200,27600)
          BackgroundColor 0x498c5c10() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
          Background 0x498c5c10() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
          Clip 0x498c5c10() (0,1200,19200,27600)(0,0,0,0)(0,1200,19200,27600)
            Clip 0x0() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0)
              CanvasBackground 0x4854a350() (0,1200,38400,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
            Clip 0x4725e010() (0,1200,19200,27600)(0,0,0,0)(0,1200,19200,27600)
              WrapList 0x4725e010() (0,1200,19200,27600)(0,0,0,0)(0,1200,19200,27600)
                nsDisplayTransform 0x4725e010() (0,1200,19200,27600)(0,0,0,0)(0,1200,19200,27600) layer=0x437b9000
                  BackgroundColor 0x4725e010() (0,0,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b7000
                  Background 0x4725e010() (0,0,19200,27600)(0,0,0,0)(0,0,0,0) layer=0x437b7000
                  Clip 0x427b37a8() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
                    Clip 0x427b37a8() (0,-300,19200,21960)(0,0,0,0)(0,0,0,0)
                      Clip 0x427b37a8() (0,-300,19200,3600)(0,0,0,0)(0,0,0,0)
                        ClipRoundedRect 0x427b37a8() (14700,900,3240,1320)(0,0,0,0)(0,0,0,0)
                          WrapList 0x427b37a8() (14700,900,3240,1320)(0,0,0,0)(0,0,0,0)
                            nsDisplayTransform 0x427b37a8() (14700,900,3240,1320)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                              BackgroundColor 0x427b37a8() (0,0,3240,1320)(0,0,0,0)(0,0,0,0) uniform layer=0x47221300
                              Background 0x427b37a8() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x47221300
                  Clip 0x427b4540() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
                    Clip 0x427b4540() (0,-300,19200,21960)(0,0,0,0)(0,0,0,0)
                      Clip 0x427b4540() (0,3360,19200,3600)(0,0,0,0)(0,0,0,0)
                        ClipRoundedRect 0x427b4540() (14700,4560,3240,1320)(0,0,0,0)(0,0,0,0)
                          WrapList 0x427b4540() (14700,4560,3240,1320)(0,0,0,0)(0,0,0,0)
                            nsDisplayTransform 0x427b4540() (14700,4560,3240,1320)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                              BackgroundColor 0x427b4540() (0,0,3240,1320)(0,0,0,0)(0,0,0,0) uniform layer=0x472223e0
                              Background 0x427b4540() (300,60,780,1200)(0,0,0,0)(0,0,0,0) layer=0x472223e0
                  Clip 0x0() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
                    BackgroundColor 0x47ed0190() (0,21660,19200,1620)(0,0,0,0)(0,0,0,0) uniform layer=0x437b9400
                    Background 0x47ed0190() (0,21660,19200,1560)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                    Border 0x47ed0190() (0,21660,19200,1620)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                  Clip 0x0() (0,0,19200,27600)(0,0,0,0)(1740,21900,6060,1080)
                    Text 0x4855a400() (1740,21900,6060,1080)(0,0,0,0)(1740,21900,6060,1080) layer=0x437b9400
                  Clip 0x47260ae0() (0,0,19200,27600)(0,0,0,0)(3240,720,7320,1560)
                    Clip 0x47260ae0() (0,-300,19200,21960)(0,0,0,0)(3240,720,7320,1560)
                      WrapList 0x47260ae0() (0,-300,19200,3660)(0,0,0,0)(3240,720,7320,1560)
                        Border 0x47260ae0() (0,-300,19200,3660)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x427b3af8() (0,-300,19200,3600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b9400
                        Background 0x427b3af8() (840,600,1800,1800)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        Clip 0x0() (0,-300,19200,3600)(0,0,0,0)(3240,720,7320,1560)
                          Text 0x48565550() (3240,720,7320,1560)(0,0,0,0)(3240,720,7320,1560) layer=0x437b9400
                  Clip 0x47261e70() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
                    Clip 0x47261e70() (0,-300,19200,21960)(0,0,0,0)(0,0,0,0)
                      Clip 0x47261e70() (0,-300,19200,3600)(0,0,0,0)(0,0,0,0)
                        WrapList 0x47261e70() (14640,840,3360,1440)(0,0,0,0)(0,0,0,0)
                          BackgroundColor 0x47261e70() (14640,840,3360,1440)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                          Background 0x47261e70() (14640,840,1380,1440)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                          Border 0x47261e70() (14640,840,3360,1440)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                  Clip 0x427b4100() (0,0,19200,27600)(0,0,0,0)(3240,4380,2040,1560)
                    Clip 0x427b4100() (0,-300,19200,21960)(0,0,0,0)(3240,4380,2040,1560)
                      WrapList 0x427b4100() (0,3360,19200,3660)(0,0,0,0)(3240,4380,2040,1560)
                        Border 0x427b4100() (0,3360,19200,3660)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x427b4948() (0,3360,19200,3600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b9400
                        Background 0x427b4948() (840,4260,1800,1800)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        Clip 0x0() (0,3360,19200,3600)(0,0,0,0)(3240,4380,2040,1560)
                          Text 0x485652b0() (3240,4380,2040,1560)(0,0,0,0)(3240,4380,2040,1560) layer=0x437b9400
                  Clip 0x427b4408() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
                    Clip 0x427b4408() (0,-300,19200,21960)(0,0,0,0)(0,0,0,0)
                      Clip 0x427b4408() (0,3360,19200,3600)(0,0,0,0)(0,0,0,0)
                        WrapList 0x427b4408() (14640,4500,3360,1440)(0,0,0,0)(0,0,0,0)
                          BackgroundColor 0x427b4408() (14640,4500,3360,1440)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                          Background 0x427b4408() (16620,4500,1380,1440)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                          Border 0x427b4408() (14640,4500,3360,1440)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                  Clip 0x427b4d58() (0,0,19200,27600)(0,0,0,0)(3240,7560,2580,1560)
                    Clip 0x427b4d58() (0,-300,19200,21960)(0,0,0,0)(3240,7560,2580,1560)
                      WrapList 0x427b4d58() (0,7020,19200,3660)(0,0,0,0)(3240,7560,2580,1560)
                        Border 0x427b4d58() (0,7020,19200,3660)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x427b9600() (0,7020,19200,3600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b9400
                        Background 0x427b9600() (840,7920,1800,1800)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        Clip 0x0() (0,7020,19200,3600)(0,0,0,0)(3240,7560,2580,1560)
                          Text 0x48564570() (3240,7560,2580,1560)(0,0,0,0)(3240,7560,2580,1560) layer=0x437b9400
                  Clip 0x427b9128() (0,0,19200,27600)(0,0,0,0)(3240,9000,2400,1080)
                    Clip 0x427b9128() (0,-300,19200,21960)(0,0,0,0)(3240,9000,2400,1080)
                      WrapList 0x427b9128() (3300,9000,2340,1020)(0,0,0,0)(3240,9000,2400,1080)
                        Clip 0x0() (3300,8820,14100,1200)(0,0,0,0)(3240,9000,2400,1080)
                          Text 0x48564cc8() (3240,9000,2400,1080)(0,0,0,0)(3240,9000,2400,1080) layer=0x437b9400
                  Clip 0x427b9a10() (0,0,19200,27600)(0,0,0,0)(3240,11700,7680,1560)
                    Clip 0x427b9a10() (0,-300,19200,21960)(0,0,0,0)(3240,11700,7680,1560)
                      WrapList 0x427b9a10() (0,10680,19200,3660)(0,0,0,0)(3240,11700,7680,1560)
                        Border 0x427b9a10() (0,10680,19200,3660)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x427b9d58() (0,10680,19200,3600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b9400
                        Background 0x427b9d58() (840,11580,1800,1800)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        Clip 0x0() (0,10680,19200,3600)(0,0,0,0)(3240,11700,7680,1560)
                          Text 0x4855bd78() (3240,11700,7680,1560)(0,0,0,0)(3240,11700,7680,1560) layer=0x437b9400
                  Clip 0x427ba168() (0,0,19200,27600)(0,0,0,0)(3240,14880,5160,1560)
                    Clip 0x427ba168() (0,-300,19200,21960)(0,0,0,0)(3240,14880,5160,1560)
                      WrapList 0x427ba168() (0,14340,19200,3660)(0,0,0,0)(3240,14880,5160,1560)
                        Border 0x427ba168() (0,14340,19200,3660)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x427ba4b0() (0,14340,19200,3600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b9400
                        Background 0x427ba4b0() (840,15240,1800,1800)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        Clip 0x0() (0,14340,19200,3600)(0,0,0,0)(3240,14880,5160,1560)
                          Text 0x4855ade0() (3240,14880,5160,1560)(0,0,0,0)(3240,14880,5160,1560) layer=0x437b9400
                  Clip 0x427ba228() (0,0,19200,27600)(0,0,0,0)(3240,16320,3540,1080)
                    Clip 0x427ba228() (0,-300,19200,21960)(0,0,0,0)(3240,16320,3540,1080)
                      WrapList 0x427ba228() (3300,16320,3480,1020)(0,0,0,0)(3240,16320,3540,1080)
                        Clip 0x0() (3300,16140,14100,1200)(0,0,0,0)(3240,16320,3540,1080)
                          Text 0x4855b650() (3240,16320,3540,1080)(0,0,0,0)(3240,16320,3540,1080) layer=0x437b9400
                  Clip 0x427ba8c0() (0,0,19200,27600)(0,0,0,0)(3240,19020,8340,1560)
                    Clip 0x427ba8c0() (0,-300,19200,21960)(0,0,0,0)(3240,19020,8340,1560)
                      WrapList 0x427ba8c0() (0,18000,19200,3660)(0,0,0,0)(3240,19020,8340,1560)
                        Border 0x427ba8c0() (0,18000,19200,3660)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x427bac08() (0,18000,19200,3600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b9400
                        Background 0x427bac08() (840,18900,1800,1800)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        Clip 0x0() (0,18000,19200,3600)(0,0,0,0)(3240,19020,8340,1560)
                          Text 0x4855ab28() (3240,19020,8340,1560)(0,0,0,0)(3240,19020,8340,1560) layer=0x437b9400
                  Clip 0x47ed0430() (0,0,19200,27600)(0,0,0,0)(3240,24300,3360,1560)
                    Clip 0x47ed0430() (0,23280,19200,21960)(0,0,0,0)(3240,24300,3360,1560)
                      WrapList 0x47ed0430() (0,23280,19200,3660)(0,0,0,0)(3240,24300,3360,1560)
                        Border 0x47ed0430() (0,23280,19200,3660)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x47ed0608() (0,23280,19200,3600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b9400
                        Background 0x47ed0608() (840,24180,1800,1800)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        Clip 0x0() (0,23280,19200,3600)(0,0,0,0)(3240,24300,3360,1560)
                          Text 0x49bb1dd0() (3240,24300,3360,1560)(0,0,0,0)(3240,24300,3360,1560) layer=0x437b9400
                  Clip 0x47ed09e8() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
                    Clip 0x47ed09e8() (0,23280,19200,21960)(0,0,0,0)(0,0,0,0)
                      WrapList 0x47ed09e8() (0,26940,19200,3660)(0,0,0,0)(0,0,0,0)
                        Border 0x47ed09e8() (0,26940,19200,3660)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x47ed0bc0() (0,26940,19200,3600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b9400
                        Background 0x47ed0bc0() (840,27840,1800,1800)(0,0,0,0)(0,0,0,0) layer=0x437b9400
                  WrapList 0x4725e1f0() (18720,1435,360,7380)(0,0,0,0)(0,0,0,0)
                    Opacity 0x4725e1f0() (18720,1435,360,7380)(0,0,0,0)(0,0,0,0) layer=0x437b9800
                      BackgroundColor 0x4725e578() (18720,1435,360,7380)(0,0,0,0)(0,0,0,0) layer=0x437ba000
                      Background 0x4725e578() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x437ba000
                      Border 0x4725e578() (18720,1435,360,7380)(0,0,0,0)(0,0,0,0) layer=0x437ba000
      Clip 0x47bada50() (0,0,19200,28800)(0,0,0,0)(16860,-60,2280,1320)
        Clip 0x47bada50() (0,0,19200,28800)(0,0,0,0)(16860,-60,2280,1320)
          WrapList 0x47bada50() (0,0,19200,1200)(0,0,0,0)(16860,-60,2280,1320)
            BackgroundColor 0x47bada50() (0,0,19200,1200)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
            Background 0x47bada50() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
            Clip 0x485515b0() (0,0,19200,1200)(0,0,0,0)(0,0,0,0)
              WrapList 0x485515b0() (15420,120,1260,960)(0,0,0,0)(0,0,0,0)
                BackgroundColor 0x485515b0() (15420,120,1260,960)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
                Background 0x485515b0() (15420,120,1260,960)(0,0,0,0)(0,0,0,0) layer=0x49a68000
            Clip 0x485513d0() (0,0,19200,1200)(0,0,0,0)(16860,-60,2280,1320)
              WrapList 0x485513d0() (16860,-60,2280,1320)(0,0,0,0)(16860,-60,2280,1320)
                Text 0x47b65870() (16860,-60,2280,1320)(0,0,0,0)(16860,-60,2280,1320) layer=0x49a68000
            Clip 0x48551820() (0,0,19200,1200)(0,0,0,0)(0,0,0,0)
              WrapList 0x48551820() (14220,120,960,960)(0,0,0,0)(0,0,0,0)
                BackgroundColor 0x48551820() (14220,120,960,960)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
                Background 0x48551820() (14220,120,960,960)(0,0,0,0)(0,0,0,0) layer=0x49a68000
Painting --- after optimization:
  SolidColor 0x4710d298() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  BackgroundColor 0x4710d7c0() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  Background 0x4710d7c0() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  BackgroundColor 0x4710d9d0() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  Background 0x4710d9d0() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x472c4800
  Clip 0x4710e938() (0,0,19200,28800)(0,0,19200,28800)(0,-60,19200,28860)
    OwnLayer 0x47e50298() (0,0,19200,28800)(0,0,19200,28800)(0,-60,19200,28860) layer=0x49a67c00
      Clip 0x47bada50() (0,0,19200,28800)(0,0,19200,28800)(0,-60,19200,28860)
        CanvasBackground 0x47e50998() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
        BackgroundColor 0x47ba65e8() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
        Background 0x47ba65e8() (0,0,19200,28800)(0,0,0,0)(0,0,0,0) layer=0x49a68000
        Clip 0x49c09d18() (0,1200,19200,27600)(0,0,0,0)(144,1620,18696,10920)
          Clip 0x49cbb890() (0,1200,19200,27600)(0,0,0,0)(144,1620,18696,10920)
            CanvasBackground 0x4af93378() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
            Opacity 0x49cbafd8() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0) layer=0x49a68000
              BackgroundColor 0x49cbafd8() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x4721faa0
              Background 0x49cbafd8() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x4721faa0
            nsDisplayTransform 0x4ad2b2c8() (144,1620,18696,10920)(0,0,0,0)(144,1620,18696,10920) layer=0x49a68000
              Image 0x498da910() (360,420,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
              Clip 0x0() (144,4680,4512,960)(0,0,0,0)(810,4440,3300,1620)
                Text 0x498dad40() (810,4440,3300,1620)(0,0,0,0)(810,4440,3300,1620) layer=0x4721fc80
              Image 0x498db010() (5160,420,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
              Clip 0x0() (4944,4680,4512,960)(0,0,0,0)(5700,4440,3120,1620)
                Text 0x498db200() (5700,4440,3120,1620)(0,0,0,0)(5700,4440,3120,1620) layer=0x4721fc80
              Image 0x498db4c8() (9960,420,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
              Clip 0x0() (9744,4680,4512,960)(0,0,0,0)(10140,4440,3840,1620)
                Text 0x498db6b8() (10140,4440,3840,1620)(0,0,0,0)(10140,4440,3840,1620) layer=0x4721fc80
              Image 0x498db9c0() (14760,420,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
              Clip 0x0() (14544,4680,4512,960)(0,0,0,0)(15090,4440,3540,1620)
                Text 0x498dbbb0() (15090,4440,3540,1620)(0,0,0,0)(15090,4440,3540,1620) layer=0x4721fc80
              Image 0x498dbe80() (360,6120,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
              Clip 0x0() (144,10380,4512,960)(0,0,0,0)(-30,10140,4980,1620)
                Text 0x498dc0b8() (-30,10140,4980,1620)(0,0,0,0)(-30,10140,4980,1620) layer=0x4721fc80
              Image 0x498dc370() (5160,6120,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x4721fc80
              Clip 0x0() (4944,10380,4512,960)(0,0,0,0)(6030,10140,2460,1620)
                Text 0x44d8b190() (6030,10140,2460,1620)(0,0,0,0)(6030,10140,2460,1620) layer=0x4721fc80
            nsDisplayTransform 0x49cbb428() (6397,1200,3200,180)(0,0,0,0)(0,0,0,0) layer=0x49a68000
              BackgroundColor 0x49cbb428() (0,0,3199,180)(0,0,0,0)(0,0,0,0) uniform layer=0x47220f40
              Background 0x49cbb428() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x47220f40
            BackgroundColor 0x49cbb890() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
            Background 0x49cbb890() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0) layer=0x49a68000
            Clip 0x4afb6db0() (0,24300,19200,4500)(0,0,0,0)(0,0,0,0)
              Image 0x4afb6530() (150,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
              Image 0x4afb6858() (4530,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
              Image 0x4afb6a98() (8910,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
              Image 0x4afb6ce0() (13290,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
              Image 0x4afb6f28() (17670,24450,4080,4080)(0,0,0,0)(0,0,0,0) layer=0x49a68000
        BackgroundColor 0x498c5c10() (0,1200,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
        Background 0x498c5c10() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
        Clip 0x498c5c10() (0,1200,19200,27600)(0,1200,19200,27600)(0,1200,19200,27600)
          Clip 0x4725e010() (0,1200,19200,27600)(0,1200,19200,27600)(0,1200,19200,27600)
            CanvasBackground 0x4854a350() (0,1200,38400,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
            nsDisplayTransform 0x4725e010() (0,1200,19200,27600)(0,1200,19200,27600)(0,1200,19200,27600) layer=0x437b9000
              BackgroundColor 0x4725e010() (0,0,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x437b7000
              Background 0x4725e010() (0,0,19200,27600)(0,0,19200,27600)(0,0,0,0) layer=0x437b7000
              Clip 0x47ed09e8() (0,0,19200,27600)(0,0,19200,27600)(1740,720,9840,25140)
                Clip 0x427b4540() (0,-300,19200,21960)(14700,900,3240,4980)(0,0,0,0)
                  Clip 0x427b37a8() (0,-300,19200,3600)(14700,900,3240,1320)(0,0,0,0)
                    ClipRoundedRect 0x427b37a8() (14700,900,3240,1320)(14700,900,3240,1320)(0,0,0,0)
                      nsDisplayTransform 0x427b37a8() (14700,900,3240,1320)(14700,900,3240,1320)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x427b37a8() (0,0,3240,1320)(0,0,3240,1320)(0,0,0,0) uniform layer=0x47221300
                        Background 0x427b37a8() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x47221300
                  Clip 0x427b4540() (0,3360,19200,3600)(14700,4560,3240,1320)(0,0,0,0)
                    ClipRoundedRect 0x427b4540() (14700,4560,3240,1320)(14700,4560,3240,1320)(0,0,0,0)
                      nsDisplayTransform 0x427b4540() (14700,4560,3240,1320)(14700,4560,3240,1320)(0,0,0,0) layer=0x437b9400
                        BackgroundColor 0x427b4540() (0,0,3240,1320)(0,0,3240,1320)(0,0,0,0) uniform layer=0x472223e0
                        Background 0x427b4540() (300,60,780,1200)(300,60,780,1200)(0,0,0,0) layer=0x472223e0
                BackgroundColor 0x47ed0190() (0,21660,19200,1620)(0,23220,19200,60)(0,0,0,0) uniform layer=0x437b9400
                Background 0x47ed0190() (0,21660,19200,1560)(0,21660,19200,1560)(0,0,0,0) layer=0x437b9400
                Border 0x47ed0190() (0,21660,19200,1620)(0,21660,19200,1620)(0,0,0,0) layer=0x437b9400
                Text 0x4855a400() (1740,21900,6060,1080)(1740,21900,6060,1080)(1740,21900,6060,1080) layer=0x437b9400
                Clip 0x427ba8c0() (0,-300,19200,21960)(0,0,19200,21660)(3240,720,8340,19860)
                  Border 0x47260ae0() (0,-300,19200,3660)(0,0,19200,3360)(0,0,0,0) layer=0x437b9400
                  BackgroundColor 0x427b3af8() (0,-300,19200,3600)(0,0,19200,3300)(0,0,0,0) uniform layer=0x437b9400
                  Background 0x427b3af8() (840,600,1800,1800)(840,600,1800,1800)(0,0,0,0) layer=0x437b9400
                  Clip 0x47261e70() (0,-300,19200,3600)(3240,720,14760,1560)(3240,720,7320,1560)
                    Text 0x48565550() (3240,720,7320,1560)(3240,720,7320,1560)(3240,720,7320,1560) layer=0x437b9400
                    BackgroundColor 0x47261e70() (14640,840,3360,1440)(14640,840,3360,1440)(0,0,0,0) layer=0x437b9400
                    Background 0x47261e70() (14640,840,1380,1440)(14640,840,1380,1440)(0,0,0,0) layer=0x437b9400
                    Border 0x47261e70() (14640,840,3360,1440)(14640,840,3360,1440)(0,0,0,0) layer=0x437b9400
                  Border 0x427b4100() (0,3360,19200,3660)(0,3360,19200,3660)(0,0,0,0) layer=0x437b9400
                  BackgroundColor 0x427b4948() (0,3360,19200,3600)(0,3360,19200,3600)(0,0,0,0) uniform layer=0x437b9400
                  Background 0x427b4948() (840,4260,1800,1800)(840,4260,1800,1800)(0,0,0,0) layer=0x437b9400
                  Clip 0x427b4408() (0,3360,19200,3600)(3240,4380,14760,1560)(3240,4380,2040,1560)
                    Text 0x485652b0() (3240,4380,2040,1560)(3240,4380,2040,1560)(3240,4380,2040,1560) layer=0x437b9400
                    BackgroundColor 0x427b4408() (14640,4500,3360,1440)(14640,4500,3360,1440)(0,0,0,0) layer=0x437b9400
                    Background 0x427b4408() (16620,4500,1380,1440)(16620,4500,1380,1440)(0,0,0,0) layer=0x437b9400
                    Border 0x427b4408() (14640,4500,3360,1440)(14640,4500,3360,1440)(0,0,0,0) layer=0x437b9400
                  Border 0x427b4d58() (0,7020,19200,3660)(0,7020,19200,3660)(0,0,0,0) layer=0x437b9400
                  BackgroundColor 0x427b9600() (0,7020,19200,3600)(0,7020,19200,3600)(0,0,0,0) uniform layer=0x437b9400
                  Background 0x427b9600() (840,7920,1800,1800)(840,7920,1800,1800)(0,0,0,0) layer=0x437b9400
                  Clip 0x0() (0,7020,19200,3600)(3240,7560,2580,1560)(3240,7560,2580,1560)
                    Text 0x48564570() (3240,7560,2580,1560)(3240,7560,2580,1560)(3240,7560,2580,1560) layer=0x437b9400
                  Clip 0x0() (3300,8820,14100,1200)(3300,9000,2340,1020)(3240,9000,2400,1080)
                    Text 0x48564cc8() (3240,9000,2400,1080)(3300,9000,2340,1020)(3240,9000,2400,1080) layer=0x437b9400
                  Border 0x427b9a10() (0,10680,19200,3660)(0,10680,19200,3660)(0,0,0,0) layer=0x437b9400
                  BackgroundColor 0x427b9d58() (0,10680,19200,3600)(0,10680,19200,3600)(0,0,0,0) uniform layer=0x437b9400
                  Background 0x427b9d58() (840,11580,1800,1800)(840,11580,1800,1800)(0,0,0,0) layer=0x437b9400
                  Clip 0x0() (0,10680,19200,3600)(3240,11700,7680,1560)(3240,11700,7680,1560)
                    Text 0x4855bd78() (3240,11700,7680,1560)(3240,11700,7680,1560)(3240,11700,7680,1560) layer=0x437b9400
                  Border 0x427ba168() (0,14340,19200,3660)(0,14340,19200,3660)(0,0,0,0) layer=0x437b9400
                  BackgroundColor 0x427ba4b0() (0,14340,19200,3600)(0,14340,19200,3600)(0,0,0,0) uniform layer=0x437b9400
                  Background 0x427ba4b0() (840,15240,1800,1800)(840,15240,1800,1800)(0,0,0,0) layer=0x437b9400
                  Clip 0x0() (0,14340,19200,3600)(3240,14880,5160,1560)(3240,14880,5160,1560)
                    Text 0x4855ade0() (3240,14880,5160,1560)(3240,14880,5160,1560)(3240,14880,5160,1560) layer=0x437b9400
                  Clip 0x0() (3300,16140,14100,1200)(3300,16320,3480,1020)(3240,16320,3540,1080)
                    Text 0x4855b650() (3240,16320,3540,1080)(3300,16320,3480,1020)(3240,16320,3540,1080) layer=0x437b9400
                  Border 0x427ba8c0() (0,18000,19200,3660)(0,18000,19200,3660)(0,0,0,0) layer=0x437b9400
                  BackgroundColor 0x427bac08() (0,18000,19200,3600)(0,18000,19200,3600)(0,0,0,0) uniform layer=0x437b9400
                  Background 0x427bac08() (840,18900,1800,1800)(840,18900,1800,1800)(0,0,0,0) layer=0x437b9400
                  Clip 0x0() (0,18000,19200,3600)(3240,19020,8340,1560)(3240,19020,8340,1560)
                    Text 0x4855ab28() (3240,19020,8340,1560)(3240,19020,8340,1560)(3240,19020,8340,1560) layer=0x437b9400
                Clip 0x47ed09e8() (0,23280,19200,21960)(0,23280,19200,4320)(3240,24300,3360,1560)
                  Border 0x47ed0430() (0,23280,19200,3660)(0,23280,19200,3660)(0,0,0,0) layer=0x437b9400
                  BackgroundColor 0x47ed0608() (0,23280,19200,3600)(0,23280,19200,3600)(0,0,0,0) uniform layer=0x437b9400
                  Background 0x47ed0608() (840,24180,1800,1800)(840,24180,1800,1800)(0,0,0,0) layer=0x437b9400
                  Clip 0x0() (0,23280,19200,3600)(3240,24300,3360,1560)(3240,24300,3360,1560)
                    Text 0x49bb1dd0() (3240,24300,3360,1560)(3240,24300,3360,1560)(3240,24300,3360,1560) layer=0x437b9400
                  Border 0x47ed09e8() (0,26940,19200,3660)(0,26940,19200,660)(0,0,0,0) layer=0x437b9400
                  BackgroundColor 0x47ed0bc0() (0,26940,19200,3600)(0,26940,19200,660)(0,0,0,0) uniform layer=0x437b9400
                  Background 0x47ed0bc0() (840,27840,1800,1800)(0,0,0,0)(0,0,0,0) layer=0x437b9400
              Opacity 0x4725e1f0() (18720,1435,360,7380)(18720,1435,360,7380)(0,0,0,0)
                BackgroundColor 0x4725e578() (18720,1435,360,7380)(18720,1435,360,7380)(0,0,0,0)
                Background 0x4725e578() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform
                Border 0x4725e578() (18720,1435,360,7380)(18720,1435,360,7380)(0,0,0,0)
        Clip 0x47bada50() (0,0,19200,28800)(0,0,19200,1200)(16860,-60,2280,1320)
          BackgroundColor 0x47bada50() (0,0,19200,1200)(0,0,19200,1200)(0,0,0,0) uniform layer=0x49a68000
          Background 0x47bada50() (0,0,0,0)(0,0,0,0)(0,0,0,0) uniform layer=0x49a68000
          Clip 0x48551820() (0,0,19200,1200)(14220,0,4920,1200)(16860,-60,2280,1320)
            BackgroundColor 0x485515b0() (15420,120,1260,960)(15420,120,1260,960)(0,0,0,0) uniform layer=0x49a68000
            Background 0x485515b0() (15420,120,1260,960)(15420,120,1260,960)(0,0,0,0) layer=0x49a68000
            Text 0x47b65870() (16860,-60,2280,1320)(16860,0,2280,1200)(16860,-60,2280,1320) layer=0x49a68000
            BackgroundColor 0x48551820() (14220,120,960,960)(14220,120,960,960)(0,0,0,0) uniform layer=0x49a68000
            Background 0x48551820() (14220,120,960,960)(14220,120,960,960)(0,0,0,0) layer=0x49a68000
Painting --- retained layer tree:
BasicLayerManager (0x44d6d190)
  BasicContainerLayer (0x472c4400) [visible=< (x=0, y=0, w=320, h=480); >] [opaqueContent] [metrics={ viewport=(x=0.000000, y=0.000000, w=320.000000, h=480.000000) viewportScroll=(x=0.000000, y=0.000000) displayport=(x=0.000000, y=0.000000, w=0.000000, h=0.000000) scrollId=0 }]
    BasicThebesLayer (0x472c4800) [clip=(x=0, y=0, w=0, h=0)] [not visible] [isFixedPosition]
    BasicColorLayer (0x4260e640) [clip=(x=0, y=0, w=0, h=0)] [not visible] [opaqueContent] [isFixedPosition] [color=rgba(0, 0, 0, 1)]
    BasicContainerLayer (0x49a67c00) [clip=(x=0, y=0, w=320, h=480)] [visible=< (x=0, y=0, w=320, h=480); >] [opaqueContent] [isFixedPosition]
      BasicThebesLayer (0x49a68000) [visible=< (x=0, y=0, w=320, h=20); >] [opaqueContent] [isFixedPosition] [valid=< (x=0, y=0, w=320, h=20); >]
      BasicContainerLayer (0x437b9000) [clip=(x=0, y=20, w=320, h=460)] [transform=[ 1 0; 0 1; 0 20; ]] [visible=< (x=0, y=0, w=320, h=460); >] [opaqueContent] [isFixedPosition]
        BasicThebesLayer (0x437b7000) [visible=< (x=0, y=0, w=320, h=460); >] [opaqueContent] [isFixedPosition] [valid=< (x=0, y=0, w=320, h=460); >]
        BasicThebesLayer (0x437b9400) [transform=[ 1 0; 0 1; 0 -82; ]] [visible=< (x=0, y=82, w=320, h=460); >] [componentAlpha] [isFixedPosition] [valid=< (x=0, y=82, w=320, h=460); >]
(Assignee)

Comment 52

6 years ago
Created attachment 682936 [details] [diff] [review]
rollup debug patch
(Assignee)

Comment 53

6 years ago
(gdb) p this->mFrame
$22 = (struct nsIFrame *) 0x4725e578
(gdb) p *this->mFrame
$23 = {<nsQueryFrame> = {_vptr.nsQueryFrame = 0x41683ca0}, static kFrameIID = nsQueryFrame::nsIFrame_id, static kPrincipalList = mozilla::layout::kPrincipalList, 
  static kAbsoluteList = mozilla::layout::kAbsoluteList, static kBulletList = mozilla::layout::kBulletList, static kCaptionList = mozilla::layout::kCaptionList, 
  static kColGroupList = mozilla::layout::kColGroupList, static kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList, 
  static kFixedList = mozilla::layout::kFixedList, static kFloatList = mozilla::layout::kFloatList, static kOverflowContainersList = mozilla::layout::kOverflowContainersList, 
  static kOverflowList = mozilla::layout::kOverflowList, static kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList, 
  static kPopupList = mozilla::layout::kPopupList, static kPushedFloatsList = mozilla::layout::kPushedFloatsList, static kSelectPopupList = mozilla::layout::kSelectPopupList, 
  static kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList, static sLayerIsPrerenderedDataKey = 0 '\000', 
  mRect = {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 0, y = 2310, width = 360, height = 7380}, <No data fields>}, mContent = 0x49c2a560, 
  mStyleContext = 0x427b3368, mParent = 0x4725e478, mNextSibling = 0x0, mPrevSibling = 0x0, mState = 2305860878425128960, mOverflow = {mType = 0, mVisualDeltas = {
      mLeft = 0 '\000', mTop = 0 '\000', mRight = 0 '\000', mBottom = 0 '\000'}}}
(gdb) x/a $22
0x4725e578:	0x41683ca0 <_ZTV16nsButtonBoxFrame+8>
(gdb)
(Assignee)

Comment 54

6 years ago
The structure should look like this:

  <label>
    <input type="checkbox" checked>
    <span></span>
  </label>
(Assignee)

Comment 55

6 years ago
The border radius is on the span:

label input[type="checkbox"][data-type="switch"] + span {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -1.1rem 0 0 -2.7rem;
  width: 5.4rem;
  height: 2.2rem;
  pointer-events: none;
  border: solid 1px #c2c2c2;
  border-radius: 5.4rem;
  overflow: hidden;
  background: url(switches/images/switch/handler.png) no-repeat -0.2rem center;
  background-size: auto calc(100% + 2px);
  transition: background 0.18s ease;
}
(Assignee)

Comment 56

6 years ago
This has almost certainly nothing to do with OMTC or scrolling into view. We invalidate all the time.
Summary: [OMTC] Scrolling border-radius content into view can draw background elements on top → border radius causes background of a transformed element to continuously invalidate
Unfortunately I still don't have a solution here.

The simplified section of the display list in question looks like this:

            nsDisplayTransform 0x4725e010() (0,1200,19200,27600)(0,1200,19200,27600)(0,1200,19200,27600) layer=0x4865c000
              BackgroundColor 0x4725e010() (0,0,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x4865c400
              Clip 0x47ed0fa0() (0,0,19200,27600)(0,0,19200,27600)(1740,480,9840,25140)
                Clip 0x427b4540() (0,-4200,19200,21960)(14700,660,3240,1320)(0,0,0,0)
                  Clip 0x427b4540() (0,-540,19200,3600)(14700,660,3240,1320)(0,0,0,0)
                    ClipRoundedRect 0x427b4540() (14700,660,3240,1320)(14700,660,3240,1320)(0,0,0,0)
                      nsDisplayTransform 0x427b4540() (14700,660,3240,1320)(14700,660,3240,1320)(0,0,0,0) layer=0x4865d000
                        BackgroundColor 0x427b4540() (0,0,3240,1320)(0,0,3240,1320)(0,0,0,0) uniform layer=0x472214e0
                BackgroundColor 0x47ed0190() (0,17760,19200,1620)(0,19320,19200,60)(0,0,0,0) uniform layer=0x4865d000
              BackgroundColor 0x4725e578() (18720,2573,360,7380)(18720,2573,360,7380)(0,0,0,0) layer=0x4865f000

We then assign these items to 3 separate thebes layers based on their 'active scrolled root'.

        BasicThebesLayer (0x4865c400) [visible=< (x=0, y=0, w=320, h=460); >] [opaqueContent] [isFixedPosition] [valid=< (x=0, y=0, w=320, h=460); >]
        BasicThebesLayer (0x4865d000) [transform=[ 1 0; 0 1; 0 -147; ]] [visible=< (x=0, y=147, w=320, h=460); >] [componentAlpha] [isFixedPosition] [valid=< (x=0, y=147, w=320, h=460); >]
        BasicThebesLayer (0x4865f000) [visible=< (x=312, y=42, w=6, h=124); >] [isFixedPosition] [valid=< (x=312, y=42, w=6, h=124); >]

The first layer (0x4865c400) contains the page background, which doesn't scroll at all, the second (0x4865d000) contains the transformed/rounded clipped content and most of the rest of the content. The final layers (0x4865f000) contains the content which is being invalidated.

After scrolling we get this:

                nsDisplayTransform 0x4725e010() (0,1200,19200,27600)(0,0,0,0)(0,1200,19200,27600) layer=0x4865c000
                  BackgroundColor 0x4725e010() (0,0,19200,27600)(0,0,0,0)(0,0,0,0) uniform layer=0x4865c400
                  Clip 0x427b4540() (0,0,19200,27600)(0,0,0,0)(0,0,0,0)
                    Clip 0x427b4540() (0,-5280,19200,21960)(0,0,0,0)(0,0,0,0)
                      Clip 0x427b4540() (0,-1620,19200,3600)(0,0,0,0)(0,0,0,0)
                        ClipRoundedRect 0x427b4540() (14700,-420,3240,1320)(0,0,0,0)(0,0,0,0)
                          WrapList 0x427b4540() (14700,-420,3240,1320)(0,0,0,0)(0,0,0,0)
                            nsDisplayTransform 0x427b4540() (14700,-420,3240,1320)(0,0,0,0)(0,0,0,0) layer=0x4865d000
                              BackgroundColor 0x427b4540() (0,0,3240,1320)(0,0,0,0)(0,0,0,0) uniform layer=0x472214e0
                    BackgroundColor 0x47ed0190() (0,16680,19200,1620)(0,0,0,0)(0,0,0,0) uniform layer=0x4865d000
                  BackgroundColor 0x4725e578() (18720,2888,360,7380)(0,0,0,0)(0,0,0,0) layer=0x4865f000

The background item hasn't changed position, and most of the rest of the content has moved by -1080 app units (18 pixels at a 1.0 zoom scale) - What we'd expect for scrolling down.

The BackgroundColor item (0x4725e578) however has moved in the opposite direction, by 315 app units (~5 pixels). Does this match what you see on screen? It seems really weird to me to have content scrolling in both directions at the same time.

Invalidation is correctly detecting the scroll offsets for the first two layers (0, and -1080 respectively) and doesn't invalidate anything. For the third layer however we compute that the scrolled frame hasn't moved relative to its parent (no scrolling has happened, shift == 0), but instead the content has physically moved instead. This triggers invalidation.

Figuring out why this is moving in the reverse direction would explain a lot I think. We compute the 'active scrolled root' when we call IsFixedItem, the parent of this should be an nsGfxScrollFrame(Inner?), and we'd expect scrolling to happen using nsGfxScrollFrameInner::ScrollVisual.

Theres another bug here (one that might actually make most of this go away), and that is that nsDisplayBackgroundColor doesn't realize that changes in its size only need to invalidate the Xor of the new/old areas instead of the Union. Patch incoming for that.
(Assignee)

Comment 58

6 years ago
There is a scrollbar indicator on the side. Thats probably the counterscroll you are seeing.
Oh! Yes, that indeed makes perfect sense.

Unfortunately it looks like all the invalidations you have been catching (with size of 360/7380) are the scrollbar thumb, which we expect to invalidate.

I think we need to change the breakpoints so that this particular size gets ignored and see what we can find out about the other invalidations.
The same data as before would be useful: Display lists, old/new geometry objects, old/new clip objects.
Hrm, quick test, can you please change this line to if (true)

http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsGfxScrollFrame.cpp#2071

So that mShouldBuildLayer is always true.
(Assignee)

Comment 62

6 years ago
I think that stops the visual glitches I am seeing. The check boxes are no longer invalidating. Though, I think the whole content is invalidated a lot more now.
(Assignee)

Comment 63

6 years ago
Ok yeah with that change we invalidate like mad in comparison to before. Matt, please setup a dev environment for this. You have to see this first hand. I think there is something seriously broken here. I don't see any other invalidations for BackgroundColor but its definitely flickering like mad when scrolling. And the change in repaint behavior with that layer enabled is kinda sketchy too. I wish I could trigger this on desktop. Sorry.
(Assignee)

Comment 64

6 years ago
To reproduce, open the settings app and scroll up and down.
Blocks: 813124
Based on comment 4, the invalidation bug here is not a basecamp blocker, so I'm renominating it for triage.

I've cloned this bug off to bug 813124 to continue my work on fixing the painting bug, which *is* a basecamp blocker.

I am not working on this invalidation problem.
Assignee: joe → nobody
blocking-basecamp: + → ?
Status: ASSIGNED → NEW
(Assignee)

Comment 66

6 years ago
Renomination is always a good idea. That having said, the invalidation causes the frame rate to drop significantly, missing out close-to-60 FPS target. When scrolling the checkbox into view, FPS is closer to 25. Thats unacceptable and likely a blocker.

I do agree that there are likely two bugs here. Invalidation/misdetection of frame movement causes us to layerize the checkbox background, and in presence of the mask layer that painting somehow breaks. This also means that these bugs are closely related, and fixing one might make the other no longer blocking. Identifying one also will help identifying the other. Based on this I also don't think we can unblock here.

Please post at least daily (preferably real time) activity/investigation updates in bug 813124 so we don't duplicate effort. I will continue to chase down the invalidation issue except if the drivers agree to unblock here. We will likely find evidence/hints the other can use.
Lawrence looked at this and it isn't clear that this is such a significant problem that you'd block shipping v.1.  Fixing 813124 may help which is already blocking.  We'd like to see this fix, but not blocking.
No longer blocks: 813124
Given comment 67, minusing.
blocking-basecamp: ? → -
(Assignee)

Comment 69

6 years ago
mattwoodrow, the scrollbar thumbs are in their own layer right? We just invalidate anyway because we don't pick up the right scroll root/shift.
(Assignee)

Comment 70

6 years ago
What did Lawrence look at? And based on what criteria is what not significant enough?
(Assignee)

Updated

6 years ago
Flags: needinfo?(lmandel)
To be clear, I had the only unagi at triage today, which is why I was testing. I followed the STR in the description and we saw that the frame rate did drop, but it also did not seem consistent when scrolling the settings when the "Airplane Mode" and "GPS" checkboxes were not in view. Please renom if you have further clarification as to what we should be looking for when attempting to reproduce and why this is a blocking issue.
Flags: needinfo?(lmandel)
(Assignee)

Comment 72

6 years ago
Looks like the scroll bar is invalidated based on a geometry change. The height is flopping. Subpixel rounding fun? That could also be the case for the switch.

Display item type BackgroundColor(0x4afa8578) (in layer 0x46c94000) changed geometry!
Invalidating layer 0x46c94000: < (x=312, y=162, w=6, h=124); >
Display item type Border(0x4afa8578) (in layer 0x46c94000) changed geometry!
Invalidating layer 0x46c94000: < (x=312, y=162, w=6, h=124); >
Display item type BackgroundColor(0x4afa8578) (in layer 0x46c94000) changed geometry!
Invalidating layer 0x46c94000: < (x=312, y=162, w=6, h=125); >
Display item type Border(0x4afa8578) (in layer 0x46c94000) changed geometry!
Invalidating layer 0x46c94000: < (x=312, y=162, w=6, h=125); >
Display item type BackgroundColor(0x4afa8578) (in layer 0x46c94000) changed geometry!
Invalidating layer 0x46c94000: < (x=312, y=163, w=6, h=124); >
Display item type Border(0x4afa8578) (in layer 0x46c94000) changed geometry!
Invalidating layer 0x46c94000: < (x=312, y=163, w=6, h=124); >
(Assignee)

Comment 73

6 years ago
Its not just off-by-rounding. We seem to be happily resizing the thumb, which of course blows chunks for performance.

Display item type BackgroundColor(0x4a99b578) added to layer 0x49647000!
Invalidating layer 0x49647000: < (x=312, y=325, w=6, h=124); >
Display item type Border(0x4a99b578) added to layer 0x49647000!
Invalidating layer 0x49647000: < (x=312, y=325, w=6, h=124); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=321, w=6, h=128); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=321, w=6, h=128); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=315, w=6, h=130); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=315, w=6, h=130); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=310, w=6, h=128); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=310, w=6, h=128); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=305, w=6, h=129); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=305, w=6, h=129); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=303, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=303, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=299, w=6, h=128); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=299, w=6, h=128); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=297, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=297, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=294, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=294, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=291, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=291, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=287, w=6, h=128); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=287, w=6, h=128); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=284, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=284, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=280, w=6, h=128); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=280, w=6, h=128); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=276, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=276, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=273, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=273, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=270, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=270, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=266, w=6, h=128); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=266, w=6, h=128); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=263, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=263, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=259, w=6, h=128); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=259, w=6, h=128); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=257, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=257, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=254, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=254, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=252, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=252, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=249, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=249, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=246, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=246, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=244, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=244, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=241, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=241, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=239, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=239, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=237, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=237, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=236, w=6, h=125); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=236, w=6, h=125); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=233, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=233, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=232, w=6, h=125); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=232, w=6, h=125); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=231, w=6, h=125); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=231, w=6, h=125); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=228, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=228, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=227, w=6, h=125); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=227, w=6, h=125); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=225, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=225, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=224, w=6, h=125); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=224, w=6, h=125); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=222, w=6, h=125); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=222, w=6, h=125); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=220, w=6, h=126); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=220, w=6, h=126); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=217, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=217, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=214, w=6, h=127); >
Display item type Border(0x4a99b578) (in layer 0x49647000) changed geometry!
Invalidating layer 0x49647000: < (x=312, y=214, w=6, h=127); >
Display item type BackgroundColor(0x4a99b578) changed layers 0x49647000 to 0x496b2000!
Invalidating layer 0x49647000: < (x=312, y=214, w=6, h=124); >
Display item type Border(0x4a99b578) changed layers 0x49647000 to 0x496b2000!
Invalidating layer 0x49647000: < (x=312, y=214, w=6, h=124); >
Scrolling perf in the settings app is part of the product requirements.  To - this we have to change product targets.
blocking-basecamp: - → +
(Assignee)

Comment 75

6 years ago
From what I can tell thumb frame only changes in position, not height (confirmed in gdb too), so we must be taking that constant height and manage to introduce the rounding error during layout. Digging a bit more.

  // figure out the new rect                                                                                                                                                    
  nsRect newThumbRect(thumbRect);

  bool reverse = mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::dir,
                                         nsGkAtoms::reverse, eCaseMatters);
  nscoord pos = reverse ? (maxPos - curPos) : (curPos - minPos);

  if (IsHorizontal())
     newThumbRect.x = clientRect.x + NSToCoordRound(pos * mRatio);
  else
     newThumbRect.y = clientRect.y + NSToCoordRound(pos * mRatio);

  // set the rect                                                                                                                                                               
  thumbFrame->SetRect(newThumbRect);
(In reply to Chris Jones [:cjones] [:warhammer] from comment #74)
> Scrolling perf in the settings app is part of the product requirements.  To
> - this we have to change product targets.

We can 100% ship with this. It's not optimal, but we have to admit to ourselves that we're going to ship with bugs.
blocking-basecamp: + → ?
I'm not sure which part of comment 74 was unclear.
blocking-basecamp: ? → +
(Assignee)

Comment 78

6 years ago
Aright, I have a pretty good theory for the mispainting now:

While scrolling, we request a single row of pixels of the switch to be painted (the one row that becomes visible):

Invalidating layer 0x437df800: < (x=0, y=156, w=320, h=1); >
Display item type BackgroundColor(0x4afa3048) (in layer 0x437df800) changed geometry!
Invalidating layer 0x437df800: < (x=0, y=156, w=320, h=1); >
Display item type Background(0x4afa3048) (in layer 0x437df800) changed geometry!
Invalidating layer 0x437df800: < (x=14, y=156, w=30, h=1); >
Display item type Text(0x4afec9e8) (in layer 0x437df800) changed geometry!
Invalidating layer 0x437df800: < (x=54, y=156, w=34, h=1); >

However, when we do this, I see the whole switch flicker. We paint all of it! Every other paint it disappears. I think we aren't clipping right somewhere.

Once we are done scrolling we deactive the layer and paint the bigger height, so the artifact goes away.
(Assignee)

Comment 79

6 years ago
Joe, please do not touch the blocking flag on this bug again without consulting with cjones first. If there is any confusion with regards of who has the ultimate technical authority/responsibility for the product we are trying to ship here, I am happy to explain that to you offline.
(In reply to Andreas Gal :gal from comment #78)
> However, when we do this, I see the whole switch flicker. We paint all of
> it! Every other paint it disappears. I think we aren't clipping right
> somewhere.

This is exactly what I wrote in 813124 comment 1, fwiw.
(Assignee)

Comment 81

6 years ago
(In reply to Joe Drew (:JOEDREW! \o/) from comment #80)
> (In reply to Andreas Gal :gal from comment #78)
> > However, when we do this, I see the whole switch flicker. We paint all of
> > it! Every other paint it disappears. I think we aren't clipping right
> > somewhere.
> 
> This is exactly what I wrote in 813124 comment 1, fwiw.

Which is exactly what I wrote in comment 66 here.

It took about 7 hours of total effort for someone who has never seen any of this code, and who has no relevant gfx/layout experience, to track down the source of the problem (clipping bug) by following the invalidation trail. Thats why I felt it was important to finish this bug and not unblock, as stated in comment 66.
(Assignee)

Comment 82

6 years ago
DrawThebesLayer < (x=0, y=166, w=320, h=1); > < >
DrawThebesLayer < (x=0, y=8, w=54, h=1); > < >

clipping must be missing in the actual drawing code
(Assignee)

Comment 83

6 years ago
The stack for the relevant DrawThebesLayer:

#0  mozilla::FrameLayerBuilder::DrawThebesLayer (aLayer=0x49760c00, aContext=0x4aff15f0, aRegionToDraw=<value optimized out>, aRegionToInvalidate=<value optimized out>, 
    aCallbackData=0xbec7a090) at /Users/gal/workspace/B2G/gecko/layout/base/FrameLayerBuilder.cpp:3126
#1  0x40f8fcdc in mozilla::layers::BasicThebesLayer::PaintBuffer (this=0x49760c00, aContext=0x413f0ea9, aRegionToDraw=<value optimized out>, aExtendedRegionToDraw=..., 
    aRegionToInvalidate=..., aDidSelfCopy=false, 
    aCallback=0x408539b1 <mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*)>, 
    aCallbackData=0xbec7a090) at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicThebesLayer.h:95
#2  0x40f90600 in mozilla::layers::BasicShadowableThebesLayer::PaintBuffer (this=0x32, aContext=0x413f0ea9, aRegionToDraw=..., aExtendedRegionToDraw=..., 
    aRegionToInvalidate=..., aDidSelfCopy=false, 
    aCallback=0x408539b1 <mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*)>, 
    aCallbackData=0xbec7a090) at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicThebesLayer.cpp:405
#3  0x40f911e8 in mozilla::layers::BasicThebesLayer::PaintThebes (this=0x49760c00, aContext=0x4700b320, aMaskLayer=<value optimized out>, 
    aCallback=0x408539b1 <mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*)>, 
    aCallbackData=0xbec7a090, aReadback=0xbec79044) at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicThebesLayer.cpp:192
#4  0x40f91474 in mozilla::layers::BasicShadowableThebesLayer::PaintThebes (this=0x49760c00, aContext=0x4700b320, aMaskLayer=0x0, 
    aCallback=0x408539b1 <mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*)>, 
    aCallbackData=0xbec7a090, aReadback=0xbec79044) at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicThebesLayer.cpp:309
#5  0x40f8b44c in mozilla::layers::BasicLayerManager::PaintSelfOrChildren (this=0x44c77190, aPaintContext=..., aGroupTarget=0x4700b320)
    at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:829
#6  0x40f8b8b8 in mozilla::layers::BasicLayerManager::PaintLayer (this=0x44c77190, aTarget=0x4700b320, aLayer=0x49760c00, aCallback=<value optimized out>, 
    aCallbackData=0xbec7a090, aReadback=0xbec79044) at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:936
#7  0x40f8b4b0 in mozilla::layers::BasicLayerManager::PaintSelfOrChildren (this=0x44c77190, aPaintContext=..., aGroupTarget=0x4700b320)
    at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:844
#8  0x40f8b8b8 in mozilla::layers::BasicLayerManager::PaintLayer (this=0x44c77190, aTarget=0x4700b320, aLayer=0x4975bc00, aCallback=<value optimized out>, 
    aCallbackData=0xbec7a090, aReadback=0xbec7946c) at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:936
#9  0x40f8b4b0 in mozilla::layers::BasicLayerManager::PaintSelfOrChildren (this=0x44c77190, aPaintContext=..., aGroupTarget=0x4700b320)
    at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:844
#10 0x40f8b8b8 in mozilla::layers::BasicLayerManager::PaintLayer (this=0x44c77190, aTarget=0x4700b320, aLayer=0x4995f000, aCallback=<value optimized out>, 
    aCallbackData=0xbec7a090, aReadback=0xbec79894) at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:936
#11 0x40f8b4b0 in mozilla::layers::BasicLayerManager::PaintSelfOrChildren (this=0x44c77190, aPaintContext=..., aGroupTarget=0x4700b320)
    at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:844
#12 0x40f8b8b8 in mozilla::layers::BasicLayerManager::PaintLayer (this=0x44c77190, aTarget=0x4700b320, aLayer=0x47077400, aCallback=<value optimized out>, 
    aCallbackData=0xbec7a090, aReadback=0x0) at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:936
#13 0x40f8c08e in mozilla::layers::BasicLayerManager::EndTransactionInternal (this=0x44c77190, aCallback=<value optimized out>, aCallbackData=0xbec7a090, 
    aFlags=<value optimized out>) at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:589
#14 0x40f8c134 in mozilla::layers::BasicLayerManager::EndTransaction (this=0x32, aCallback=0x413f0ea9, aCallbackData=0xbec784fc, aFlags=3200746860)
    at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:508
#15 0x40f8c56a in mozilla::layers::BasicShadowLayerManager::EndTransaction (this=0x32, aCallback=0x413f0ea9, aCallbackData=0xbec784fc, aFlags=3200746860)
    at /Users/gal/workspace/B2G/gecko/gfx/layers/basic/BasicLayerManager.cpp:1136
#16 0x40874c0a in nsDisplayList::PaintForFrame (this=<value optimized out>, aBuilder=0xbec7a090, aCtx=<value optimized out>, aForFrame=<value optimized out>, aFlags=13)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:1127
#17 0x40874d74 in nsDisplayList::PaintRoot (this=0xbec7a418, aBuilder=0xbec7a090, aCtx=0x0, aFlags=13) at /Users/gal/workspace/B2G/gecko/layout/base/nsDisplayList.cpp:992
#18 0x408838d8 in nsLayoutUtils::PaintFrame (aRenderingContext=<value optimized out>, aFrame=0x46f0d298, aDirtyRegion=<value optimized out>, aBackstop=<value optimized out>, 
    aFlags=772) at /Users/gal/workspace/B2G/gecko/layout/base/nsLayoutUtils.cpp:1857
#19 0x4088fc18 in PresShell::Paint (this=0x46f09200, aViewToPaint=<value optimized out>, aDirtyRegion=..., aFlags=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/layout/base/nsPresShell.cpp:5329
#20 0x40aa449c in nsViewManager::ProcessPendingUpdatesForView (this=0x46a8c310, aView=0x46a51e80, aFlushDirtyRegion=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/view/src/nsViewManager.cpp:435
#21 0x40aa453e in nsViewManager::ProcessPendingUpdates (this=<value optimized out>) at /Users/gal/workspace/B2G/gecko/view/src/nsViewManager.cpp:1210
---Type <return> to continue, or q <return> to quit---
#22 0x4089350c in nsRefreshDriver::Notify (this=0x427fe1d0, aTimer=<value optimized out>) at /Users/gal/workspace/B2G/gecko/layout/base/nsRefreshDriver.cpp:432
#23 0x40f2c504 in nsTimerImpl::Fire (this=0x47766a00) at /Users/gal/workspace/B2G/gecko/xpcom/threads/nsTimerImpl.cpp:485
#24 0x40f2c5b2 in nsTimerEvent::Run (this=<value optimized out>) at /Users/gal/workspace/B2G/gecko/xpcom/threads/nsTimerImpl.cpp:565
#25 0x40f2a6ea in nsThread::ProcessNextEvent (this=0x404078e0, mayWait=<value optimized out>, result=0xbec7a837)
    at /Users/gal/workspace/B2G/gecko/xpcom/threads/nsThread.cpp:627
#26 0x40f0a98e in NS_ProcessNextEvent_P (thread=0x32, mayWait=true) at /Users/gal/workspace/B2G/objdir-gecko/xpcom/build/nsThreadUtils.cpp:221
#27 0x40e33e02 in mozilla::ipc::MessagePump::Run (this=0x40403400, aDelegate=0x4040f0c0) at /Users/gal/workspace/B2G/gecko/ipc/glue/MessagePump.cpp:117
#28 0x40f4c428 in MessageLoop::RunInternal (this=0x1000001) at /Users/gal/workspace/B2G/gecko/ipc/chromium/src/base/message_loop.cc:215
#29 0x40f4c4de in MessageLoop::RunHandler (this=0x4040f0c0) at /Users/gal/workspace/B2G/gecko/ipc/chromium/src/base/message_loop.cc:208
#30 MessageLoop::Run (this=0x4040f0c0) at /Users/gal/workspace/B2G/gecko/ipc/chromium/src/base/message_loop.cc:182
#31 0x40dbf364 in nsBaseAppShell::Run (this=0x42619760) at /Users/gal/workspace/B2G/gecko/widget/xpwidgets/nsBaseAppShell.cpp:163
#32 0x40d24d5c in nsAppStartup::Run (this=0x426328e0) at /Users/gal/workspace/B2G/gecko/toolkit/components/startup/nsAppStartup.cpp:290
#33 0x40775f0c in XREMain::XRE_mainRun (this=0xbec7a9d4) at /Users/gal/workspace/B2G/gecko/toolkit/xre/nsAppRunner.cpp:3823
#34 0x40778010 in XREMain::XRE_main (this=0xbec7a9d4, argc=<value optimized out>, argv=0xbec7cbb4, aAppData=<value optimized out>)
    at /Users/gal/workspace/B2G/gecko/toolkit/xre/nsAppRunner.cpp:3890
#35 0x40778154 in XRE_main (argc=1, argv=0xbec7cbb4, aAppData=0xa9a4, aFlags=<value optimized out>) at /Users/gal/workspace/B2G/gecko/toolkit/xre/nsAppRunner.cpp:4084
#36 0x0000898a in do_main (argc=1, argv=0xbec7cbb4) at /Users/gal/workspace/B2G/gecko/b2g/app/nsBrowserApp.cpp:154
#37 main (argc=1, argv=0xbec7cbb4) at /Users/gal/workspace/B2G/gecko/b2g/app/nsBrowserApp.cpp:239
(Assignee)

Comment 84

6 years ago
Fun. So mRegionToDraw looks correct.

Display item type BackgroundColor(0x46cf98a8) (in layer 0x49eb3400) changed geometry!
Invalidating layer 0x49eb3400: < (x=0, y=609, w=320, h=1); >
Display item type Background(0x46cf98a8) (in layer 0x49eb3400) changed geometry!
Invalidating layer 0x49eb3400: < (x=14, y=609, w=30, h=1); >
result.mRegionToDraw < (x=0, y=149, w=320, h=1); >
DrawThebesLayer < (x=0, y=149, w=320, h=1); > < >
We should definitely always be clipped to aRegionToDraw when we enter DrawThebesLayer.

I guess it's possible that something is clobbering the clip somewhere.

calling GetClipExtents() on the gfxContext object at various places might help. At least at the start of the function and right before we call FlashPaint().
(In reply to Andreas Gal :gal from comment #56)
> This has almost certainly nothing to do with OMTC or scrolling into view. We
> invalidate all the time.

I was concerned by this, but it turns out we're both right. In latest mozilla-central, I don't see the bad drawing I used to see (although the artifact of not clipping still exists, as you found). In older mozilla-central, I can still easily reproduce the bad drawing.

Comment 87

6 years ago
Going through unassigned basecamp bugs in triage - Andreas is currently investigating with help from Matt.  Kick it back to nobody if it needs another owner.
Assignee: nobody → gal
This bug has been called out as likely having risk to non-B2G platforms. Given that, marking as P1, and moving into the C2 milestone. We should prioritize this landing to mozilla-beta as soon as possible, to prevent late-breaking regressions to other platforms.
Target Milestone: --- → B2G C2 (20nov-10dec)
(Assignee)

Comment 89

6 years ago
Comment 86 is not correct as far as I can tell. I see this on trunk in on device builds.
Joyously, it seems that we (correctly) invalidate the inside of the rounded button, and then the paint flashing, which should be drawn only inside the rounded-rectangle clipped button, leaks outside of it because we didn't know how to use rounded clips.

Which means that this actually was not a bug, but rather a red herring.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 813124
You need to log in before you can comment on or make changes to this bug.