RESOLVED FIXED 88818
Add fullscreen button to Chrome video controls
https://bugs.webkit.org/show_bug.cgi?id=88818
Summary Add fullscreen button to Chrome video controls
Silvia Pfeiffer
Reported 2012-06-11 16:27:10 PDT
This patch is part of the introduction of the new Chromium video controls, master bug at https://bugs.webkit.org/show_bug.cgi?id=84672 . It introduces a fullscreen button.
Attachments
Full patch for layout tests (89.30 KB, patch)
2012-06-11 20:41 PDT, Silvia Pfeiffer
no flags
Use this for review (16.11 KB, patch)
2012-06-11 20:46 PDT, Silvia Pfeiffer
no flags
adapted to work with recent fullscreen commits (64.83 KB, patch)
2012-06-12 09:20 PDT, Silvia Pfeiffer
no flags
Use this for review (23.61 KB, patch)
2012-06-12 09:24 PDT, Silvia Pfeiffer
no flags
added a fullscreen transparent background for audio (full patch) (27.32 KB, patch)
2012-06-14 06:15 PDT, Silvia Pfeiffer
no flags
Use this for review (10.84 KB, patch)
2012-06-14 06:21 PDT, Silvia Pfeiffer
no flags
patch for cq (15.76 KB, patch)
2012-06-14 17:26 PDT, Silvia Pfeiffer
no flags
Silvia Pfeiffer
Comment 1 2012-06-11 20:41:38 PDT
Created attachment 147000 [details] Full patch for layout tests
Silvia Pfeiffer
Comment 2 2012-06-11 20:46:51 PDT
Created attachment 147003 [details] Use this for review Fullscreen related changes only
Eric Carlson
Comment 3 2012-06-12 06:54:45 PDT
Comment on attachment 147003 [details] Use this for review it looks like this was created largely by copying and pasting chunks from MediaControlRootElement.cpp. This makes sense in as much as the patch adds functionality that is already in the media controls root used by all of the other ports, but it also means that the two classes are more and more similar without actually sharing any code. We now have two classes that perform exactly the same function and that are called from cross platform code, but that share by copy and paste instead of by using a common base class. I don't know why Steve decided to create this file by cloning MediaControlRootElement instead of factoring the common code into a base class, and clearly I should not have r+d the original change, but I think it is time to reevaluate. Instead of making this mess worse, how hard would it be to add these fullscreen changes by factoring the code from MediaControlRootElement into a base class?
Silvia Pfeiffer
Comment 4 2012-06-12 07:02:42 PDT
(In reply to comment #3) > (From update of attachment 147003 [details]) > I don't know why Steve decided to create this file by cloning MediaControlRootElement instead of > factoring the common code into a base class, and clearly I should not have r+d the original change, but >I think it is time to reevaluate. Instead of making this mess worse, how hard would it be to add these > fullscreen changes by factoring the code from MediaControlRootElement into a base class? Actually, today, a patch landed that added fullscreen support for Android, so half this patch has already landed. Also, if you look at the individual functions, some of them are actually quite different between the two files. I understand where you're coming from and I am sympathetic, but I'd prefer doing it after this patch. I am supposed to land this this week so it can make it into Chrome 21. So, I'd prefer to do the analysis and clean-up afterwards.
Silvia Pfeiffer
Comment 5 2012-06-12 07:29:35 PDT
Created a new bug for the code restructing issue, see bug 88871 .
Silvia Pfeiffer
Comment 6 2012-06-12 09:20:56 PDT
Created attachment 147096 [details] adapted to work with recent fullscreen commits
Silvia Pfeiffer
Comment 7 2012-06-12 09:24:00 PDT
Created attachment 147098 [details] Use this for review Substantial change with recent comment, see bug 88266.
Eric Carlson
Comment 8 2012-06-12 09:41:20 PDT
Comment on attachment 147098 [details] Use this for review View in context: https://bugs.webkit.org/attachment.cgi?id=147098&action=review This generally looks OK, but I would like to see a version with corrected ChangeLogs. > Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp:365 > + // When we get a mouse move in fullscreen mode, show the media controls, and start a timer > + // that will hide the media controls after a 3 seconds without a mouse move. Copy-pasta: you redefined timeWithoutMouseMovementBeforeHidingControls above to 2 seconds. > Source/WebCore/rendering/RenderMediaControlsChromium.cpp:277 > - DEFINE_STATIC_LOCAL(Image*, mediaFullscreen, (platformResource("mediaFullscreen"))); > - return paintMediaButton(paintInfo.context, rect, mediaFullscreen); > + static Image* mediaFullscreenButton = platformResource("mediaplayerFullscreen"); Why the change from "DEFINE_STATIC_LOCAL" to just "static"? > Source/WebCore/rendering/RenderThemeChromiumSkia.cpp:462 > -String formatMediaControlsTime(float time) const > +String formatMediaControlsTime(float time) Is it not possible for RenderMediaControlsChromium::formatMediaControlsTime to be const?
Silvia Pfeiffer
Comment 9 2012-06-12 09:49:09 PDT
(In reply to comment #8) > (From update of attachment 147098 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=147098&action=review > > This generally looks OK, but I would like to see a version with corrected ChangeLogs. Actually, I was hasty with this diff, since it includes more than it should, in particular the weird changes to the ChangeLogs and the Skia changes (the latter of which need to go into bug 88724 where the skia builds failed. > > Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp:365 > > + // When we get a mouse move in fullscreen mode, show the media controls, and start a timer > > + // that will hide the media controls after a 3 seconds without a mouse move. > > Copy-pasta: you redefined timeWithoutMouseMovementBeforeHidingControls above to 2 seconds. Thanks for noticing! > > Source/WebCore/rendering/RenderMediaControlsChromium.cpp:277 > > - DEFINE_STATIC_LOCAL(Image*, mediaFullscreen, (platformResource("mediaFullscreen"))); > > - return paintMediaButton(paintInfo.context, rect, mediaFullscreen); > > + static Image* mediaFullscreenButton = platformResource("mediaplayerFullscreen"); > > Why the change from "DEFINE_STATIC_LOCAL" to just "static"? All images are now pulled in in this way - the previous way doesn't work any more. > > Source/WebCore/rendering/RenderThemeChromiumSkia.cpp:462 > > -String formatMediaControlsTime(float time) const > > +String formatMediaControlsTime(float time) > > Is it not possible for RenderMediaControlsChromium::formatMediaControlsTime to be const? It's not a class member function, just a static helper so can't declare it in this way. Hmm... I missed the "static". Will fix.
WebKit Review Bot
Comment 10 2012-06-12 11:14:08 PDT
Comment on attachment 147096 [details] adapted to work with recent fullscreen commits Attachment 147096 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12938788
Silvia Pfeiffer
Comment 11 2012-06-14 06:15:22 PDT
Created attachment 147568 [details] added a fullscreen transparent background for audio (full patch)
Silvia Pfeiffer
Comment 12 2012-06-14 06:21:36 PDT
Created attachment 147569 [details] Use this for review This patch plus the changelog will be what I'm planning to land.
Eric Carlson
Comment 13 2012-06-14 09:42:00 PDT
Comment on attachment 147569 [details] Use this for review View in context: https://bugs.webkit.org/attachment.cgi?id=147569&action=review > Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp:365 > + // When we get a mouse move in fullscreen mode, show the media controls, and start a timer > + // that will hide the media controls after a 3 seconds without a mouse move. Nit: you hide the controls after 2 seconds, not 3. > Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp:369 > + if (m_isFullscreen) { > + // When we get a mouse move in fullscreen mode, show the media controls, and start a timer > + // that will hide the media controls after a 3 seconds without a mouse move. > + makeOpaque(); > + if (shouldHideControls()) > + startHideFullscreenControlsTimer(); > + } Does it matter that you may call startHideFullscreenControlsTimer() multiple times?
Silvia Pfeiffer
Comment 14 2012-06-14 15:00:25 PDT
(In reply to comment #13) > (From update of attachment 147569 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=147569&action=review > > > Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp:365 > > + // When we get a mouse move in fullscreen mode, show the media controls, and start a timer > > + // that will hide the media controls after a 3 seconds without a mouse move. > > Nit: you hide the controls after 2 seconds, not 3. DONE. > > Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp:369 > > + if (m_isFullscreen) { > > + // When we get a mouse move in fullscreen mode, show the media controls, and start a timer > > + // that will hide the media controls after a 3 seconds without a mouse move. > > + makeOpaque(); > > + if (shouldHideControls()) > > + startHideFullscreenControlsTimer(); > > + } > > Does it matter that you may call startHideFullscreenControlsTimer() multiple times? Every time that the mouse is moved, the timer has to be reset. So, no, it's intended. (Also note that MediaControlRootElement.cpp does the same thing.)
Silvia Pfeiffer
Comment 15 2012-06-14 17:26:24 PDT
Created attachment 147687 [details] patch for cq
WebKit Review Bot
Comment 16 2012-06-15 00:20:09 PDT
Comment on attachment 147687 [details] patch for cq Clearing flags on attachment: 147687 Committed r120414: <http://trac.webkit.org/changeset/120414>
WebKit Review Bot
Comment 17 2012-06-15 00:20:26 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.