RESOLVED WONTFIX 96339
[chromium] Video captions should use full video space when controls disappear
https://bugs.webkit.org/show_bug.cgi?id=96339
Summary [chromium] Video captions should use full video space when controls disappear
Silvia Pfeiffer
Reported 2012-09-10 17:05:23 PDT
There's a bug in the video controls that makes the panel display:none, but leaves the enclosure sitting there transparently. This inhibits the video captions from using the full video viewport.
Attachments
Patch (6.23 KB, patch)
2013-02-18 20:35 PST, Silvia Pfeiffer
no flags
move timer into MediaControlDivElement (19.24 KB, patch)
2013-02-22 01:01 PST, Silvia Pfeiffer
eric.carlson: review+
webkit.review.bot: commit-queue-
Silvia Pfeiffer
Comment 1 2013-02-18 20:35:45 PST
Eric Carlson
Comment 2 2013-02-19 07:46:47 PST
Comment on attachment 188978 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=188978&action=review > Source/WebCore/html/shadow/MediaControlElements.cpp:319 > +void MediaControlPanelEnclosureElement::startTimer() > +{ > + stopTimer(); > + > + // The timer is required to set the property display:'none' on the panel, > + // such that captions are correctly displayed at the bottom of the video > + // at the end of the fadeout transition. > + double duration = document()->page() ? document()->page()->theme()->mediaControlsFadeOutDuration() : 0; > + m_transitionTimer.startOneShot(duration); > +} > + > +void MediaControlPanelEnclosureElement::stopTimer() > +{ > + if (m_transitionTimer.isActive()) > + m_transitionTimer.stop(); > +} > + > +void MediaControlPanelEnclosureElement::transitionTimerFired(Timer<MediaControlPanelEnclosureElement>*) > +{ > + if (!m_opaque) > + hide(); > + > + stopTimer(); > +} It looks like these were copied verbatim from MediaControlPanelElement. Both classes both derive from MediaControlDivElement, can these be moved there instead so we have only one implementation?
Silvia Pfeiffer
Comment 3 2013-02-19 15:31:27 PST
Yes they were. :-) MediaControlDivElement is the parent for almost all controls. Only MediaControlPanelElement and MediaControlPanelEnclosureElement need the timer before hiding. I could create another common parent between the two but it seems the extra class hierarchy is less efficient than this small amount of copied code.
Eric Carlson
Comment 4 2013-02-19 16:36:19 PST
(In reply to comment #3) > Yes they were. :-) > > MediaControlDivElement is the parent for almost all controls. Only MediaControlPanelElement and MediaControlPanelEnclosureElement need the timer before hiding. I could create another common parent between the two but it seems the extra class hierarchy is less efficient than this small amount of copied code. I don't see any reason it couldn't go into the base class. We don't want objects that don't need a timer to have one, but you can use an OwnPtr<Timer<..> > and have startTimer() allocate it the first time it is called. See RenderButton::styleDidChange for an example of how this might work.
Silvia Pfeiffer
Comment 5 2013-02-19 17:20:38 PST
(In reply to comment #4) > I don't see any reason it couldn't go into the base class. We don't want objects that don't need a timer to have one, but you can use an OwnPtr<Timer<..> > and have startTimer() allocate it the first time it is called. See RenderButton::styleDidChange for an example of how this might work. Good idea, thanks!
Silvia Pfeiffer
Comment 6 2013-02-21 20:05:07 PST
Just noticed it on MediaControlEmbeddedPanelElement of the Blackberry controls, too. This will remove some duplicated code from there, too.
Silvia Pfeiffer
Comment 7 2013-02-22 01:01:00 PST
Created attachment 189709 [details] move timer into MediaControlDivElement
WebKit Review Bot
Comment 8 2013-02-22 01:49:35 PST
Comment on attachment 189709 [details] move timer into MediaControlDivElement Attachment 189709 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/16698688 New failing tests: media/video-controls-toggling.html
Eric Carlson
Comment 9 2013-02-22 09:54:37 PST
Comment on attachment 189709 [details] move timer into MediaControlDivElement View in context: https://bugs.webkit.org/attachment.cgi?id=189709&action=review Nice refactoring, thanks for taking the extra time to do it! > Source/WebCore/html/shadow/MediaControlElementTypes.cpp:154 > + double duration = document()->page() ? document()->page()->theme()->mediaControlsFadeInDuration() : 0; > + > + setInlineStyleProperty(CSSPropertyWebkitTransitionProperty, CSSPropertyOpacity); > + setInlineStyleProperty(CSSPropertyWebkitTransitionDuration, duration, CSSPrimitiveValue::CSS_S); > + setInlineStyleProperty(CSSPropertyOpacity, 1.0, CSSPrimitiveValue::CSS_NUMBER); > + > + setOpaque(true); Nit: if this was in a separate method it could be shared by makeOpaque and makeTransparent.
Note You need to log in before you can comment on or make changes to this bug.