Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | pt.postProcessor.doPostProcess(treeBuilder.parser.document); |
201 | 201 | |
202 | 202 | // And serialize the result. |
203 | | - var out = treeBuilder.body().innerHTML; |
| 203 | + var out = treeBuilder.document.body.innerHTML; |
204 | 204 | |
205 | 205 | // Finally, check the result vs. the expected result. |
206 | 206 | pt.checkResult( pt.currentItem, out ); |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.HTML5TreeBuilder.node.js |
— | — | @@ -62,6 +62,9 @@ |
63 | 63 | break; |
64 | 64 | case "END": |
65 | 65 | this.emit('end'); |
| 66 | + // HACK: This should not be needed really. |
| 67 | + this.document = this.parser.document; |
| 68 | + this.document.body = this.document.getElementsByTagName('body')[0]; |
66 | 69 | break; |
67 | 70 | case "NEWLINE": |
68 | 71 | //this.emit('end'); |
— | — | @@ -72,9 +75,6 @@ |
73 | 76 | } |
74 | 77 | }; |
75 | 78 | |
76 | | -FauxHTML5.TreeBuilder.prototype.body = function () { |
77 | | - return this.parser.document.getElementsByTagName('body')[0]; |
78 | | -} |
79 | 79 | |
80 | 80 | |
81 | 81 | if (typeof module == "object") { |