We run into an non invertible transform because while building the matrix, it is scaled by a zero scale factor that was produced here: https://searchfox.org/mozilla-central/rev/8dd35cd8f5284fbaa506aab02fe42fc87efb249e/layout/svg/SVGTextFrame.cpp#4906 with `expectedTextLength` also begin equal to zero. Looking at the test case, it explicitly sets the text length to zero, so I guess there's no need to seach further for reasons why we get this value. I'm not intimate with the text layout code but my unedicated guess would be that in this case we should bail out earlier, maybe in `nsTextFrame::PaintText` either after checking whether the scale factor is zero (or the text length itself), or if we think that there's a lot of other wonky input that can get us in this situation, by checking early if the matrix is invertible. Jonathan, does that sound right?
Bug 1404086 Comment 8 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
We run into an non invertible transform because while building the matrix, it is scaled by a zero scale factor that was produced here: https://searchfox.org/mozilla-central/rev/8dd35cd8f5284fbaa506aab02fe42fc87efb249e/layout/svg/SVGTextFrame.cpp#4906 with `expectedTextLength` also begin equal to zero. Looking at the test case, it explicitly sets the text length to zero, so I guess there's no need to seach further for reasons why we get this value. I'm not intimate with the text layout code but my uneducated guess would be that in this case we should bail out earlier, maybe in `nsTextFrame::PaintText` either after checking whether the scale factor is zero (or the text length itself), or if we think that there's a lot of other wonky input that can get us in this situation, by checking early if the matrix is invertible. Jonathan, does that sound right?