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

Side by Side Diff: Source/core/html/track/vtt/VTTRegion.cpp

Issue 182243002: Allow the implementation to return references instead of pointers to the bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 return m_regionDisplayTree; 332 return m_regionDisplayTree;
333 } 333 }
334 334
335 void VTTRegion::willRemoveVTTCueBox(VTTCueBox* box) 335 void VTTRegion::willRemoveVTTCueBox(VTTCueBox* box)
336 { 336 {
337 WTF_LOG(Media, "VTTRegion::willRemoveVTTCueBox"); 337 WTF_LOG(Media, "VTTRegion::willRemoveVTTCueBox");
338 ASSERT(m_cueContainer->contains(box)); 338 ASSERT(m_cueContainer->contains(box));
339 339
340 double boxHeight = box->getBoundingClientRect()->bottom() - box->getBounding ClientRect()->top(); 340 double boxHeight = box->getBoundingClientRect()->bottom() - box->getBounding ClientRect()->top();
341 341
342 m_cueContainer->classList()->remove(textTrackCueContainerScrollingClass(), A SSERT_NO_EXCEPTION); 342 m_cueContainer->classList().remove(textTrackCueContainerScrollingClass(), AS SERT_NO_EXCEPTION);
343 343
344 m_currentTop += boxHeight; 344 m_currentTop += boxHeight;
345 m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrim itiveValue::CSS_PX); 345 m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrim itiveValue::CSS_PX);
346 } 346 }
347 347
348 void VTTRegion::appendVTTCueBox(PassRefPtr<VTTCueBox> displayBox) 348 void VTTRegion::appendVTTCueBox(PassRefPtr<VTTCueBox> displayBox)
349 { 349 {
350 ASSERT(m_cueContainer); 350 ASSERT(m_cueContainer);
351 351
352 if (m_cueContainer->contains(displayBox.get())) 352 if (m_cueContainer->contains(displayBox.get()))
(...skipping 10 matching lines...) Expand all
363 363
364 // FIXME: This should not be causing recalc styles in a loop to set the "top " css 364 // FIXME: This should not be causing recalc styles in a loop to set the "top " css
365 // property to move elements. We should just scroll the text track cues on t he 365 // property to move elements. We should just scroll the text track cues on t he
366 // compositor with an animation. 366 // compositor with an animation.
367 367
368 if (m_scrollTimer.isActive()) 368 if (m_scrollTimer.isActive())
369 return; 369 return;
370 370
371 // If it's a scrolling region, add the scrolling class. 371 // If it's a scrolling region, add the scrolling class.
372 if (isScrollingRegion()) 372 if (isScrollingRegion())
373 m_cueContainer->classList()->add(textTrackCueContainerScrollingClass(), ASSERT_NO_EXCEPTION); 373 m_cueContainer->classList().add(textTrackCueContainerScrollingClass(), A SSERT_NO_EXCEPTION);
374 374
375 float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom(); 375 float regionBottom = m_regionDisplayTree->getBoundingClientRect()->bottom();
376 376
377 // Find first cue that is not entirely displayed and scroll it upwards. 377 // Find first cue that is not entirely displayed and scroll it upwards.
378 for (Element* child = ElementTraversal::firstWithin(*m_cueContainer); child && !m_scrollTimer.isActive(); child = ElementTraversal::nextSibling(*child)) { 378 for (Element* child = ElementTraversal::firstWithin(*m_cueContainer); child && !m_scrollTimer.isActive(); child = ElementTraversal::nextSibling(*child)) {
379 float childTop = toHTMLDivElement(child)->getBoundingClientRect()->top() ; 379 float childTop = toHTMLDivElement(child)->getBoundingClientRect()->top() ;
380 float childBottom = toHTMLDivElement(child)->getBoundingClientRect()->bo ttom(); 380 float childBottom = toHTMLDivElement(child)->getBoundingClientRect()->bo ttom();
381 381
382 if (regionBottom >= childBottom) 382 if (regionBottom >= childBottom)
383 continue; 383 continue;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 465
466 void VTTRegion::scrollTimerFired(Timer<VTTRegion>*) 466 void VTTRegion::scrollTimerFired(Timer<VTTRegion>*)
467 { 467 {
468 WTF_LOG(Media, "VTTRegion::scrollTimerFired"); 468 WTF_LOG(Media, "VTTRegion::scrollTimerFired");
469 469
470 stopTimer(); 470 stopTimer();
471 displayLastVTTCueBox(); 471 displayLastVTTCueBox();
472 } 472 }
473 473
474 } // namespace WebCore 474 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698