aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCorey Frang <gnarf@gnarf.net>2015-05-18 17:11:21 -0400
committerCorey Frang <gnarf@gnarf.net>2015-06-26 20:05:25 -0400
commitcdaed15c7ea1bbfdde5a5bea691c583ce7961526 (patch)
tree05d8666c3a39339224545a347d7f32f31a208a4f /src
parent3a0d582cf63b6e8f77150d9c38d2bf34d0c7790e (diff)
downloadjquery-cdaed15c7ea1bbfdde5a5bea691c583ce7961526.tar.gz
jquery-cdaed15c7ea1bbfdde5a5bea691c583ce7961526.zip
Effects: Add tests for jQuery.Tween
Diffstat (limited to 'src')
-rw-r--r--src/effects/Tween.js8
-rw-r--r--src/selector-native.js3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/effects/Tween.js b/src/effects/Tween.js
index 478fed007..d7cd8e606 100644
--- a/src/effects/Tween.js
+++ b/src/effects/Tween.js
@@ -59,8 +59,10 @@ Tween.propHooks = {
get: function( tween ) {
var result;
- if ( tween.elem[ tween.prop ] != null &&
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ // Use a property on the element directly when it is not a DOM element,
+ // or when there is no matching style property that exists.
+ if ( tween.elem.nodeType !== 1 ||
+ tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
return tween.elem[ tween.prop ];
}
@@ -78,7 +80,7 @@ Tween.propHooks = {
// Use .style if available and use plain properties where available.
if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween );
- } else if ( tween.elem.style &&
+ } else if ( tween.elem.nodeType === 1 &&
( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
jQuery.cssHooks[ tween.prop ] ) ) {
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
diff --git a/src/selector-native.js b/src/selector-native.js
index 1b2dd185b..5717918bc 100644
--- a/src/selector-native.js
+++ b/src/selector-native.js
@@ -154,7 +154,8 @@ jQuery.extend({
expr: {
attrHandle: {},
match: {
- bool: /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,
+ bool: new RegExp( "^(?:checked|selected|async|autofocus|autoplay|controls|defer" +
+ "|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$", "i" ),
needsContext: /^[\x20\t\r\n\f]*[>+~]/
}
}