In WK2 for iOS this function is called on every selection change. The selection could be set by Javascript in an element that is not visible. In that case we won't be able to create a VisiblePosition and wordRangeForPosition should not ASSERT that the VisiblePosition is not null, but rather perform an early return if it is null.
Created attachment 231981 [details] Patch
Committed revision 169280.