Catrope has submitted this change and it was merged.
Change subject: Use ve.parseXhtml() and ve.serializeXhtml()
......................................................................
Use ve.parseXhtml() and ve.serializeXhtml()
Introduced in VE core in I0fb47f7c91f61.
In IE, this fixes corruption of style and bgcolor attributes.
In other browsers, the only change is that we now use
XMLSerializer rather than .outerHTML to serialize, but as
far as I can tell this isn't materially different. XMLSerializer
correctly uses HTML semantics when given an HTML document.
Bug: 70856
Change-Id: If48555fa4763e763484bbabfa0bc4ded0d0a5c58
---
M modules/ve-mw/init/ve.init.mw.Target.js
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Catrope: Verified; Looks good to me, approved
diff --git a/modules/ve-mw/init/ve.init.mw.Target.js
b/modules/ve-mw/init/ve.init.mw.Target.js
index 7e98d57..8710f6e 100644
--- a/modules/ve-mw/init/ve.init.mw.Target.js
+++ b/modules/ve-mw/init/ve.init.mw.Target.js
@@ -398,7 +398,7 @@
);
} else {
this.originalHtml = data.content;
- this.doc = ve.createDocumentFromHtml( this.originalHtml );
+ this.doc = ve.parseXhtml( this.originalHtml );
// Parsoid outputs a protocol-relative <base> tag, so
absolutize it
this.constructor.static.fixBase( this.doc, document );
@@ -927,7 +927,8 @@
copyAttributes( oldDoc.documentElement, newDoc.documentElement );
copyAttributes( oldDoc.head, newDoc.head );
copyAttributes( oldDoc.body, newDoc.body );
- return '<!doctype html>' + ve.properOuterHtml( newDoc.documentElement );
+ // Add doctype manually
+ return '<!doctype html>' + ve.serializeXhtml( newDoc );
};
/**
--
To view, visit https://gerrit.wikimedia.org/r/160596
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If48555fa4763e763484bbabfa0bc4ded0d0a5c58
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.24wmf20
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits