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

Unified Diff: Source/core/html/track/vtt/VTTRegion.cpp

Issue 420193007: Use new Traversal<> API more in the code base (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/HTMLLabelElement.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceClipper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/vtt/VTTRegion.cpp
diff --git a/Source/core/html/track/vtt/VTTRegion.cpp b/Source/core/html/track/vtt/VTTRegion.cpp
index d2bc0555291250fa36c8f3b8a7fb8f540a688bb2..1639ab6b130b44ca655e887abdd59a4fe6492ec0 100644
--- a/Source/core/html/track/vtt/VTTRegion.cpp
+++ b/Source/core/html/track/vtt/VTTRegion.cpp
@@ -373,9 +373,9 @@ void VTTRegion::displayLastVTTCueBox()
float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom();
// Find first cue that is not entirely displayed and scroll it upwards.
- for (Element* child = ElementTraversal::firstChild(*m_cueContainer); child && !m_scrollTimer.isActive(); child = ElementTraversal::nextSibling(*child)) {
- float childTop = toHTMLDivElement(child)->getBoundingClientRect()->top();
- float childBottom = toHTMLDivElement(child)->getBoundingClientRect()->bottom();
+ for (HTMLDivElement* child = Traversal<HTMLDivElement>::firstChild(*m_cueContainer); child && !m_scrollTimer.isActive(); child = Traversal<HTMLDivElement>::nextSibling(*child)) {
adamk 2014/07/28 21:06:38 It's not clear to me why this code was calling toH
Inactive 2014/07/28 21:13:33 Yes, this looked unsafe. OK, I'll keep using Eleme
Inactive 2014/07/28 21:41:06 Done.
+ float childTop = child->getBoundingClientRect()->top();
+ float childBottom = child->getBoundingClientRect()->bottom();
adamk 2014/07/28 21:06:38 Sad that this code calls getBoundingClientRect() t
Inactive 2014/07/28 21:41:06 Done.
if (regionBottom >= childBottom)
continue;
« no previous file with comments | « Source/core/html/HTMLLabelElement.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698