[Service Worker] Add stubs for Client / WindowClient / Clients
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Oct 2017 22:31:55 +0000 (22:31 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Oct 2017 22:31:55 +0000 (22:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178469

Reviewed by Youenn Fablet.

Source/WebCore:

Add stubs for Client / WindowClient / Clients:
- https://w3c.github.io/ServiceWorker/v1/#clients
- https://w3c.github.io/ServiceWorker/v1/#client-interface

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::visibilityState const):
* dom/Document.h:
* dom/Document.idl:
* dom/VisibilityState.h: Renamed from Source/WebCore/page/PageVisibilityState.h.
* dom/VisibilityState.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* page/Page.cpp:
(WebCore::Page::visibilityState const):
* page/Page.h:
* workers/service/ServiceWorkerClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
(WebCore::ServiceWorkerClient::ServiceWorkerClient):
(WebCore::ServiceWorkerClient::activeDOMObjectName const):
(WebCore::ServiceWorkerClient::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorkerClient::url const):
(WebCore::ServiceWorkerClient::frameType const):
(WebCore::ServiceWorkerClient::id const):
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerClients.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
(WebCore::ServiceWorkerClients::ServiceWorkerClients):
(WebCore::ServiceWorkerClients::activeDOMObjectName const):
(WebCore::ServiceWorkerClients::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorkerClients::get):
(WebCore::ServiceWorkerClients::matchAll):
(WebCore::ServiceWorkerClients::openWindow):
(WebCore::ServiceWorkerClients::claim):
* workers/service/ServiceWorkerClients.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
(WebCore::ServiceWorkerClients::create):
* workers/service/ServiceWorkerClients.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
* workers/service/ServiceWorkerGlobalScope.h:
(WebCore::ServiceWorkerGlobalScope::clients):
* workers/service/ServiceWorkerGlobalScope.idl:
* workers/service/ServiceWorkerWindowClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
(WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
(WebCore::ServiceWorkerWindowClient::visibilityState const):
(WebCore::ServiceWorkerWindowClient::isFocused const):
(WebCore::ServiceWorkerWindowClient::focus):
(WebCore::ServiceWorkerWindowClient::navigate):
* workers/service/ServiceWorkerWindowClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerWindowClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.

Source/WebKit:

Rename PageVisibilityState to VisibilityState.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toVisibilityState):
* WebProcess/WebPage/WebPage.h:

Source/WebKitLegacy/mac:

Rename PageVisiblityState to VisibilityState.

* WebView/WebView.mm:
(kit):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223634 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Document.idl
Source/WebCore/dom/VisibilityState.h [moved from Source/WebCore/page/PageVisibilityState.h with 93% similarity]
Source/WebCore/dom/VisibilityState.idl [new file with mode: 0644]
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/workers/service/ServiceWorkerClient.cpp [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerClient.h [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerClient.idl [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerClients.cpp [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerClients.h [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerClients.idl [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp
Source/WebCore/workers/service/ServiceWorkerGlobalScope.h
Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl
Source/WebCore/workers/service/ServiceWorkerWindowClient.cpp [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerWindowClient.h [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerWindowClient.idl [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/Shared/API/c/WKSharedAPICast.h
Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/DOMDocument.mm
Source/WebKitLegacy/mac/WebView/WebView.mm

index e8bf998..43a6390 100644 (file)
@@ -576,6 +576,7 @@ set(WebCore_NON_SVG_IDL_FILES
     dom/TreeWalker.idl
     dom/UIEvent.idl
     dom/UIEventInit.idl
+    dom/VisibilityState.idl
     dom/WebKitAnimationEvent.idl
     dom/WebKitTransitionEvent.idl
     dom/WheelEvent.idl
@@ -794,10 +795,13 @@ set(WebCore_NON_SVG_IDL_FILES
     workers/service/ExtendableEventInit.idl
     workers/service/FetchEvent.idl
     workers/service/ServiceWorker.idl
+    workers/service/ServiceWorkerClient.idl
+    workers/service/ServiceWorkerClients.idl
     workers/service/ServiceWorkerContainer.idl
     workers/service/ServiceWorkerGlobalScope.idl
     workers/service/ServiceWorkerRegistration.idl
     workers/service/ServiceWorkerUpdateViaCache.idl
+    workers/service/ServiceWorkerWindowClient.idl
 
     xml/DOMParser.idl
     xml/XMLHttpRequest.idl
@@ -3085,6 +3089,8 @@ set(WebCore_SOURCES
     workers/service/ExtendableEvent.cpp
     workers/service/FetchEvent.cpp
     workers/service/ServiceWorker.cpp
+    workers/service/ServiceWorkerClient.cpp
+    workers/service/ServiceWorkerClients.cpp
     workers/service/ServiceWorkerContainer.cpp
     workers/service/ServiceWorkerGlobalScope.cpp
     workers/service/ServiceWorkerJob.cpp
@@ -3094,6 +3100,7 @@ set(WebCore_SOURCES
     workers/service/ServiceWorkerRegistrationData.cpp
     workers/service/ServiceWorkerRegistrationKey.cpp
     workers/service/ServiceWorkerRegistrationOptions.cpp
+    workers/service/ServiceWorkerWindowClient.cpp
 
     workers/service/server/SWClientConnection.cpp
     workers/service/server/SWServer.cpp
index 9c1cf99..4b854bf 100644 (file)
@@ -1,3 +1,62 @@
+2017-10-18  Chris Dumez  <cdumez@apple.com>
+
+        [Service Worker] Add stubs for Client / WindowClient / Clients
+        https://bugs.webkit.org/show_bug.cgi?id=178469
+
+        Reviewed by Youenn Fablet.
+
+        Add stubs for Client / WindowClient / Clients:
+        - https://w3c.github.io/ServiceWorker/v1/#clients
+        - https://w3c.github.io/ServiceWorker/v1/#client-interface
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * dom/Document.cpp:
+        (WebCore::Document::visibilityState const):
+        * dom/Document.h:
+        * dom/Document.idl:
+        * dom/VisibilityState.h: Renamed from Source/WebCore/page/PageVisibilityState.h.
+        * dom/VisibilityState.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
+        * page/Page.cpp:
+        (WebCore::Page::visibilityState const):
+        * page/Page.h:
+        * workers/service/ServiceWorkerClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
+        (WebCore::ServiceWorkerClient::ServiceWorkerClient):
+        (WebCore::ServiceWorkerClient::activeDOMObjectName const):
+        (WebCore::ServiceWorkerClient::canSuspendForDocumentSuspension const):
+        (WebCore::ServiceWorkerClient::url const):
+        (WebCore::ServiceWorkerClient::frameType const):
+        (WebCore::ServiceWorkerClient::id const):
+        (WebCore::ServiceWorkerClient::postMessage):
+        * workers/service/ServiceWorkerClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
+        * workers/service/ServiceWorkerClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
+        * workers/service/ServiceWorkerClients.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
+        (WebCore::ServiceWorkerClients::ServiceWorkerClients):
+        (WebCore::ServiceWorkerClients::activeDOMObjectName const):
+        (WebCore::ServiceWorkerClients::canSuspendForDocumentSuspension const):
+        (WebCore::ServiceWorkerClients::get):
+        (WebCore::ServiceWorkerClients::matchAll):
+        (WebCore::ServiceWorkerClients::openWindow):
+        (WebCore::ServiceWorkerClients::claim):
+        * workers/service/ServiceWorkerClients.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
+        (WebCore::ServiceWorkerClients::create):
+        * workers/service/ServiceWorkerClients.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
+        * workers/service/ServiceWorkerGlobalScope.cpp:
+        (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
+        * workers/service/ServiceWorkerGlobalScope.h:
+        (WebCore::ServiceWorkerGlobalScope::clients):
+        * workers/service/ServiceWorkerGlobalScope.idl:
+        * workers/service/ServiceWorkerWindowClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
+        (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
+        (WebCore::ServiceWorkerWindowClient::visibilityState const):
+        (WebCore::ServiceWorkerWindowClient::isFocused const):
+        (WebCore::ServiceWorkerWindowClient::focus):
+        (WebCore::ServiceWorkerWindowClient::navigate):
+        * workers/service/ServiceWorkerWindowClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
+        * workers/service/ServiceWorkerWindowClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
+
 2017-10-18  Zalan Bujtas  <zalan@apple.com>
 
         [FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value on reentrancy
index 47a7866..50853b1 100644 (file)
@@ -494,6 +494,7 @@ JS_BINDING_IDLS = \
     $(WebCore)/dom/TreeWalker.idl \
     $(WebCore)/dom/UIEvent.idl \
     $(WebCore)/dom/UIEventInit.idl \
+    $(WebCore)/dom/VisibilityState.idl \
     $(WebCore)/dom/WebKitAnimationEvent.idl \
     $(WebCore)/dom/WebKitTransitionEvent.idl \
     $(WebCore)/dom/WheelEvent.idl \
@@ -914,10 +915,13 @@ JS_BINDING_IDLS = \
     $(WebCore)/workers/service/ExtendableEventInit.idl \
     $(WebCore)/workers/service/FetchEvent.idl \
     $(WebCore)/workers/service/ServiceWorker.idl \
+    $(WebCore)/workers/service/ServiceWorkerClient.idl \
+    $(WebCore)/workers/service/ServiceWorkerClients.idl \
     $(WebCore)/workers/service/ServiceWorkerContainer.idl \
     $(WebCore)/workers/service/ServiceWorkerGlobalScope.idl \
     $(WebCore)/workers/service/ServiceWorkerRegistration.idl \
     $(WebCore)/workers/service/ServiceWorkerUpdateViaCache.idl \
+    $(WebCore)/workers/service/ServiceWorkerWindowClient.idl \
     $(WebCore)/xml/DOMParser.idl \
     $(WebCore)/xml/XMLHttpRequest.idl \
     $(WebCore)/xml/XMLHttpRequestEventTarget.idl \
index d9cf4e9..f135d1b 100644 (file)
                46C696CC1E7205FC00597937 /* CPUMonitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46C696CA1E7205E400597937 /* CPUMonitor.cpp */; };
                46C83EFD1A9BBE2900A79A41 /* GeoNotifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46C83EFB1A9BBE2900A79A41 /* GeoNotifier.cpp */; };
                46C83EFE1A9BBE2900A79A41 /* GeoNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 46C83EFC1A9BBE2900A79A41 /* GeoNotifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               46CA9C441F97BBE9004CFC3A /* VisibilityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 46CA9C411F97BBE7004CFC3A /* VisibilityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
                46DBB6501AB8C96F00D9A813 /* PowerObserverMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DBB64E1AB8C96F00D9A813 /* PowerObserverMac.h */; };
                46DFF4981DC2603100B80B48 /* ShadowRootMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DFF4961DC2601300B80B48 /* ShadowRootMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                46DFF49B1DC2620B00B80B48 /* JSShadowRootMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46DFF4991DC261F900B80B48 /* JSShadowRootMode.cpp */; };
                46DFF49C1DC2620B00B80B48 /* JSShadowRootMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DFF49A1DC261F900B80B48 /* JSShadowRootMode.h */; };
+               46E791481F97E01A00199739 /* JSVisibilityState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46E791451F97E01700199739 /* JSVisibilityState.cpp */; };
+               46E791491F97E01A00199739 /* JSVisibilityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 46E791461F97E01700199739 /* JSVisibilityState.h */; };
+               46EB37C91F97CCD200B65523 /* JSServiceWorkerClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46EB37C21F97CCCB00B65523 /* JSServiceWorkerClient.cpp */; };
+               46EB37CA1F97CCD200B65523 /* JSServiceWorkerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EB37C31F97CCCB00B65523 /* JSServiceWorkerClient.h */; };
+               46EB37CB1F97CCD200B65523 /* JSServiceWorkerClients.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46EB37C41F97CCCB00B65523 /* JSServiceWorkerClients.cpp */; };
+               46EB37CC1F97CCD200B65523 /* JSServiceWorkerClients.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EB37C51F97CCCB00B65523 /* JSServiceWorkerClients.h */; };
+               46EB37CD1F97CCD200B65523 /* JSServiceWorkerWindowClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46EB37C61F97CCCB00B65523 /* JSServiceWorkerWindowClient.cpp */; };
+               46EB37CE1F97CCD200B65523 /* JSServiceWorkerWindowClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EB37C71F97CCCB00B65523 /* JSServiceWorkerWindowClient.h */; };
                46EBEA021B7D4D6500BE4941 /* CollectionTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EBEA011B7D4D5D00BE4941 /* CollectionTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               46EF142A1F97B7D800C2A524 /* ServiceWorkerWindowClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EF14201F97B7BA00C2A524 /* ServiceWorkerWindowClient.h */; };
+               46EF142B1F97B7D800C2A524 /* ServiceWorkerClients.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46EF14211F97B7BA00C2A524 /* ServiceWorkerClients.cpp */; };
+               46EF142C1F97B7D800C2A524 /* ServiceWorkerClients.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EF14221F97B7BA00C2A524 /* ServiceWorkerClients.h */; };
+               46EF142D1F97B7D800C2A524 /* ServiceWorkerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EF14241F97B7BA00C2A524 /* ServiceWorkerClient.h */; };
+               46EF142E1F97B7D800C2A524 /* ServiceWorkerWindowClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46EF14251F97B7BA00C2A524 /* ServiceWorkerWindowClient.cpp */; };
+               46EF142F1F97B7D800C2A524 /* ServiceWorkerClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46EF14271F97B7BA00C2A524 /* ServiceWorkerClient.cpp */; };
                46EFAF0E1E5FB9CA00E7F34B /* LowPowerModeNotifierIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46EFAF0D1E5FB9C200E7F34B /* LowPowerModeNotifierIOS.mm */; };
                46EFAF111E5FB9F100E7F34B /* LowPowerModeNotifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46EFAF0F1E5FB9E100E7F34B /* LowPowerModeNotifier.cpp */; };
                46EFAF121E5FB9F100E7F34B /* LowPowerModeNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EFAF101E5FB9E100E7F34B /* LowPowerModeNotifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7E474E2012494DC900235364 /* SQLiteDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */; };
                7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */; };
                7E4C96DC1AD4483500365A51 /* JSReadableStreamSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A51 /* JSReadableStreamSource.cpp */; };
