Use document direction when a fragment has a null range

Bug: 63945
Change-Id: Ic856376bbee06cd8d20b0016653185b1dd288606
Merge "Use document direction when a fragment has a null range"