[Webkit-unassigned] [Bug 203386] New: document.caretRangeFromPoint returns wrong range on google docs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 24 16:09:08 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=203386

            Bug ID: 203386
           Summary: document.caretRangeFromPoint returns wrong range on
                    google docs
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Macintosh
                OS: macOS 10.14
            Status: NEW
          Severity: Major
          Priority: P2
         Component: DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: maikudou at gmail.com

Created attachment 381852

  --> https://bugs.webkit.org/attachment.cgi?id=381852&action=review

Screenshot with notes for observing bug on the page

document.caretRangeFromPoint returns incorrect range for some google docs documents

Steps to reproduce:
1. Open https://docs.google.com/document/d/1G0PhdEEVO1BTzRHZipnksOci4eIWyXEevPvHL5rlNxM/edit?usp=sharing
2. Set browser window width to 1490 (not necessary but helps with exact coordinates sync)
3. Open developer tools
4. Call document.caretRangeFromPoint(595.265625, 293) -- it's coordinates of first letter of word 'general' in the 4th line of the doc
5. Observe returned range. Its startContainer and endContainer erroneously point to different Dom node, in this case blue underline that google docs use to imitate link on ', I am a link' text in the middle of the document

Expected behavior:
document.caretRangeFromPoint(595.265625, 293) returns range in textNode containing 'general' in the 4th line of the doc

Notes: 
doc.elementFromPoint(595.265625, 293) on the other hand works just right

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191024/1377f234/attachment.htm>


More information about the webkit-unassigned mailing list