Bug 1809492 Comment 26 Edit History

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

There is some mechanism in place to try to guarantee that `mTreeBody` outlives the `XULTreeElement`: `nsTreeBodyFrame::DestroyFrom()` will call  `mTree->BodyDestroyed(mTopRowIndex);` if `mTree` is set. That will in turn set `mTreeBody` to `nullptr` for that `XULTreeElement`. This raises some questions:

- Are we sure that `mTree` is always correctly set for any `nsTreeBodyFrame` whose pointer is part of the layout of a `XULTreeElement`? As far as I can tell, `mTree` is set only when we call into `nsTreeBodyFrame::GetBaseElement()`. Do we always call into that function for these `nsTreeBodyFrame` objects?
- Are we sure that after `mTreeBody` has been set to `nullptr` following a call to `XULTreeElement::BodyDestroyed`, the next call to `XULTreeElement::GetTreeBodyFrame()` cannot set it back to the same `nsTreeBodyFrame`? (I guess not)
There is some mechanism in place to try to guarantee that `mTreeBody` outlives the `XULTreeElement`: `nsTreeBodyFrame::DestroyFrom()` will call  `mTree->BodyDestroyed(mTopRowIndex);` if `mTree` is set for that `nsTreeBodyFrame`. That will in turn set `mTreeBody` to `nullptr` for that `XULTreeElement`. This raises some questions:

- Are we sure that `mTree` is always correctly set for any `nsTreeBodyFrame` whose pointer is part of the layout of a `XULTreeElement`? As far as I can tell, `mTree` is set only when we call into `nsTreeBodyFrame::GetBaseElement()`. Do we always call into that function for these `nsTreeBodyFrame` objects?
- Are we sure that after `mTreeBody` has been set to `nullptr` following a call to `XULTreeElement::BodyDestroyed`, the next call to `XULTreeElement::GetTreeBodyFrame()` cannot set it back to the same `nsTreeBodyFrame`? (I guess not)
There is some mechanism in place to try to guarantee that `mTreeBody` outlives the `XULTreeElement`: `nsTreeBodyFrame::DestroyFrom()` will call  `mTree->BodyDestroyed(mTopRowIndex);` if `mTree` is set for that `nsTreeBodyFrame`. That will in turn set `mTreeBody` to `nullptr` for that `XULTreeElement`. This raises some questions:

- Are we sure that `mTree` is always correctly set for any `nsTreeBodyFrame` whose pointer is part of the layout of a `XULTreeElement`? As far as I can tell, `mTree` is set only when we call into `nsTreeBodyFrame::GetBaseElement()`. Do we always call into that function for these `nsTreeBodyFrame` objects?
- Are we sure that after `mTreeBody` has been set to `nullptr` following a call to `XULTreeElement::BodyDestroyed`, the next call to `XULTreeElement::GetTreeBodyFrame()` cannot set it back to the same `nsTreeBodyFrame`? (This part sounds safe I would say)
There is some mechanism in place to try to guarantee that `mTreeBody` outlives the `XULTreeElement`: `nsTreeBodyFrame::DestroyFrom()` will call  `mTree->BodyDestroyed(mTopRowIndex);` if `mTree` is set for that `nsTreeBodyFrame`. That will in turn set `mTreeBody` to `nullptr` for that `XULTreeElement`. This raises some questions:

- Are we sure that `mTree` is always correctly set for any `nsTreeBodyFrame` whose pointer is part of the layout of a `XULTreeElement`? As far as I can tell, `mTree` is set only when we call into `nsTreeBodyFrame::GetBaseElement()`. Do we always call into that function for these `nsTreeBodyFrame` objects?
- Are we sure that after `mTreeBody` has been set to `nullptr` following a call to `XULTreeElement::BodyDestroyed`, the next call to `XULTreeElement::GetTreeBodyFrame()` cannot set it back to the same `nsTreeBodyFrame*`? (This part sounds safe I would say)
There is some mechanism in place to try to guarantee that `mTreeBody` outlives the `XULTreeElement`: `nsTreeBodyFrame::DestroyFrom()` will call  `mTree->BodyDestroyed(mTopRowIndex);` if `mTree` is set for that `nsTreeBodyFrame`. That will in turn set `mTreeBody` to `nullptr` for that `XULTreeElement`. This raises some questions:

- Are we sure that `mTree` is always correctly set for any `nsTreeBodyFrame` whose pointer is part of the layout of a `XULTreeElement`? As far as I can tell, `mTree` is set only when we call into `nsTreeBodyFrame::GetBaseElement()`. Do we always call into that function for these `nsTreeBodyFrame` objects? Are we sure that we find the correct `XULTreeElement`?
- Are we sure that after `mTreeBody` has been set to `nullptr` following a call to `XULTreeElement::BodyDestroyed`, the next call to `XULTreeElement::GetTreeBodyFrame()` cannot set it back to the same `nsTreeBodyFrame*`? (This part sounds safe I would say)
There is some mechanism in place to try to guarantee that `mTreeBody` outlives the `XULTreeElement`: `nsTreeBodyFrame::DestroyFrom()` will call  `mTree->BodyDestroyed(mTopRowIndex);` if `mTree` is set for that `nsTreeBodyFrame`. That will in turn set `mTreeBody` to `nullptr` for that `XULTreeElement`. This raises some questions:

- Are we sure that `mTree` is always correctly set for any `nsTreeBodyFrame` whose pointer is part of the layout of a `XULTreeElement`? As far as I can tell, `mTree` is set only when we call into `nsTreeBodyFrame::GetBaseElement()`. Do we always call into that function for these `nsTreeBodyFrame` objects? Are we sure that this function finds the correct `XULTreeElement`?
- Are we sure that after `mTreeBody` has been set to `nullptr` following a call to `XULTreeElement::BodyDestroyed`, the next call to `XULTreeElement::GetTreeBodyFrame()` cannot set it back to the same `nsTreeBodyFrame*`? (This part sounds safe I would say)
There is some mechanism in place to try to guarantee that `mTreeBody` outlives the `XULTreeElement`: `nsTreeBodyFrame::DestroyFrom()` will call  `mTree->BodyDestroyed(mTopRowIndex);` if `mTree` is set for that `nsTreeBodyFrame`. That will in turn set `mTreeBody` to `nullptr` for that `XULTreeElement`. This raises some questions:

- Are we sure that `mTree` is always correctly set for any `nsTreeBodyFrame` whose pointer is part of the layout of a `XULTreeElement`? As far as I can tell, `mTree` is set only when we call into `nsTreeBodyFrame::GetBaseElement()`. Do we always call into that function for these `nsTreeBodyFrame` objects? Are we sure that this function finds the correct `XULTreeElement`?
- Are we sure that after `mTreeBody` has been set to `nullptr` following a call to `XULTreeElement::BodyDestroyed`, the next call to `XULTreeElement::GetTreeBodyFrame()` cannot set it back to the same `nsTreeBodyFrame*`?

Back to Bug 1809492 Comment 26