Title: [255001] branches/safari-609-branch
Revision
255001
Author
[email protected]
Date
2020-01-23 13:43:06 -0800 (Thu, 23 Jan 2020)

Log Message

Cherry-pick r254408. rdar://problem/58606270

    [WebCore] Fix crash in module loader due to change in fragment reservation
    https://bugs.webkit.org/show_bug.cgi?id=206125

    Reviewed by Dean Jackson.

    LayoutTests/imported/w3c:

    * web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt:

    Source/WebCore:

    At some point, CachedResource::url() starts returning URL without fragment.
    However, this was invariant in ScriptModuleLoader, so one of WPT test is crashing.

    We save source URL so that we preserve fragment information.
    Still we need to have fragment information after the redirect to fix a bug filed in [1].

    [1]: https://bugs.webkit.org/show_bug.cgi?id=205294

    * bindings/js/CachedModuleScriptLoader.cpp:
    (WebCore::CachedModuleScriptLoader::load):
    * bindings/js/CachedModuleScriptLoader.h:
    * bindings/js/ScriptModuleLoader.cpp:
    (WebCore::ScriptModuleLoader::notifyFinished):

    LayoutTests:

    * TestExpectations:

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

Modified Paths

Diff

Modified: branches/safari-609-branch/LayoutTests/ChangeLog (255000 => 255001)


--- branches/safari-609-branch/LayoutTests/ChangeLog	2020-01-23 21:42:59 UTC (rev 255000)
+++ branches/safari-609-branch/LayoutTests/ChangeLog	2020-01-23 21:43:06 UTC (rev 255001)
@@ -1,5 +1,49 @@
 2020-01-23  Russell Epstein  <[email protected]>
 
+        Cherry-pick r254408. rdar://problem/58606270
+
+    [WebCore] Fix crash in module loader due to change in fragment reservation
+    https://bugs.webkit.org/show_bug.cgi?id=206125
+    
+    Reviewed by Dean Jackson.
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt:
+    
+    Source/WebCore:
+    
+    At some point, CachedResource::url() starts returning URL without fragment.
+    However, this was invariant in ScriptModuleLoader, so one of WPT test is crashing.
+    
+    We save source URL so that we preserve fragment information.
+    Still we need to have fragment information after the redirect to fix a bug filed in [1].
+    
+    [1]: https://bugs.webkit.org/show_bug.cgi?id=205294
+    
+    * bindings/js/CachedModuleScriptLoader.cpp:
+    (WebCore::CachedModuleScriptLoader::load):
+    * bindings/js/CachedModuleScriptLoader.h:
+    * bindings/js/ScriptModuleLoader.cpp:
+    (WebCore::ScriptModuleLoader::notifyFinished):
+    
+    LayoutTests:
+    
+    * TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-01-10  Yusuke Suzuki  <[email protected]>
+
+            [WebCore] Fix crash in module loader due to change in fragment reservation
+            https://bugs.webkit.org/show_bug.cgi?id=206125
+
+            Reviewed by Dean Jackson.
+
+            * TestExpectations:
+
+2020-01-23  Russell Epstein  <[email protected]>
+
         Cherry-pick r254296. rdar://problem/58606275
 
     Resource Load Statistics: Add timing information to WebPageProxy::logFrameNavigation() to detect delayed client-side redirects

Modified: branches/safari-609-branch/LayoutTests/TestExpectations (255000 => 255001)


--- branches/safari-609-branch/LayoutTests/TestExpectations	2020-01-23 21:42:59 UTC (rev 255000)
+++ branches/safari-609-branch/LayoutTests/TestExpectations	2020-01-23 21:43:06 UTC (rev 255001)
@@ -338,7 +338,6 @@
 imported/w3c/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.html [ Skip ]
 imported/w3c/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html [ Skip ]
 imported/w3c/web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html [ Skip ]
-imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url.html [ Skip ]
 imported/w3c/web-platform-tests/html/browsers/offline/application-cache-api/api_update.https.html [ Skip ]
 imported/w3c/web-platform-tests/cors/image-tainting-in-cross-origin-iframe.sub.html [ Skip ]
 imported/w3c/web-platform-tests/dom/events/EventListener-incumbent-global-1.sub.html [ Skip ]

Modified: branches/safari-609-branch/LayoutTests/imported/w3c/ChangeLog (255000 => 255001)


