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

Change subject: Make loading VE work on Opera again, attempt two
......................................................................


Make loading VE work on Opera again, attempt two

Once more, with feeling. Expanding the solution implemented in I1ab60665.

Bug: 50417
Change-Id: Ie0f552a0598068abc3f00bdc09cfb67230525a72
---
M modules/ve/ve.js
1 file changed, 4 insertions(+), 3 deletions(-)

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



diff --git a/modules/ve/ve.js b/modules/ve/ve.js
index 9743b49..b0e2b48 100644
--- a/modules/ve/ve.js
+++ b/modules/ve/ve.js
@@ -821,9 +821,10 @@
                // FIXME detaching breaks access to newDocument in IE
                iframe.parentNode.removeChild( iframe );
 
-               if ( !newDocument.body ) {
-                       // Surprise! The document is not a document!
-                       // Fun fact: this never happens on Opera when debugging 
with Dragonfly.
+               if ( !newDocument.documentElement || 
newDocument.documentElement.cloneNode() === undefined ) {
+                       // Surprise! The document is not a document! Only 
happens on Opera.
+                       // (Or its nodes are not actually nodes, while the 
document
+                       // *is* a document. This only happens when debugging 
with Dragonfly.)
                        newDocument = 
document.implementation.createHTMLDocument( '' );
                        // Carefully unwrap the HTML out of the root node (and 
doctype, if any).
                        // <html> might have some arguments here, but they're 
apparently not important.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0f552a0598068abc3f00bdc09cfb67230525a72
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to