Changeset 256381 in webkit
- Timestamp:
- Feb 11, 2020 3:32:10 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r256379 r256381 1 2020-02-11 Youenn Fablet <youenn@apple.com> 2 3 Parent service worker controller should be used for child iframe as per https://w3c.github.io/ServiceWorker/#control-and-use-window-client 4 https://bugs.webkit.org/show_bug.cgi?id=207506 5 6 Reviewed by Darin Adler. 7 8 * http/tests/workers/service/serviceworkerclients-claim.https-expected.txt: 9 Rebased test since now the frame is doing a fetch that is no longer intercepted by the service worker, 10 and is thus failing due to CORS. 11 * http/tests/workers/service/serviceworkerclients-claim.https.html: 12 1 13 2020-02-11 Jason Lawrence <lawrence.j@apple.com> 2 14 -
trunk/LayoutTests/http/tests/workers/service/serviceworkerclients-claim.https-expected.txt
r226361 r256381 1 CONSOLE MESSAGE: Origin null is not allowed by Access-Control-Allow-Origin. 2 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:8443/pinkelephant due to access control checks. 3 CONSOLE MESSAGE: line 1: Unhandled Promise Rejection: TypeError: Origin null is not allowed by Access-Control-Allow-Origin. 1 4 2 5 -
trunk/LayoutTests/http/tests/workers/service/serviceworkerclients-claim.https.html
r226361 r256381 61 61 var promise = new Promise((resolve, reject) => { 62 62 window.addEventListener("message", (event) => { 63 re solve(event.data);63 reject("Received a message from iframe:" + event.data); 64 64 }, false); 65 setTimeout( () => { reject("Did not receive any message from iframe"); }, 5000);65 setTimeout(resolve, 100); 66 66 }); 67 67 var frame = await withFrame("data:text/html," + htmlString); 68 var result = await promise; 69 assert_equals(result, "PASS"); 68 return promise; 70 69 }, "Test data URL frame"); 71 70 -
trunk/LayoutTests/imported/w3c/ChangeLog
r256207 r256381 1 2020-02-11 Youenn Fablet <youenn@apple.com> 2 3 Parent service worker controller should be used for child iframe as per https://w3c.github.io/ServiceWorker/#control-and-use-window-client 4 https://bugs.webkit.org/show_bug.cgi?id=207506 5 6 Reviewed by Darin Adler. 7 8 * web-platform-tests/service-workers/service-worker/local-url-inherit-controller.https-expected.txt: 9 1 10 2020-02-07 Ryosuke Niwa <rniwa@webkit.org> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/local-url-inherit-controller.https-expected.txt
r238592 r256381 4 4 FAIL Same-origin blob URL worker should inherit service worker controller. assert_equals: blob URL worker should inherit controller expected (string) "https://localhost:9443/service-workers/service-worker/resources/local-url-inherit-controller-worker.js" but got (object) null 5 5 PASS Same-origin blob URL worker should intercept fetch(). 6 FAIL Data URL iframe should not intercept fetch(). assert_equals: data URL iframe should not intercept fetch expected "" but got "intercepted" 6 PASS Data URL iframe should not intercept fetch(). 7 7 FAIL Data URL worker should not inherit service worker controller. promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure." 8 8 FAIL Data URL worker should not intercept fetch(). promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure." -
trunk/Source/WebCore/ChangeLog
r256380 r256381 1 2020-02-11 Youenn Fablet <youenn@apple.com> 2 3 Parent service worker controller should be used for child iframe as per https://w3c.github.io/ServiceWorker/#control-and-use-window-client 4 https://bugs.webkit.org/show_bug.cgi?id=207506 5 6 Reviewed by Darin Adler. 7 8 Instead of checking document URL protocol, implement the rules as per spec, in particular: 9 - If http/https, do not reuse controller 10 - If iframe has a unique origin, do not reuse controller 11 - If iframe does not have same origin as parent, do not reuse controller. 12 13 Covered by rebased test. 14 15 * loader/DocumentLoader.cpp: 16 (WebCore::isInheritingControllerFromParent): 17 (WebCore::DocumentLoader::commitData): 18 (WebCore::isLocalURL): Deleted. 19 1 20 2020-02-11 Zalan Bujtas <zalan@apple.com> 2 21 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r255961 r256381 1058 1058 1059 1059 #if ENABLE(SERVICE_WORKER) 1060 static inline bool isLocalURL(const URL& url) 1061 { 1062 // https://fetch.spec.whatwg.org/#is-local 1063 auto protocol = url.protocol().toStringWithoutCopying(); 1064 return equalLettersIgnoringASCIICase(protocol, "data") || equalLettersIgnoringASCIICase(protocol, "blob") || equalLettersIgnoringASCIICase(protocol, "about"); 1060 // https://w3c.github.io/ServiceWorker/#control-and-use-window-client 1061 static inline bool shouldUseActiveServiceWorkerFromParent(const Document& document, const Document& parent) 1062 { 1063 return !document.url().protocolIsInHTTPFamily() && !document.securityOrigin().isUnique() && parent.securityOrigin().canAccess(document.securityOrigin()); 1065 1064 } 1066 1065 #endif … … 1093 1092 m_frame->document()->setActiveServiceWorker(ServiceWorker::getOrCreate(*m_frame->document(), WTFMove(m_serviceWorkerRegistrationData->activeWorker.value()))); 1094 1093 m_serviceWorkerRegistrationData = { }; 1095 } else if ( isLocalURL(m_frame->document()->url())) {1096 if ( auto* parent = m_frame->document()->parentDocument())1094 } else if (auto* parent = m_frame->document()->parentDocument()) { 1095 if (shouldUseActiveServiceWorkerFromParent(*m_frame->document(), *parent)) 1097 1096 m_frame->document()->setActiveServiceWorker(parent->activeServiceWorker()); 1098 1097 }
Note: See TracChangeset
for help on using the changeset viewer.