Bug 1459312 Comment 28 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Oh dear, the scopes of things in that function are utterly inscrutable. No, this change of scopes was definitely not an intended effect of the patch. We need to change the scoping such that the `AutoCurrentScrollParentIdSetter` gets destroyed in the same spot as before, i.e. ideally just before the

```
  if (mWillBuildScrollableLayer && aBuilder->IsPaintingToWindow()) {
    aBuilder->ForceLayerForScrollParent();
  }
```

block. I hope this doesn't conflict with any of the other scope changes that the patch made.

In terms of outside-to-inside wrapping of things, I think we want the following order:

 - Viewport clip, affects:
     - optional `nsDisplayAsyncZoom` container item, wraps:
         - optional `nsDisplayScrollInfoLayer`
         - scroll parent ID setter, affects:
             - `asrSetter`, affects:
                 - the items which are built in the call to `mOuter->BuildDisplayListForChild`.

So really, the only scope change that this patch wants to make is to have a scope for the nsDisplayAsyncZoom for which the following are true:

 1. The asrSetter is not on the stack, and
 2. The Viewport clip is on the stack.

The rest should stay the same.
Oh dear, the scopes of things in that function are utterly inscrutable. No, this change of scopes was definitely not an intended effect of the patch. We need to change the scoping such that the `AutoCurrentScrollParentIdSetter` gets destroyed in the same spot as before, i.e. ideally just before the

```
  if (mWillBuildScrollableLayer && aBuilder->IsPaintingToWindow()) {
    aBuilder->ForceLayerForScrollParent();
  }
```

block. I hope this doesn't conflict with any of the other scope changes that the patch made.

In terms of outside-to-inside wrapping of things, I think we want the following order:

 - Viewport clip, affects:
     - optional `nsDisplayAsyncZoom` container item, wraps:
         - optional `nsDisplayScrollInfoLayer`
         - scroll parent ID setter, affects:
             - `asrSetter`, affects:
                 - the items which are built in the call to `mOuter->BuildDisplayListForChild`.

So really, the only scope change that this patch wants to make is to have a scope for the `nsDisplayAsyncZoom` for which the following are true:

 1. The asrSetter is not on the stack, and
 2. The Viewport clip is on the stack.

The rest should stay the same.

Back to Bug 1459312 Comment 28