aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2013-08-27 00:54:13 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2013-09-06 03:38:22 +0200
commitbbbdd947256a3fcd788fb9d4f306046082a1ef1f (patch)
tree2fc5a02969653d281a44a7b3ff6426b5561c8140 /src
parent776012b8b3898fad2e0727880f1dc4af5c7b33c1 (diff)
downloadjquery-bbbdd947256a3fcd788fb9d4f306046082a1ef1f.tar.gz
jquery-bbbdd947256a3fcd788fb9d4f306046082a1ef1f.zip
Fix #10814. Make support tests lazy and broken out to components.
Diffstat (limited to 'src')
-rw-r--r--src/ajax/xhr.js12
-rw-r--r--src/attributes/attr.js9
-rw-r--r--src/attributes/prop.js6
-rw-r--r--src/attributes/support.js35
-rw-r--r--src/attributes/val.js8
-rw-r--r--src/core.js11
-rw-r--r--src/css.js86
-rw-r--r--src/css/hiddenVisibleSelectors.js (renamed from src/css/hidden-visible-selectors.js)0
-rw-r--r--src/css/support.js82
-rw-r--r--src/css/swap.js (renamed from src/core/swap.js)2
-rw-r--r--src/effects/animatedSelector.js (renamed from src/effects/animated-selector.js)0
-rw-r--r--src/event.js9
-rw-r--r--src/event/support.js9
-rw-r--r--src/jquery.js5
-rw-r--r--src/manipulation.js12
-rw-r--r--src/manipulation/support.js29
-rw-r--r--src/support.js111
-rw-r--r--src/var/support.js4
18 files changed, 246 insertions, 184 deletions
diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js
index fdc5b08d3..e08cfcac3 100644
--- a/src/ajax/xhr.js
+++ b/src/ajax/xhr.js
@@ -1,8 +1,8 @@
define([
"../core",
- "../ajax",
- "../support"
-], function( jQuery ) {
+ "../var/support",
+ "../ajax"
+], function( jQuery, support ) {
jQuery.ajaxSettings.xhr = function() {
try {
@@ -33,13 +33,13 @@ if ( window.ActiveXObject ) {
});
}
-jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-jQuery.support.ajax = xhrSupported = !!xhrSupported;
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+support.ajax = xhrSupported = !!xhrSupported;
jQuery.ajaxTransport(function( options ) {
var callback;
// Cross domain only allowed if supported through XMLHttpRequest
- if ( jQuery.support.cors || xhrSupported && !options.crossDomain ) {
+ if ( support.cors || xhrSupported && !options.crossDomain ) {
return {
send: function( headers, complete ) {
var i, id,
diff --git a/src/attributes/attr.js b/src/attributes/attr.js
index 170e6a39e..e47bde2f3 100644
--- a/src/attributes/attr.js
+++ b/src/attributes/attr.js
@@ -2,9 +2,9 @@ define([
"../core",
"../var/rnotwhite",
"../var/strundefined",
- "../selector",
- "../support"
-], function( jQuery, rnotwhite, strundefined ) {
+ "./support",
+ "../selector"
+], function( jQuery, rnotwhite, strundefined, support ) {
var nodeHook, boolHook,
attrHandle = jQuery.expr.attrHandle;
@@ -93,7 +93,8 @@ jQuery.extend({
attrHooks: {
type: {
set: function( elem, value ) {
- if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ if ( !support.radioValue && value === "radio" &&
+ jQuery.nodeName( elem, "input" ) ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to default in case type is set after value during creation
var val = elem.value;
diff --git a/src/attributes/prop.js b/src/attributes/prop.js
index 95462bbbb..f321b1ef7 100644
--- a/src/attributes/prop.js
+++ b/src/attributes/prop.js
@@ -1,7 +1,7 @@
define([
"../core",
- "../support"
-], function( jQuery ) {
+ "./support"
+], function( jQuery, support ) {
var rfocusable = /^(?:input|select|textarea|button)$/i;
@@ -65,7 +65,7 @@ jQuery.extend({
// Support: IE9+
// Selectedness for an option in an optgroup can be inaccurate
-if ( !jQuery.support.optSelected ) {
+if ( !support.optSelected ) {
jQuery.propHooks.selected = {
get: function( elem ) {
var parent = elem.parentNode;
diff --git a/src/attributes/support.js b/src/attributes/support.js
new file mode 100644
index 000000000..aa9adf265
--- /dev/null
+++ b/src/attributes/support.js
@@ -0,0 +1,35 @@
+define([
+ "../var/support"
+], function( support ) {
+
+(function () {
+ var input = document.createElement( "input" ),
+ select = document.createElement( "select" ),
+ opt = select.appendChild( document.createElement( "option" ) );
+
+ input.type = "checkbox";
+
+ // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
+ // Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
+ support.checkOn = input.value !== "";
+
+ // Must access the parent to make an option select properly
+ // Support: IE9, IE10
+ support.optSelected = opt.selected;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Check if an input maintains its value after becoming a radio
+ // Support: IE9, IE10
+ input = document.createElement( "input" );
+ input.value = "t";
+ input.type = "radio";
+ support.radioValue = input.value === "t";
+})();
+
+return support;
+
+});
diff --git a/src/attributes/val.js b/src/attributes/val.js
index 73a3bf3ea..74d8c9c46 100644
--- a/src/attributes/val.js
+++ b/src/attributes/val.js
@@ -1,7 +1,7 @@
define([
"../core",
- "../support"
-], function( jQuery ) {
+ "./support"
+], function( jQuery, support ) {
var rreturn = /\r/g;
@@ -95,7 +95,7 @@ jQuery.extend({
// IE6-9 doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
- ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+ ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
@@ -146,7 +146,7 @@ jQuery.each([ "radio", "checkbox" ], function() {
}
}
};
- if ( !jQuery.support.checkOn ) {
+ if ( support.checkOn ) {
jQuery.valHooks[ this ].get = function( elem ) {
// Support: Webkit
// "" is returned instead of "on" if a value isn't specified
diff --git a/src/core.js b/src/core.js
index 0eef72311..4103b3832 100644
--- a/src/core.js
+++ b/src/core.js
@@ -9,9 +9,10 @@ define([
"./var/class2type",
"./var/toString",
"./var/hasOwn",
- "./var/trim"
+ "./var/trim",
+ "./var/support"
], function( strundefined, arr, slice, concat, push, indexOf,
- class2type, toString, hasOwn, trim ) {
+ class2type, toString, hasOwn, trim, support ) {
var
// A central reference to the root jQuery(document)
@@ -702,7 +703,11 @@ jQuery.extend({
length ? fn( elems[0], key ) : emptyGet;
},
- now: Date.now
+ now: Date.now,
+
+ // jQuery.support is not used in Core but other projects attach their
+ // properties to it so it needs to exist.
+ support: support
});
// Populate the class2type map
diff --git a/src/css.js b/src/css.js
index 4ac7dfbce..fc59205b1 100644
--- a/src/css.js
+++ b/src/css.js
@@ -3,15 +3,15 @@ define([
"./var/pnum",
"./css/var/cssExpand",
"./css/var/isHidden",
+ "./css/support",
"./css/defaultDisplay",
"./data/var/data_priv",
- "./core/swap",
+ "./css/swap",
"./core/ready",
"./selector", // contains
- "./support",
// Optional
"./offset"
-], function( jQuery, pnum, cssExpand, isHidden, defaultDisplay, data_priv ) {
+], function( jQuery, pnum, cssExpand, isHidden, support, defaultDisplay, data_priv ) {
var curCSS,
// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
@@ -233,7 +233,7 @@ jQuery.extend({
// Fixes #8908, it can be done more correctly by specifying setters in cssHooks,
// but it would mean to define eight (for every problematic property) identical functions
- if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
+ if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
style[ name ] = "inherit";
}
@@ -382,7 +382,7 @@ function getWidthOrHeight( elem, name, extra ) {
var valueIsBorderBox = true,
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
styles = getStyles( elem ),
- isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+ isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
// some non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
@@ -401,7 +401,8 @@ function getWidthOrHeight( elem, name, extra ) {
// we need the check for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
- valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
+ valueIsBorderBox = isBorderBox &&
+ ( support.boxSizingReliable() || val === elem.style[ name ] );
// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
@@ -440,7 +441,7 @@ jQuery.each([ "height", "width" ], function( i, name ) {
elem,
name,
extra,
- jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+ jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
styles
) : 0
);
@@ -448,42 +449,49 @@ jQuery.each([ "height", "width" ], function( i, name ) {
};
});
-// These hooks cannot be added until DOM ready because the support test
-// for it is not run until after DOM ready
-jQuery(function() {
- // Support: Android 2.3
- if ( !jQuery.support.reliableMarginRight ) {
- jQuery.cssHooks.marginRight = {
- get: function( elem, computed ) {
- if ( computed ) {
- // Support: Android 2.3
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- // Work around by temporarily setting element display to inline-block
- return jQuery.swap( elem, { "display": "inline-block" },
- curCSS, [ elem, "marginRight" ] );
- }
- }
- };
+// Support: Android 2.3
+jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ if ( support.reliableMarginRight() ) {
+ // Hook not needed, remove it.
+ // Since there are no other hooks for marginRight, remove the whole object.
+ delete jQuery.cssHooks.marginRight;
+ return;
+ }
+ if ( computed ) {
+ // Support: Android 2.3
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ return jQuery.swap( elem, { "display": "inline-block" },
+ curCSS, [ elem, "marginRight" ] );
+ }
}
+};
- // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
- // getComputedStyle returns percent when specified for top/left/bottom/right
- // rather than make the css module depend on the offset module, we just check for it here
- if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
- jQuery.each( [ "top", "left" ], function( i, prop ) {
- jQuery.cssHooks[ prop ] = {
- get: function( elem, computed ) {
- if ( computed ) {
- computed = curCSS( elem, prop );
- // if curCSS returns percentage, fallback to offset
- return rnumnonpx.test( computed ) ?
- jQuery( elem ).position()[ prop ] + "px" :
- computed;
- }
+// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+// getComputedStyle returns percent when specified for top/left/bottom/right
+// rather than make the css module depend on the offset module, we just check for it here
+jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = {
+ get: function( elem, computed ) {
+ if ( support.pixelPosition() || !jQuery.fn.position ) {
+ // Hook not needed, remove it.
+ // Since there are no other hooks for prop, remove the whole object.
+ delete jQuery.cssHooks[ prop ];
+ return;
+ }
+ jQuery.cssHooks[ prop ].get = function ( i, prop ) {
+ if ( computed ) {
+ computed = curCSS( elem, prop );
+ // if curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( computed ) ?
+ jQuery( elem ).position()[ prop ] + "px" :
+ computed;
}
};
- });
- }
+ return jQuery.cssHooks[ prop ].get( i, prop );
+ }
+ };
});
// These hooks are used by animate to expand properties
diff --git a/src/css/hidden-visible-selectors.js b/src/css/hiddenVisibleSelectors.js
index c7f1c7ee7..c7f1c7ee7 100644
--- a/src/css/hidden-visible-selectors.js
+++ b/src/css/hiddenVisibleSelectors.js
diff --git a/src/css/support.js b/src/css/support.js
new file mode 100644
index 000000000..6ddf6c1a8
--- /dev/null
+++ b/src/css/support.js
@@ -0,0 +1,82 @@
+define([
+ "../var/support"
+], function( support ) {
+
+(function () {
+ var pixelPositionVal, boxSizingReliableVal,
+ // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
+ divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;" +
+ "-moz-box-sizing:content-box;box-sizing:content-box",
+ docElem = document.documentElement,
+ container = document.createElement( "div" ),
+ div = document.createElement( "div" );
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;" +
+ "margin-top:1px";
+ container.appendChild( div );
+
+ // Executing both pixelPosition & boxSizingReliable tests require only one layout
+ // so they're executed at the same time to save the second computation.
+ function computePixelPositionAndBoxSizingReliable() {
+ // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
+ div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
+ "box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;" +
+ "position:absolute;top:1%";
+ docElem.appendChild( container );
+
+ var divStyle = window.getComputedStyle( div, null );
+ pixelPositionVal = divStyle.top !== "1%";
+ boxSizingReliableVal = divStyle.width === "4px";
+
+ docElem.removeChild( container );
+ }
+
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
+ if ( window.getComputedStyle ) {
+ jQuery.extend(support, {
+ pixelPosition: function() {
+ // This test is executed only once but we still do memoizing
+ // since we can use the boxSizingReliable pre-computing.
+ // No need to check if the test was already performed, though.
+ computePixelPositionAndBoxSizingReliable();
+ return pixelPositionVal;
+ },
+ boxSizingReliable: function() {
+ if ( boxSizingReliableVal == null ) {
+ computePixelPositionAndBoxSizingReliable();
+ }
+ return boxSizingReliableVal;
+ },
+ reliableMarginRight: function() {
+ // Support: Android 2.3
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. (#3333)
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // This support function is only executed once so no memoizing is needed.
+ var ret,
+ marginDiv = div.appendChild( document.createElement( "div" ) );
+ marginDiv.style.cssText = div.style.cssText = divReset;
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
+ div.style.width = "1px";
+ docElem.appendChild( container );
+
+ ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
+
+ docElem.removeChild( container );
+
+ // Clean up the div for other support tests.
+ div.innerHTML = "";
+
+ return ret;
+ }
+ });
+ }
+})();
+
+return support;
+
+});
diff --git a/src/core/swap.js b/src/css/swap.js
index 95f4e2c69..07a661c03 100644
--- a/src/core/swap.js
+++ b/src/css/swap.js
@@ -3,8 +3,6 @@ define([
], function( jQuery ) {
// A method for quickly swapping in/out CSS properties to get correct calculations.
- // Note: this method belongs to the css module but it's needed here for the support module.
- // If support gets modularized, this method should be moved back to the css module.
jQuery.swap = function( elem, options, callback, args ) {
var ret, name,
old = {};
diff --git a/src/effects/animated-selector.js b/src/effects/animatedSelector.js
index c9fa68950..c9fa68950 100644
--- a/src/effects/animated-selector.js
+++ b/src/effects/animatedSelector.js
diff --git a/src/event.js b/src/event.js
index 541326f6d..dfe923d51 100644
--- a/src/event.js
+++ b/src/event.js
@@ -4,11 +4,11 @@ define([
"./var/rnotwhite",
"./var/hasOwn",
"./var/slice",
+ "./event/support",
"./data/var/data_priv",
"./data/accepts",
- "./selector",
- "./support"
-], function( jQuery, strundefined, rnotwhite, hasOwn, slice, data_priv ) {
+ "./selector"
+], function( jQuery, strundefined, rnotwhite, hasOwn, slice, support, data_priv ) {
var rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
@@ -716,7 +716,8 @@ jQuery.each({
// Create "bubbling" focus and blur events
// Support: Firefox, Chrome, Safari
-if ( !jQuery.support.focusinBubbles ) {
+// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+if ( !support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
diff --git a/src/event/support.js b/src/event/support.js
new file mode 100644
index 000000000..85060db77
--- /dev/null
+++ b/src/event/support.js
@@ -0,0 +1,9 @@
+define([
+ "../var/support"
+], function( support ) {
+
+support.focusinBubbles = "onfocusin" in window;
+
+return support;
+
+});
diff --git a/src/jquery.js b/src/jquery.js
index 2c63e3606..ef8745c7b 100644
--- a/src/jquery.js
+++ b/src/jquery.js
@@ -5,7 +5,6 @@ define([
"./callbacks",
"./deferred",
"./core/ready",
- "./support",
"./data",
"./queue",
"./queue/delay",
@@ -16,7 +15,7 @@ define([
"./manipulation/_evalUrl",
"./wrap",
"./css",
- "./css/hidden-visible-selectors",
+ "./css/hiddenVisibleSelectors",
"./serialize",
"./ajax",
"./ajax/xhr",
@@ -24,7 +23,7 @@ define([
"./ajax/jsonp",
"./ajax/load",
"./effects",
- "./effects/animated-selector",
+ "./effects/animatedSelector",
"./offset",
"./dimensions",
"./deprecated",
diff --git a/src/manipulation.js b/src/manipulation.js
index 89cc46c62..f47cdec38 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -3,14 +3,14 @@ define([
"./var/concat",
"./var/push",
"./manipulation/var/rcheckableType",
+ "./manipulation/support",
"./data/var/data_priv",
"./data/var/data_user",
"./data/accepts",
"./selector",
"./traversing",
- "./event",
- "./support"
-], function( jQuery, concat, push, rcheckableType, data_priv, data_user ){
+ "./event"
+], function( jQuery, concat, push, rcheckableType, support, data_priv, data_user ){
var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
rtagName = /<([\w:]+)/,
@@ -218,7 +218,8 @@ jQuery.fn.extend({
isFunction = jQuery.isFunction( value );
// We can't cloneNode fragments that contain checked, in WebKit
- if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
+ if ( isFunction || !( l <= 1 || typeof value !== "string" || support.checkClone ||
+ !rchecked.test( value ) ) ) {
return this.each(function( index ) {
var self = set.eq( index );
if ( isFunction ) {
@@ -324,7 +325,8 @@ jQuery.extend({
// Support: IE >= 9
// Fix Cloning issues
- if ( !jQuery.support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {
+ if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
+ !jQuery.isXMLDoc( elem ) ) {
// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
destElements = getAll( clone );
diff --git a/src/manipulation/support.js b/src/manipulation/support.js
new file mode 100644
index 000000000..62c932c11
--- /dev/null
+++ b/src/manipulation/support.js
@@ -0,0 +1,29 @@
+define([
+ "../var/support"
+], function( support ){
+
+(function () {
+ var input = document.createElement( "input" ),
+ fragment = document.createDocumentFragment();
+
+ input.type = "checkbox";
+
+ // Make sure checked status is properly cloned
+ // Support: IE9, IE10
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ input.setAttribute( "checked", "t" );
+ input.setAttribute( "name", "t" );
+
+ fragment.appendChild( input );
+
+ // Support: Safari 5.1, Android 4.x, Android 2.3
+ // old WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+})();
+
+return support;
+
+});
diff --git a/src/support.js b/src/support.js
deleted file mode 100644
index ec15b16f3..000000000
--- a/src/support.js
+++ /dev/null
@@ -1,111 +0,0 @@
-define([
- "./core",
- "./core/swap",
- // This is listed as a dependency for build order, but it's still optional in builds
- "./core/ready"
-], function( jQuery ) {
-
-jQuery.support = (function( support ) {
- var container, marginDiv, divStyle,
- // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
- divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",
- docElem = document.documentElement,
- input = document.createElement("input"),
- fragment = document.createDocumentFragment(),
- div = document.createElement("div"),
- select = document.createElement("select"),
- opt = select.appendChild( document.createElement("option") );
-
- // Finish early in limited environments
- if ( !input.type ) {
- return support;
- }
-
- input.type = "checkbox";
-
- // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
- // Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
- support.checkOn = input.value !== "";
-
- // Must access the parent to make an option select properly
- // Support: IE9, IE10
- support.optSelected = opt.selected;
-
- // This is hard-coded to true for compatibility reasons,
- // all supported browsers passed the test.
- support.boxSizing = true;
-
- // Will be defined later
- support.reliableMarginRight = true;
- support.boxSizingReliable = true;
- support.pixelPosition = false;
-
- // Make sure checked status is properly cloned
- // Support: IE9, IE10
- input.checked = true;
- support.noCloneChecked = input.cloneNode( true ).checked;
-
- // Make sure that the options inside disabled selects aren't marked as disabled
- // (WebKit marks them as disabled)
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
- // Check if an input maintains its value after becoming a radio
- // Support: IE9, IE10
- input = document.createElement("input");
- input.value = "t";
- input.type = "radio";
- support.radioValue = input.value === "t";
-
- // #11217 - WebKit loses check when the name is after the checked attribute
- input.setAttribute( "checked", "t" );
- input.setAttribute( "name", "t" );
-
- fragment.appendChild( input );
-
- // Support: Safari 5.1, Android 4.x, Android 2.3
- // old WebKit doesn't clone checked state correctly in fragments
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Support: Firefox, Chrome, Safari
- // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
- support.focusinBubbles = "onfocusin" in window;
-
- div.style.backgroundClip = "content-box";
- div.cloneNode( true ).style.backgroundClip = "";
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
- container = document.createElement("div");
- container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
-
- // Check box-sizing and margin behavior.
- docElem.appendChild( container ).appendChild( div );
- div.innerHTML = "";
- // Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
- div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%";
-
- // Use window.getComputedStyle because jsdom on node.js will break without it.
- if ( window.getComputedStyle ) {
- divStyle = window.getComputedStyle( div, null );
- support.pixelPosition = ( divStyle || {} ).top !== "1%";
- support.boxSizingReliable = ( divStyle || { width: "4px" } ).width === "4px";
-
- // Support: Android 2.3
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. (#3333)
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- marginDiv = div.appendChild( document.createElement( "div" ) );
- marginDiv.style.cssText = div.style.cssText = divReset;
- marginDiv.style.marginRight = marginDiv.style.width = "0";
- div.style.width = "1px";
-
- support.reliableMarginRight =
- !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
- }
-
- docElem.removeChild( container );
-
- return support;
-})( {} );
-
-});
diff --git a/src/var/support.js b/src/var/support.js
new file mode 100644
index 000000000..b25dbc74b
--- /dev/null
+++ b/src/var/support.js
@@ -0,0 +1,4 @@
+define(function() {
+ // All support tests are defined in their respective modules.
+ return {};
+});