aboutsummaryrefslogtreecommitdiffstats
path: root/src/support.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2011-05-09 09:48:23 +0200
committerjaubourg <j@ubourg.net>2011-05-09 09:48:23 +0200
commitefd0fce7a1ae9bc62ef2b1aa51d7adc224da1ec0 (patch)
tree8ce17e769aecaf102b9504c92e5e2b5fddeab3e5 /src/support.js
parent18b1cf2942cc082c1c97a2ac9bc33ad77f42d775 (diff)
downloadjquery-efd0fce7a1ae9bc62ef2b1aa51d7adc224da1ec0.tar.gz
jquery-efd0fce7a1ae9bc62ef2b1aa51d7adc224da1ec0.zip
Fixes #9109. When jQuery is loaded in the body, then the fake body element used in support has to be inserted before the document's body for boxModel to be properly detected (got the hint by looking at the code in jQuery mobile). Test page added so that we can keep checking this.
Diffstat (limited to 'src/support.js')
-rw-r--r--src/support.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/support.js b/src/support.js
index 41af06322..9a6a318d1 100644
--- a/src/support.js
+++ b/src/support.js
@@ -3,6 +3,7 @@
jQuery.support = (function() {
var div = document.createElement( "div" ),
+ documentElement = document.documentElement,
all,
a,
select,
@@ -150,7 +151,7 @@ jQuery.support = (function() {
body.style[ i ] = bodyStyle[ i ];
}
body.appendChild( div );
- document.documentElement.appendChild( body );
+ documentElement.insertBefore( body, documentElement.firstChild );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
@@ -210,7 +211,7 @@ jQuery.support = (function() {
// Remove the body element we added
body.innerHTML = "";
- document.documentElement.removeChild( body );
+ documentElement.removeChild( body );
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/