Bug 103430 - Range.getClientRects() and Range.getBoundingClientRect() incorrectly include hidden overflown content
Summary: Range.getClientRects() and Range.getBoundingClientRect() incorrectly include ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Blocker
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-11-27 09:33 PST by Daniel Trebbien
Modified: 2022-08-07 06:33 PDT (History)
6 users (show)

See Also:


Attachments
Test case (904 bytes, text/html)
2012-11-27 09:33 PST, Daniel Trebbien
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Trebbien 2012-11-27 09:33:09 PST
Created attachment 176287 [details]
Test case

Range.getClientRects() and Range.getBoundingClientRect() consider overflow content of children that is hidden by overflow:hidden.  Horizontally and vertically overflown content is included.

Attached is a reduced test case.  The test case works as expected in Firefox 17.0 and Opera 12.11 (the alert message should be "bcr.width = 14, bcr.height = 54"), but it fails in Safari 6.0.2, Safari 5.0.5, Chrome 23.0.1271.91, and the latest WebKit nightly r135851 built on 27 November 2012.

Possibly related:  Bug 103150 - Range.getBoundingClientRect() does not handle max-height correctly
Comment 1 Daniel Trebbien 2012-11-29 15:37:55 PST

*** This bug has been marked as a duplicate of bug 103658 ***
Comment 2 Daniel Trebbien 2013-01-15 13:44:49 PST
https://bugzilla.mozilla.org/show_bug.cgi?id=816238
Comment 3 Ahmad Saleem 2022-08-01 14:00:36 PDT
*** Safari 15.6 on macOS 12.5 ***

bcr.width = 197.5234375, bcr.height = 200

*** Chrome Canary 106 ***

bcr.width = 197.5234375, bcr.height = 205.5

*** Firefox Nightly 105 ***

bcr.width = 14, bcr.height = 54

________

I am not sure on correct behavior or expected result aligned with web-spec but as per Comment 0, Firefox is correct here. Just wanted to share updated results for reference. Thanks!
Comment 4 Radar WebKit Bug Importer 2022-08-01 14:12:24 PDT
<rdar://problem/97935682>