-               7E4C96DC1AD4483500365A52 /* WebCore/JSFetchEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A52 /* WebCore/JSFetchEvent.cpp */; };
-               7E4C96DC1AD4483500365A53 /* WebCore/JSExtendableEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A53 /* WebCore/JSExtendableEvent.cpp */; };
-               7E4C96DC1AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp */; };
+               7E4C96DC1AD4483500365A52 /* JSFetchEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A52 /* JSFetchEvent.cpp */; };
+               7E4C96DC1AD4483500365A53 /* JSExtendableEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A53 /* JSExtendableEvent.cpp */; };
+               7E4C96DC1AD4483500365A54 /* JSExtendableEventInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A54 /* JSExtendableEventInit.cpp */; };
                7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A50 /* JSFetchRequest.h */; };
                7E4C96DD1AD4483500365A51 /* JSReadableStreamSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A51 /* JSReadableStreamSource.h */; };
                7E4C96DD1AD4483500365A52 /* JSFetchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A52 /* JSFetchEvent.h */; };
                FFAC30FF184FB145008C4F1E /* TrailingObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFAC30FD184FB145008C4F1E /* TrailingObjects.cpp */; };
                FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CA1833EC3800158A31 /* LineBreaker.cpp */; };
                FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CD1833F17600158A31 /* LineInfo.cpp */; };
