Created attachment 565290 [details] ff_selection_test.html User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27 Steps to reproduce: If you try to grab the selectionStart or selectionEnd from a textarea after setting style.display to "none", you get an uncaught NS_ERROR_FAILURE exception. Expected results: Other browsers seem to cache the old selection. Tested in FF 5.5, 7, and today's nightly.
Ehsan, don't we store that stuff in the editor state now?
6 years ago
The problem here is that in GetSelectionStart/End, we do a GetFormControlFrame which might flush, in which case the frame will go away and we throw. We need to check for the selection information being cached after doing that too.
Created attachment 565325 [details] [diff] [review] Patch (v1)
Comment on attachment 565325 [details] [diff] [review] Patch (v1) Textarea didn't use to null-check mState. Should it have, or should that change not be made in this patch? r=me with that sorted out.
Created attachment 565333 [details] [diff] [review] Patch (v2) You're right, the null check is not necessary.
Ahem: Bug 617068
(In reply to Ms2ger from comment #6) > Ahem: Bug 617068 That's a really cryptic bug, but reading the patch, if all you want to do is to throw NS_ERROR_DOM_INVALID_STATE_ERR when this stuff is called on non-text inputs, then you should really look into building your patch on top of this one. That patch is incorrect already. :-)