--- branches/safari-609-branch/LayoutTests/imported/w3c/ChangeLog	2020-01-23 21:42:59 UTC (rev 255000)
+++ branches/safari-609-branch/LayoutTests/imported/w3c/ChangeLog	2020-01-23 21:43:06 UTC (rev 255001)
@@ -1,3 +1,47 @@
+2020-01-23  Russell Epstein  <[email protected]>
+
+        Cherry-pick r254408. rdar://problem/58606270
+
+    [WebCore] Fix crash in module loader due to change in fragment reservation
+    https://bugs.webkit.org/show_bug.cgi?id=206125
+    
+    Reviewed by Dean Jackson.
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt:
+    
+    Source/WebCore:
+    
+    At some point, CachedResource::url() starts returning URL without fragment.
+    However, this was invariant in ScriptModuleLoader, so one of WPT test is crashing.
+    
+    We save source URL so that we preserve fragment information.
+    Still we need to have fragment information after the redirect to fix a bug filed in [1].
+    
+    [1]: https://bugs.webkit.org/show_bug.cgi?id=205294
+    
+    * bindings/js/CachedModuleScriptLoader.cpp:
+    (WebCore::CachedModuleScriptLoader::load):
+    * bindings/js/CachedModuleScriptLoader.h:
+    * bindings/js/ScriptModuleLoader.cpp:
+    (WebCore::ScriptModuleLoader::notifyFinished):
+    
+    LayoutTests:
+    
+    * TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-01-10  Yusuke Suzuki  <[email protected]>
+
+            [WebCore] Fix crash in module loader due to change in fragment reservation
+            https://bugs.webkit.org/show_bug.cgi?id=206125
+
+            Reviewed by Dean Jackson.
+
+            * web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt:
+
 2020-01-15  Alan Coon  <[email protected]>
 
         Cherry-pick r254229. rdar://problem/58605950

Modified: branches/safari-609-branch/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt (255000 => 255001)


--- branches/safari-609-branch/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt	2020-01-23 21:42:59 UTC (rev 255000)
+++ branches/safari-609-branch/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt	2020-01-23 21:43:06 UTC (rev 255001)
@@ -0,0 +1,9 @@
+
+PASS import.meta.url in a root inline script 
+PASS import.meta.url in a root external script 
+PASS import.meta.url in a dependent external script 
+PASS import.meta is an object 
+PASS import.meta is extensible 
+PASS import.meta's properties are writable, configurable, and enumerable 
+PASS import.meta.url when importing the module with different fragments 
+

Modified: branches/safari-609-branch/Source/WebCore/ChangeLog (255000 => 255001)


--- branches/safari-609-branch/Source/WebCore/ChangeLog	2020-01-23 21:42:59 UTC (rev 255000)
+++ branches/safari-609-branch/Source/WebCore/ChangeLog	2020-01-23 21:43:06 UTC (rev 255001)
@@ -1,3 +1,59 @@
+2020-01-23  Russell Epstein  <[email protected]>
+
+        Cherry-pick r254408. rdar://problem/58606270
+
+    [WebCore] Fix crash in module loader due to change in fragment reservation
+    https://bugs.webkit.org/show_bug.cgi?id=206125
+    
+    Reviewed by Dean Jackson.
+    
+    LayoutTests/imported/w3c:
+    
+    * web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt:
+    
+    Source/WebCore:
+    
+    At some point, CachedResource::url() starts returning URL without fragment.
+    However, this was invariant in ScriptModuleLoader, so one of WPT test is crashing.
+    
+    We save source URL so that we preserve fragment information.
+    Still we need to have fragment information after the redirect to fix a bug filed in [1].
+    
+    [1]: https://bugs.webkit.org/show_bug.cgi?id=205294
+    
+    * bindings/js/CachedModuleScriptLoader.cpp:
+    (WebCore::CachedModuleScriptLoader::load):
+    * bindings/js/CachedModuleScriptLoader.h:
+    * bindings/js/ScriptModuleLoader.cpp:
+    (WebCore::ScriptModuleLoader::notifyFinished):
+    
+    LayoutTests:
+    
+    * TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-01-10  Yusuke Suzuki  <[email protected]>
+
+            [WebCore] Fix crash in module loader due to change in fragment reservation
+            https://bugs.webkit.org/show_bug.cgi?id=206125
+
+            Reviewed by Dean Jackson.
+
+            At some point, CachedResource::url() starts returning URL without fragment.
+            However, this was invariant in ScriptModuleLoader, so one of WPT test is crashing.
+
+            We save source URL so that we preserve fragment information.
+            Still we need to have fragment information after the redirect to fix a bug filed in [1].
+
+            [1]: https://bugs.webkit.org/show_bug.cgi?id=205294
+
+            * bindings/js/CachedModuleScriptLoader.cpp:
+            (WebCore::CachedModuleScriptLoader::load):
+            * bindings/js/CachedModuleScriptLoader.h:
+            * bindings/js/ScriptModuleLoader.cpp:
+            (WebCore::ScriptModuleLoader::notifyFinished):
+
 2020-01-15  Alan Coon  <[email protected]>
 
         Cherry-pick r254267. rdar://problem/58606290