-               FFD5B97B135CC97800D5E92A /* PageVisibilityState.h in Headers */ = {isa = PBXBuildFile; fileRef = FFD5B978135CC97800D5E92A /* PageVisibilityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FFDBC047183D27B700407109 /* LineWidth.h in Headers */ = {isa = PBXBuildFile; fileRef = FFDBC045183D27B700407109 /* LineWidth.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FFDBC048183D27B700407109 /* LineWidth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFDBC046183D27B700407109 /* LineWidth.cpp */; };
                FFEFAB2A18380DA000514534 /* LineLayoutState.h in Headers */ = {isa = PBXBuildFile; fileRef = FFEFAB2918380DA000514534 /* LineLayoutState.h */; };
                46C696CA1E7205E400597937 /* CPUMonitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPUMonitor.cpp; sourceTree = "<group>"; };
                46C83EFB1A9BBE2900A79A41 /* GeoNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeoNotifier.cpp; sourceTree = "<group>"; };
                46C83EFC1A9BBE2900A79A41 /* GeoNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeoNotifier.h; sourceTree = "<group>"; };
+               46CA9C411F97BBE7004CFC3A /* VisibilityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibilityState.h; sourceTree = "<group>"; };
+               46CA9C421F97BBE7004CFC3A /* VisibilityState.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VisibilityState.idl; sourceTree = "<group>"; };
                46DBB64E1AB8C96F00D9A813 /* PowerObserverMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PowerObserverMac.h; sourceTree = "<group>"; };
                46DFF4961DC2601300B80B48 /* ShadowRootMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowRootMode.h; sourceTree = "<group>"; };
                46DFF4971DC2601300B80B48 /* ShadowRootMode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ShadowRootMode.idl; sourceTree = "<group>"; };
                46DFF4991DC261F900B80B48 /* JSShadowRootMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSShadowRootMode.cpp; sourceTree = "<group>"; };
                46DFF49A1DC261F900B80B48 /* JSShadowRootMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSShadowRootMode.h; sourceTree = "<group>"; };
                46E016AD1F72D61E00282B2C /* DOMHighResTimeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHighResTimeStamp.h; sourceTree = "<group>"; };
+               46E791451F97E01700199739 /* JSVisibilityState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVisibilityState.cpp; sourceTree = "<group>"; };
+               46E791461F97E01700199739 /* JSVisibilityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVisibilityState.h; sourceTree = "<group>"; };
+               46EB37C21F97CCCB00B65523 /* JSServiceWorkerClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerClient.cpp; sourceTree = "<group>"; };
+               46EB37C31F97CCCB00B65523 /* JSServiceWorkerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerClient.h; sourceTree = "<group>"; };
+               46EB37C41F97CCCB00B65523 /* JSServiceWorkerClients.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerClients.cpp; sourceTree = "<group>"; };
+               46EB37C51F97CCCB00B65523 /* JSServiceWorkerClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerClients.h; sourceTree = "<group>"; };
+               46EB37C61F97CCCB00B65523 /* JSServiceWorkerWindowClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerWindowClient.cpp; sourceTree = "<group>"; };
+               46EB37C71F97CCCB00B65523 /* JSServiceWorkerWindowClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerWindowClient.h; sourceTree = "<group>"; };
                46EBEA011B7D4D5D00BE4941 /* CollectionTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionTraversal.h; sourceTree = "<group>"; };
+               46EF14201F97B7BA00C2A524 /* ServiceWorkerWindowClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerWindowClient.h; sourceTree = "<group>"; };
+               46EF14211F97B7BA00C2A524 /* ServiceWorkerClients.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerClients.cpp; sourceTree = "<group>"; };
+               46EF14221F97B7BA00C2A524 /* ServiceWorkerClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerClients.h; sourceTree = "<group>"; };
+               46EF14231F97B7BA00C2A524 /* ServiceWorkerClients.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceWorkerClients.idl; sourceTree = "<group>"; };
+               46EF14241F97B7BA00C2A524 /* ServiceWorkerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerClient.h; sourceTree = "<group>"; };
+               46EF14251F97B7BA00C2A524 /* ServiceWorkerWindowClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerWindowClient.cpp; sourceTree = "<group>"; };
+               46EF14261F97B7BA00C2A524 /* ServiceWorkerWindowClient.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceWorkerWindowClient.idl; sourceTree = "<group>"; };
+               46EF14271F97B7BA00C2A524 /* ServiceWorkerClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerClient.cpp; sourceTree = "<group>"; };
+               46EF14281F97B7BA00C2A524 /* ServiceWorkerClient.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceWorkerClient.idl; sourceTree = "<group>"; };
                46EFAF0D1E5FB9C200E7F34B /* LowPowerModeNotifierIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LowPowerModeNotifierIOS.mm; sourceTree = "<group>"; };
                46EFAF0F1E5FB9E100E7F34B /* LowPowerModeNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowPowerModeNotifier.cpp; sourceTree = "<group>"; };
                46EFAF101E5FB9E100E7F34B /* LowPowerModeNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LowPowerModeNotifier.h; sourceTree = "<group>"; };
                517FBA17151AA71B00B57959 /* DOMWindowExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtension.cpp; sourceTree = "<group>"; };
                517FBA18151AA71B00B57959 /* DOMWindowExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowExtension.h; sourceTree = "<group>"; };
                5182C24B1F313AE00059BA7C /* NavigatorServiceWorker.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = NavigatorServiceWorker.idl; sourceTree = "<group>"; };
-               5182C24D1F3142500059BA7C /* JSServiceWorkerGlobalScope.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSServiceWorkerGlobalScope.h; path = WebCore/JSServiceWorkerGlobalScope.h; sourceTree = "<group>"; };
-               5182C24E1F3142500059BA7C /* JSServiceWorkerGlobalScope.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSServiceWorkerGlobalScope.cpp; path = WebCore/JSServiceWorkerGlobalScope.cpp; sourceTree = "<group>"; };
-               5182C24F1F3142500059BA7C /* JSServiceWorkerRegistration.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSServiceWorkerRegistration.cpp; path = WebCore/JSServiceWorkerRegistration.cpp; sourceTree = "<group>"; };
-               5182C2501F3142500059BA7C /* JSServiceWorkerRegistration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSServiceWorkerRegistration.h; path = WebCore/JSServiceWorkerRegistration.h; sourceTree = "<group>"; };
-               5182C2511F3142500059BA7C /* JSServiceWorkerContainer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSServiceWorkerContainer.cpp; path = WebCore/JSServiceWorkerContainer.cpp; sourceTree = "<group>"; };
-               5182C2521F3142500059BA7C /* JSServiceWorker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSServiceWorker.h; path = WebCore/JSServiceWorker.h; sourceTree = "<group>"; };
-               5182C2531F3142500059BA7C /* JSServiceWorker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSServiceWorker.cpp; path = WebCore/JSServiceWorker.cpp; sourceTree = "<group>"; };
-               5182C2541F3142500059BA7C /* JSServiceWorkerContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSServiceWorkerContainer.h; path = WebCore/JSServiceWorkerContainer.h; sourceTree = "<group>"; };
+               5182C24D1F3142500059BA7C /* JSServiceWorkerGlobalScope.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerGlobalScope.h; sourceTree = "<group>"; };
+               5182C24E1F3142500059BA7C /* JSServiceWorkerGlobalScope.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerGlobalScope.cpp; sourceTree = "<group>"; };
+               5182C24F1F3142500059BA7C /* JSServiceWorkerRegistration.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerRegistration.cpp; sourceTree = "<group>"; };
+               5182C2501F3142500059BA7C /* JSServiceWorkerRegistration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerRegistration.h; sourceTree = "<group>"; };
+               5182C2511F3142500059BA7C /* JSServiceWorkerContainer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerContainer.cpp; sourceTree = "<group>"; };
+               5182C2521F3142500059BA7C /* JSServiceWorker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSServiceWorker.h; sourceTree = "<group>"; };
+               5182C2531F3142500059BA7C /* JSServiceWorker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorker.cpp; sourceTree = "<group>"; };
+               5182C2541F3142500059BA7C /* JSServiceWorkerContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerContainer.h; sourceTree = "<group>"; };
                5185FCBC1BB5CB770012898F /* IDBConnectionToServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBConnectionToServer.cpp; sourceTree = "<group>"; };
                5185FCBD1BB5CB770012898F /* IDBConnectionToServerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBConnectionToServerDelegate.h; sourceTree = "<group>"; };
                518864DE1BBAF30F00E540C9 /* UniqueIDBDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueIDBDatabase.cpp; sourceTree = "<group>"; };
                51EEAA721BEFFA7900218008 /* IndexValueEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexValueEntry.h; sourceTree = "<group>"; };
                51F174FA1F3588D700C74950 /* WorkerType.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WorkerType.idl; sourceTree = "<group>"; };
                51F174FC1F35898800C74950 /* WorkerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerType.h; sourceTree = "<group>"; };
-               51F175001F358B3600C74950 /* JSServiceWorkerUpdateViaCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSServiceWorkerUpdateViaCache.cpp; path = WebCore/JSServiceWorkerUpdateViaCache.cpp; sourceTree = "<group>"; };
-               51F175011F358B3600C74950 /* JSServiceWorkerUpdateViaCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSServiceWorkerUpdateViaCache.h; path = WebCore/JSServiceWorkerUpdateViaCache.h; sourceTree = "<group>"; };
+               51F175001F358B3600C74950 /* JSServiceWorkerUpdateViaCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerUpdateViaCache.cpp; sourceTree = "<group>"; };
+               51F175011F358B3600C74950 /* JSServiceWorkerUpdateViaCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerUpdateViaCache.h; sourceTree = "<group>"; };
                51F175041F358BDE00C74950 /* JSWorkerType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerType.cpp; sourceTree = "<group>"; };
                51F175051F358BDE00C74950 /* JSWorkerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerType.h; sourceTree = "<group>"; };
                51F175461F3EBC0C00C74950 /* ServiceWorkerUpdateViaCache.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceWorkerUpdateViaCache.idl; sourceTree = "<group>"; };
                51F6A3D60663BF04004D2919 /* HTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLCanvasElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                51F798EB1BE880D3008AE491 /* IDBIndexInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBIndexInfo.cpp; sourceTree = "<group>"; };
                51F798EC1BE880D3008AE491 /* IDBIndexInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBIndexInfo.h; sourceTree = "<group>"; };
-               51F886BE1F32920700C193EF /* JSNavigatorServiceWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSNavigatorServiceWorker.cpp; path = WebCore/JSNavigatorServiceWorker.cpp; sourceTree = "<group>"; };
-               51F886BF1F32920700C193EF /* JSNavigatorServiceWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSNavigatorServiceWorker.h; path = WebCore/JSNavigatorServiceWorker.h; sourceTree = "<group>"; };
+               51F886BE1F32920700C193EF /* JSNavigatorServiceWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorServiceWorker.cpp; sourceTree = "<group>"; };
+               51F886BF1F32920700C193EF /* JSNavigatorServiceWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorServiceWorker.h; sourceTree = "<group>"; };
                51FB5502113E3E9100821176 /* JSCloseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCloseEvent.h; sourceTree = "<group>"; };
                51FB5503113E3E9100821176 /* JSCloseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCloseEvent.cpp; sourceTree = "<group>"; };
                51FB67D91AE6B5E400D06C5A /* ContentExtensionStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionStyleSheet.cpp; sourceTree = "<group>"; };
                7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteDatabaseTracker.cpp; sourceTree = "<group>"; };
                7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchRequest.cpp; sourceTree = "<group>"; };
                7E4C96D81AD4483500365A51 /* JSReadableStreamSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamSource.cpp; sourceTree = "<group>"; };
-               7E4C96D81AD4483500365A52 /* WebCore/JSFetchEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCore/JSFetchEvent.cpp; sourceTree = "<group>"; };
-               7E4C96D81AD4483500365A53 /* WebCore/JSExtendableEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCore/JSExtendableEvent.cpp; sourceTree = "<group>"; };
-               7E4C96D81AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCore/JSExtendableEventInit.cpp; sourceTree = "<group>"; };
+               7E4C96D81AD4483500365A52 /* JSFetchEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchEvent.cpp; sourceTree = "<group>"; };
+               7E4C96D81AD4483500365A53 /* JSExtendableEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSExtendableEvent.cpp; sourceTree = "<group>"; };
+               7E4C96D81AD4483500365A54 /* JSExtendableEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSExtendableEventInit.cpp; sourceTree = "<group>"; };
                7E4C96D91AD4483500365A50 /* JSFetchRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchRequest.h; sourceTree = "<group>"; };
                7E4C96D91AD4483500365A51 /* JSReadableStreamSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamSource.h; sourceTree = "<group>"; };
                7E4C96D91AD4483500365A52 /* JSFetchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchEvent.h; sourceTree = "<group>"; };
                FFB698CB1833EC3800158A31 /* LineBreaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreaker.h; sourceTree = "<group>"; };
                FFB698CD1833F17600158A31 /* LineInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineInfo.cpp; sourceTree = "<group>"; };
                FFB698CE1833F17600158A31 /* LineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineInfo.h; sourceTree = "<group>"; };
-               FFD5B978135CC97800D5E92A /* PageVisibilityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageVisibilityState.h; sourceTree = "<group>"; };
                FFDBC045183D27B700407109 /* LineWidth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineWidth.h; sourceTree = "<group>"; };
                FFDBC046183D27B700407109 /* LineWidth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineWidth.cpp; sourceTree = "<group>"; };
                FFEFAB2918380DA000514534 /* LineLayoutState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineLayoutState.h; sourceTree = "<group>"; };
                5182C24C1F3142090059BA7C /* ServiceWorkers */ = {
                        isa = PBXGroup;
                        children = (
+                               7E4C96D81AD4483500365A53 /* JSExtendableEvent.cpp */,
                                7E4C96D91AD4483500365A53 /* JSExtendableEvent.h */,
+                               7E4C96D81AD4483500365A54 /* JSExtendableEventInit.cpp */,
+                               7E4C96D81AD4483500365A52 /* JSFetchEvent.cpp */,
                                7E4C96D91AD4483500365A52 /* JSFetchEvent.h */,
                                51F886BE1F32920700C193EF /* JSNavigatorServiceWorker.cpp */,
                                51F886BF1F32920700C193EF /* JSNavigatorServiceWorker.h */,
                                5182C2531F3142500059BA7C /* JSServiceWorker.cpp */,
                                5182C2521F3142500059BA7C /* JSServiceWorker.h */,
+                               46EB37C21F97CCCB00B65523 /* JSServiceWorkerClient.cpp */,
+                               46EB37C31F97CCCB00B65523 /* JSServiceWorkerClient.h */,
+                               46EB37C41F97CCCB00B65523 /* JSServiceWorkerClients.cpp */,
+                               46EB37C51F97CCCB00B65523 /* JSServiceWorkerClients.h */,
                                5182C2511F3142500059BA7C /* JSServiceWorkerContainer.cpp */,
                                5182C2541F3142500059BA7C /* JSServiceWorkerContainer.h */,
                                5182C24E1F3142500059BA7C /* JSServiceWorkerGlobalScope.cpp */,
                                5182C2501F3142500059BA7C /* JSServiceWorkerRegistration.h */,
                                51F175001F358B3600C74950 /* JSServiceWorkerUpdateViaCache.cpp */,
                                51F175011F358B3600C74950 /* JSServiceWorkerUpdateViaCache.h */,
-                               7E4C96D81AD4483500365A53 /* WebCore/JSExtendableEvent.cpp */,
-                               7E4C96D81AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp */,
-                               7E4C96D81AD4483500365A52 /* WebCore/JSFetchEvent.cpp */,
+                               46EB37C61F97CCCB00B65523 /* JSServiceWorkerWindowClient.cpp */,
+                               46EB37C71F97CCCB00B65523 /* JSServiceWorkerWindowClient.h */,
                        );
                        name = ServiceWorkers;
-                       path = DerivedSources;
-                       sourceTree = BUILT_PRODUCTS_DIR;
+                       sourceTree = "<group>";
                };
                518F4FE9194CA4B60081BAAE /* gamepad */ = {
                        isa = PBXGroup;
                                51F1755B1F3EBC0C00C74950 /* ServiceWorker.cpp */,
                                51F1755A1F3EBC0C00C74950 /* ServiceWorker.h */,
                                51F175591F3EBC0C00C74950 /* ServiceWorker.idl */,
+                               46EF14271F97B7BA00C2A524 /* ServiceWorkerClient.cpp */,
+                               46EF14241F97B7BA00C2A524 /* ServiceWorkerClient.h */,
+                               46EF14281F97B7BA00C2A524 /* ServiceWorkerClient.idl */,
+                               46EF14211F97B7BA00C2A524 /* ServiceWorkerClients.cpp */,
+                               46EF14221F97B7BA00C2A524 /* ServiceWorkerClients.h */,
+                               46EF14231F97B7BA00C2A524 /* ServiceWorkerClients.idl */,
                                51F175581F3EBC0C00C74950 /* ServiceWorkerContainer.cpp */,
                                51F175571F3EBC0C00C74950 /* ServiceWorkerContainer.h */,
                                51F175561F3EBC0C00C74950 /* ServiceWorkerContainer.idl */,
                                51F1754A1F3EBC0C00C74950 /* ServiceWorkerRegistrationOptions.h */,
                                51F175471F3EBC0C00C74950 /* ServiceWorkerUpdateViaCache.h */,
                                51F175461F3EBC0C00C74950 /* ServiceWorkerUpdateViaCache.idl */,
+                               46EF14251F97B7BA00C2A524 /* ServiceWorkerWindowClient.cpp */,
+                               46EF14201F97B7BA00C2A524 /* ServiceWorkerWindowClient.h */,
+                               46EF14261F97B7BA00C2A524 /* ServiceWorkerWindowClient.idl */,
                        );
                        path = service;
                        sourceTree = "<group>";
                                2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */,
                                371E65CD13661EED00BEEDB0 /* PageSerializer.cpp */,
                                371E65CB13661EDC00BEEDB0 /* PageSerializer.h */,
-                               FFD5B978135CC97800D5E92A /* PageVisibilityState.h */,
                                E526AF3E1727F8F200E41781 /* Performance.cpp */,
                                8A844D0211D3C18E0014065C /* Performance.h */,
                                8A844D0311D3C18E0014065C /* Performance.idl */,
                                9B098BE71F3D6AF6002DD562 /* JSStringCallback.h */,
                                65DF31EF09D1CC60000BE325 /* JSText.cpp */,
                                65DF31F009D1CC60000BE325 /* JSText.h */,
+                               46E791451F97E01700199739 /* JSVisibilityState.cpp */,
+                               46E791461F97E01700199739 /* JSVisibilityState.h */,
                                83F570AE1C53268E007FD6CB /* JSXMLDocument.cpp */,
                                83F570AD1C53268E007FD6CB /* JSXMLDocument.h */,
                        );
                                CEF418CC1179678C009D112C /* ViewportArguments.cpp */,
                                CEF418CD1179678C009D112C /* ViewportArguments.h */,
                                83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */,
