| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 return; | 366 return; |
| 367 | 367 |
| 368 // If it's a scrolling region, add the scrolling class. | 368 // If it's a scrolling region, add the scrolling class. |
| 369 if (isScrollingRegion()) | 369 if (isScrollingRegion()) |
| 370 m_cueContainer->classList().add(textTrackCueContainerScrollingClass(), A
SSERT_NO_EXCEPTION); | 370 m_cueContainer->classList().add(textTrackCueContainerScrollingClass(), A
SSERT_NO_EXCEPTION); |
| 371 | 371 |
| 372 float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom(); | 372 float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom(); |
| 373 | 373 |
| 374 // Find first cue that is not entirely displayed and scroll it upwards. | 374 // Find first cue that is not entirely displayed and scroll it upwards. |
| 375 for (Element* child = ElementTraversal::firstChild(*m_cueContainer); child &
& !m_scrollTimer.isActive(); child = ElementTraversal::nextSibling(*child)) { | 375 for (Element* child = ElementTraversal::firstChild(*m_cueContainer); child &
& !m_scrollTimer.isActive(); child = ElementTraversal::nextSibling(*child)) { |
| 376 RefPtrWillBeRawPtr<ClientRect> clientRect = child->getBoundingClientRect
(); | 376 ClientRect* clientRect = child->getBoundingClientRect(); |
| 377 float childTop = clientRect->top(); | 377 float childTop = clientRect->top(); |
| 378 float childBottom = clientRect->bottom(); | 378 float childBottom = clientRect->bottom(); |
| 379 | 379 |
| 380 if (regionBottom >= childBottom) | 380 if (regionBottom >= childBottom) |
| 381 continue; | 381 continue; |
| 382 | 382 |
| 383 float height = childBottom - childTop; | 383 float height = childBottom - childTop; |
| 384 | 384 |
| 385 m_currentTop -= std::min(height, childBottom - regionBottom); | 385 m_currentTop -= std::min(height, childBottom - regionBottom); |
| 386 m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSS
PrimitiveValue::CSS_PX); | 386 m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSS
PrimitiveValue::CSS_PX); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 } | 470 } |
| 471 | 471 |
| 472 DEFINE_TRACE(VTTRegion) | 472 DEFINE_TRACE(VTTRegion) |
| 473 { | 473 { |
| 474 visitor->trace(m_cueContainer); | 474 visitor->trace(m_cueContainer); |
| 475 visitor->trace(m_regionDisplayTree); | 475 visitor->trace(m_regionDisplayTree); |
| 476 visitor->trace(m_track); | 476 visitor->trace(m_track); |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace blink | 479 } // namespace blink |
| OLD | NEW |