Skip to main content

Bug Tracker

Side navigation

#8402 closed bug (fixed)

Opened February 28, 2011 03:07PM UTC

Closed April 12, 2011 04:39AM UTC

jQuery.cssProps is useless in all browsers but IE6/7/8

Reported by: lrbabe Owned by: lrbabe
Priority: high Milestone: 1.6
Component: css Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:
Description

jQuery.cssProps is an object in which you can "Add in properties whose names you wish to fix before setting or getting the value".

It is used by jQuery core to map the float property to "cssFloat" or "styleFloat" depending on the browser.

Unfortunately, the current implementation is not as generic as it is supposed to be: browsers implementing window.getComputedStyle will completely ignore the "fixed property" in jQuery.css(). It works well for the 'float' property but makes jQuery.cssProps useless for other properties.

It could be really useful to create basic cssHooks:

var vendorPrefixedTransform = detectFeature('transform');
jQuery.cssProps.transform = vendorPrefixedTransform;
Attachments (0)
Change History (8)

Changed February 28, 2011 03:10PM UTC by lrbabe comment:1

Changed March 09, 2011 03:04PM UTC by rwaldron comment:2

component: unfiledcss
owner: → lrbabe
status: newpending

It sounds like you're actually describing cssHooks - can you confirm?

Changed March 14, 2011 03:37PM UTC by lrbabe comment:3

status: pendingnew

Nope, I do not confirm.

I should be able to use jquery.cssProps to make my cssHooks smaller and faster.

Changed March 30, 2011 06:24PM UTC by dmethvin comment:4

status: newpending

We're not clear on what you are asking for here; can you explain further?

Changed April 11, 2011 04:55PM UTC by lrbabe comment:5

status: pendingnew

Using jQuery.cssProps, I should be able to create tiny pseudo-cssHooks like so:

jQuery.cssProps.transform = "-webkit-transform";

This feature is described in the comments of the jQuery.cssProps object: "Add in properties whose names you wish to fix before setting or getting the value"

Unfortunately, the implementation is only half-baked and trying to access the computed style will fail. This patch fixes this problem. I'll add a unit-test asap.

Changed April 11, 2011 05:54PM UTC by lrbabe comment:6

Changed April 11, 2011 06:37PM UTC by lrbabe comment:7

New pull request is here: https://github.com/jquery/jquery/pull/316

Changed April 12, 2011 04:39AM UTC by john comment:8

milestone: 1.next1.6
priority: undecidedhigh
resolution: → fixed
status: newclosed

Landed.