Bug 100025 - [WK2] [Mac] WebKit Full Screen API should use NSWindow full screen API.
Summary: [WK2] [Mac] WebKit Full Screen API should use NSWindow full screen API.
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: Jer Noble
URL:
Keywords:
: 78929 102807 (view as bug list)
Depends on: 102300
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-22 13:55 PDT by Jer Noble
Modified: 2012-11-27 16:41 PST (History)
2 users (show)

See Also:


Attachments
Patch (30.25 KB, patch)
2012-10-22 14:30 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (32.77 KB, patch)
2012-10-23 11:45 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (41.97 KB, patch)
2012-10-23 14:55 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (41.98 KB, patch)
2012-10-23 15:30 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (41.98 KB, patch)
2012-10-23 16:03 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (41.77 KB, patch)
2012-10-23 16:21 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (14.20 KB, patch)
2012-11-14 17:01 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (14.21 KB, patch)
2012-11-16 11:39 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (14.84 KB, patch)
2012-11-16 11:43 PST, Jer Noble
mitz: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2012-10-22 13:55:12 PDT
[WK2] [Mac] WebKit Full Screen API should use NSWindow full screen API.
Comment 1 Jer Noble 2012-10-22 14:29:53 PDT
<rdar://problem/9569685>
Comment 2 Jer Noble 2012-10-22 14:30:04 PDT
Created attachment 169986 [details]
Patch
Comment 3 mitz 2012-10-22 14:38:52 PDT
Comment on attachment 169986 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:92
> +    _exitWarning = adoptNS([[WebCoreFullScreenWarningView alloc] initWithTitle:@"Click to exit full screen mode"]);