+                               46CA9C411F97BBE7004CFC3A /* VisibilityState.h */,
+                               46CA9C421F97BBE7004CFC3A /* VisibilityState.idl */,
                                419BC2DC1685329900D64D6D /* VisitedLinkState.cpp */,
                                419BC2DD1685329900D64D6D /* VisitedLinkState.h */,
                                31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */,
                                834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
                                CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
                                5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
+                               46EB37CA1F97CCD200B65523 /* JSServiceWorkerClient.h in Headers */,
+                               46EB37CC1F97CCD200B65523 /* JSServiceWorkerClients.h in Headers */,
                                5182C2581F3143CD0059BA7C /* JSServiceWorkerContainer.h in Headers */,
                                5182C25A1F3143CD0059BA7C /* JSServiceWorkerGlobalScope.h in Headers */,
                                5182C25C1F3143CD0059BA7C /* JSServiceWorkerRegistration.h in Headers */,
                                51F175031F358B3B00C74950 /* JSServiceWorkerUpdateViaCache.h in Headers */,
+                               46EB37CE1F97CCD200B65523 /* JSServiceWorkerWindowClient.h in Headers */,
                                9BDA64D81B975CF2009C4387 /* JSShadowRoot.h in Headers */,
                                46DFF49C1DC2620B00B80B48 /* JSShadowRootMode.h in Headers */,
                                CD9DE17B17AAC75B00EA386D /* JSSourceBuffer.h in Headers */,
                                15C77093100D3CA8005BA267 /* JSValidityState.h in Headers */,
                                BE8EF04B171C9014009B48C3 /* JSVideoTrack.h in Headers */,
                                BE8EF04D171C9014009B48C3 /* JSVideoTrackList.h in Headers */,
