Bug
1872301 - Make `nsFocusManager::GetSelectionLocation` never fail when found text node has no frame r=NeilDeakin
In the test case, `nsFocusManager::GetSelectionLocation` is called with
collapsed selection at end of the `<svg>` which ends with collapsible
white-spaces. Therefore, it reaches the white-space only text node and it
does not have a primary frame due to invisible.
Previously, creating `nsFrameIterator` failed and then the method returned
error, but after bug 779684, `nsFrameIterator` constructor wants non-nullptr
frame avoiding crash. Therefore, I added the `MOZ_ASSERT` there to get a
way to reproduce the case and now we got it.
I think that just removing `MOZ_ASSERT` and keeping returning error is not
correct. The text can be invisible with the other reasons and it does not
collapsed at end of invisible text, this does not return error. Therefore,
this patch makes just returning the text in the case without error.
Differential Revision: https://phabricator.services.mozilla.com/
D198128