Strip fragment identifier from ServiceWorker's scriptURL
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Dec 2017 21:15:28 +0000 (21:15 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Dec 2017 21:15:28 +0000 (21:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180887

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT test now that one more check is passing.

* web-platform-tests/service-workers/service-worker/serviceworkerobject-scripturl.https-expected.txt:

Source/WebCore:

Strip fragment identifier from ServiceWorker's scriptURL to match Firefox and Chrome.
This behavior does not appear to be specified so I filed:
- https://github.com/w3c/ServiceWorker/issues/1249

No new tests, rebaselined existing test.

* workers/service/server/SWServerWorker.cpp:
(WebCore::m_script):

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

LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/serviceworkerobject-scripturl.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/workers/service/server/SWServerWorker.cpp

index 03245f7..4a5e4ba 100644 (file)
@@ -1,3 +1,14 @@
+2017-12-17  Chris Dumez  <cdumez@apple.com>
+
+        Strip fragment identifier from ServiceWorker's scriptURL
+        https://bugs.webkit.org/show_bug.cgi?id=180887
+
+        Reviewed by Darin Adler.
+
+        Rebaseline WPT test now that one more check is passing.
+
+        * web-platform-tests/service-workers/service-worker/serviceworkerobject-scripturl.https-expected.txt:
+
 2017-12-16  Romain Bellessort  <romain.bellessort@crf.canon.fr>
 
         [Readable Streams API] Fix filling of descriptor from queue
index b6e731d..02c6a5f 100644 (file)
@@ -1,5 +1,5 @@
 
 PASS Verify the scriptURL property: relative 
-FAIL Verify the scriptURL property: with-fragment assert_equals: Returned ServiceWorker object should have scriptURL expected "https://localhost:9443/service-workers/service-worker/resources/empty-worker.js" but got "https://localhost:9443/service-workers/service-worker/resources/empty-worker.js#ref"
+PASS Verify the scriptURL property: with-fragment 
 PASS Verify the scriptURL property: absolute 
 
index 6ed810a..a67eb39 100644 (file)
@@ -1,3 +1,19 @@
+2017-12-17  Chris Dumez  <cdumez@apple.com>
+
+        Strip fragment identifier from ServiceWorker's scriptURL
+        https://bugs.webkit.org/show_bug.cgi?id=180887
+
+        Reviewed by Darin Adler.
+
+        Strip fragment identifier from ServiceWorker's scriptURL to match Firefox and Chrome.
+        This behavior does not appear to be specified so I filed:
+        - https://github.com/w3c/ServiceWorker/issues/1249
+
+        No new tests, rebaselined existing test.
+
+        * workers/service/server/SWServerWorker.cpp:
+        (WebCore::m_script):
+
 2017-12-17  Antti Koivisto  <antti@apple.com>
 
         Move render tree updating related files under rendering/updating/
index e01154e..1a575be 100644 (file)
@@ -50,6 +50,8 @@ SWServerWorker::SWServerWorker(SWServer& server, SWServerRegistration& registrat
     , m_data { identifier, scriptURL, ServiceWorkerState::Redundant, type, registration.identifier() }
     , m_script(script)
 {
+    m_data.scriptURL.removeFragmentIdentifier();
+
     auto result = allWorkers().add(identifier, this);
     ASSERT_UNUSED(result, result.isNewEntry);
 }