Chromium Code Reviews| 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; |