Bug 1609663 Comment 5 Edit History

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

OK. Looks like the order of the initialization of the `SVGTextFrame` and `nsFrame` has some isseus:

1. Call `SVGTextFrame::Init()`, which [calls its parents' `Init()`s](https://searchfox.org/mozilla-central/rev/df94cd5ba431234bc220ac081def0801fe44b89e/layout/svg/SVGTextFrame.cpp#2780) before [setting `NS_FRAME_IS_SVG_TEXT` bit](https://searchfox.org/mozilla-central/rev/df94cd5ba431234bc220ac081def0801fe44b89e/layout/svg/SVGTextFrame.cpp#2781-2782).
2. Call `nsFrame::Init()`, and then this function calls `nsFrame::DidSetComputedStyle(nullptr)`
3. `nsFrame::DidSetComputedStyle()` calls `MaybeScheduleReflowSVGNonDisplayText()`
4. `MaybeScheduleReflowSVGNonDisplayText` early returns because `nsSVGUtils::IsInSVGTextSubtree(aFrame)` is false. The reason is that we haven't set the svg text frame bit yet. We set the svg text frame bit right after parents' `Init()`s.

So we don't call `ScheduleReflowSVGNonDisplayText` in this case. This may be an existing issue.
OK. Looks like the order of the initialization of the `SVGTextFrame` and `nsFrame` has some isseus:

1. Call `SVGTextFrame::Init()`, which [calls its parents' `Init()`s](https://searchfox.org/mozilla-central/rev/df94cd5ba431234bc220ac081def0801fe44b89e/layout/svg/SVGTextFrame.cpp#2780) before [setting `NS_FRAME_IS_SVG_TEXT` bit](https://searchfox.org/mozilla-central/rev/df94cd5ba431234bc220ac081def0801fe44b89e/layout/svg/SVGTextFrame.cpp#2781-2782).
2. Call `nsFrame::Init()`, and then this function calls `nsFrame::DidSetComputedStyle(nullptr)`
3. `nsFrame::DidSetComputedStyle()` calls `MaybeScheduleReflowSVGNonDisplayText()`
4. `MaybeScheduleReflowSVGNonDisplayText` early returns because [`nsSVGUtils::IsInSVGTextSubtree(aFrame)` is false](https://searchfox.org/mozilla-central/rev/df94cd5ba431234bc220ac081def0801fe44b89e/layout/generic/nsFrame.cpp#584). The reason is that we haven't set the svg text frame bit yet. We set the svg text frame bit right after parents' `Init()`s.

So we don't call `ScheduleReflowSVGNonDisplayText` in this case. This may be an existing issue.

Back to Bug 1609663 Comment 5