Title: [249344] trunk

Diff

Modified: trunk/LayoutTests/ChangeLog (249343 => 249344)


--- trunk/LayoutTests/ChangeLog	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/LayoutTests/ChangeLog	2019-08-30 20:33:44 UTC (rev 249344)
@@ -1,3 +1,16 @@
+2019-08-30  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r249338.
+
+        Caused 500+ layout test failures on WK1
+
+        Reverted changeset:
+
+        "Add support for postMessage buffering between the service
+        worker and window"
+        https://bugs.webkit.org/show_bug.cgi?id=201169
+        https://trac.webkit.org/changeset/249338
+
 2019-08-30  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Caret does not appear in text field inside a transformed, overflow: hidden container

Modified: trunk/LayoutTests/TestExpectations (249343 => 249344)


--- trunk/LayoutTests/TestExpectations	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/LayoutTests/TestExpectations	2019-08-30 20:33:44 UTC (rev 249344)
@@ -208,6 +208,7 @@
 imported/w3c/web-platform-tests/service-workers/service-worker/fetch-mixed-content-to-inscope.https.html [ Skip ]
 imported/w3c/web-platform-tests/service-workers/service-worker/fetch-mixed-content-to-outscope.https.html [ Skip ]
 imported/w3c/web-platform-tests/service-workers/service-worker/multipart-image.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-to-client-message-queue.https.html [ Skip ]
 imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-using-registration.https.html [ Skip ]
 imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-without-using-registration.https.html [ Skip ]
 imported/w3c/web-platform-tests/service-workers/service-worker/update-not-allowed.https.html [ Skip ]

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (249343 => 249344)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-08-30 20:33:44 UTC (rev 249344)
@@ -1,3 +1,16 @@
+2019-08-30  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r249338.
+
+        Caused 500+ layout test failures on WK1
+
+        Reverted changeset:
+
+        "Add support for postMessage buffering between the service
+        worker and window"
+        https://bugs.webkit.org/show_bug.cgi?id=201169
+        https://trac.webkit.org/changeset/249338
+
 2019-08-30  Chris Dumez  <cdu...@apple.com>
 
         Add support for postMessage buffering between the service worker and window

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-to-client-message-queue.https-expected.txt (249343 => 249344)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-to-client-message-queue.https-expected.txt	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/postmessage-to-client-message-queue.https-expected.txt	2019-08-30 20:33:44 UTC (rev 249344)
@@ -1,7 +1,9 @@
 
-PASS Messages from ServiceWorker to Client only received after DOMContentLoaded event. 
-PASS Messages from ServiceWorker to Client only received after calling startMessages(). 
-PASS Messages from ServiceWorker to Client only received after setting onmessage. 
-PASS Microtasks run before dispatching messages after calling startMessages(). 
-PASS Microtasks run before dispatching messages after setting onmessage. 
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT Messages from ServiceWorker to Client only received after DOMContentLoaded event. Test timed out
+NOTRUN Messages from ServiceWorker to Client only received after calling startMessages(). 
+NOTRUN Messages from ServiceWorker to Client only received after setting onmessage. 
+NOTRUN Microtasks run before dispatching messages after calling startMessages(). 
+NOTRUN Microtasks run before dispatching messages after setting onmessage. 
+

Modified: trunk/LayoutTests/platform/win/http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt (249343 => 249344)


--- trunk/LayoutTests/platform/win/http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/LayoutTests/platform/win/http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt	2019-08-30 20:33:44 UTC (rev 249344)
@@ -1,3 +1,4 @@
+CONSOLE MESSAGE: line 21: TypeError: null is not an object (evaluating 'errorFrame.contentDocument.querySelector("#error-url").click')
 
 
 FAIL Do not navigate to 404 for anchor with download assert_unreached: Navigated instead of downloading Reached unreachable code

Modified: trunk/LayoutTests/resources/testharnessreport.js (249343 => 249344)


--- trunk/LayoutTests/resources/testharnessreport.js	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/LayoutTests/resources/testharnessreport.js	2019-08-30 20:33:44 UTC (rev 249344)
@@ -98,7 +98,7 @@
         // Wait for any other completion callbacks, which may eliminate test elements
         // from the page and therefore reduce the output.
         setTimeout(function () {
-            testRunner.forceImmediateCompletion();
+            testRunner.notifyDone();
         }, 0);
     });
 }

Modified: trunk/Source/WebCore/ChangeLog (249343 => 249344)


