Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iframes always load with about:blank in history #14720

Closed
cbrewster opened this issue Dec 24, 2016 · 8 comments
Closed

Iframes always load with about:blank in history #14720

cbrewster opened this issue Dec 24, 2016 · 8 comments

Comments

@cbrewster
Copy link
Member

@cbrewster cbrewster commented Dec 24, 2016

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.

@cbrewster
Copy link
Member Author

@cbrewster cbrewster commented Dec 28, 2016

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.

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Dec 29, 2016

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

@cbrewster
Copy link
Member Author

@cbrewster cbrewster commented Dec 29, 2016

@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.

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Jan 1, 2017

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.

@cbrewster
Copy link
Member Author

@cbrewster cbrewster commented Jan 1, 2017

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

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Jan 1, 2017

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

@cbrewster
Copy link
Member Author

@cbrewster cbrewster commented Jan 1, 2017

@asajeffrey I believe so

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Jan 2, 2017

https://html.spec.whatwg.org/multipage/#process-the-iframe-attributes seems quite clear on that point; I don't understand where the confusion arises.

@cbrewster cbrewster mentioned this issue May 12, 2017
4 of 5 tasks complete
bors-servo added a commit that referenced this issue May 12, 2017
Replace initial about:blank on navigation

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14720 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo added a commit that referenced this issue May 17, 2017
…ffrey

Replace initial about:blank on navigation

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14720 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16848)
<!-- Reviewable:end -->
@cbrewster cbrewster mentioned this issue Apr 7, 2018
5 of 6 tasks complete
bors-servo added a commit that referenced this issue Apr 7, 2018
Replace initial about:blank loads

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14720 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20579)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Apr 11, 2018
Replace initial about:blank loads

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14720 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20579)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.