Skip to content

Commit 85af4e6

Browse files
jonathansampsondmethvin
authored andcommitted
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
1 parent 541e734 commit 85af4e6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/manipulation/support.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ define([
44

55
(function() {
66
var fragment = document.createDocumentFragment(),
7-
div = fragment.appendChild( document.createElement( "div" ) );
7+
div = fragment.appendChild( document.createElement( "div" ) ),
8+
input = document.createElement( "input" );
89

910
// #11217 - WebKit loses check when the name is after the checked attribute
10-
div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
11+
// Support: Windows Web Apps (WWA)
12+
// `name` and `type` need .setAttribute for WWA
13+
input.setAttribute( "type", "radio" );
14+
input.setAttribute( "checked", "checked" );
15+
input.setAttribute( "name", "t" );
16+
17+
div.appendChild( input );
1118

1219
// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
1320
// old WebKit doesn't clone checked state correctly in fragments

0 commit comments

Comments
 (0)