Closed mattyoung closed 12 years ago
Hi Matt,
Yes your right there. It seems strange that webkit supports both. Maybe its because Css3 is still in development.
For most of the cssHooks, a hook is not added if the standard property is supported, but it seems the order should be more like:
support.borderRadius =
divStyle.borderRadius === ''? 'BorderRadius' :
(divStyle.MozBorderRadius === ''? 'MozBorderRadius' :
(divStyle.MsBorderRadius === ''? 'MsBorderRadius' :
(divStyle.WebkitBorderRadius === ''? 'WebkitBorderRadius' :
(divStyle.OBorderRadius === ''? 'OBorderRadius' :
false))));
So it checks for the standard one first, otherwise in webkits case "WebkitBorderRadius" would be true and an unnecessary cssHook would be added.
the vender prefix name is calculated before the official non-vender prefixed name.
So for example, in Chrome, both "webkitBorderRadius" and "borderRadius" work. Shouldn't "BorderRadius" be used instead of "WebkitBorderRadius"?
I did some experiment, in chrome, "webkitBorderRadius" and "borderRadius" are interchangable in javascript code. Since we always put the official property name one last in css to let it have precedence, shouldn't we use the official name in js if that's supported? Or maybe not even define the cssHooks and use jQuery default (simply do .css("borderRadius", x) without going through any custom cssHook )?