NEW 197042
Range.getBoundingClientRect returns invalid bounds when between two non-editable nodes
https://bugs.webkit.org/show_bug.cgi?id=197042
Summary Range.getBoundingClientRect returns invalid bounds when between two non-edita...
Shrey Banga
Reported 2019-04-17 16:54:50 PDT
Created attachment 367698 [details] You can open it in Safari and look at the console log to see the bug I have attached a test case where you can see this in the console log, but also copying the description from the Chrome bug (#953977) I filed for this: Steps to reproduce the problem: 1. Create a contenteditable=true node 2. Add two nodes inside it with contenteditable=false 3. Position a Range between these two programmatically or by clicking between them 4. Call getBoundingClientRect() on the current range What is the expected behavior? This should return the same bounds as it would if the two adjacent nodes were editable. What went wrong? This currently returns a DOMRect with everything zero-ed out: bottom: 0 height: 0 left: 0 right: 0 top: 0 width: 0 x: 0 y: 0 Did this work before? No
Attachments
You can open it in Safari and look at the console log to see the bug (454 bytes, text/html)
2019-04-17 16:54 PDT, Shrey Banga
no flags
Radar WebKit Bug Importer
Comment 1 2019-04-18 09:23:50 PDT
Ahmad Saleem
Comment 2 2022-08-09 13:58:13 PDT
I am able to reproduce this bug in Safari 15.6 on macOS 12.5 and get following using attached test case and looking into Console: >>> DOMRect bottom: 0 height: 0 left: 0 right: 0 top: 0 width: 0 x: 0 y: 0 In other browsers, I get following: *** Chrome Canary 106 *** Same as Safari 15.6 *** Firefox Nightly 105 *** bottom: 8 height: 0 left: 8 right: 8 top: 8 width: 0 x: 8 y: 8 _______ I am not sure on web-spec but just wanted to update latest test results. Thanks!
Note You need to log in before you can comment on or make changes to this bug.