Matmarex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71174


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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/74/71174/1

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: newchange
Gerrit-Change-Id: Ie0f552a0598068abc3f00bdc09cfb67230525a72
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>

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

Reply via email to