Bug 138949 - range.getBoundingClientRect() returns incorrect value for collapsed ranges
Summary: range.getBoundingClientRect() returns incorrect value for collapsed ranges
Status: RESOLVED DUPLICATE of bug 196380
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-20 20:51 PST by Glen Huang
Modified: 2022-09-18 17:04 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glen Huang 2014-11-20 20:51:33 PST
Example URL:
http://jsbin.com/lesobugupi/2/edit?html,js,output

Steps to reproduce the problem:
1. click on the hello text
2. see a 0 0 0 0 value in the output div

What went wrong?
range.getBoundingClientRect() should return a rect that denotes the range position even if it's collapsed, according to the spec http://www.w3.org/TR/cssom-view/#dom-range-getclientrects

Especially the "including when the boundary-points are identical" part.

Blink also has this problem. Works in gecko.
Comment 1 Glen Huang 2014-12-20 02:49:54 PST
Blink has confirmed this bug.
https://code.google.com/p/chromium/issues/detail?id=435438

I believe this bug exists pre-fork.
Comment 2 Ahmad Saleem 2022-09-17 03:48:06 PDT
I am not able to reproduce this with Safari Technology Preview 153 and it does not show "0 0 0 0" value.

I will tag others to confirm whether it is fixed it or not. Thanks!
Comment 3 Alexey Proskuryakov 2022-09-18 17:04:42 PDT

*** This bug has been marked as a duplicate of bug 196380 ***