Core:CSS: Attach test nodes to documentElement, not body

Attaching test divs to document.documentElement instead of document.body
used to cause issues in jQuery 1.x; jQuery Compat doesn't execute any tests
on document ready, though so it could be aligned with master.

This makes jQuery Compat support tests work correctly even if jQuery is
included & used in head before body even exists - making it similar to
the master behavior.

Fixes gh-2502
This commit is contained in:
Michał Gołębiowski
2015-07-28 12:23:28 +02:00
parent 3923bb8400
commit 9b04201ff2
3 changed files with 6 additions and 26 deletions

View File

@@ -88,15 +88,10 @@ define([
function computeStyleTests() {
var contents, divStyle,
body = document.body;
if ( !body || !body.style ) {
// Test fired too early or in an unsupported environment, exit.
return;
}
documentElement = document.documentElement;
// Setup
body.appendChild( container );
documentElement.appendChild( container );
div.style.cssText =
// Support: Android 2.3
@@ -162,7 +157,7 @@ define([
}
// Teardown
body.removeChild( container );
documentElement.removeChild( container );
}
})();