RESOLVED FIXED 136189
Add WebKit SPI to control the navigator.standalone property
https://bugs.webkit.org/show_bug.cgi?id=136189
Summary Add WebKit SPI to control the navigator.standalone property
Matt Lilek
Reported 2014-08-22 18:53:05 PDT
WebKit1's WebPreferences exposes a method to control this and there's already plumbing in WebKit2's WebKit::WebPreferences. We just need to expose this on WKPreferences.
Attachments
Patch (2.62 KB, patch)
2014-08-22 18:57 PDT, Matt Lilek
sam: review-
dev+webkit: commit-queue-
Patch v2 (8.93 KB, patch)
2014-08-26 16:10 PDT, Matt Lilek
aestes: review+
Matt Lilek
Comment 1 2014-08-22 18:57:09 PDT
Sam Weinig
Comment 2 2014-08-22 21:41:26 PDT
I don't think this needs to be iOS specific. It would also be good to add an API test for this.
Darin Adler
Comment 3 2014-08-24 12:00:04 PDT
Comment on attachment 237020 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=237020&action=review > Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h:57 > +#if TARGET_OS_IPHONE Why the #if? I see no harm in doing this on Mac too.
Sam Weinig
Comment 4 2014-08-24 16:32:51 PDT
Comment on attachment 237020 [details] Patch Given both Darin and my comments, putting to r- for now.
Matt Lilek
Comment 5 2014-08-24 21:59:02 PDT
(In reply to comment #4) > (From update of attachment 237020 [details]) > Given both Darin and my comments, putting to r- for now. I was just matching WK1 which has this only on iOS, but I'll gladly change that. Any pointers to how to write an API test?
Sam Weinig
Comment 6 2014-08-26 13:24:06 PDT
Take a look at TestWebKitAPI's WebKit2 Cocoa group.
Matt Lilek
Comment 7 2014-08-26 16:10:41 PDT
Created attachment 237180 [details] Patch v2 Not iOS-specific and with an API test.
Andy Estes
Comment 8 2014-08-26 16:27:51 PDT
Comment on attachment 237180 [details] Patch v2 View in context: https://bugs.webkit.org/attachment.cgi?id=237180&action=review r=me > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm:31 > +#import "Test.h" This should come before the <>-style imports. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm:33 > +#if WK_API_ENABLED This should come after #import "config.h" but before the other imports. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm:40 > +TEST(WebKit2, DefaultWKPreferences) > +{ > + RetainPtr<WKPreferences> preferences = adoptNS([[WKPreferences alloc] init]); > + > + EXPECT_FALSE([preferences _isStandalone]); > +} You should also test setting the property (e.g. [preferences _setStandalone:YES]; EXPECT_TRUE([preferences _isStandalone];).
Matt Lilek
Comment 9 2014-08-26 20:18:32 PDT
Note You need to log in before you can comment on or make changes to this bug.