Skip to content

Commit 3718953

Browse files
Luming Yinnt1m
authored andcommitted
[macOS] Enable Navigator.standalone on macOS
https://bugs.webkit.org/show_bug.cgi?id=257776 rdar://110362364 Reviewed by Tim Nguyen. Enable Navigator.standalone for all Cocoa platforms, which including macOS and iOS. * LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt: * LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt: * LayoutTests/platform/mac/fast/dom/navigator-detached-no-crash-expected.txt: Rebaseline layout tests to reflect the availability of navigator.standalone. * Source/WTF/wtf/PlatformEnableCocoa.h: Same as above. * Source/WebCore/page/Navigator.cpp: * Source/WebCore/page/Navigator.h: Change compile-time flag to check for ENABLE(NAVIGATOR_STANDALONE) instead of PLATFORM(IOS_FAMILY). Canonical link: https://commits.webkit.org/265004@main
1 parent 7b6d3bc commit 3718953

File tree

6 files changed

+9
-3
lines changed

6 files changed

+9
-3
lines changed

LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ navigator.plugins is OK
2222
navigator.product is OK
2323
navigator.productSub is OK
2424
navigator.requestMediaKeySystemAccess() is OK
25+
navigator.standalone is OK
2526
navigator.storage is OK
2627
navigator.userActivation is OK
2728
navigator.userAgent is OK
@@ -51,6 +52,7 @@ navigator.plugins is OK
5152
navigator.product is OK
5253
navigator.productSub is OK
5354
navigator.requestMediaKeySystemAccess() is OK
55+
navigator.standalone is OK
5456
navigator.storage is OK
5557
navigator.userActivation is OK
5658
navigator.userAgent is OK

LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ navigator.setAppBadge() is OK
3434
navigator.setLoggedIn() is OK
3535
navigator.setLoggedOut() is OK
3636
navigator.share() is OK
37+
navigator.standalone is OK
3738
navigator.storage is OK
3839
navigator.userActivation is OK
3940
navigator.userAgent is OK
@@ -75,6 +76,7 @@ navigator.setAppBadge() is OK
7576
navigator.setLoggedIn() is OK
7677
navigator.setLoggedOut() is OK
7778
navigator.share() is OK
79+
navigator.standalone is OK
7880
navigator.storage is OK
7981
navigator.userActivation is OK
8082
navigator.userAgent is OK

LayoutTests/platform/mac/fast/dom/navigator-detached-no-crash-expected.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ navigator.productSub is OK
2323
navigator.requestMediaKeySystemAccess() is OK
2424
navigator.sendBeacon() threw err TypeError: Not enough arguments
2525
navigator.serviceWorker is OK
26+
navigator.standalone is OK
2627
navigator.userAgent is OK
2728
navigator.vendor is OK
2829
navigator.vendorSub is OK
@@ -49,6 +50,7 @@ navigator.productSub is OK
4950
navigator.requestMediaKeySystemAccess() is OK
5051
navigator.sendBeacon() threw err TypeError: Not enough arguments
5152
navigator.serviceWorker is OK
53+
navigator.standalone is OK
5254
navigator.userAgent is OK
5355
navigator.vendor is OK
5456
navigator.vendorSub is OK

Source/WTF/wtf/PlatformEnableCocoa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@
474474
#define ENABLE_MOUSE_CURSOR_SCALE 1
475475
#endif
476476

477-
#if !defined(ENABLE_NAVIGATOR_STANDALONE) && PLATFORM(IOS_FAMILY)
477+
#if !defined(ENABLE_NAVIGATOR_STANDALONE)
478478
#define ENABLE_NAVIGATOR_STANDALONE 1
479479
#endif
480480

Source/WebCore/page/Navigator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ bool Navigator::cookieEnabled() const
350350
return page->cookieJar().cookiesEnabled(*document);
351351
}
352352

353-
#if PLATFORM(IOS_FAMILY)
353+
#if ENABLE(NAVIGATOR_STANDALONE)
354354

355355
bool Navigator::standalone() const
356356
{

Source/WebCore/page/Navigator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Navigator final : public NavigatorBase, public ScriptWrappable, public Loc
5353
bool canShare(Document&, const ShareData&);
5454
void share(Document&, const ShareData&, Ref<DeferredPromise>&&);
5555

56-
#if PLATFORM(IOS_FAMILY)
56+
#if ENABLE(NAVIGATOR_STANDALONE)
5757
bool standalone() const;
5858
#endif
5959

0 commit comments

Comments
 (0)