Title: [289477] trunk
Revision
289477
Author
cdu...@apple.com
Date
2022-02-09 09:14:01 -0800 (Wed, 09 Feb 2022)

Log Message

Stop obfuscating exceptions thrown by scripts in data URLs
https://bugs.webkit.org/show_bug.cgi?id=236329

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing or whose output looks different.

* web-platform-tests/workers/dedicated-worker-in-data-url-context.window-expected.txt:
* web-platform-tests/workers/interfaces/WorkerUtils/importScripts/004-expected.txt:
* web-platform-tests/workers/interfaces/WorkerUtils/importScripts/006-expected.txt:

Source/WebCore:

Stop obfuscating exceptions thrown by scripts in data URLs. This is causing some WPT tests to fail.

No new tests, rebaselined existing tests.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canIncludeErrorDetails):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (289476 => 289477)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-09 17:06:14 UTC (rev 289476)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-09 17:14:01 UTC (rev 289477)
@@ -1,5 +1,18 @@
 2022-02-09  Chris Dumez  <cdu...@apple.com>
 
+        Stop obfuscating exceptions thrown by scripts in data URLs
+        https://bugs.webkit.org/show_bug.cgi?id=236329
+
+        Reviewed by Brent Fulgham.
+
+        Rebaseline WPT tests that are now passing or whose output looks different.
+
+        * web-platform-tests/workers/dedicated-worker-in-data-url-context.window-expected.txt:
+        * web-platform-tests/workers/interfaces/WorkerUtils/importScripts/004-expected.txt:
+        * web-platform-tests/workers/interfaces/WorkerUtils/importScripts/006-expected.txt:
+
+2022-02-09  Chris Dumez  <cdu...@apple.com>
+
         Resync web-platform-tests/html/dom from upstream
         https://bugs.webkit.org/show_bug.cgi?id=236252
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/local-url-inherit-controller.https-expected.txt (289476 => 289477)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/local-url-inherit-controller.https-expected.txt	2022-02-09 17:06:14 UTC (rev 289476)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/local-url-inherit-controller.https-expected.txt	2022-02-09 17:14:01 UTC (rev 289477)
@@ -4,6 +4,6 @@
 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
 PASS Same-origin blob URL worker should intercept fetch().
 PASS Data URL iframe should not intercept fetch().
-FAIL Data URL worker should not inherit service worker controller. promise_test: Unhandled rejection with value: "Error: Script error."
+FAIL Data URL worker should not inherit service worker controller. promise_test: Unhandled rejection with value: "TypeError: undefined is not an object (evaluating 'navigator.serviceWorker.controller')"
 FAIL Data URL worker should not intercept fetch(). assert_equals: data URL worker should not intercept fetch expected "" but got "intercepted"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/dedicated-worker-in-data-url-context.window-expected.txt (289476 => 289477)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/dedicated-worker-in-data-url-context.window-expected.txt	2022-02-09 17:06:14 UTC (rev 289476)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/dedicated-worker-in-data-url-context.window-expected.txt	2022-02-09 17:14:01 UTC (rev 289477)
@@ -1,7 +1,7 @@
-CONSOLE MESSAGE: Error: Script error.
+CONSOLE MESSAGE: ReferenceError: Can't find variable: Worker
 
 FAIL Create a dedicated worker in a data url frame assert_equals: expected "PASS" but got "Worker construction unexpectedly synchronously failed"
 FAIL Create a dedicated worker in a data url dedicated worker assert_equals: expected "PASS" but got "Worker construction unexpectedly synchronously failed"
 PASS Create a data url dedicated worker in a data url frame
-FAIL Create a data url dedicated worker in a data url dedicated worker promise_test: Unhandled rejection with value: "Error: Script error."
+FAIL Create a data url dedicated worker in a data url dedicated worker promise_test: Unhandled rejection with value: "ReferenceError: Can't find variable: Worker"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/importScripts/004-expected.txt (289476 => 289477)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/importScripts/004-expected.txt	2022-02-09 17:06:14 UTC (rev 289476)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/importScripts/004-expected.txt	2022-02-09 17:14:01 UTC (rev 289477)
@@ -1,3 +1,3 @@
 
-FAIL importScripts broken script assert_true: expected SyntaxError expected true got "Error: Script error."
+PASS importScripts broken script
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/importScripts/006-expected.txt (289476 => 289477)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/importScripts/006-expected.txt	2022-02-09 17:06:14 UTC (rev 289476)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/importScripts/006-expected.txt	2022-02-09 17:14:01 UTC (rev 289477)
@@ -1,10 +1,3 @@
-CONSOLE MESSAGE: DataCloneError: The object can not be cloned.
 
-Harness Error (FAIL), message = DataCloneError: The object can not be cloned.
+PASS importScripts uncaught exception
 
-TIMEOUT importScripts uncaught exception Test timed out
-
-Harness Error (FAIL), message = DataCloneError: The object can not be cloned.
-
-TIMEOUT importScripts uncaught exception Test timed out
-

Modified: trunk/Source/WebCore/ChangeLog (289476 => 289477)


--- trunk/Source/WebCore/ChangeLog	2022-02-09 17:06:14 UTC (rev 289476)
+++ trunk/Source/WebCore/ChangeLog	2022-02-09 17:14:01 UTC (rev 289477)
@@ -1,3 +1,17 @@
+2022-02-09  Chris Dumez  <cdu...@apple.com>
+
+        Stop obfuscating exceptions thrown by scripts in data URLs
+        https://bugs.webkit.org/show_bug.cgi?id=236329
+
+        Reviewed by Brent Fulgham.
+
+        Stop obfuscating exceptions thrown by scripts in data URLs. This is causing some WPT tests to fail.
+
+        No new tests, rebaselined existing tests.
+
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::canIncludeErrorDetails):
+
 2022-02-09  Yusuke Suzuki  <ysuz...@apple.com>
 
         AudioBuffer should take a lock while visiting m_channelWrappers

Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (289476 => 289477)


--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp	2022-02-09 17:06:14 UTC (rev 289476)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp	2022-02-09 17:14:01 UTC (rev 289477)
@@ -388,12 +388,15 @@
     // Errors from module scripts are never muted.
     if (fromModule)
         return true;
+    URL completeSourceURL = completeURL(sourceURL);
+    if (completeSourceURL.protocolIsData())
+        return true;
     if (script) {
         ASSERT(script->origin());
         ASSERT(securityOrigin()->toString() == script->origin()->toString());
         return script->isCORSSameOrigin();
     }
-    return securityOrigin()->canRequest(completeURL(sourceURL));
+    return securityOrigin()->canRequest(completeSourceURL);
 }
 
 void ScriptExecutionContext::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, JSC::Exception* exception, RefPtr<ScriptCallStack>&& callStack, CachedScript* cachedScript, bool fromModule)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to