The getBoundingClientRect() JS method may return zero region when called the first time.

Not reproducible Issue #280050

Details

Created
Jun 3, 2014
Privacy
This issue is public.
Reports
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce

URL:

Repro Steps:

Open our website which uses jQuery and object generation. Open the F12 development tools. Add breakpoint at some place and wait for it to be hit. Open Console.

//*** Test 1
//Calling getBoundingClientRect() for the first time
obj.getBoundingClientRect()
//>{bottom: 0, left: 0, right: 0, top: 0} - BUG!

//Calling getBoundingClientRect() for the second time
obj.getBoundingClientRect()
//>{bottom: 304, left: 227, right: 941, top: 281} - NO BUG

//*** Test 2
//Accessing some property not related to positioning
obj.className
//>someClass

//Calling getBoundingClientRect() for the first time
obj.getBoundingClientRect()
//>{bottom: 0, left: 0, right: 0, top: 0} - BUG!

//*** Test 3
//Accessing some property related to positioning
obj.clientTop
//>0

//Calling getBoundingClientRect() for the first time
obj.getBoundingClientRect()
//>{bottom: 304, left: 227, right: 941, top: 281} - NO BUG (bug was prevented)

Expected Results:

I expect the getBoundingClientRect() method to always return correct results without any hacks and workarounds ().

Actual Results:

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Tony S.”

      Changed Assigned To from “Tony S.” to “Eugene V.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Eugene V.” to “Phil O.”

      Changed Assigned To from “Phil O.” to “IE F.”

      Changed Status from “Confirmed” to “Not reproducible”

    You need to sign in to your Microsoft account to add a comment.

    Sign in