Bug 1782195 Comment 14 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 Emilio Cobos Álvarez (:emilio) from comment #11)
> Most likely bug 1312379... It seems we're probably exporting a bogus baseline from the grid container, when doing an incremental reflow, somehow?

Most likely, what's happening is:
* When you resize the window, we're calling `nsGridContainerFrame::MarkIntrinsicISizesDirty` which resets our cached baseline values:
https://searchfox.org/mozilla-central/rev/b63f8c50a3398aff80d2a5f185a90dcdba47f419/layout/generic/nsGridContainerFrame.cpp#10342,10346
* Then we do an incremental reflow, and we call one of the [baseline getters](https://searchfox.org/mozilla-central/rev/b63f8c50a3398aff80d2a5f185a90dcdba47f419/layout/generic/nsGridContainerFrame.h#393-398) **before we manage to reflow the grid again** (possibly because we're able to recompute the grid's marked-as-dirty intrinsic sizes, and aside from those, we don't think the grid needs to be reflowed?)
* ...and so that baseline getter returns the bogus `NS_INTRINSIC_ISIZE_UNKNOWN` value which is `nscoord_MIN`, a giant negative number.

To fix this, we probably need to ensure that the grid always gets a reflow after `MarkIntrinsicISizesDirty` has been called, in order to recompute the baseline offsets; or, we need to let our baseline-offset getters have a fallback codepath that's able to dynamically compute the baseline by walking the persistent data that we built up in the last reflow.
(In reply to Emilio Cobos Álvarez (:emilio) from comment #11)
> It seems we're probably exporting a bogus baseline from the grid container, when doing an incremental reflow, somehow?

Most likely, what's happening is:
* When you resize the window, we're calling `nsGridContainerFrame::MarkIntrinsicISizesDirty` which resets our cached baseline values:
https://searchfox.org/mozilla-central/rev/b63f8c50a3398aff80d2a5f185a90dcdba47f419/layout/generic/nsGridContainerFrame.cpp#10342,10346
* Then we do an incremental reflow, and we call one of the [baseline getters](https://searchfox.org/mozilla-central/rev/b63f8c50a3398aff80d2a5f185a90dcdba47f419/layout/generic/nsGridContainerFrame.h#393-398) **before we manage to reflow the grid again** (possibly because we're able to recompute the grid's marked-as-dirty intrinsic sizes, and aside from those, we don't think the grid needs to be reflowed?)
* ...and so that baseline getter returns the bogus `NS_INTRINSIC_ISIZE_UNKNOWN` value which is `nscoord_MIN`, a giant negative number.

To fix this, we probably need to ensure that the grid always gets a reflow after `MarkIntrinsicISizesDirty` has been called, in order to recompute the baseline offsets; or, we need to let our baseline-offset getters have a fallback codepath that's able to dynamically compute the baseline by walking the persistent data that we built up in the last reflow.
(In reply to Emilio Cobos Álvarez (:emilio) from comment #11)
> It seems we're probably exporting a bogus baseline from the grid container, when doing an incremental reflow, somehow?

Most likely, what's happening is:
* When you resize the window, we're calling `nsGridContainerFrame::MarkIntrinsicISizesDirty` which resets our cached baseline values to `NS_INTRINSIC_ISIZE_UNKNOWN`, here:
https://searchfox.org/mozilla-central/rev/b63f8c50a3398aff80d2a5f185a90dcdba47f419/layout/generic/nsGridContainerFrame.cpp#10342,10346
* Then we do an incremental reflow, and we call one of the [baseline getters](https://searchfox.org/mozilla-central/rev/b63f8c50a3398aff80d2a5f185a90dcdba47f419/layout/generic/nsGridContainerFrame.h#393-398) **before we manage to reflow the grid again** (possibly because we're able to recompute the grid's marked-as-dirty intrinsic sizes, and aside from those, we don't think the grid needs to be reflowed?)
* ...and so that baseline getter returns the bogus `NS_INTRINSIC_ISIZE_UNKNOWN` value which is `nscoord_MIN`, a giant negative number.

To fix this, we probably need to ensure that the grid always gets a reflow after `MarkIntrinsicISizesDirty` has been called, in order to recompute the baseline offsets; or, we need to let our baseline-offset getters have a fallback codepath that's able to dynamically compute the baseline by walking the persistent data that we built up in the last reflow.
(In reply to Emilio Cobos Álvarez (:emilio) from comment #11)
> It seems we're probably exporting a bogus baseline from the grid container, when doing an incremental reflow, somehow?

Most likely, what's happening is:
* When you resize the window, we're calling `nsGridContainerFrame::MarkIntrinsicISizesDirty` which resets our cached baseline values to `NS_INTRINSIC_ISIZE_UNKNOWN`, here:
https://searchfox.org/mozilla-central/rev/b63f8c50a3398aff80d2a5f185a90dcdba47f419/layout/generic/nsGridContainerFrame.cpp#10342,10346
* Then we do an incremental reflow, and we call one of the [baseline getters](https://searchfox.org/mozilla-central/rev/b63f8c50a3398aff80d2a5f185a90dcdba47f419/layout/generic/nsGridContainerFrame.h#393-398) **before we manage to reflow the grid again** (possibly because we're able to recompute the grid's marked-as-dirty intrinsic sizes -- and aside from those, the inline-block doesn't think the grid needs to be reflowed and so doesn't call its reflow method)
* ...and so that baseline getter returns the bogus `NS_INTRINSIC_ISIZE_UNKNOWN` value which is `nscoord_MIN`, a giant negative number.

To fix this, we probably need to ensure that the grid always gets a reflow after `MarkIntrinsicISizesDirty` has been called, in order to recompute the baseline offsets; or, we need to let our baseline-offset getters have a fallback codepath that's able to dynamically compute the baseline by walking the persistent data that we built up in the last reflow.

Back to Bug 1782195 Comment 14