visiblePositionForIndex can return an instance that returns true for isNotNull(). One of common case is when the corresponding input element has "-webkit-user-select: none" style attribute. We should allow the case instead of putting ASSERT.
Created attachment 31000 [details] Proposed fix for 26214
Comment on attachment 31000 [details] Proposed fix for 26214 Why does this need to be guarded in an if? Doesn't VisibleSelection(foo, null) result in an empty selection? or does that ASSERT too?
(In reply to comment #2) > (From update of attachment 31000 [details] [review]) > Why does this need to be guarded in an if? Doesn't VisibleSelection(foo, null) > result in an empty selection? or does that ASSERT too? > Yes, creation of VisibleSelection can be put outside if-clause. Fixed. The line ASSERT(startPosition.deepEquivalent().node()->shadowAncestorNode() == node() && endPosition.deepEquivalent().node()->shadowAncestorNode() == node()); must be guarded into if-clause because deepEquivalent() can be null. In fact, I observe shadowAncestorNode() called with this=null.
Created attachment 31079 [details] Proposed fix for 26214 (rev2)
Comment on attachment 31079 [details] Proposed fix for 26214 (rev2) r=me
Thank you. Could you land this for me?
Landed in @r44578.
(In reply to comment #7) > Landed in @r44578. > Thank you.