Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Fix reading zIndex under chrome #122

Closed
wants to merge 1 commit into from

Conversation

theospears
Copy link

For me on chrome 26 the object returned by getComputedStyle() has
properties with names as in css ('z-index') not like the javascript
style properties ('zIndex') so we need to convert to look up the
z-index correctly.

For me on chrome 26 the object returned by getComputedStyle() has
properties with names as in css ('z-index') not like the javascript
style properties ('zIndex') so we need to convert to look up the
z-index correctly.
@JamesMGreene
Copy link
Member

Thanks for the PR! I was aware of this issue with getComputedStyle but haven't had the time to address it yet, so thank you for beating me to it. :)

That said:

  1. I cannot personally merge this yet as our build doesn't currently work on Windows (see Make a build that works on Windows (+ Mac + Linux) #71), so all of my efforts are being invested in resolving that first so that I can do legit PR testing, etc.
  2. So, we'll probably have to wait for @jonrohan to get back from his vacation to merge this, unless I finish the cross-platform-including-Windows build before then.
  3. When @jonrohan and I talked about this previously, our decision was to provide the strings in their native CSS format (e.g. "z-index") and then convert them to their camel-cased-and-sometimes-crazy alternative forms for use with currentStyle in old IE (e.g. styleFloat Fix for "float" jonathantneal/Polyfills-for-IE8#1).

@jonrohan
Copy link
Contributor

I'm ok with using this for now. Does just replacing the camel case with - work in most cases?

@JamesMGreene
Copy link
Member

We only get 4 computed styles right now (zIndex, borderTopWidth, borderLeftWidth, and cursor). I believe this technique will work for all of them, yes. If we add any more, we'll need to double-check each one's oldIE equivalent name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants