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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js

Issue 2060793002: Rewrite tests for slots (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@events-related
Patch Set: fixed Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shadow-dom/slots.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js b/third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js
index f4f0a65bb7f9b56bb041e794ca0ad01b5487a00d..3dc2490e444ea2620f1df22c3872abbd8e76e216 100644
--- a/third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js
+++ b/third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js
@@ -1,17 +1,17 @@
function removeWhiteSpaceOnlyTextNodes(node)
{
- for (var i = 0; i < node.childNodes.length; i++) {
- var child = node.childNodes[i];
- if (child.nodeType === Node.TEXT_NODE && child.nodeValue.trim().length == 0) {
- node.removeChild(child);
- i--;
- } else if (child.nodeType === Node.ELEMENT_NODE || child.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
- removeWhiteSpaceOnlyTextNodes(child);
- }
- }
- if (node.shadowRoot) {
- removeWhiteSpaceOnlyTextNodes(node.shadowRoot);
+ for (var i = 0; i < node.childNodes.length; i++) {
+ var child = node.childNodes[i];
+ if (child.nodeType === Node.TEXT_NODE && child.nodeValue.trim().length == 0) {
+ node.removeChild(child);
+ i--;
+ } else if (child.nodeType === Node.ELEMENT_NODE || child.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
+ removeWhiteSpaceOnlyTextNodes(child);
}
+ }
+ if (node.shadowRoot) {
+ removeWhiteSpaceOnlyTextNodes(node.shadowRoot);
+ }
}
function convertTemplatesToShadowRootsWithin(node) {
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/shadow-dom/slots.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698