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

Unified Diff: third_party/WebKit/LayoutTests/media/media-controls.js

Issue 2268923003: Clean up textTrackDisplayElement utility function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 4 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/media/track/css-cue-for-video-in-shadow.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/media-controls.js
diff --git a/third_party/WebKit/LayoutTests/media/media-controls.js b/third_party/WebKit/LayoutTests/media/media-controls.js
index 0eb0b03562f06a905ce84cfc3403fb6671c59828..ebb609d6c474702afb19d3b8ff65ec19563fba8a 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls.js
+++ b/third_party/WebKit/LayoutTests/media/media-controls.js
@@ -73,13 +73,8 @@ function textTrackContainerElement(parentElement) {
"-webkit-media-text-track-container");
}
-function textTrackCueDisplayElement(parentElement) {
- var containerElement = textTrackContainerElement(parentElement);
- return mediaControlsElement(containerElement.firstChild, "-webkit-media-text-track-display");
-}
-
function textTrackCueElementByIndex(parentElement, cueIndex) {
- var displayElement = textTrackCueDisplayElement(parentElement);
+ var displayElement = textTrackDisplayElement(parentElement);
if (displayElement) {
for (i = 0; i < cueIndex; i++)
displayElement = displayElement.nextSibling;
@@ -100,35 +95,10 @@ function textTrackRegionContainerElement(parentElement)
return mediaControlsElement(containerElement.firstChild, "-webkit-media-text-track-region-container");
}
-// TODO(srirama.m): Phase out the uses of this function and
-// replace with more specific functions at each call site.
-function textTrackDisplayElement(parentElement, id, cueNumber)
+function textTrackDisplayElement(parentElement)
{
var containerElement = textTrackContainerElement(parentElement);
-
- if (!containerElement)
- throw "Failed to find text track container element";
-
- if (!id)
- return containerElement;
-
- var controlID = id;
- if (controlID != 'cue')
- controlID = "-webkit-media-text-track-" + id;
-
- var displayElement = mediaControlsElement(containerElement.firstChild, controlID);
- if (!displayElement)
- throw "No text track cue with display id '" + controlID + "' is currently visible";
-
- if (cueNumber) {
- for (i = 0; i < cueNumber; i++)
- displayElement = displayElement.nextSibling;
-
- if (!displayElement)
- throw "There are not " + cueNumber + " text track cues visible";
- }
-
- return displayElement;
+ return mediaControlsElement(containerElement.firstChild, "-webkit-media-text-track-display");
}
function isClosedCaptionsButtonVisible(currentMediaElement)
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698