--- trunk/Source/WebCore/ChangeLog	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/Source/WebCore/ChangeLog	2019-08-30 20:33:44 UTC (rev 249344)
@@ -1,3 +1,16 @@
+2019-08-30  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r249338.
+
+        Caused 500+ layout test failures on WK1
+
+        Reverted changeset:
+
+        "Add support for postMessage buffering between the service
+        worker and window"
+        https://bugs.webkit.org/show_bug.cgi?id=201169
+        https://trac.webkit.org/changeset/249338
+
 2019-08-30  Alex Christensen  <achristen...@webkit.org>
 
         Remove HAVE_CFNETWORK_WITH_IGNORE_HSTS conditional

Modified: trunk/Source/WebCore/dom/Document.cpp (249343 => 249344)


--- trunk/Source/WebCore/dom/Document.cpp	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/Source/WebCore/dom/Document.cpp	2019-08-30 20:33:44 UTC (rev 249344)
@@ -193,7 +193,6 @@
 #include "SegmentedString.h"
 #include "SelectorQuery.h"
 #include "ServiceWorkerClientData.h"
-#include "ServiceWorkerContainer.h"
 #include "ServiceWorkerProvider.h"
 #include "Settings.h"
 #include "ShadowRoot.h"
@@ -5709,14 +5708,6 @@
 
     // Parser should have picked up all speculative preloads by now
     m_cachedResourceLoader->clearPreloads(CachedResourceLoader::ClearPreloadsMode::ClearSpeculativePreloads);
-
-#if ENABLE(SERVICE_WORKER)
-    if (RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled()) {
-        // Stop queuing service worker client messages now that the DOMContentLoaded event has been fired.
-        if (auto* serviceWorkerContainer = this->serviceWorkerContainer())
-            serviceWorkerContainer->startMessages();
-    }
-#endif
 }
 
 void Document::clearSharedObjectPool()

Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (249343 => 249344)


--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp	2019-08-30 20:33:44 UTC (rev 249344)
@@ -612,18 +612,6 @@
     return navigator ? &navigator->serviceWorker() : nullptr;
 }
 
-ServiceWorkerContainer* ScriptExecutionContext::ensureServiceWorkerContainer()
-{
-    NavigatorBase* navigator = nullptr;
-    if (is<Document>(*this)) {
-        if (auto* window = downcast<Document>(*this).domWindow())
-            navigator = &window->navigator();
-    } else
-        navigator = &downcast<WorkerGlobalScope>(*this).navigator();
-        
-    return navigator ? &navigator->serviceWorker() : nullptr;
-}
-
 bool ScriptExecutionContext::postTaskTo(const DocumentOrWorkerIdentifier& contextIdentifier, WTF::Function<void(ScriptExecutionContext&)>&& task)
 {
     ASSERT(isMainThread());

Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (249343 => 249344)


--- trunk/Source/WebCore/dom/ScriptExecutionContext.h	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h	2019-08-30 20:33:44 UTC (rev 249344)
@@ -255,7 +255,6 @@
     ServiceWorker* serviceWorker(ServiceWorkerIdentifier identifier) { return m_serviceWorkers.get(identifier); }
 
     ServiceWorkerContainer* serviceWorkerContainer();
-    ServiceWorkerContainer* ensureServiceWorkerContainer();
 
     WEBCORE_EXPORT static bool postTaskTo(const DocumentOrWorkerIdentifier&, WTF::Function<void(ScriptExecutionContext&)>&&);
 #endif

Modified: trunk/Source/WebCore/workers/service/SWClientConnection.cpp (249343 => 249344)


--- trunk/Source/WebCore/workers/service/SWClientConnection.cpp	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/Source/WebCore/workers/service/SWClientConnection.cpp	2019-08-30 20:33:44 UTC (rev 249344)
@@ -125,8 +125,10 @@
     if (!destinationDocument)
         return;
 
-    if (auto* container = destinationDocument->ensureServiceWorkerContainer())
-        container->postMessage(WTFMove(message), WTFMove(sourceData), WTFMove(sourceOrigin));
+    destinationDocument->postTask([message = WTFMove(message), sourceData = WTFMove(sourceData), sourceOrigin = WTFMove(sourceOrigin)](auto& context) mutable {
+        if (auto* container = context.serviceWorkerContainer())
+            container->postMessage(WTFMove(message), WTFMove(sourceData), WTFMove(sourceOrigin));
+    });
 }
 
 void SWClientConnection::updateRegistrationState(ServiceWorkerRegistrationIdentifier identifier, ServiceWorkerRegistrationState state, const Optional<ServiceWorkerData>& serviceWorkerData)

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp (249343 => 249344)


--- trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp	2019-08-30 20:33:44 UTC (rev 249344)
@@ -64,13 +64,8 @@
 ServiceWorkerContainer::ServiceWorkerContainer(ScriptExecutionContext* context, NavigatorBase& navigator)
     : ActiveDOMObject(context)
     , m_navigator(navigator)
-    , m_messageQueue(*this)
 {
     suspendIfNeeded();
-    
-    // We should queue messages until the DOMContentLoaded event has fired or startMessages() has been called.
-    if (is<Document>(context) && downcast<Document>(*context).parsing())
-        m_messageQueue.suspend();
 }
 
 ServiceWorkerContainer::~ServiceWorkerContainer()
@@ -383,7 +378,6 @@
 
 void ServiceWorkerContainer::startMessages()
 {
-    m_messageQueue.resume();
 }
 
 void ServiceWorkerContainer::jobFailedWithException(ServiceWorkerJob& job, const Exception& exception)
@@ -481,8 +475,7 @@
     MessageEventSource source = RefPtr<ServiceWorker> { ServiceWorker::getOrCreate(context, WTFMove(sourceData)) };
 
     auto messageEvent = MessageEvent::create(MessagePort::entanglePorts(context, WTFMove(message.transferredPorts)), message.message.releaseNonNull(), sourceOrigin, { }, WTFMove(source));
-    
-    m_messageQueue.enqueueEvent(WTFMove(messageEvent));
+    dispatchEvent(messageEvent);
 }
 
 void ServiceWorkerContainer::notifyRegistrationIsSettled(const ServiceWorkerRegistrationKey& registrationKey)
@@ -592,16 +585,6 @@
     return !hasPendingActivity();
 }
 
-void ServiceWorkerContainer::suspend(ReasonForSuspension)
-{
-    m_messageQueue.suspend();
-}
-
-void ServiceWorkerContainer::resume()
-{
-    m_messageQueue.resume();
-}
-
 SWClientConnection& ServiceWorkerContainer::ensureSWClientConnection()
 {
     ASSERT(scriptExecutionContext());
@@ -653,7 +636,6 @@
     removeAllEventListeners();
     m_pendingPromises.clear();
     m_readyPromise = nullptr;
-    m_messageQueue.close();
     auto jobMap = WTFMove(m_jobMap);
     for (auto& ongoingJob : jobMap.values()) {
         if (ongoingJob.job->cancelPendingLoad())
@@ -698,16 +680,6 @@
     return false;
 }
 
-bool ServiceWorkerContainer::addEventListener(const AtomString& eventType, Ref<EventListener>&& eventListener, const AddEventListenerOptions& options)
-{
-    // Setting the onmessage EventHandler attribute on the ServiceWorkerContainer should start the messages
-    // automatically.
-    if (eventListener->isAttribute() && eventType == eventNames().messageEvent)
-        startMessages();
-
-    return EventTargetWithInlineData::addEventListener(eventType, WTFMove(eventListener), options);
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(SERVICE_WORKER)

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h (249343 => 249344)


--- trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h	2019-08-30 20:27:33 UTC (rev 249343)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h	2019-08-30 20:33:44 UTC (rev 249344)
@@ -30,7 +30,6 @@
 #include "ActiveDOMObject.h"
 #include "DOMPromiseProxy.h"
 #include "EventTarget.h"
-#include "GenericEventQueue.h"
 #include "SWClientConnection.h"
 #include "SWServer.h"
 #include "ServiceWorkerJobClient.h"
@@ -91,8 +90,6 @@
     NavigatorBase* navigator() { return &m_navigator; }
 
 private:
-    bool addEventListener(const AtomString& eventType, Ref<EventListener>&&, const AddEventListenerOptions& = { }) final;
-
     void scheduleJob(std::unique_ptr<ServiceWorkerJob>&&);
 
     void jobFailedWithException(ServiceWorkerJob&, const Exception&) final;
@@ -112,12 +109,8 @@
 
     SWClientConnection& ensureSWClientConnection();
 
-    // ActiveDOMObject.
     const char* activeDOMObjectName() const final;
     bool canSuspendForDocumentSuspension() const final;
-    void suspend(ReasonForSuspension) final;
-    void resume() final;
-    
     ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
     EventTargetInterface eventTargetInterface() const final { return ServiceWorkerContainerEventTargetInterfaceType; }
     void refEventTarget() final;
@@ -161,7 +154,6 @@
 
     uint64_t m_lastOngoingSettledRegistrationIdentifier { 0 };
     HashMap<uint64_t, ServiceWorkerRegistrationKey> m_ongoingSettledRegistrations;
-    GenericEventQueue m_messageQueue;
 
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to