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

Unified Diff: Source/core/html/shadow/MediaControlElements.cpp

Issue 25798003: Enable WebVTT regions for runtime testing, updated tests and minor fixes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revert Logging Created 7 years, 2 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: Source/core/html/shadow/MediaControlElements.cpp
diff --git a/Source/core/html/shadow/MediaControlElements.cpp b/Source/core/html/shadow/MediaControlElements.cpp
index 6a9061faad9695140a4690124e1c95418ab32ba5..ed387eb4f1894d752a3305b6ba450d3393384d93 100644
--- a/Source/core/html/shadow/MediaControlElements.cpp
+++ b/Source/core/html/shadow/MediaControlElements.cpp
@@ -30,6 +30,7 @@
#include "config.h"
#include "core/html/shadow/MediaControlElements.h"
+#include "RuntimeEnabledFeatures.h"
#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "core/dom/DOMTokenList.h"
#include "core/events/EventNames.h"
@@ -737,20 +738,17 @@ void MediaControlTextTrackContainerElement::updateDisplay()
continue;
RefPtr<TextTrackCueBox> displayBox = cue->getDisplayTree(m_videoDisplaySize.size());
+ TextTrackRegion* region = 0;
+ if (RuntimeEnabledFeatures::webVTTRegionsEnabled() && cue->track()->regions())
+ region = cue->track()->regions()->getRegionById(cue->regionId());
-#if ENABLE(WEBVTT_REGIONS)
- String regionId = cue->regionId();
- TextTrackRegion* region = cue->track()->regions()->getRegionById(regionId);
- if (!region) {
+ if (!RuntimeEnabledFeatures::webVTTRegionsEnabled() || !region) {
acolwell GONE FROM CHROMIUM 2013/10/04 19:48:20 nit: Isn't the !RuntimeEnabledFeatures::webVTTRegi
vcarbune.chromium 2013/10/08 18:07:38 Correct, I removed it from here and the line above
// If cue has an empty text track cue region identifier or there is no
// WebVTT region whose region identifier is identical to cue's text
// track cue region identifier, run the following substeps:
-#endif
- if (displayBox->hasChildNodes() && !contains(displayBox.get())) {
+ if (displayBox->hasChildNodes() && !contains(displayBox.get()))
// Note: the display tree of a cue is removed when the active flag of the cue is unset.
appendChild(displayBox);
- }
-#if ENABLE(WEBVTT_REGIONS)
} else {
// Let region be the WebVTT region whose region identifier
// matches the text track cue region identifier of cue.
@@ -762,7 +760,6 @@ void MediaControlTextTrackContainerElement::updateDisplay()
region->appendTextTrackCueBox(displayBox);
}
-#endif
}
// 11. Return output.

Powered by Google App Engine
This is Rietveld 408576698