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

Unified Diff: Source/core/html/track/TextTrackRegion.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: Rebased 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
« no previous file with comments | « Source/core/html/track/TextTrackRegion.h ('k') | Source/core/html/track/TextTrackRegion.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/TextTrackRegion.cpp
diff --git a/Source/core/html/track/TextTrackRegion.cpp b/Source/core/html/track/TextTrackRegion.cpp
index eaae93f559df7fc382e08779b1858dbf7fa84ce7..b4af3e2d17834d6b84649f55ba69c9f97b417241 100644
--- a/Source/core/html/track/TextTrackRegion.cpp
+++ b/Source/core/html/track/TextTrackRegion.cpp
@@ -29,9 +29,6 @@
*/
#include "config.h"
-
-#if ENABLE(WEBVTT_REGIONS)
-
#include "core/html/track/TextTrackRegion.h"
#include "bindings/v8/ExceptionState.h"
@@ -358,7 +355,7 @@ const AtomicString& TextTrackRegion::textTrackRegionShadowPseudoId()
PassRefPtr<HTMLDivElement> TextTrackRegion::getDisplayTree()
{
if (!m_regionDisplayTree) {
- m_regionDisplayTree = HTMLDivElement::create(ownerDocument());
+ m_regionDisplayTree = HTMLDivElement::create(*ownerDocument());
prepareRegionDisplayTree();
}
@@ -382,6 +379,8 @@ void TextTrackRegion::willRemoveTextTrackCueBox(TextTrackCueBox* box)
void TextTrackRegion::appendTextTrackCueBox(PassRefPtr<TextTrackCueBox> displayBox)
{
+ ASSERT(m_cueContainer);
+
if (m_cueContainer->contains(displayBox.get()))
return;
@@ -398,7 +397,7 @@ void TextTrackRegion::displayLastTextTrackCueBox()
// property to move elements. We should just scroll the text track cues on the
// compositor with an animation.
- if (!m_scrollTimer.isActive())
+ if (m_scrollTimer.isActive())
return;
// If it's a scrolling region, add the scrolling class.
@@ -408,7 +407,7 @@ void TextTrackRegion::displayLastTextTrackCueBox()
float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom();
// Find first cue that is not entirely displayed and scroll it upwards.
- for (int i = 0; i < m_cueContainer->childNodeCount() && !m_scrollTimer.isActive(); ++i) {
+ for (size_t i = 0; i < m_cueContainer->childNodeCount() && !m_scrollTimer.isActive(); ++i) {
float childTop = toHTMLDivElement(m_cueContainer->childNode(i))->getBoundingClientRect()->top();
float childBottom = toHTMLDivElement(m_cueContainer->childNode(i))->getBoundingClientRect()->bottom();
@@ -466,7 +465,7 @@ void TextTrackRegion::prepareRegionDisplayTree()
// The cue container is used to wrap the cues and it is the object which is
// gradually scrolled out as multiple cues are appended to the region.
- m_cueContainer = HTMLDivElement::create(ownerDocument());
+ m_cueContainer = HTMLDivElement::create(*ownerDocument());
m_cueContainer->setInlineStyleProperty(CSSPropertyTop,
0.0,
CSSPrimitiveValue::CSS_PX);
@@ -506,5 +505,3 @@ void TextTrackRegion::scrollTimerFired(Timer<TextTrackRegion>*)
}
} // namespace WebCore
-
-#endif
« no previous file with comments | « Source/core/html/track/TextTrackRegion.h ('k') | Source/core/html/track/TextTrackRegion.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698