Skip to content

Commit

Permalink
Manipulation: Change support test to be WWA-friendly
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jonathansampson authored and dmethvin committed Mar 20, 2014
1 parent 541e734 commit 85af4e6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/manipulation/support.js
Expand Up @@ -4,10 +4,17 @@ define([


(function() { (function() {
var fragment = document.createDocumentFragment(), 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 // #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 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
// old WebKit doesn't clone checked state correctly in fragments // old WebKit doesn't clone checked state correctly in fragments
Expand Down

0 comments on commit 85af4e6

Please sign in to comment.