Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Unified Diff: LayoutTests/http/tests/w3c/resources/testharnessreport.js

Issue 1154773008: testharnessreport: Remove Text children of the body. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update form-validation-reportValidity-expected.txt Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/w3c/resources/testharnessreport.js
diff --git a/LayoutTests/http/tests/w3c/resources/testharnessreport.js b/LayoutTests/http/tests/w3c/resources/testharnessreport.js
index 038ea16801fe50e0f3243d8f2ec399d32d4e6942..91f3d4fe2c75a4bc8ae01a5b5aa9d8830967e6f7 100644
--- a/LayoutTests/http/tests/w3c/resources/testharnessreport.js
+++ b/LayoutTests/http/tests/w3c/resources/testharnessreport.js
@@ -101,8 +101,13 @@ add_completion_callback(function (tests, harness_status) {
if ((isCSSWGTest() || isJSTest()) && logDiv) {
// Assume it's a CSSWG style test, and anything other than the log div isn't
// material to the testrunner output, so should be hidden from the text dump
- for (var i = 0; i < document.body.children.length; i++) {
- document.body.children[i].style.visibility = "hidden";
+ var next = null;
+ for (var child = document.body.firstChild; child; child = next) {
+ next = child.nextSibling;
+ if (child.nodeType == Node.ELEMENT_NODE)
+ child.style.visibility = "hidden";
+ else if (child.nodeType == Node.TEXT_NODE)
+ document.body.removeChild(child);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698