This UI string is not localizable.
Comment 4 Jer Noble 2012-10-22 14:41:15 PDT
Whoo(In reply to comment #3)
> (From update of attachment 169986 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=169986&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:92
> > +    _exitWarning = adoptNS([[WebCoreFullScreenWarningView alloc] initWithTitle:@"Click to exit full screen mode"]);
> 
> This UI string is not localizable.

Whoops, meant to fix that before uploading.  I'll get a new (rebased) patch up shortly.
Comment 5 Darin Adler 2012-10-22 18:16:36 PDT
Comment on attachment 169986 [details]
Patch

The patch didn’t apply. You should rebase it and upload it again.
Comment 6 Jer Noble 2012-10-23 11:45:49 PDT
Created attachment 170201 [details]
Patch

Added a localized string for the 'click to exit' text; rebaselined to current ToT.
Comment 7 Jer Noble 2012-10-23 14:55:21 PDT
Created attachment 170241 [details]
Patch

One last revision.  Moved the Placeholder View implementation into WebCore where it could be shared by WebKit2 and WebKit1.
Comment 8 Jer Noble 2012-10-23 15:30:15 PDT
Created attachment 170250 [details]
Patch

Rebased.
Comment 9 Jer Noble 2012-10-23 16:00:49 PDT
The bots seem to be choking on the changes to Localizable.strings.  Trying to figure out why, now.
Comment 10 Jer Noble 2012-10-23 16:03:03 PDT
Created attachment 170259 [details]
Patch

Added extra newline after my change to Localizable.strings.
Comment 11 Jer Noble 2012-10-23 16:11:27 PDT
I'll just split this change into two parts; the non-Localizable.strings part, and the rest.
Comment 12 Jer Noble 2012-10-23 16:21:03 PDT
Created attachment 170264 [details]
Patch

Localized.strings is now a binary diff.  Hopefully this makes the EWS bots happy.
Comment 13 Jer Noble 2012-11-14 11:25:53 PST
*** Bug 78929 has been marked as a duplicate of this bug. ***
Comment 14 Jer Noble 2012-11-14 17:01:31 PST
Created attachment 174294 [details]
Patch
Comment 15 Jer Noble 2012-11-14 17:01:56 PST
Comment on attachment 174294 [details]
Patch

In order to ease reviewing, I split out two dependent patches from this one, in bug #102299 and bug #102300.
Comment 16 Build Bot 2012-11-15 06:50:42 PST
Comment on attachment 174294 [details]
Patch

Attachment 174294 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14833730
Comment 17 Jer Noble 2012-11-16 10:42:16 PST
(Mac build failure is a missing symbol, which is added in a dependent patch in bug #102300.)
Comment 18 mitz 2012-11-16 11:00:19 PST
Comment on attachment 174294 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h:60
> +    NSTimeInterval _animationDuration;

This is unused.

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:58
> +@interface NSWindow(MoreSpecificFullScreenActions)

Needs a space before the parenthesis. Also, the modern naming scheme for categories like this is (WebNSWindowDetails).

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:102
> +    [window setDelegate:self];
> +    [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary)];

1. I think it’s safest to set the delegate to nil in this class’s -dealloc. Even though the window is private to this class, it’s not hard for something else to get a reference to it and extend its lifetime beyond this instance’s.
2. It’s a little crazy to use window after releasing it, even though it’s almost certainly assured to work. You can fix this by using a RetainPtr, but I think it’s also acceptable to replace the -release with -autorelease above.

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:282
> +    ASSERT([[self window] respondsToSelector:@selector(enterFullScreenMode:)]);
> +    [[self window] enterFullScreenMode:self];

I don’t think the assertion is buying us anything. If the assertion is false, then it will be obvious from the crash when sending an unrecognized selector to the window.

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:359
> +    ASSERT([[self window] respondsToSelector:@selector(exitFullScreenMode:)]);

Ditto.
Comment 19 Jer Noble 2012-11-16 11:19:42 PST
(In reply to comment #18)
> (From update of attachment 174294 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=174294&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h:60
> > +    NSTimeInterval _animationDuration;
> 
> This is unused.

I'll delete it.

> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:58
> > +@interface NSWindow(MoreSpecificFullScreenActions)
> 
> Needs a space before the parenthesis. Also, the modern naming scheme for categories like this is (WebNSWindowDetails).

Sure thing.  This is probably something which could be added to check-webkit-style. (I'll file a bug.)

> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:102
> > +    [window setDelegate:self];
> > +    [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary)];
> 
> 1. I think it’s safest to set the delegate to nil in this class’s -dealloc. Even though the window is private to this class, it’s not hard for something else to get a reference to it and extend its lifetime beyond this instance’s.

Sure thing, I'll add it.

> 2. It’s a little crazy to use window after releasing it, even though it’s almost certainly assured to work. You can fix this by using a RetainPtr, but I think it’s also acceptable to replace the -release with -autorelease above.

Yeah, it should be owned by the superclass after initWithWindow:, but you're right that it's a little weird.  I'll wrap it in a RetainPtr.

> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:282
> > +    ASSERT([[self window] respondsToSelector:@selector(enterFullScreenMode:)]);
> > +    [[self window] enterFullScreenMode:self];
> 
> I don’t think the assertion is buying us anything. If the assertion is false, then it will be obvious from the crash when sending an unrecognized selector to the window.

In fact, it's less informative, since the unrecognized selector crash will generate a crash log with the selector name in it.  I'll delete the ASSERT.

> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:359
> > +    ASSERT([[self window] respondsToSelector:@selector(exitFullScreenMode:)]);
> 
> Ditto.

Ditto.
Comment 20 Jer Noble 2012-11-16 11:39:46 PST
Created attachment 174730 [details]
Patch

Updated after mitz's comments.
Comment 21 Jer Noble 2012-11-16 11:43:17 PST
Created attachment 174732 [details]
Patch
Comment 22 mitz 2012-11-16 11:59:41 PST
Comment on attachment 174732 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h:60
> +    NSTimeInterval _animationDuration;

Didn’t you say you’d delete this?
Comment 23 Jer Noble 2012-11-16 12:33:06 PST
(In reply to comment #22)
> (From update of attachment 174732 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=174732&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h:60
> > +    NSTimeInterval _animationDuration;
> 
> Didn’t you say you’d delete this?

Ack!  Yes, i will before landing.
Comment 24 Build Bot 2012-11-16 21:27:44 PST
Comment on attachment 174732 [details]
Patch

Attachment 174732 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14873380
Comment 25 Jer Noble 2012-11-26 16:15:37 PST
*** Bug 102807 has been marked as a duplicate of this bug. ***
Comment 26 Jer Noble 2012-11-27 16:41:16 PST
Committed r135944: <http://trac.webkit.org/changeset/135944>