jenkins-bot has submitted this change and it was merged.

Change subject: Fix CSS transplantation in IE
......................................................................


Fix CSS transplantation in IE

Apparently using importNode() to copy a <style> node from
the main document into an iframe doesn't work in IE: the
<style> node is copied over, but its CSS isn't applied or
even parsed.

Work around this by copying over the <style> node's .textContent
manually.

Change-Id: If2c848e9fb53b06a23c85c30a1b56c20854bea50
---
M src/Frame.js
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/Frame.js b/src/Frame.js
index 23a3aac..91344a8 100644
--- a/src/Frame.js
+++ b/src/Frame.js
@@ -97,7 +97,9 @@
                                '#' + pollNodeId + ' { font-family: ' + 
fontFamily + '; }';
                } else {
                        // Not an external stylesheet, or no polling required; 
just copy the node over
-                       newNode = frameDoc.importNode( styleNode, true );
+                       // Can't use importNode here because that breaks in IE
+                       newNode = frameDoc.createElement( 'style' );
+                       newNode.textContent = styleNode.textContent;
                }
                frameDoc.head.appendChild( newNode );
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/153980
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If2c848e9fb53b06a23c85c30a1b56c20854bea50
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to