[Webkit-unassigned] [Bug 169467] New: iframe `window.parent` should return null when iframe element removed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 10 07:44:43 PST 2017


            Bug ID: 169467
           Summary: iframe `window.parent` should return null when iframe
                    element removed
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Macintosh
                OS: OS X 10.11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Frames
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: lyza at lyza.com

Created attachment 304043
  --> https://bugs.webkit.org/attachment.cgi?id=304043&action=review
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.
* Webkit Nightly 10.0.3 (11602., 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

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170310/0751b276/attachment.html>

More information about the webkit-unassigned mailing list