mediawiki-extensions-Visual.../modules/ve/test/dm
Catrope 3035c311ec Make the converter work with full HTML documents rather than fragments
The Parsoid output will also be expected to be a full HTML document. For
backwards compatibility, we allow for the Parsoid output to be a
document fragment as well. We don't send a full document back yet, also
for b/c -- we'll change this later once Parsoid has been updated in
production.

ve.dm.Converter.js:
* Make getDataFromDom() accept a document rather than a node
** Split off the recursion (which does use nodes) into its own function
** For now we just convert the <body>. In the future, we'll want to do
   things with the <head> as well
* Pass the document around so we can use it when creating elements
* Make getDomFromData() return a document rather than a <div>

ve.init.mw.Target.js:
* Store a document (this.doc) rather than a DOM node (this.dom)
* Pass around documents rather than DOM nodes
* Detect whether the Parsoid output is an HTML document or a fragment
  using a hacky regex
* When submitting to Parsoid, submit the innerHTML of the <body>

ve.init.mw.ViewPageTarget.js:
* s/dom/doc/
* Store body.innerHTML in this.originalHtml

ve.Surface.js:
* s/dom/doc/

demos/ve/index.php:
* Don't wrap HTML in <div>
* Pass HTML document rather than DOM node to ve.Surface

ve.dm.Converter.test.js:
* Construct a document from the test HTML, rather than a <div>

ve.dm.example.js:
* Wrap the HTML in the converter test cases in <body> tags to prevent
  misinterpretation (HTML fragments starting with comments, <meta>,
  <link> and whitespace are problematic)

Change-Id: I82fdad0a099febc5e658486cbf8becfcdbc85a2d
2013-02-19 10:38:39 -08:00
..
nodes Major Documentation Cleanup 2013-01-16 15:37:59 -08:00
ve.dm.BranchNode.test.js Convert node rules to static properties 2013-01-18 14:51:40 -08:00
ve.dm.Converter.test.js Make the converter work with full HTML documents rather than fragments 2013-02-19 10:38:39 -08:00
ve.dm.Document.test.js Added tests and fixed inconsistencies for empty text node handling 2013-01-29 15:13:17 -08:00
ve.dm.DocumentSynchronizer.test.js Major Documentation Cleanup 2013-01-16 15:37:59 -08:00
ve.dm.example.js Make the converter work with full HTML documents rather than fragments 2013-02-19 10:38:39 -08:00
ve.dm.LeafNode.test.js Convert node rules to static properties 2013-01-18 14:51:40 -08:00
ve.dm.ModelRegistry.test.js Add extension-specific types functionality to ModelRegistry 2013-01-22 18:12:35 -08:00
ve.dm.Node.test.js Convert node rules to static properties 2013-01-18 14:51:40 -08:00
ve.dm.NodeFactory.test.js Convert node rules to static properties 2013-01-18 14:51:40 -08:00
ve.dm.Surface.test.js Major Documentation Cleanup 2013-01-16 15:37:59 -08:00
ve.dm.SurfaceFragment.test.js Major Documentation Cleanup 2013-01-16 15:37:59 -08:00
ve.dm.Transaction.test.js (bug 45029) Transactions for metadata modification. 2013-02-14 17:27:27 -08:00
ve.dm.TransactionProcessor.test.js (bug 45029) Transactions for metadata modification. 2013-02-14 17:27:27 -08:00