+                               46E791491F97E01A00199739 /* JSVisibilityState.h in Headers */,
                                2DDE1CE41F574AE900D1A365 /* JSVRDisplay.h in Headers */,
                                2DDE1CF81F574C3900D1A365 /* JSVRDisplayCapabilities.h in Headers */,
                                2DDE1CFA1F574C3E00D1A365 /* JSVRDisplayEvent.h in Headers */,
                                A5F36D3B18F758720054C024 /* PageScriptDebugServer.h in Headers */,
                                371E65CC13661EDC00BEEDB0 /* PageSerializer.h in Headers */,
                                E1284AE110447D4500EAEB52 /* PageTransitionEvent.h in Headers */,
-                               FFD5B97B135CC97800D5E92A /* PageVisibilityState.h in Headers */,
                                9377ABA015DEFEEF0031FD04 /* Pagination.h in Headers */,
                                0885067F11DA045B00182B98 /* PaintInfo.h in Headers */,
                                0885068011DA045B00182B98 /* PaintPhase.h in Headers */,
                                516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */,
                                2D93AEE319DF5641002A86C3 /* ServicesOverlayController.h in Headers */,
                                51F1755D1F3EBC8300C74950 /* ServiceWorker.h in Headers */,
+                               46EF142D1F97B7D800C2A524 /* ServiceWorkerClient.h in Headers */,
+                               46EF142C1F97B7D800C2A524 /* ServiceWorkerClients.h in Headers */,
                                51F1755F1F3EBC8300C74950 /* ServiceWorkerContainer.h in Headers */,
                                51CA7EE91F883390003D3131 /* ServiceWorkerContextData.h in Headers */,
                                517A535D1F5899FE00DCDC0A /* ServiceWorkerFetchResult.h in Headers */,
                                51F175691F3EBC8300C74950 /* ServiceWorkerRegistrationOptions.h in Headers */,
                                51BCCE301F8F179E006BA0ED /* ServiceWorkerThread.h in Headers */,
                                51F1756C1F3EBC8300C74950 /* ServiceWorkerUpdateViaCache.h in Headers */,
+                               46EF142A1F97B7D800C2A524 /* ServiceWorkerWindowClient.h in Headers */,
                                93309E10099E64920056E581 /* SetNodeAttributeCommand.h in Headers */,
                                B8DBDB4C130B0F8A00F5CDB1 /* SetSelectionCommand.h in Headers */,
                                7CD58DFB1F9565A500112791 /* Settings.h in Headers */,
                                26F9A83918A046AC00AEB88A /* ViewportConfiguration.h in Headers */,
                                3FFFF9AE159D9B060020BBD5 /* ViewportStyleResolver.h in Headers */,
                                83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */,
+                               46CA9C441F97BBE9004CFC3A /* VisibilityState.h in Headers */,
                                93309E20099E64920056E581 /* VisiblePosition.h in Headers */,
                                A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */,
                                93309E1E099E64920056E581 /* VisibleUnits.h in Headers */,
                                E0FEF372B47C53EAC1C1FBEE /* JSEventSource.cpp in Sources */,
                                C6A703325C9D0B6CDCBC4D77 /* JSEventTarget.cpp in Sources */,
                                724ED3311A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp in Sources */,
+                               7E4C96DC1AD4483500365A53 /* JSExtendableEvent.cpp in Sources */,
+                               7E4C96DC1AD4483500365A54 /* JSExtendableEventInit.cpp in Sources */,
                                72F1ADA51A390B9F00014E18 /* JSEXTFragDepth.cpp in Sources */,
                                5C4304B5191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp in Sources */,
                                72E417631A2E8D2F004C562A /* JSEXTsRGB.cpp in Sources */,
                                77D50FF51ED4D99100DA4C87 /* JSFederatedCredentialInit.cpp in Sources */,
                                77D510141ED5F4F100DA4C87 /* JSFederatedCredentialRequestOptions.cpp in Sources */,
                                7F4C96DC1AD4483500365A50 /* JSFetchBody.cpp in Sources */,
+                               7E4C96DC1AD4483500365A52 /* JSFetchEvent.cpp in Sources */,
                                4131F3B31F9552860059995A /* JSFetchEventCustom.cpp in Sources */,
                                7D4C96DC1AD4483500365A50 /* JSFetchHeaders.cpp in Sources */,
                                7CE191701F2ABE7100272F78 /* JSFetchReferrerPolicy.cpp in Sources */,
                                834476EE1DA5BC57002B6ED2 /* JSScrollToOptions.cpp in Sources */,
                                CED06AD01C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.cpp in Sources */,
                                5182C2551F3143CD0059BA7C /* JSServiceWorker.cpp in Sources */,
+                               46EB37C91F97CCD200B65523 /* JSServiceWorkerClient.cpp in Sources */,
+                               46EB37CB1F97CCD200B65523 /* JSServiceWorkerClients.cpp in Sources */,
                                5182C2571F3143CD0059BA7C /* JSServiceWorkerContainer.cpp in Sources */,
                                5182C2591F3143CD0059BA7C /* JSServiceWorkerGlobalScope.cpp in Sources */,
                                5182C25B1F3143CD0059BA7C /* JSServiceWorkerRegistration.cpp in Sources */,
                                51F175021F358B3B00C74950 /* JSServiceWorkerUpdateViaCache.cpp in Sources */,
+                               46EB37CD1F97CCD200B65523 /* JSServiceWorkerWindowClient.cpp in Sources */,
                                9BDA64D71B975CE5009C4387 /* JSShadowRoot.cpp in Sources */,
                                46DFF49B1DC2620B00B80B48 /* JSShadowRootMode.cpp in Sources */,
                                CD9DE17A17AAC75B00EA386D /* JSSourceBuffer.cpp in Sources */,
                                CDE83DB6183D352A0031EAA3 /* JSVideoPlaybackQuality.cpp in Sources */,
                                BE8EF04A171C9014009B48C3 /* JSVideoTrack.cpp in Sources */,
                                BE8EF04C171C9014009B48C3 /* JSVideoTrackList.cpp in Sources */,
