Index: third_party/WebKit/LayoutTests/media/track/track-helpers.js |
diff --git a/third_party/WebKit/LayoutTests/media/track/track-helpers.js b/third_party/WebKit/LayoutTests/media/track/track-helpers.js |
index a377ae0628c054457dfd5bb0b4ea884d6ced089a..12e8aff7354523530d3a05289bb7a7b5b587fc42 100644 |
--- a/third_party/WebKit/LayoutTests/media/track/track-helpers.js |
+++ b/third_party/WebKit/LayoutTests/media/track/track-helpers.js |
@@ -45,6 +45,11 @@ function assert_cue_fragment(cue, children) { |
assert_true(fragment.isEqualNode(cue.getCueAsHTML())); |
} |
+function assert_cue_fragment_as_textcontent(cue, children) { |
+ var fragment = createFragment(children); |
+ assert_equals(cue.getCueAsHTML().textContent, fragment.textContent); |
+} |
+ |
function createFragment(children) { |
var fragment = document.createDocumentFragment(); |
cloneChildrenToFragment(fragment, children); |
@@ -58,6 +63,9 @@ function cloneChildrenToFragment(root, children) { |
childElement = document.createTextNode(child.value); |
} else { |
childElement = document.createElement(child.type); |
+ var styles = child.style || {}; |
+ for (var attr of Object.getOwnPropertyNames(styles)) |
+ childElement[attr] = styles[attr]; |
cloneChildrenToFragment(childElement, child.value); |
} |
root.appendChild(childElement); |