replacing documentElement is enough

This commit is contained in:
Deathamns 2015-02-11 17:49:50 +01:00
parent af05ceffb8
commit 2642d5aa92
1 changed files with 5 additions and 9 deletions

View File

@ -690,21 +690,17 @@ var stopPicker = function() {
/******************************************************************************/
var startPicker = function(details) {
pickerRoot.onload = stopPicker;
var frameDoc = pickerRoot.contentDocument;
var parsedDom = (new DOMParser()).parseFromString(
details.frameContent,
'text/html'
);
pickerRoot.onload = stopPicker;
frameDoc.documentElement.replaceChild(
frameDoc.adoptNode(parsedDom.head),
frameDoc.head
);
frameDoc.documentElement.replaceChild(
frameDoc.adoptNode(parsedDom.body),
frameDoc.body
frameDoc.replaceChild(
frameDoc.adoptNode(parsedDom.documentElement),
frameDoc.documentElement
);
frameDoc.body.setAttribute('lang', navigator.language);