+                               46E791481F97E01A00199739 /* JSVisibilityState.cpp in Sources */,
                                9703E1BF15DC4E37001F24C8 /* JSVoidCallback.cpp in Sources */,
                                2DDE1CE11F574AD600D1A365 /* JSVRDisplay.cpp in Sources */,
                                2DDE1CF71F574C0400D1A365 /* JSVRDisplayCapabilities.cpp in Sources */,
                                516F7F6E1C31E39C00F111DC /* ServerOpenDBRequest.cpp in Sources */,
                                2D93AEE419DF5641002A86C3 /* ServicesOverlayController.mm in Sources */,
                                51F1755C1F3EBC8300C74950 /* ServiceWorker.cpp in Sources */,
+                               46EF142F1F97B7D800C2A524 /* ServiceWorkerClient.cpp in Sources */,
+                               46EF142B1F97B7D800C2A524 /* ServiceWorkerClients.cpp in Sources */,
                                51F1755E1F3EBC8300C74950 /* ServiceWorkerContainer.cpp in Sources */,
                                517C87181F8FD4D900EB8076 /* ServiceWorkerContextData.cpp in Sources */,
                                51F175601F3EBC8300C74950 /* ServiceWorkerGlobalScope.cpp in Sources */,
                                517A53281F4B90B900DCDC0A /* ServiceWorkerRegistrationKey.cpp in Sources */,
                                51F645A21F4BF53C00B54DED /* ServiceWorkerRegistrationOptions.cpp in Sources */,
                                51BCCE2F1F8F1795006BA0ED /* ServiceWorkerThread.cpp in Sources */,
+                               46EF142E1F97B7D800C2A524 /* ServiceWorkerWindowClient.cpp in Sources */,
                                93309E0F099E64920056E581 /* SetNodeAttributeCommand.cpp in Sources */,
                                B8DBDB4B130B0F8A00F5CDB1 /* SetSelectionCommand.cpp in Sources */,
                                7CD58DFD1F9565A800112791 /* Settings.cpp in Sources */,
                                9B9299B21F6796A4006723C2 /* WebContentReaderCocoa.mm in Sources */,
                                9B0811241F67CDC00074BDE2 /* WebContentReaderIOS.mm in Sources */,
                                9B9299AE1F67865B006723C2 /* WebContentReaderMac.mm in Sources */,
-                               7E4C96DC1AD4483500365A53 /* WebCore/JSExtendableEvent.cpp in Sources */,
-                               7E4C96DC1AD4483500365A54 /* WebCore/JSExtendableEventInit.cpp in Sources */,
-                               7E4C96DC1AD4483500365A52 /* WebCore/JSFetchEvent.cpp in Sources */,
                                CD7E05221651C28200C1201F /* WebCoreAVFResourceLoader.mm in Sources */,
                                2D3EF44B1917915C00034184 /* WebCoreCALayerExtras.mm in Sources */,
                                515F79531CFCA3D000CCED93 /* WebCoreCrossThreadCopier.cpp in Sources */,
