Skip to content

Conversation

@mgol
Copy link
Member

@mgol mgol commented May 11, 2015

This prevents jQuery from caching a prefixed property name if provided
directly by the user, e.g. the following code:

elem.css( "msTransform", "translate(5px, 2px)" );

should not prevent one from from later setting the transition directly:

elem.css( "transform", "translate(5px, 2px)" );

on a browser not understanding the unprefixed version which is the case
for Safari 8 & transform.

Fixes gh-2015

@mgol
Copy link
Member Author

mgol commented May 11, 2015

When writing this patch I discovered that we have no tests that our prefixing mechanism works. :O The commit that introduced them didn't add them:
5376a80

@mgol mgol force-pushed the css-prefix-shadowing branch 2 times, most recently from 3e0a2db to e816e94 Compare May 11, 2015 22:04
@mgol
Copy link
Member Author

mgol commented May 11, 2015

BTW, this both fixes the bug & reduces the size by 1 byte. ;)

@mgol mgol mentioned this pull request May 11, 2015
@mgol mgol changed the title CSS: Don't cache unrecognized CSS property names WIP: CSS: Don't cache unrecognized CSS property names May 11, 2015
@mgol
Copy link
Member Author

mgol commented May 11, 2015

I found some issues with this patch, marking as WIP.

@mgol mgol force-pushed the css-prefix-shadowing branch from e816e94 to de39b88 Compare May 12, 2015 09:35
@mgol mgol changed the title WIP: CSS: Don't cache unrecognized CSS property names CSS: Don't cache unrecognized CSS property names May 12, 2015
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change we'd set node.style.undefined; I added a test for that.

@mgol
Copy link
Member Author

mgol commented May 12, 2015

Should be ready now. -5 bytes. :)

@mgol mgol force-pushed the css-prefix-shadowing branch from de39b88 to 25ca2a4 Compare May 12, 2015 09:56
@mgol
Copy link
Member Author

mgol commented May 12, 2015

I added one more test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transform is unprefixed in WebKit Nightly but it's prefixed in all Androids < 5 so this should not become a useless test any time soon.

@dmethvin
Copy link
Member

LGTM, nice unit test. 😄

@timmywil
Copy link
Member

👍

This prevents jQuery from caching a prefixed property name if provided
directly by the user, e.g. the following code:

	elem.css( "msTransform", "translate(5px, 2px)" );

should not prevent one from from later setting the transition directly:

	elem.css( "transform", "translate(5px, 2px)" );

on a browser not understanding the unprefixed version which is the case
for Safari 8 & transform.

Fixes jquerygh-2015
@mgol mgol force-pushed the css-prefix-shadowing branch from 25ca2a4 to 6da90d9 Compare May 19, 2015 12:13
@mgol
Copy link
Member Author

mgol commented May 30, 2015

I'll merge it tomorrow if no one opposes.

@mgol mgol closed this in d471842 Jun 1, 2015
@mgol mgol deleted the css-prefix-shadowing branch June 1, 2015 12:06
mgol added a commit that referenced this pull request Jun 1, 2015
This prevents jQuery from caching a prefixed property name if provided
directly by the user, e.g. the following code:

	elem.css( "msTransform", "translate(5px, 2px)" );

should not prevent one from from later setting the transition directly:

	elem.css( "transform", "translate(5px, 2px)" );

on a browser not understanding the unprefixed version which is the case
for Safari 8 & transform.

(cherry-picked from d471842)

Fixes gh-2015
Closes gh-2298
mgol added a commit that referenced this pull request Nov 10, 2015
This prevents jQuery from caching a prefixed property name if provided
directly by the user, e.g. the following code:

	elem.css( "msTransform", "translate(5px, 2px)" );

should not prevent one from from later setting the transition directly:

	elem.css( "transform", "translate(5px, 2px)" );

on a browser not understanding the unprefixed version which is the case
for Safari 8 & transform.

Fixes gh-2015
Closes gh-2298
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

css vendor prefix error

4 participants