aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes/support.js
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/attributes/support.js
parent776012b8b3898fad2e0727880f1dc4af5c7b33c1 (diff)
downloadjquery-bbbdd947256a3fcd788fb9d4f306046082a1ef1f.tar.gz
jquery-bbbdd947256a3fcd788fb9d4f306046082a1ef1f.zip
Fix #10814. Make support tests lazy and broken out to components.
Diffstat (limited to 'src/attributes/support.js')
-rw-r--r--src/attributes/support.js35
1 files changed, 35 insertions, 0 deletions
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;
+
+});