Skip to main content

Bug Tracker

Side navigation

#12235 closed bug (fixed)

Opened August 10, 2012 06:18AM UTC

Closed August 10, 2012 11:34PM UTC

getComputedStyle is used without namespace

Reported by: Owned by: rwaldron
Priority: low Milestone: 1.8.1
Component: css Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:

v1.8.0 L:6612 says:

"computed = getComputedStyle( elem, null )"

but in any other place, you are using window.getComputedStyle.

I'm using jQuery on Node.js, then it's a big problem.

I want to fix to window.getComputedStyle same as the "If( window.getComputedStyle)" in L:6609.

or change L:6609 to "if(getComputedStyle)"

Attachments (0)
Change History (7)

Changed August 10, 2012 02:47PM UTC by dmethvin comment:1

milestone: None1.8.1
status: newopen

Changed August 10, 2012 10:05PM UTC by mikesherov comment:2

component: unfiledcss
owner: → mikesherov
priority: undecidedlow
status: openassigned

This was done to save bytes. I guess it's not worth the savings to break node.

Changed August 10, 2012 10:07PM UTC by rwaldron comment:3

status: assignedpending

jQuery on Node.js? Are you using jsdom? If so, then you should create a window property on the global object

Changed August 10, 2012 11:10PM UTC by anonymous comment:4

Yes. I'm using jsdom and create window on global namespace. but unfortunately on Node.js, the top scope is not window but global. so that I can access to window.getComputedStyle but cannot access to "getComputeStyle" because of "no such a function". It does not happen v1.7.2 so that I wrote a bug report.

Changed August 10, 2012 11:11PM UTC by comment:5

status: pendingnew

(the comment previous is my comment)

Changed August 10, 2012 11:21PM UTC by rwaldron comment:6

owner: brilliantpenguin@gmail.comrwaldron
status: newassigned

Right, got it. Fix coming

Changed August 10, 2012 11:34PM UTC by Rick Waldron comment:7

resolution: → fixed
status: assignedclosed

Use window.getComputedStyle to prevent breaking jsdom/node.js . Fixes #12235

Changeset: 3722aef8be5d31a7dbf3de6998cdf249081f028c