I've been reading the WebRender code for creating WebRenderScrollLayerData nodes, and my understanding so far is that the "ancestor transform" is an optimization of sorts. Rather than having every nsDisplayTransform display item create its own WebRenderScrollLayerData node, we try to "defer" some transforms and combine them into other nodes (and possibly also combine them with each other); this is explained in more detail in [this comment](https://searchfox.org/mozilla-central/rev/77f0b36028b2368e342c982ea47609040b399d89/gfx/layers/wr/StackingContextHelper.h#83). When a WebRenderScrollLayerData node is finally emitted, the deferred transforms are stored in the "ancestor transform" field, which gets associated with the topmost metrics during hit-testing tree building. If I disable this optimization (by commenting out the branches [here](https://searchfox.org/mozilla-central/rev/77f0b36028b2368e342c982ea47609040b399d89/layout/painting/nsDisplayList.cpp#8164) and [here](https://searchfox.org/mozilla-central/rev/77f0b36028b2368e342c982ea47609040b399d89/layout/painting/nsDisplayList.cpp#8211)), the bug goes away.
Bug 1719913 Comment 17 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I've been reading the WebRender code for creating WebRenderLayerScrollData nodes, and my understanding so far is that the "ancestor transform" is an optimization of sorts. Rather than having every nsDisplayTransform display item create its own WebRenderLayerScrollData node, we try to "defer" some transforms and combine them into other nodes (and possibly also combine them with each other); this is explained in more detail in [this comment](https://searchfox.org/mozilla-central/rev/77f0b36028b2368e342c982ea47609040b399d89/gfx/layers/wr/StackingContextHelper.h#83). When a WebRenderLayerScrollData node is finally emitted, the deferred transforms are stored in the "ancestor transform" field, which gets associated with the topmost metrics during hit-testing tree building. If I disable this optimization (by commenting out the branches [here](https://searchfox.org/mozilla-central/rev/77f0b36028b2368e342c982ea47609040b399d89/layout/painting/nsDisplayList.cpp#8164) and [here](https://searchfox.org/mozilla-central/rev/77f0b36028b2368e342c982ea47609040b399d89/layout/painting/nsDisplayList.cpp#8211)), the bug goes away.