Modified: branches/safari-609-branch/Source/WebCore/bindings/js/CachedModuleScriptLoader.cpp (255000 => 255001)


--- branches/safari-609-branch/Source/WebCore/bindings/js/CachedModuleScriptLoader.cpp	2020-01-23 21:42:59 UTC (rev 255000)
+++ branches/safari-609-branch/Source/WebCore/bindings/js/CachedModuleScriptLoader.cpp	2020-01-23 21:43:06 UTC (rev 255001)
@@ -68,6 +68,7 @@
     m_cachedScript = m_scriptFetcher->requestModuleScript(document, sourceURL, WTFMove(integrity));
     if (!m_cachedScript)
         return false;
+    m_sourceURL = sourceURL;
 
     // If the content is already cached, this immediately calls notifyFinished.
     m_cachedScript->addClient(*this);

Modified: branches/safari-609-branch/Source/WebCore/bindings/js/CachedModuleScriptLoader.h (255000 => 255001)


--- branches/safari-609-branch/Source/WebCore/bindings/js/CachedModuleScriptLoader.h	2020-01-23 21:42:59 UTC (rev 255000)
+++ branches/safari-609-branch/Source/WebCore/bindings/js/CachedModuleScriptLoader.h	2020-01-23 21:43:06 UTC (rev 255001)
@@ -30,6 +30,7 @@
 #include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
+#include <wtf/URL.h>
 
 namespace WebCore {
 
@@ -52,6 +53,7 @@
     CachedScriptFetcher& scriptFetcher() { return m_scriptFetcher.get(); }
     CachedScript* cachedScript() { return m_cachedScript.get(); }
     ModuleFetchParameters* parameters() { return m_parameters.get(); }
+    const URL& sourceURL() const { return m_sourceURL; }
 
     void clearClient()
     {
@@ -69,6 +71,7 @@
     Ref<CachedScriptFetcher> m_scriptFetcher;
     RefPtr<ModuleFetchParameters> m_parameters;
     CachedResourceHandle<CachedScript> m_cachedScript;
+    URL m_sourceURL;
 };
 
 } // namespace WebCore

Modified: branches/safari-609-branch/Source/WebCore/bindings/js/ScriptModuleLoader.cpp (255000 => 255001)


--- branches/safari-609-branch/Source/WebCore/bindings/js/ScriptModuleLoader.cpp	2020-01-23 21:42:59 UTC (rev 255000)
+++ branches/safari-609-branch/Source/WebCore/bindings/js/ScriptModuleLoader.cpp	2020-01-23 21:43:06 UTC (rev 255001)
@@ -281,6 +281,7 @@
 {
     // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script
 
+    URL sourceURL = loader.sourceURL();
     if (!m_loaders.remove(&loader))
         return;
     loader.clearClient();
@@ -317,7 +318,7 @@
         }
     }
 
-    m_requestURLToResponseURLMap.add(cachedScript.url(), cachedScript.response().url());
+    m_requestURLToResponseURLMap.add(WTFMove(sourceURL), cachedScript.response().url());
     promise->resolveWithCallback([&] (JSDOMGlobalObject& jsGlobalObject) {
         return JSC::JSSourceCode::create(jsGlobalObject.vm(),
             JSC::SourceCode { ScriptSourceCode { &cachedScript, JSC::SourceProviderSourceType::Module, loader.scriptFetcher() }.jsSourceCode() });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to