WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
246372
imported/w3c/web-platform-tests/content-security-policy/inheritance/history-iframe.sub.html fails to navigate back in history to srcdoc iframe
https://bugs.webkit.org/show_bug.cgi?id=246372
Summary
imported/w3c/web-platform-tests/content-security-policy/inheritance/history-i...
Ryan Reno
Reported
2022-10-11 16:03:25 PDT
We're timing out on the srcdoc subtests of the named WPT. After playing with this a little bit I believe this is because when we navigate back in history with window.history.back() we aren't navigating back to the srcdoc but instead to the document before we set srcdoc attribute. I reproduced this by reducing the WPT subtest to this: message.html: -------------- <!DOCTYPE html> <script> top.postMessage("ready", "*"); </script> message-and-back.html: -------------- <!DOCTYPE html> <script> top.postMessage({msg:"message-and-back"}, "*"); window.history.back(); </script> srcdoc.html: -------------- <!DOCTYPE html> <script> const message_from = (starts_with) => { return new Promise(resolve => { window.addEventListener('message', msg => { if (!starts_with || msg.data.msg.startsWith(starts_with)) resolve(msg.data.msg); }); }); }; const htmlPayload = ` <!DOCTYPE html> <script> function ready() { top.postMessage({msg:'sdoc'}, '*'); } <\/script> <body onpageshow='ready()'> <h1>Hello world!<\/h1> <\/body> <\/html> `; async function run() { let i = document.createElement("iframe"); document.body.appendChild(i); i.contentWindow.location = "message.html"; await message_from("ready"); i.srcdoc = html_payload; await message_from("sdoc"); i.contentWindow.location = "message-and-back.html"; await message_from("message-and-back"); await message_from("sdoc"); // <-- this is where WPT hangs and times out } </script> <body onload="run()"></body> If I serve and navigate to srcdoc.html and check the inspector, the iframe has the expected srcdoc attribute but the document in the frame is actually the content of message.html I think we're either mistakenly not putting the srcdoc entry in history or the spec tells us not to and the WPT needs to change. I'll need to take a closer look.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-10-11 16:03:58 PDT
<
rdar://problem/101055087
>
Ryan Reno
Comment 2
2022-10-13 10:19:32 PDT
It looks like there's spec work to be done w.r.t srcdoc in history. See
https://github.com/whatwg/html/issues/6809
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug