Skip to content

Commit

Permalink
imported/w3c/web-platform-tests/FileAPI/url/url-reload.window.html is…
Browse files Browse the repository at this point in the history
… timing out in WebKit

https://bugs.webkit.org/show_bug.cgi?id=244864

Reviewed by Geoffrey Garen.

imported/w3c/web-platform-tests/FileAPI/url/url-reload.window.html is timing
out in WebKit but passing in Gecko.

The test is reloading a frame with a Blob URL after revoking that URL,
expecting the reload to succeed. To support this, the Document now keeps its
blob URL alive using a BlobURLHandle.

* LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-reload.window-expected.txt:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::setURL):
* Source/WebCore/dom/Document.h:

Canonical link: https://commits.webkit.org/254254@main
  • Loading branch information
cdumez committed Sep 7, 2022
1 parent 9791054 commit e295563
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
@@ -1,6 +1,4 @@

Harness Error (TIMEOUT), message = null

PASS Reloading a blob URL succeeds.
TIMEOUT Reloading a blob URL succeeds even if the URL was revoked. Test timed out
PASS Reloading a blob URL succeeds even if the URL was revoked.

5 changes: 5 additions & 0 deletions Source/WebCore/dom/Document.cpp
Expand Up @@ -3502,6 +3502,11 @@ void Document::setURL(const URL& url)
if (SecurityOrigin::shouldIgnoreHost(m_url))
m_url.setHostAndPort({ });

if (m_url.protocolIsBlob())
m_blobURLLifetimeExtension = m_url;
else
m_blobURLLifetimeExtension.clear();

m_documentURI = m_url.string();
updateBaseURL();
}
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/dom/Document.h
Expand Up @@ -27,6 +27,7 @@

#pragma once

#include "BlobURL.h"
#include "CSSPropertyNames.h"
#include "CSSRegisteredCustomProperty.h"
#include "CanvasBase.h"
Expand Down Expand Up @@ -1848,6 +1849,7 @@ class Document

// Document URLs.
URL m_url; // Document.URL: The URL from which this document was retrieved.
BlobURLHandle m_blobURLLifetimeExtension; // Keep the Document's blob alive so it can be reloaded.
URL m_creationURL; // https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url.
URL m_baseURL; // Node.baseURI: The URL to use when resolving relative URLs.
URL m_baseURLOverride; // An alternative base URL that takes precedence over m_baseURL (but not m_baseElementURL).
Expand Down

0 comments on commit e295563

Please sign in to comment.