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

Unified Diff: Source/core/html/track/TextTrackContainer.cpp

Issue 1018593004: Implement <video controls> dodging for text track layout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: braces Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/track/TextTrackContainer.h ('k') | Source/core/layout/LayoutMedia.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/TextTrackContainer.cpp
diff --git a/Source/core/html/track/TextTrackContainer.cpp b/Source/core/html/track/TextTrackContainer.cpp
index bb0935eeacb5a0a05fb0da6f300da18500ed0d04..932517e78867c7293da9f647cc1d42592347e253 100644
--- a/Source/core/html/track/TextTrackContainer.cpp
+++ b/Source/core/html/track/TextTrackContainer.cpp
@@ -53,7 +53,7 @@ LayoutObject* TextTrackContainer::createLayoutObject(const LayoutStyle&)
return new LayoutTextTrackContainer(this);
}
-void TextTrackContainer::updateDisplay(HTMLMediaElement& mediaElement)
+void TextTrackContainer::updateDisplay(HTMLMediaElement& mediaElement, ExposingControls exposingControls)
{
if (!mediaElement.closedCaptionsVisible()) {
removeChildren();
@@ -82,11 +82,13 @@ void TextTrackContainer::updateDisplay(HTMLMediaElement& mediaElement)
// output one or more completely transparent positioned CSS block boxes that
// cover the same region as the user interface.
- // 5. If the last time these rules were run, the user agent was not exposing
- // a user interface for video, but now it is, let reset be true. Otherwise,
- // let reset be false.
+ // Note: Overlap checking for the controls is implemented in LayoutVTTCue
+ // without a placeholder box (element or layout object).
- // TODO(philipj): Implement step 4 and 5.
+ // 5. If the last time these rules were run, the user agent was not exposing
+ // a user interface for video, but now it is, optionally let reset be true.
+ // Otherwise, let reset be false.
+ bool reset = exposingControls == DidStartExposingControls;
// 6. Let tracks be the subset of video's list of text tracks that have as
// their rules for updating the text track rendering these rules for
@@ -101,9 +103,11 @@ void TextTrackContainer::updateDisplay(HTMLMediaElement& mediaElement)
// text track cue display state has a set of CSS boxes, then add those boxes
// to output, and remove cue from cues.
- // There is nothing explicitly to be done here, as all the caching occurs
- // within the TextTrackCue instance itself. If parameters of the cue change,
- // the display tree is cleared.
+ // Note: Removing all children will cause them to be re-inserted below,
+ // invalidating the layout.
+ // effect
+ if (reset)
+ removeChildren();
// 10. For each text track cue cue in cues that has not yet had
// corresponding CSS boxes added to output, in text track cue order, run the
« no previous file with comments | « Source/core/html/track/TextTrackContainer.h ('k') | Source/core/layout/LayoutMedia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698