Bug Tracker

Ticket #8402 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

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:
Blocking: Blocked by:

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;

Change History

comment:1 Changed 4 years ago by lrbabe

comment:2 Changed 4 years ago by rwaldron

  • Owner set to lrbabe
  • Status changed from new to pending
  • Component changed from unfiled to css

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

comment:3 Changed 4 years ago by lrbabe

  • Status changed from pending to new

Nope, I do not confirm. I should be able to use jquery.cssProps to make my cssHooks smaller and faster.

comment:4 Changed 4 years ago by dmethvin

  • Status changed from new to pending

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

comment:5 Changed 4 years ago by lrbabe

  • Status changed from pending to new

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.

comment:7 Changed 4 years ago by lrbabe

comment:8 Changed 4 years ago by john

  • Priority changed from undecided to high
  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from 1.next to 1.6

Landed.

Note: See TracTickets for help on using tickets.