On 12/17/13 6:55 PM, Andrea Giammarchi wrote:
Which library uses window.webkitRequestAnimationFrame before
window.requestAnimationFrame and why nobody filed a bug until now?

You have three choices, as a library author.

Either you don't use the unprefixed version, and then your library somewhat relies on UAs never removing their prefixed versions.

Or you use the unprefixed version after the prefixed version, and then your library relies on UAs never removing the prefixed version unless its behavior matches the unprefixed version.

Or you use the unprefixed version first, as you suggest, and then your library relies on the unprefixed version having the same behavior as the prefixed version, thus negating the "we can change the behavior" benefits of prefixing that Oliver brings up.

In practice, option 1 is pretty common. For example, jQuery 1.10.2 (and in fact any recent jQuery) does option 1 of these for Element.moz/ie/webkit/oMatchesSelector (not least because there was no unprefixed version really specced), which is why we need to support one of the prefixed versions "forever" (as long as current jQuery versions are still being used on the web; likely a pretty long time). Similarly, jQuery 1.6.1 does the same thing with requestAnimationFrame, falling back to setTimeout if none of the prefixed versions are supported. GWT versions before 2.5 also use option 1 for requestAnimationFrame.

Option 2 is not that uncommon either. For example, jQuery 1.10.2 uses it for element.style.foo access: it first tries prefixed versions like MozFoo and WebKitFoo, before trying foo itself. Modernizr 2.7.1 does some of this too, if I read testPropsAll correctly.

Option 3 is sort of used by Prototype 1.7.1.0 for matchesSelector, though it assumes the unprefixed name will be matchesSelector(), not matches(), so in practice it's using option 1. Oh, and it doesn't even use all the vendor prefixes that are relevant for today's browsers. Option 3 is also used in thins like https://gist.github.com/paulirish/1579671 and various other things on the web.

Plus I am one of those that hand-craft CSS withe prefixes included and I
am happy to deal with prefixes ... which developer uses prefixes
everywhere on daily basis without tools?

A majority of developers working on "mobile" web sites, for example.

-Boris

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to