Bug 56210

Summary: WebKit2: Implement a full screen window controller
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: WebKit2Assignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, eric.carlson, jer.noble, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 55993    
Bug Blocks: 56218    
Attachments:
Description Flags
Patch
none
Patch andersca: review+

Description Jer Noble 2011-03-11 11:30:05 PST
WebKit2 needs a full screen window controller, like WebKit/WebFullScreenController.
Comment 1 Jer Noble 2011-03-11 13:06:32 PST
Created attachment 85515 [details]
Patch
Comment 2 Jer Noble 2011-03-11 13:07:17 PST
Note this patch contains changes to WebFullScreenController.{h,cpp}.  (Copyright year changes only.)  This is because of the dumb way git does rename detection.
Comment 3 Jer Noble 2011-03-11 13:16:34 PST
Created attachment 85518 [details]
Patch

Updated the ChangeLog with more information.
Comment 4 Anders Carlsson 2011-03-11 16:59:11 PST
Comment on attachment 85518 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:361
> +- (void)getFullScreenRect:(WebCore::IntRect*)rect

This can just return an IntRect object.

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:368
> +    rect->setX(roundl(NSMinX(windowFrame)));
> +    rect->setY(roundl(NSMinY(windowFrame)));
> +    rect->setWidth(roundl(NSWidth(windowFrame)));
> +    rect->setHeight(roundl(NSHeight(windowFrame)));

Instead of doing this, you can just use enclosingIntRect([[self window] frame]);

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:477
> +        return NULL;

This should be return 0;

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:507
> +    return (WKFullScreenWindow *)[self window];

Please add a

ASSERT([[self window] isKindOfClass:[WKFullScreenWindow class]])

before casting.
Comment 5 Jer Noble 2011-03-11 17:27:13 PST
Comment on attachment 85518 [details]
Patch

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

>> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:361
>> +- (void)getFullScreenRect:(WebCore::IntRect*)rect
> 
> This can just return an IntRect object.

Great idea. :)

>> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:368
>> +    rect->setHeight(roundl(NSHeight(windowFrame)));
> 
> Instead of doing this, you can just use enclosingIntRect([[self window] frame]);

You learn something every day.  Used.

>> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:477
>> +        return NULL;
> 
> This should be return 0;

Right.  I got my C and C++ style guide rules backwards.  Changed.

>> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:507
>> +    return (WKFullScreenWindow *)[self window];
> 
> Please add a
> 
> ASSERT([[self window] isKindOfClass:[WKFullScreenWindow class]])
> 
> before casting.

Added.  Thanks!
Comment 6 Jer Noble 2011-03-11 21:39:31 PST
Committed r80923: <http://trac.webkit.org/changeset/80923>