index 5e3dc54..410577e 100644 (file)
@@ -37,6 +37,8 @@ namespace WebCore {
     macro(Audio) \
     macro(Cache) \
     macro(CacheStorage) \
+    macro(Client) \
+    macro(Clients) \
     macro(Credential) \
     macro(CredentialsContainer) \
     macro(CustomElementRegistry) \
@@ -162,6 +164,7 @@ namespace WebCore {
     macro(WebKitMediaKeySession) \
     macro(WebKitMediaKeys) \
     macro(WebSocket) \
+    macro(WindowClient) \
     macro(WritableStream) \
     macro(XMLHttpRequest) \
     macro(addTrack) \
index 43c4fd7..1cd443c 100644 (file)
@@ -1611,7 +1611,7 @@ void Document::visibilityStateChanged()
     notifyMediaCaptureOfVisibilityChanged();
 }
 
-auto Document::visibilityState() const -> VisibilityState
+VisibilityState Document::visibilityState() const
 {
     // The visibility of the document is inherited from the visibility of the
     // page. If there is no page associated with the document, we will assume
index d82fd4b..978e049 100644 (file)
@@ -37,7 +37,6 @@
 #include "MediaProducer.h"
 #include "MutationObserver.h"
 #include "OrientationNotifier.h"
-#include "PageVisibilityState.h"
 #include "PlatformEvent.h"
 #include "ReferrerPolicy.h"
 #include "Region.h"
@@ -50,6 +49,7 @@
 #include "TreeScope.h"
 #include "UserActionElementSet.h"
 #include "ViewportArguments.h"
+#include "VisibilityState.h"
 #include <pal/SessionID.h>
 #include <wtf/Deque.h>
 #include <wtf/Forward.h>
@@ -457,7 +457,6 @@ public:
     String documentURI() const { return m_documentURI; }
     WEBCORE_EXPORT void setDocumentURI(const String&);
 
-    using VisibilityState = PageVisibilityState;
     WEBCORE_EXPORT VisibilityState visibilityState() const;
     void visibilityStateChanged();
     WEBCORE_EXPORT bool hidden() const;
index 7ce1735..930624d 100644 (file)
@@ -212,9 +212,6 @@ typedef (
     [Replaceable] readonly attribute HTMLAllCollection all; /* [SameObject] */
 };
 
-// FIXME: Missing "unloaded" value (https://www.w3.org/TR/page-visibility/#sec-document-interface).
-enum VisibilityState { "hidden", "visible", "prerender" };
-
 enum DocumentReadyState { "loading", "interactive", "complete" };
 
 Document implements DocumentAndElementEventHandlers;
similarity index 93%
rename from Source/WebCore/page/PageVisibilityState.h
rename to Source/WebCore/dom/VisibilityState.h
index 53f3ebf..85009af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
 
 #pragma once
 
-#include <wtf/text/WTFString.h>
-
 namespace WebCore {
 
-enum class PageVisibilityState {
+enum class VisibilityState {
     Hidden,
     Visible,
     Prerender
diff --git a/Source/WebCore/dom/VisibilityState.idl b/Source/WebCore/dom/VisibilityState.idl
new file mode 100644 (file)
index 0000000..21bfc6f
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// FIXME: Missing "unloaded" value (https://www.w3.org/TR/page-visibility/#sec-document-interface).
+enum VisibilityState { "hidden", "visible", "prerender" };
index dbe2851..5b97093 100644 (file)
@@ -1651,13 +1651,13 @@ void Page::setIsPrerender()
     updateDOMTimerAlignmentInterval();
 }
 
-PageVisibilityState Page::visibilityState() const
+VisibilityState Page::visibilityState() const
 {
     if (isVisible())
-        return PageVisibilityState::Visible;
+        return VisibilityState::Visible;
     if (m_isPrerender)
-        return PageVisibilityState::Prerender;
-    return PageVisibilityState::Hidden;
+        return VisibilityState::Prerender;
+    return VisibilityState::Hidden;
 }
 
 #if ENABLE(RUBBER_BANDING)
index 0850422..46b6f62 100644 (file)
@@ -27,7 +27,6 @@
 #include "LayoutRect.h"
 #include "LengthBox.h"
 #include "MediaProducer.h"
-#include "PageVisibilityState.h"
 #include "Pagination.h"
 #include "RTCController.h"
 #include "Region.h"
@@ -36,6 +35,7 @@
 #include "Timer.h"
 #include "UserInterfaceLayoutDirection.h"
 #include "ViewportArguments.h"
+#include "VisibilityState.h"
 #include "WheelEventTestTrigger.h"
 #include <memory>
 #include <pal/SessionID.h>
@@ -423,7 +423,7 @@ public:
     void setEditable(bool isEditable) { m_isEditable = isEditable; }
     bool isEditable() { return m_isEditable; }
 
-    WEBCORE_EXPORT PageVisibilityState visibilityState() const;
+    WEBCORE_EXPORT VisibilityState visibilityState() const;
     WEBCORE_EXPORT void resumeAnimatingImages();
 
     WEBCORE_EXPORT void addLayoutMilestones(LayoutMilestones);
diff --git a/Source/WebCore/workers/service/ServiceWorkerClient.cpp b/Source/WebCore/workers/service/ServiceWorkerClient.cpp
new file mode 100644 (file)
index 0000000..825bc90
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(SERVICE_WORKER)
+#include "ServiceWorkerClient.h"
+
+namespace WebCore {
+
+ServiceWorkerClient::ServiceWorkerClient(ScriptExecutionContext& context)
+    : ActiveDOMObject(&context)
+{
+    suspendIfNeeded();
+}
+
+const char* ServiceWorkerClient::activeDOMObjectName() const
+{
+    return "ServiceWorkerClient";
+}
+
+bool ServiceWorkerClient::canSuspendForDocumentSuspension() const
+{
+    return !hasPendingActivity();
+}
+
+String ServiceWorkerClient::url() const
+{
+    return { };
+}
+
+auto ServiceWorkerClient::frameType() const -> FrameType
+{
+    return FrameType::None;
+}
+
+String ServiceWorkerClient::id() const
+{
+    return { };
+}
+
+ExceptionOr<void> ServiceWorkerClient::postMessage(JSC::ExecState&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
+{
+    UNUSED_PARAM(message);
+    UNUSED_PARAM(transfer);
+    return Exception { NotSupportedError, ASCIILiteral("client.postMessage() is not yet supported") };
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SERVICE_WORKER)
diff --git a/Source/WebCore/workers/service/ServiceWorkerClient.h b/Source/WebCore/workers/service/ServiceWorkerClient.h
new file mode 100644 (file)
index 0000000..f38e602
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(SERVICE_WORKER)
+
+#include "ActiveDOMObject.h"
+#include "ExceptionOr.h"
+#include <heap/Strong.h>
+#include <wtf/RefCounted.h>
+
+namespace JSC {
+class ExecState;
+class JSValue;
+}
+
+namespace WebCore {
+
+class ServiceWorkerClient : public RefCounted<ServiceWorkerClient>, public ActiveDOMObject {
+public:
+    enum class FrameType {
+        Auxiliary,
+        TopLevel,
+        Nested,
+        None
+    };
+
+    String url() const;
+    FrameType frameType() const;
+    String id() const;
+
+    ExceptionOr<void> postMessage(JSC::ExecState&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&& transfer);
+
+protected:
+    explicit ServiceWorkerClient(ScriptExecutionContext&);
+
+    // ActiveDOMObject.
+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SERVICE_WORKER)
diff --git a/Source/WebCore/workers/service/ServiceWorkerClient.idl b/Source/WebCore/workers/service/ServiceWorkerClient.idl
new file mode 100644 (file)
index 0000000..53fdd08
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SERVICE_WORKER,
+    EnabledAtRuntime=ServiceWorker,
+    Exposed=ServiceWorker,
+    InterfaceName=Client,
+] interface ServiceWorkerClient {
+    readonly attribute USVString url;
+    readonly attribute FrameType frameType;
+    readonly attribute DOMString id;
+
+    [CallWith=ScriptState, MayThrowException] void postMessage(any message, optional sequence<object> transfer = []);
+};
+
+enum FrameType {
+  "auxiliary",
+  "top-level",
+  "nested",
+  "none"
+};
diff --git a/Source/WebCore/workers/service/ServiceWorkerClients.cpp b/Source/WebCore/workers/service/ServiceWorkerClients.cpp
new file mode 100644 (file)
index 0000000..a14557e
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(SERVICE_WORKER)
+#include "ServiceWorkerClients.h"
+
+#include "JSDOMPromiseDeferred.h"
+
+namespace WebCore {
+
+ServiceWorkerClients::ServiceWorkerClients(ScriptExecutionContext& context)
+    : ActiveDOMObject(&context)
+{
+    suspendIfNeeded();
+}
+
+const char* ServiceWorkerClients::activeDOMObjectName() const
+{
+    return "ServiceWorkerClients";
+}
+
+bool ServiceWorkerClients::canSuspendForDocumentSuspension() const
+{
+    return !hasPendingActivity();
+}
+
+void ServiceWorkerClients::get(const String& id, Ref<DeferredPromise>&& promise)
+{
+    UNUSED_PARAM(id);
+    promise->reject(Exception { NotSupportedError, ASCIILiteral("clients.get() is not yet supported") });
+}
+
+void ServiceWorkerClients::matchAll(const ClientQueryOptions&, Ref<DeferredPromise>&& promise)
+{
+    promise->reject(Exception { NotSupportedError, ASCIILiteral("clients.matchAll() is not yet supported") });
+}
+
+void ServiceWorkerClients::openWindow(const String& url, Ref<DeferredPromise>&& promise)
+{
+    UNUSED_PARAM(url);
+    promise->reject(Exception { NotSupportedError, ASCIILiteral("clients.openWindow() is not yet supported") });
+}
+
+void ServiceWorkerClients::claim(Ref<DeferredPromise>&& promise)
+{
+    promise->reject(Exception { NotSupportedError, ASCIILiteral("clients.claim() is not yet supported") });
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SERVICE_WORKER)
diff --git a/Source/WebCore/workers/service/ServiceWorkerClients.h b/Source/WebCore/workers/service/ServiceWorkerClients.h
new file mode 100644 (file)
index 0000000..3ee4f46
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(SERVICE_WORKER)
+
+#include "ActiveDOMObject.h"
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class DeferredPromise;
+
+class ServiceWorkerClients : public RefCounted<ServiceWorkerClients>, public ActiveDOMObject {
+public:
+    static Ref<ServiceWorkerClients> create(ScriptExecutionContext& context)
+    {
+        return adoptRef(*new ServiceWorkerClients(context));
+    }
+
+    enum class ClientType {
+        Window,
+        Worker,
+        Sharedworker,
+        All
+    };
+
+    struct ClientQueryOptions {
+        bool includeUncontrolled { false };
+        ClientType type { ClientType::Window };
+    };
+
+    void get(const String& id, Ref<DeferredPromise>&&);
+    void matchAll(const ClientQueryOptions&, Ref<DeferredPromise>&&);
+    void openWindow(const String& url, Ref<DeferredPromise>&&);
+    void claim(Ref<DeferredPromise>&&);
+
+private:
+    explicit ServiceWorkerClients(ScriptExecutionContext&);
+
+    // ActiveDOMObject.
+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SERVICE_WORKER)
diff --git a/Source/WebCore/workers/service/ServiceWorkerClients.idl b/Source/WebCore/workers/service/ServiceWorkerClients.idl
new file mode 100644 (file)
index 0000000..2b970f4
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SERVICE_WORKER,
+    EnabledAtRuntime=ServiceWorker,
+    Exposed=ServiceWorker,
+    InterfaceName=Clients,
+] interface ServiceWorkerClients {
+    // The objects returned will be new instances every time
+    [NewObject] Promise<any> get(DOMString id);
+    [NewObject] Promise<sequence<Client>> matchAll(optional ClientQueryOptions options);
+    [NewObject] Promise<WindowClient?> openWindow(USVString url);
+    [NewObject] Promise<void> claim();
+};
+
+dictionary ClientQueryOptions {
+    boolean includeUncontrolled = false;
+    ClientType type = "window";
+};
+
+enum ClientType {
+    "window",
+    "worker",
+    "sharedworker",
+    "all"
+};
index 1467ce9..c134a5f 100644 (file)
@@ -28,6 +28,7 @@
 
 #if ENABLE(SERVICE_WORKER)
 
+#include "ServiceWorkerClients.h"
 #include "ServiceWorkerThread.h"
 
 namespace WebCore {
@@ -36,6 +37,7 @@ ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(uint64_t serverConnectionIden
     : WorkerGlobalScope(url, identifier, userAgent, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, connectionProxy, socketProvider, sessionID)
     , m_serverConnectionIdentifier(serverConnectionIdentifier)
     , m_contextData(crossThreadCopy(data))
+    , m_clients(ServiceWorkerClients::create(*this))
 {
 }
 
index 377963b..dc40c6f 100644 (file)
@@ -34,6 +34,7 @@
 namespace WebCore {
 
 class DeferredPromise;
+class ServiceWorkerClients;
 class ServiceWorkerThread;
 
 class ServiceWorkerGlobalScope : public WorkerGlobalScope {
@@ -47,6 +48,7 @@ public:
 
     bool isServiceWorkerGlobalScope() const final { return true; }
 
+    ServiceWorkerClients& clients() { return m_clients.get(); }
     ServiceWorkerRegistration& registration();
     
     uint64_t serverConnectionIdentifier() const { return m_serverConnectionIdentifier; }
@@ -60,6 +62,7 @@ private:
 
     uint64_t m_serverConnectionIdentifier;
     ServiceWorkerContextData m_contextData;
+    Ref<ServiceWorkerClients> m_clients;
 };
 
 } // namespace WebCore
index fb102cb..b0b0cc8 100644 (file)
@@ -30,8 +30,7 @@
     Conditional=SERVICE_WORKER,
     EnabledAtRuntime=ServiceWorker,
 ] interface ServiceWorkerGlobalScope : WorkerGlobalScope {
-    // Add clients after first round of IDL stubbing.
-    // [SameObject] readonly attribute Clients clients;
+    [SameObject] readonly attribute ServiceWorkerClients clients;
     [SameObject] readonly attribute ServiceWorkerRegistration registration;
 
     [NewObject] Promise<void> skipWaiting();
diff --git a/Source/WebCore/workers/service/ServiceWorkerWindowClient.cpp b/Source/WebCore/workers/service/ServiceWorkerWindowClient.cpp
new file mode 100644 (file)
index 0000000..5c78b78
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(SERVICE_WORKER)
+#include "ServiceWorkerWindowClient.h"
+
+#include "JSDOMPromiseDeferred.h"
+
+namespace WebCore {
+
+ServiceWorkerWindowClient::ServiceWorkerWindowClient(ScriptExecutionContext& context)
+    : ServiceWorkerClient(context)
+{
+}
+
+VisibilityState ServiceWorkerWindowClient::visibilityState() const
+{
+    return VisibilityState::Visible;
+}
+
+bool ServiceWorkerWindowClient::isFocused() const
+{
+    return true;
+}
+
+void ServiceWorkerWindowClient::focus(Ref<DeferredPromise>&& promise)
+{
+    promise->reject(Exception { NotSupportedError, ASCIILiteral("windowClient.focus() is not yet supported") });
+}
+
+void ServiceWorkerWindowClient::navigate(const String& url, Ref<DeferredPromise>&& promise)
+{
+    UNUSED_PARAM(url);
+    promise->reject(Exception { NotSupportedError, ASCIILiteral("windowClient.navigate() is not yet supported") });
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SERVICE_WORKER)
diff --git a/Source/WebCore/workers/service/ServiceWorkerWindowClient.h b/Source/WebCore/workers/service/ServiceWorkerWindowClient.h
new file mode 100644 (file)
index 0000000..6bb77d7
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(SERVICE_WORKER)
+
+#include "ServiceWorkerClient.h"
+#include "VisibilityState.h"
+
+namespace WebCore {
+
+class DeferredPromise;
+
+class ServiceWorkerWindowClient final : public ServiceWorkerClient {
+public:
+    static Ref<ServiceWorkerWindowClient> create(ScriptExecutionContext& context)
+    {
+        return adoptRef(*new ServiceWorkerWindowClient(context));
+    }
+
+    VisibilityState visibilityState() const;
+    bool isFocused() const;
+
+    void focus(Ref<DeferredPromise>&&);
+    void navigate(const String& url, Ref<DeferredPromise>&&);
+
+private:
+    explicit ServiceWorkerWindowClient(ScriptExecutionContext&);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SERVICE_WORKER)
diff --git a/Source/WebCore/workers/service/ServiceWorkerWindowClient.idl b/Source/WebCore/workers/service/ServiceWorkerWindowClient.idl
new file mode 100644 (file)
index 0000000..4f71ac6
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SERVICE_WORKER,
+    EnabledAtRuntime=ServiceWorker,
+    Exposed=ServiceWorker,
+    InterfaceName=WindowClient,
+] interface ServiceWorkerWindowClient : ServiceWorkerClient {
+    readonly attribute VisibilityState visibilityState;
+    [ImplementedAs=isFocused] readonly attribute boolean focused;
+
+    [NewObject] Promise<WindowClient> focus();
+    [NewObject] Promise<WindowClient> navigate(USVString url);
+};
index dcc2e5a..a933fa2 100644 (file)
@@ -1,3 +1,16 @@
+2017-10-18  Chris Dumez  <cdumez@apple.com>
+
+        [Service Worker] Add stubs for Client / WindowClient / Clients
+        https://bugs.webkit.org/show_bug.cgi?id=178469
+
+        Reviewed by Youenn Fablet.
+
+        Rename PageVisibilityState to VisibilityState.
+
+        * Shared/API/c/WKSharedAPICast.h:
+        (WebKit::toVisibilityState):
+        * WebProcess/WebPage/WebPage.h:
+
 2017-10-18  John Wilander  <wilander@apple.com>
 
         Check notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPageProxy
index 5b82d4d..da8ce54 100644 (file)
 #include <WebCore/FrameLoaderTypes.h>
 #include <WebCore/IntRect.h>
 #include <WebCore/LayoutMilestones.h>
-#include <WebCore/PageVisibilityState.h>
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/UserContentTypes.h>
 #include <WebCore/UserScriptTypes.h>
+#include <WebCore/VisibilityState.h>
 
 namespace API {
 class Array;
@@ -899,19 +899,19 @@ inline WebCore::LayoutMilestones toLayoutMilestones(WKLayoutMilestones wkMilesto
     return milestones;
 }
 
-inline WebCore::PageVisibilityState toPageVisibilityState(WKPageVisibilityState wkPageVisibilityState)
+inline WebCore::VisibilityState toVisibilityState(WKPageVisibilityState wkPageVisibilityState)
 {
     switch (wkPageVisibilityState) {
     case kWKPageVisibilityStateVisible:
-        return WebCore::PageVisibilityState::Visible;
+        return WebCore::VisibilityState::Visible;
     case kWKPageVisibilityStateHidden:
-        return WebCore::PageVisibilityState::Hidden;
+        return WebCore::VisibilityState::Hidden;
     case kWKPageVisibilityStatePrerender:
-        return WebCore::PageVisibilityState::Prerender;
+        return WebCore::VisibilityState::Prerender;
     }
 
     ASSERT_NOT_REACHED();
-    return WebCore::PageVisibilityState::Visible;
+    return WebCore::VisibilityState::Visible;
 }
 
 inline ImageOptions toImageOptions(WKImageOptions wkImageOptions)
index 33ce67c..0891c77 100644 (file)
@@ -1925,11 +1925,11 @@ gchar* webkit_dom_document_get_visibility_state(WebKitDOMDocument* self)
     g_return_val_if_fail(WEBKIT_DOM_IS_DOCUMENT(self), 0);
     WebCore::Document* item = WebKit::core(self);
     switch (item->visibilityState()) {
-    case WebCore::Document::VisibilityState::Hidden:
+    case WebCore::VisibilityState::Hidden:
         return convertToUTF8String("hidden");
-    case WebCore::Document::VisibilityState::Visible:
+    case WebCore::VisibilityState::Visible:
         return convertToUTF8String("visible");
-    case WebCore::Document::VisibilityState::Prerender:
+    case WebCore::VisibilityState::Prerender:
         return convertToUTF8String("prerender");
     }
     ASSERT_NOT_REACHED();
index 643074a..42cea7d 100644 (file)
 #include <WebCore/IntSizeHash.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageOverlay.h>
-#include <WebCore/PageVisibilityState.h>
 #include <WebCore/UserActivity.h>
 #include <WebCore/UserContentTypes.h>
 #include <WebCore/UserInterfaceLayoutDirection.h>
 #include <WebCore/UserScriptTypes.h>
+#include <WebCore/VisibilityState.h>
 #include <WebCore/WebCoreKeyboardUIMode.h>
 #include <memory>
 #include <pal/HysteresisActivity.h>
index 7eab64c..150a237 100644 (file)
@@ -1,3 +1,15 @@
+2017-10-18  Chris Dumez  <cdumez@apple.com>
+
+        [Service Worker] Add stubs for Client / WindowClient / Clients
+        https://bugs.webkit.org/show_bug.cgi?id=178469
+
+        Reviewed by Youenn Fablet.
+
+        Rename PageVisiblityState to VisibilityState.
+
+        * WebView/WebView.mm:
+        (kit):
+
 2017-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Unreviewed, rolling out r223291.
index fdf6e4d..6c2f36d 100644 (file)
 {
     WebCore::JSMainThreadNullState state;
     switch (IMPL->visibilityState()) {
-    case WebCore::Document::VisibilityState::Hidden:
+    case WebCore::VisibilityState::Hidden:
         return @"hidden";
-    case WebCore::Document::VisibilityState::Visible:
+    case WebCore::VisibilityState::Visible:
         return @"visible";
-    case WebCore::Document::VisibilityState::Prerender:
+    case WebCore::VisibilityState::Prerender:
         return @"prerender";
     }
 }
index f194dc2..7897dac 100644 (file)
@@ -586,14 +586,14 @@ WebLayoutMilestones kitLayoutMilestones(LayoutMilestones milestones)
         | (milestones & DidHitRelevantRepaintedObjectsAreaThreshold ? WebDidHitRelevantRepaintedObjectsAreaThreshold : 0);
 }
 
-static WebPageVisibilityState kit(PageVisibilityState visibilityState)
+static WebPageVisibilityState kit(VisibilityState visibilityState)
 {
     switch (visibilityState) {
-    case PageVisibilityState::Visible:
+    case VisibilityState::Visible:
         return WebPageVisibilityStateVisible;
-    case PageVisibilityState::Hidden:
+    case VisibilityState::Hidden:
         return WebPageVisibilityStateHidden;
-    case PageVisibilityState::Prerender:
+    case VisibilityState::Prerender:
         return WebPageVisibilityStatePrerender;
     }