Bug 1525561 Comment 18 Edit History

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

(In reply to Hiroyuki Ikezoe (:hiro) from comment #4)
> * [in nsLayoutUtils::CalculateRootCompositionSize](https://searchfox.org/mozilla-central/rev/5a4aaccb28665807a6fd49cf48367d47fbb5a19a/layout/base/nsLayoutUtils.cpp#8737)
>   * It looks harmless in fission world for me (it looks inefficient though), but I am not 100% sure, __Botond__?

This function serves a very similar purpose to `RestrictToRootDisplayPort`: it calculates a quantity ([`FrameMetrics::mRootCompositionSize`](https://searchfox.org/mozilla-central/rev/e11d919cdc8a909354eb2c3e19904d9229c55d88/gfx/layers/FrameMetrics.h#645)) on the main thread that is shipped over to APZ, and used to [restrict](https://searchfox.org/mozilla-central/rev/e11d919cdc8a909354eb2c3e19904d9229c55d88/gfx/layers/FrameMetrics.h#238) the "display port base" that APZ [uses](https://searchfox.org/mozilla-central/rev/e11d919cdc8a909354eb2c3e19904d9229c55d88/gfx/layers/apz/src/AsyncPanZoomController.cpp#3773) to compute the display port size. The restriction is important in exactly the same case as `RestrictToRootDisplayPort`, i.e. cases where a scrollable subframe's viewport is larger than root viewport.

We can probably unify `CalculateRootCompositionSize` and part of `RestrictToRootDisplayPort` to compute a single quantity related to the root viewport size that's used to restrict the display port base in both Layout and APZ. The work in bug 1650398 would then apply to the unified code and make both functions fission-friendly. I'll make a note about this in bug 1650398.
(In reply to Hiroyuki Ikezoe (:hiro) from comment #4)
> * [in nsLayoutUtils::CalculateRootCompositionSize](https://searchfox.org/mozilla-central/rev/5a4aaccb28665807a6fd49cf48367d47fbb5a19a/layout/base/nsLayoutUtils.cpp#8737)
>   * It looks harmless in fission world for me (it looks inefficient though), but I am not 100% sure, __Botond__?

This function serves a very similar purpose to `RestrictToRootDisplayPort`: it calculates a quantity ([`FrameMetrics::mRootCompositionSize`](https://searchfox.org/mozilla-central/rev/e11d919cdc8a909354eb2c3e19904d9229c55d88/gfx/layers/FrameMetrics.h#645)) on the main thread that is shipped over to APZ, and used to [restrict](https://searchfox.org/mozilla-central/rev/e11d919cdc8a909354eb2c3e19904d9229c55d88/gfx/layers/FrameMetrics.h#238) the "display port base" that APZ [uses](https://searchfox.org/mozilla-central/rev/e11d919cdc8a909354eb2c3e19904d9229c55d88/gfx/layers/apz/src/AsyncPanZoomController.cpp#3773) to compute the display port size. The restriction is important in exactly the same case as `RestrictToRootDisplayPort`, i.e. cases where a scrollable subframe's viewport is larger than root viewport.

We can probably unify `CalculateRootCompositionSize` and part of `RestrictToRootDisplayPort` to compute a single quantity related to the root viewport size that's used to restrict the display port base in both Layout and APZ. The work in bug 1650183 would then apply to the unified code and make both functions fission-friendly. I'll make a note about this in bug 1650183.

Back to Bug 1525561 Comment 18