New issue
Advanced search Search tips

Issue 628305 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Object.values is not working with ClientRect object

Reported by cyril.au...@gmail.com, Jul 14 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.8 Safari/537.36

Steps to reproduce the problem:
1. Object.values(document.body.getBoundingClientRect())
2. 
3. 

What is the expected behavior?
Object.values(document.body.getBoundingClientRect()) should return the values for top, left, ...
like: 
Object.values({bottom : 0, height : 0, left : 12, right : 0, top : 0, width : 0})
or
Object.values(new class{constructor(){this.a=1;this.b=2}})

What went wrong?
it returns []

Did this work before? N/A 

Chrome version: 53.0.2785.8  Channel: dev
OS Version: 10.0
Flash Version: Shockwave Flash 22.0 r0

it's the same on Firefox though
 
it's really minor, I had to test that width, height, top and left where not all equal to 0 when applying getBoundingClientRect to a Range. So it's not a big deal to chain 4 things
Components: -Blink Blink>JavaScript>Language
Labels: -OS-Windows OS-All
Status: WontFix (was: Unconfirmed)
Object.values iterates over own values. All of the getters of the ClientRect instance are on the prototype, so you won't really get any Object.values or Object.keys:

http://jsbin.com/jalewijuqu/edit?js,console
Yes, thanks, I saw that Object.getOwnPropertyNames(document.body.getBoundingClientRect())) was also [], ok I didn't know it was getters

Sign in to add a comment