Skip to content

Iframes always load with about:blank in history #14720

Closed

Description

@cbrewster

If the iframe has a src attribute, once the website loads in the iframe, the about:blank should be replaced in the session history.

https://html.spec.whatwg.org/multipage/embedded-content.html#process-the-iframe-attributes

Similarly, if the nested browsing context's session history contained only one Document when the process the iframe attributes algorithm was invoked, and that was the about:blank Document created when the nested browsing context was created, then any navigation required of the user agent in that algorithm must be completed with replacement enabled.

Sample:

iframe.html:

<iframe src="https://www.servo.org"></iframe>
/mach run -d iframe.html

Traverse the history backwards using the keyboard shortcut and the iframe will traverse back to about:blank.

Activity

  1. added
    A-constellation
    A-content/dom
    on Dec 24, 2016
  2. cbrewster commented on Dec 28, 2016

    @cbrewster
    ContributorAuthor

    cc @asajeffrey
    One solution is to wait until Urls are stored in FrameState and then when an iframe is loading a new Url, check the Frame prev see if it has a single entry with the url about:blank, if so, enable replacement.

  3. Ms2ger commented on Dec 29, 2016

    @Ms2ger
    Contributor

    Not sure that's quite enough; we might need to store the "is initial about:blank document" flag.

  4. cbrewster commented on Dec 29, 2016

    @cbrewster
    ContributorAuthor

    @Ms2ger you're right, otherwise subsequent about:blank loads would be replaced as well. I think we could store this flag on the Frame itself.

  5. asajeffrey commented on Jan 1, 2017

    @asajeffrey
    Contributor

    We could check to see if the old URL is about: blank and prev is empty? Not sure what is meant to happen if the iframe "really" contains about: blank.

  6. cbrewster commented on Jan 1, 2017

    @cbrewster
    ContributorAuthor

    If it "really" contains about:blank it just does a normal navigation without replacement enabled

  7. asajeffrey commented on Jan 1, 2017

    @asajeffrey
    Contributor

    So an iframe which starts with src=about:blank is treated differently from one which starts with no src?

  8. cbrewster commented on Jan 1, 2017

    @cbrewster
    ContributorAuthor

    @asajeffrey I believe so

  9. Ms2ger commented on Jan 2, 2017

    @Ms2ger
    Contributor
  10. added 2 commits that reference this issue on May 12, 2017
    171cb09
    beeb5c2
  11. added 2 commits that reference this issue on Apr 7, 2018
    6fac5b8
    ae117be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-constellationA-content/dom

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions