Bug 66746 - Expose setFullscreen method on WebPluginContainer
Summary: Expose setFullscreen method on WebPluginContainer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-22 23:12 PDT by Jeremy Apthorp
Modified: 2011-08-24 11:09 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.09 KB, patch)
2011-08-22 23:14 PDT, Jeremy Apthorp
no flags Details | Formatted Diff | Diff
Patch (3.13 KB, patch)
2011-08-22 23:41 PDT, Jeremy Apthorp
no flags Details | Formatted Diff | Diff
Patch (3.91 KB, patch)
2011-08-23 18:19 PDT, Jeremy Apthorp
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Apthorp 2011-08-22 23:12:11 PDT
Expose setFullscreen method on WebPluginContainer
Comment 1 Jeremy Apthorp 2011-08-22 23:14:05 PDT
Created attachment 104791 [details]
Patch
Comment 2 WebKit Review Bot 2011-08-22 23:18:48 PDT
Comment on attachment 104791 [details]
Patch

Attachment 104791 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9482076
Comment 3 Jeremy Apthorp 2011-08-22 23:41:51 PDT
Created attachment 104792 [details]
Patch
Comment 4 Eric Seidel (no email) 2011-08-23 11:57:57 PDT
API changes sound like a fishd review.
Comment 5 Eric Seidel (no email) 2011-08-23 12:06:19 PDT
Comment on attachment 104792 [details]
Patch

I thought the new fullscreen goodness allowed you to make any element fullscreen?
Comment 6 Jeremy Apthorp 2011-08-23 15:25:17 PDT
(In reply to comment #5)
> (From update of attachment 104792 [details])
> I thought the new fullscreen goodness allowed you to make any element fullscreen?

They do. The reason I put the code in WebPluginContainer instead of WebElement is that WebPluginContainer has a direct reference to a WebCore::HTMLPlugInElement, and it seemed silly to wrap it in WebElement only to unwrap it and call a method on it immediately afterwards.

I think if I moved the function to WebElement, I would mirror the WebKit API, and have:

webelement->requestFullScreen(flags);

and

webelement->document()->cancelFullScreen();

which would necessitate adding 3 methods:
- void WebElement::requestFullScreen(flags)
- WebDocument WebElement::document()
- void WebDocument::cancelFullScreen()


If that seems cleaner/better to someone with a clearer understanding of the WebFoo wrapper APIs than me, I'm happy to reimplement it that way :)
Comment 7 Darin Fisher (:fishd, Google) 2011-08-23 16:24:38 PDT
Comment on attachment 104792 [details]
Patch

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

> Source/WebKit/chromium/public/WebPluginContainer.h:93
> +    virtual void setFullscreen(bool) = 0;

Since this is implemented as webkitRequestFullScreen, it could fail.  In other
words, this method should probably have a name indicative of the fact that this
could fail.

Another idea here, is that we could just expose a requestFullScreen function on
WebElement.  WebPluginContainer provides a way to get the WebElement containing
the plugin.  We could also add a cancelFullScreen method on WebElement.  This
might be the better way to expose this functionality to the embedder of WebKit.
Comment 8 Darin Fisher (:fishd, Google) 2011-08-23 16:27:00 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > (From update of attachment 104792 [details] [details])
> > I thought the new fullscreen goodness allowed you to make any element fullscreen?
> 
> They do. The reason I put the code in WebPluginContainer instead of WebElement is that WebPluginContainer has a direct reference to a WebCore::HTMLPlugInElement, and it seemed silly to wrap it in WebElement only to unwrap it and call a method on it immediately afterwards.
> 
> I think if I moved the function to WebElement, I would mirror the WebKit API, and have:
> 
> webelement->requestFullScreen(flags);
> 
> and
> 
> webelement->document()->cancelFullScreen();
> 
> which would necessitate adding 3 methods:
> - void WebElement::requestFullScreen(flags)
> - WebDocument WebElement::document()
> - void WebDocument::cancelFullScreen()
> 
> 
> If that seems cleaner/better to someone with a clearer understanding of the WebFoo wrapper APIs than me, I'm happy to reimplement it that way :)

Heh, sorry... I only looked at the patch before commenting.  I think it is better to add the more generic APIs.  We've found that to be the better way in the past.

I have to note though that if this is for Pepper, we may have a bit of an issue to worry about.  Assuming we want to require a user gesture before accepting a request to make an element fullscreen, we might have trouble here.  You see with pepper, events are dispatched asynchronously.  This means that when the plugin sees the event, webkit has already cleared its user gesture flag.
Comment 9 Jeremy Apthorp 2011-08-23 18:19:10 PDT
Created attachment 104953 [details]
Patch
Comment 10 Jeremy Apthorp 2011-08-23 18:20:51 PDT
(In reply to comment #7)
> (From update of attachment 104792 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=104792&action=review
> 
> > Source/WebKit/chromium/public/WebPluginContainer.h:93
> > +    virtual void setFullscreen(bool) = 0;
> 
> Since this is implemented as webkitRequestFullScreen, it could fail.  In other
> words, this method should probably have a name indicative of the fact that this
> could fail.
> 
> Another idea here, is that we could just expose a requestFullScreen function on
> WebElement.  WebPluginContainer provides a way to get the WebElement containing
> the plugin.  We could also add a cancelFullScreen method on WebElement.  This
> might be the better way to expose this functionality to the embedder of WebKit.

I've rearranged this to reflect the arrangement of the underlying WebKit implementation.
Comment 11 WebKit Review Bot 2011-08-24 11:09:21 PDT
Comment on attachment 104953 [details]
Patch

Clearing flags on attachment: 104953

Committed r93714: <http://trac.webkit.org/changeset/93714>
Comment 12 WebKit Review Bot 2011-08-24 11:09:26 PDT
All reviewed patches have been landed.  Closing bug.