WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
61715
Controls never hide in full screen after user stops moving mouse
https://bugs.webkit.org/show_bug.cgi?id=61715
Summary
Controls never hide in full screen after user stops moving mouse
Brian Weinstein
Reported
2011-05-29 17:43:25 PDT
Full screen HTML5 video at vimeo, reveal the controls by moving the mouse, they never go away again! * STEPS TO REPRODUCE 1. Go to vimeo.com 2. Play the front page video 3. Take it full screen. 4. Notice the controls are hidden. 5. Move the mouse to reveal them. 6. They never re-hide. * RESULTS They should re-hide! <
rdar://problem/9522182
>
Attachments
[PATCH] Fix
(5.08 KB, patch)
2011-05-29 17:46 PDT
,
Brian Weinstein
no flags
Details
Formatted Diff
Diff
[PATCH] Fix v2
(7.84 KB, patch)
2011-05-29 19:21 PDT
,
Brian Weinstein
no flags
Details
Formatted Diff
Diff
Patch
(10.46 KB, patch)
2011-05-29 19:55 PDT
,
Jer Noble
darin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Brian Weinstein
Comment 1
2011-05-29 17:46:35 PDT
Created
attachment 95310
[details]
[PATCH] Fix
Jer Noble
Comment 2
2011-05-29 17:48:45 PDT
Is there any way to hide the mouse pointer from within WebCore? If not, that's fine (because the user can park their mouse in the corner).
Darin Adler
Comment 3
2011-05-29 17:48:51 PDT
Comment on
attachment 95310
[details]
[PATCH] Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=95310&action=review
> Source/WebCore/html/HTMLMediaElement.cpp:1649 > + // If we have a timer running to hide the controls, stop and restart it to start out three second > + // period over again. > + if (m_hideFullscreenControlsTimer.isActive()) > + m_hideFullscreenControlsTimer.stop();
Doesn’t startOneShot already do this?
> Source/WebCore/html/HTMLMediaElement.cpp:2412 > + startHideFullscreenControlsTimer();
What if this timer is still running when some other code calls makeOpaque. I would expect to see more calls to stop the timer elsewhere.
Brian Weinstein
Comment 4
2011-05-29 17:53:38 PDT
Comment on
attachment 95310
[details]
[PATCH] Fix View in context:
https://bugs.webkit.org/attachment.cgi?id=95310&action=review
>> Source/WebCore/html/HTMLMediaElement.cpp:1649 >> + m_hideFullscreenControlsTimer.stop(); > > Doesn’t startOneShot already do this?
I wasn't 100% sure from looking at the Timer code, but I believe so on closer inspection.
>> Source/WebCore/html/HTMLMediaElement.cpp:2412 >> + startHideFullscreenControlsTimer(); > > What if this timer is still running when some other code calls makeOpaque. I would expect to see more calls to stop the timer elsewhere.
makeOpaque is only called in one other places in HTMLMediaElement - when handling mouseOver events. I can discuss with Jer other places to stop the timer, I'm not sure the other places we would want to.
Brian Weinstein
Comment 5
2011-05-29 17:56:28 PDT
(In reply to
comment #4
)
> (From update of
attachment 95310
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=95310&action=review
> > >> Source/WebCore/html/HTMLMediaElement.cpp:1649 > >> + m_hideFullscreenControlsTimer.stop(); > > > > Doesn’t startOneShot already do this? > > I wasn't 100% sure from looking at the Timer code, but I believe so on closer inspection.
Testing confirms you are correct. Fixed to remove the unnecessary code.
Brian Weinstein
Comment 6
2011-05-29 19:21:10 PDT
Created
attachment 95314
[details]
[PATCH] Fix v2
Darin Adler
Comment 7
2011-05-29 19:39:09 PDT
Comment on
attachment 95314
[details]
[PATCH] Fix v2 View in context:
https://bugs.webkit.org/attachment.cgi?id=95314&action=review
This is missing the mouseover and mouseout part. I see no reason to land the partial fix.
> Source/WebCore/html/HTMLMediaElement.cpp:2417 > mediaControls()->makeOpaque();
We should stop the timer here, when we move over the controls.
> Source/WebCore/html/HTMLMediaElement.cpp:2419 > m_mouseOver = false;
And we should start the timer here.
Jer Noble
Comment 8
2011-05-29 19:45:24 PDT
Comment on
attachment 95314
[details]
[PATCH] Fix v2 View in context:
https://bugs.webkit.org/attachment.cgi?id=95314&action=review
>> Source/WebCore/html/HTMLMediaElement.cpp:2417 >> mediaControls()->makeOpaque(); > > We should stop the timer here, when we move over the controls.
There's not currently a way to determine here that the mouse is over the controls, since the MediaControls class doesn't give access to its innards, and MediaControls()->hovered() is apparently always returning true if the mouse is over the video element. But if MediaControls had a new virtual function, say "bool shouldHideControls()", and MediaControlRootElement implemented it to return, "return !m_panel->hovered()", that should be enough to determine if the mouse is over the media control panel. I've modified Brian's patch to add this to MediaControls (but not stopping the timer here, yet), and it seems to work well.
Brian Weinstein
Comment 9
2011-05-29 19:53:10 PDT
Comment on
attachment 95314
[details]
[PATCH] Fix v2 View in context:
https://bugs.webkit.org/attachment.cgi?id=95314&action=review
>> Source/WebCore/html/HTMLMediaElement.cpp:2419 >> m_mouseOver = false; > > And we should start the timer here.
I believe this represents whether or not the mouse is in the media element, not whether or not it is over the controls. As Jer mentioned in the comment, there currently isn't a way to determine if the mouse is in the controls.
Jer Noble
Comment 10
2011-05-29 19:55:51 PDT
Created
attachment 95316
[details]
Patch
Darin Adler
Comment 11
2011-05-29 19:59:07 PDT
Comment on
attachment 95316
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=95316&action=review
> Source/WebCore/html/HTMLMediaElement.cpp:2420 > + if (mediaControls()->shouldHideControls()) > + startHideFullscreenControlsTimer();
Mousing over means we should *stop* the timer.
> Source/WebCore/html/HTMLMediaElement.cpp:2424 > m_mouseOver = false; > + stopHideFullscreenControlsTimer();
Mousing out means we should *start* the timer.
Jer Noble
Comment 12
2011-05-29 20:09:38 PDT
Comment on
attachment 95316
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=95316&action=review
>> Source/WebCore/html/HTMLMediaElement.cpp:2420 >> + startHideFullscreenControlsTimer(); > > Mousing over means we should *stop* the timer.
What we are mousing over is not necessarily the controls. We are mousing over the element here. We may still want to hide the controls after the inactivity period if the mouse isn't over the controls.
>> Source/WebCore/html/HTMLMediaElement.cpp:2424 >> + stopHideFullscreenControlsTimer(); > > Mousing out means we should *start* the timer.
And here, we are mousing out of the element entirely, so we are going to hide the controls the next time we get a playbackProgressTimerFired call.
Darin Adler
Comment 13
2011-05-29 20:14:26 PDT
Comment on
attachment 95316
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=95316&action=review
OK, then assuming you tested enough, r=me
> Source/WebCore/html/shadow/MediaControlRootElement.h:99 > + bool shouldHideControls();
Should this be marked virtual?
> Source/WebCore/html/shadow/MediaControls.h:71 > + virtual bool shouldHideControls() = 0;
I see only one derived class implementing this. Will having this new pure virtual function break the build?
Jer Noble
Comment 14
2011-05-29 20:36:04 PDT
Comment on
attachment 95316
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=95316&action=review
>> Source/WebCore/html/shadow/MediaControlRootElement.h:99 >> + bool shouldHideControls(); > > Should this be marked virtual?
It should be. None of the other functions in this file are, and they should all be as well. (But later)
>> Source/WebCore/html/shadow/MediaControls.h:71 >> + virtual bool shouldHideControls() = 0; > > I see only one derived class implementing this. Will having this new pure virtual function break the build?
I checked, an no other class in WebCore inherits from this class except MediaControlRootElement.
Jer Noble
Comment 15
2011-05-29 20:37:23 PDT
Committed
r87661
: <
http://trac.webkit.org/changeset/87661
>
Dimitri Glazkov (Google)
Comment 16
2011-05-31 09:08:10 PDT
Why can't this be done with just CSS?
Darin Adler
Comment 17
2011-05-31 14:38:17 PDT
(In reply to
comment #16
)
> Why can't this be done with just CSS?
It probably can be.
Ademar Reis
Comment 18
2011-06-03 14:01:58 PDT
Revision
r87661
cherry-picked into qtwebkit-2.2 with commit ec7a9b6 <
http://gitorious.org/webkit/qtwebkit/commit/ec7a9b6
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug