WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
169467
iframe `window.parent` should return null when iframe element removed
https://bugs.webkit.org/show_bug.cgi?id=169467
Summary
iframe `window.parent` should return null when iframe element removed
Lyza Gardner
Reported
2017-03-10 07:44:43 PST
Created
attachment 304043
[details]
window.parent should be null after iframe removed While working on some web-platform-tests regarding `window.parent` and `window.top` for nested browsing contexts[1], I happened on some unexpected behavior in Safari/Webkit regarding `window.parent`. When an `iframe` element is removed from a document, its associated browsing context should be discarded. For a nested browsing container to be the parent or child of another browsing context, both parties need to be connected and active.[2][3] Expected behavior: When an iframe is removed from a document, its previous browsing context (window) should return `null` for `window.parent`. Actual behavior: When an iframe is removed from a document, Webkit/Safari continues to return the prior-associated `parent` browsing context. Steps to reproduce: 1. Append an iframe `iframe` to top-level browsing context's active document's `body` 2. Let `iframeWindow` be the current value of `iframe.contentWindow`. 3. Remove `iframe` from `document` 4. Observe the returned value of `iframeWindow.parent` (it should be `null`) (Test case attached). Behavior observed in * Safari 10.0.3 (11602.4.8.0.1) * Webkit Nightly 10.0.3 (11602.4.8.0.1,
r213646
) [1]:
https://github.com/w3c/web-platform-tests/pull/5105
[2]:
https://html.spec.whatwg.org/#nested-browsing-contexts
[3]:
https://html.spec.whatwg.org/#the-iframe-element
Attachments
window.parent should be null after iframe removed
(544 bytes, text/html)
2017-03-10 07:44 PST
,
Lyza Gardner
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2024-01-10 13:38:25 PST
All browsers (Safari 17.2.1, Chrome Canary 122 and Firefox Nightly 123) show 'true', 'true' in console. Plus Safari Technology Preview 185 passes all tests:
https://wpt.fyi/results/html/browsers/windows/nested-browsing-contexts?label=master&label=experimental&aligned
= Marking this as 'RESOLVED CONFIGURATION CHANGED'.
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