Skip to content

Commit

Permalink
Merge pull request web-platform-tests#160 from MicrosoftEdge/fix-xhtm…
Browse files Browse the repository at this point in the history
…l-svg-dom-hierarchy-error

Issue web-platform-tests#157: DOM hierarchy error with XHTML and SVG; r=Ms2ger
  • Loading branch information
Ms2ger committed Dec 30, 2015
2 parents 4a2d411 + 6c2060f commit 154ec10
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions testharnessreport.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*global add_completion_callback, setup */
/* global add_completion_callback */
/* global setup */

/*
* This file is intended for vendors to implement
* code needed to integrate testharness.js tests with their own test systems.
Expand All @@ -23,8 +25,6 @@
* parameters they are called with see testharness.js
*/



var metadata_generator = {

currentMetadata: {},
Expand Down Expand Up @@ -389,13 +389,20 @@ function dump_test_results(tests, status) {
var test_results = tests.map(function(x) {
return {name:x.name, status:x.status, message:x.message, stack:x.stack}
});
data = {test:window.location.href,
tests:test_results,
status: status.status,
message: status.message,
stack: status.stack};
var data = {test:window.location.href,
tests:test_results,
status: status.status,
message: status.message,
stack: status.stack};
results_element.textContent = JSON.stringify(data);
document.documentElement.lastChild.appendChild(results_element);

// To avoid a HierarchyRequestError with XML documents, ensure that 'results_element'
// is inserted at a location that results in a valid document.
var parent = document.body
? document.body // <body> is required in XHTML documents
: document.documentElement; // fallback for optional <body> in HTML5, SVG, etc.

parent.appendChild(results_element);
}

metadata_generator.setup();
Expand Down

0 comments on commit 154ec10

Please sign in to comment.