Fix: if the startContainer of endContainer is an element, we get wrong offset.
Fix: if the startContainer of endContainer is an element, we get wrong offset.

danny0838/firefox-scrapbook,danny0838/firefox-scrapbook