Bug 65061 - REGRESSION: ClickToFlash HTML5 player doesn't disable screen dimming when full screen
Summary: REGRESSION: ClickToFlash HTML5 player doesn't disable screen dimming when ful...
Status: RESOLVED DUPLICATE of bug 73730
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.7
: P1 Normal
Assignee: Jer Noble
URL: http://youtube.com
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-07-22 20:14 PDT by Jon
Modified: 2011-12-19 10:34 PST (History)
2 users (show)

See Also:


Attachments
Patch (16.40 KB, patch)
2011-08-24 13:16 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Update patch to address Mark's comments. (16.44 KB, patch)
2011-09-20 08:55 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (18.67 KB, patch)
2011-09-22 11:55 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon 2011-07-22 20:14:24 PDT
Using ClickToFlash's HTML5 player on youtube.com, the system's screen dimming preference is not disabled while playing full screen video. Recent bug fixes have fixed other bugs with CTF's player, including the cursor hiding and controller display. This is a regression from Safari 5.0.5 on Snow Leopard that has occurred for all of the 5.1 builds I've used in Lion. I don't know whether this affects 5.1 on SL.
Comment 1 Alexey Proskuryakov 2011-07-22 23:44:11 PDT
<rdar://problem/9828140>
Comment 2 Jer Noble 2011-08-24 13:16:31 PDT
Created attachment 105053 [details]
Patch
Comment 3 Mark Rowe (bdash) 2011-09-19 23:20:45 PDT
Comment on attachment 105053 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=105053&action=review

> Source/WebKit2/UIProcess/mac/WebFullScreenManagerProxyMac.mm:114
> +    [[m_webView fullScreenWindowController] setIsPlaying:(isPlaying ? YES : NO)];

You shouldn’t need to jump through that hoop to convert from bool -> BOOL.  Does the compiler complain if you pass isPlaying directly?

> Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp:79
> +        DOMWindow* window = m_element->document()->domWindow();
> +        if (window) {

We’d typically move the declaration of window in to the condition part of the if statement here, and below.

> Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp:94
> +            window->addEventListener(eventNames.endedEvent, m_mediaEventListener, true);

Why does the call to addEventListener not require .get() like the calls to removeEventListener above?
Comment 4 Jer Noble 2011-09-19 23:27:22 PDT
Comment on attachment 105053 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=105053&action=review

>> Source/WebKit2/UIProcess/mac/WebFullScreenManagerProxyMac.mm:114
>> +    [[m_webView fullScreenWindowController] setIsPlaying:(isPlaying ? YES : NO)];
> 
> You shouldn’t need to jump through that hoop to convert from bool -> BOOL.  Does the compiler complain if you pass isPlaying directly?

No, this was just me being (needlessly) type-specific.  I'll remove it.

>> Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp:79
>> +        if (window) {
> 
> We’d typically move the declaration of window in to the condition part of the if statement here, and below.

Yup; will do.

>> Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp:94
>> +            window->addEventListener(eventNames.endedEvent, m_mediaEventListener, true);
> 
> Why does the call to addEventListener not require .get() like the calls to removeEventListener above?

Looks like that's because addEventListener() takes a PassRefPtr<> and removeEventListener() takes a bare pointer.
Comment 5 Jer Noble 2011-09-20 08:55:20 PDT
Created attachment 108008 [details]
Update patch to address Mark's comments.
Comment 6 Darin Adler 2011-09-20 10:38:15 PDT
Comment on attachment 108008 [details]
Update patch to address Mark's comments.

Windows build failure is:


4>WebFullScreenManagerProxyMessageReceiver.obj : error LNK2001: unresolved external symbol "private: void __thiscall WebKit::WebFullScreenManagerProxy::setIsPlaying(bool)" (?setIsPlaying@WebFullScreenManagerProxy@WebKit@@AAEX_N@Z)
Comment 7 Jer Noble 2011-09-20 13:00:19 PDT
(In reply to comment #6)
> (From update of attachment 108008 [details])
> Windows build failure is:
> 
> 
> 4>WebFullScreenManagerProxyMessageReceiver.obj : error LNK2001: unresolved external symbol "private: void __thiscall WebKit::WebFullScreenManagerProxy::setIsPlaying(bool)" (?setIsPlaying@WebFullScreenManagerProxy@WebKit@@AAEX_N@Z)

I'll address this and resubmit.
Comment 8 Jer Noble 2011-09-22 11:55:33 PDT
Created attachment 108374 [details]
Patch

Added stubs for setIsPlaying() to each of the ports which implement WebFullScreenManagerProxy.
Comment 9 Eric Seidel (no email) 2011-12-19 10:23:19 PST
Comment on attachment 108374 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=108374&action=review

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:148
> +    [self _updatePowerAssertions];

This just scream for KVO (I don't think we use such fancy cocoaisms in WebKit though). :p

> Source/WebKit2/UIProcess/mac/WebFullScreenManagerProxyMac.mm:114
> +    [[m_webView fullScreenWindowController] setIsPlaying:(isPlaying ? YES : NO)];

As Mark said, I'm surprised you have to do this?  Can't you just pass isPlaying directly?

> Source/WebKit2/UIProcess/win/WebFullScreenManagerProxyWin.cpp:113
> +    // FIXME: Implement

notImplemented()?

> Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp:78
> +        DOMWindow* window = m_element->document()->domWindow();

Do we need to grab this twice?  If not, than these checks could be if (m_element && window) and we lose an indent level.

> Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp:87
> +    setIsPlaying(isAnyMoviePlaying());

isAnyMoviePlaying() sounds scary... Do hidden movies count as "playing"?  Ones which are display: none, etc?  (certainly I can produce cases where movies play and are not visible to the user) will that interact poorly with this code?

> Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp:201
> +        nextNode = nextNode->traverseNextNode(m_element.get());

This feels like a for loop, but it might be clearer written in this while style?  I trust your judgemnet.
Comment 10 Jer Noble 2011-12-19 10:33:30 PST
(In reply to comment #9)
> (From update of attachment 108374 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=108374&action=review
> 

Eric,  thanks for looking at this patch.  Unfortunately, it has been largely (if not entirely) made irrelevant by the fix for: https://bugs.webkit.org/show_bug.cgi?id=73730.

I'll clear the review bit and close this bug.  Sorry for wasting your time.
Comment 11 Jer Noble 2011-12-19 10:34:02 PST

*** This bug has been marked as a duplicate of bug 73730 ***