Core: Support non-browser environments

Fixes gh-2133
Fixes gh-2501
Closes gh-2504
Refs gh-1950
Refs gh-1949
Refs gh-2397
Refs gh-1537
Refs gh-2504
Refs 842958e7ae
This commit is contained in:
Michał Gołębiowski
2015-07-28 12:58:44 +02:00
parent 9b04201ff2
commit 04ec688e80
45 changed files with 363 additions and 68 deletions

View File

@@ -1,21 +1,25 @@
define([
"../var/document",
"../var/support"
], function( support ) {
], function( document, support ) {
(function() {
// Minified: var a,b,c,d,e
var input, div, select, a, opt;
var a,
input = document.createElement( "input" ),
div = document.createElement( "div" ),
select = document.createElement( "select" ),
opt = select.appendChild( document.createElement( "option" ) );
// Setup
div = document.createElement( "div" );
div.innerHTML = " <link/><a href='/a'>a</a><input type='checkbox'/>";
a = div.getElementsByTagName("a")[ 0 ];
div.innerHTML = " <link/><a href='/a'>a</a>";
// Support: Windows Web Apps (WWA)
// `type` must use .setAttribute for WWA (#14901)
input.setAttribute( "type", "checkbox" );
div.appendChild( input );
a = div.getElementsByTagName( "a" )[ 0 ];
// First batch of tests.
select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName("input")[ 0 ];
a.style.cssText = "top:1px";
// Get the style information from getAttribute