diff options
author | Jonathan Sampson <jjdsampson@gmail.com> | 2014-03-11 03:44:34 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2014-03-20 16:54:37 -0400 |
commit | 85af4e6412e49c2e6a872feef00718a46c2fa2ce (patch) | |
tree | 346c22475c3112bd2b3012f01ab96231cf15015f /src/manipulation | |
parent | 541e7349b6533eb533c15d17e3e9e432e4a719ea (diff) | |
download | jquery-85af4e6412e49c2e6a872feef00718a46c2fa2ce.tar.gz jquery-85af4e6412e49c2e6a872feef00718a46c2fa2ce.zip |
Manipulation: Change support test to be WWA-friendly
Setting the innerHTML property in an unsafe manner raises issues in
Windows Web Applications. Strings being passed into innerHTML cannot
include the name attribute.
Closes gh-1537
Diffstat (limited to 'src/manipulation')
-rw-r--r-- | src/manipulation/support.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/manipulation/support.js b/src/manipulation/support.js index e2ba066ec..fb1e85567 100644 --- a/src/manipulation/support.js +++ b/src/manipulation/support.js @@ -4,10 +4,17 @@ define([ (function() { var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ); + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); // #11217 - WebKit loses check when the name is after the checked attribute - div.innerHTML = "<input type='radio' checked='checked' name='t'/>"; + // Support: Windows Web Apps (WWA) + // `name` and `type` need .setAttribute for WWA + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // old WebKit doesn't clone checked state correctly in fragments |