#10679 closed feature (fixed)
CSS3 vendor prefix support
| Reported by: | mikesherov | Owned by: | mikesherov |
|---|---|---|---|
| Priority: | low | Milestone: | 1.8 |
| Component: | css | Version: | 1.7 |
| Keywords: | 1.8-discuss | Cc: | |
| Blocked by: | Blocking: |
Description (last modified by )
There are a few bugs, although admittedly edge cases, that effect the css and effects modules due to jQuery not taking into account CSS3: http://bugs.jquery.com/ticket/10413
I'd like to bring CSS3 vendor prefix detection to jQuery as both an exposed and documented feature, but also to address the bugs.
I've already submitted a pull request containing the code: https://github.com/jquery/jquery/pull/528
Please consider this for 1.8
Change History (19)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
| Component: | unfiled → core |
|---|---|
| Keywords: | 1.8-discuss added |
| Priority: | undecided → low |
| Status: | new → open |
| Version: | git → 1.7 |
comment:3 Changed 10 years ago by
I have a pretty solid prefix detector in Abacus... I'll ping you later with code
comment:4 Changed 10 years ago by
Yeah, please do. Also, check out the prefix code from what I wrote in the pull request I listed. Hopefully, they're similar.
comment:5 Changed 10 years ago by
This is the prefix detector I wrote for Abacus:
https://github.com/Abacus/Abacus/blob/master/src/abacus.js#L109-115
comment:6 Changed 9 years ago by
| Owner: | set to mikesherov |
|---|---|
| Status: | open → assigned |
comment:7 Changed 9 years ago by
| Component: | core → css |
|---|
comment:8 Changed 9 years ago by
| Description: | modified (diff) |
|---|
+1, I'd argue that this is the type of thing people'd want in core jQuery. The homepage of jquery.com touts CSS1-3 support in jQuery (although the "and more" is ambiguous). Vendor prefixed attributes are a part of that, unfortunately, and this can help users of jQuery write a lot less code.
comment:9 Changed 9 years ago by
+1, Vendor prefixes are hell but the kind of hell jQuery needs to tackle.
comment:10 Changed 9 years ago by
| Description: | modified (diff) |
|---|
+1, Since it's pretty common, this does seem like a place where adding bytes is worth it.
comment:13 Changed 9 years ago by
| Milestone: | None → 1.8 |
|---|
comment:15 Changed 9 years ago by
Working code from dupe ticket. This can be plopped into jQuery's root routines easily. Instead of taking a piecemeal approach of adding workarounds manually, this skips all of that BS and just scans through div.style. If it's a vendor-specific property, then the name is normalized, and a cssHook is added. Done. Fin. Put it in!
var div = document.createElement('div');
for (var prop in div.style) {
// Sanity checks
if (! /^(Moz|Webkit|O|ms)[A-Z]/.test(prop)) continue;
if (typeof prop !== 'string') continue;
var cssProp = prop.replace(/^(Moz|Webkit|O|ms)/, '');
cssProp = cssProp.charAt(0).toLowerCase() + cssProp.slice(1);
if (!$.cssHooks[cssProp]) $.cssHooks[cssProp] = {
get: function (elem, computed, extra) { return $.css(elem, prop); },
set: function (elem, value) { elem.style[prop] = value; }
};
}
comment:16 Changed 9 years ago by
Thanks for the code snippet! We've already landed a patch in the 1.8pre branch that does almost exactly this. Feel free to comment there too!
comment:18 Changed 9 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:19 Changed 9 years ago by
Fix #10413, #10679. Fix box-sizing:border-box and add css vendor prefix support.
Changeset: 5376a809c0d2bee4b7872847c2821e458dfdcc3b

This bug too: http://bugs.jquery.com/ticket/5520