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

Session history fixup #20629

Merged
merged 1 commit into from
Apr 12, 2018
Merged

Conversation

cbrewster
Copy link
Contributor

@cbrewster cbrewster commented Apr 12, 2018

When a browsing context was removed, its entries were not removed from the joint session history.
The embedder should be notified that the history changed after a navigation matures.


  • ./mach build -d does not report any errors
  • ./mach build-geckolib does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #__ (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @asajeffrey: components/constellation/constellation.rs, components/constellation/session_history.rs
  • @paulrouget: components/constellation/constellation.rs, components/constellation/session_history.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 12, 2018
@cbrewster
Copy link
Contributor Author

r? @asajeffrey

@servo-wpt-sync
Copy link
Collaborator

Opened new PR for upstreamable changes.

Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#50.

@servo-wpt-sync
Copy link
Collaborator

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#50.

@servo-wpt-sync
Copy link
Collaborator

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#50.

@servo-wpt-sync
Copy link
Collaborator

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#50.

Copy link
Member

@asajeffrey asajeffrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

{
let session_history = self.get_joint_session_history(browsing_context.top_level_id);
session_history.remove_entries_for_browsing_context(browsing_context_id);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is interesting. Does this mean we're now eagerly removing entries from the session history, so the changes to history.length will be immediately visible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

assert_equals(old_history_len + 1, history.length);
document.body.removeChild(document.getElementById("frame"));
assert_equals(old_history_len, history.length);
t.done();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good test! Have you tried on other browsers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works in Firefox; fails in Chrome and Safari.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's interesting. I'm pretty sure this is a spec-compliant test.

@asajeffrey asajeffrey added S-needs-squash Some (or all) of the commits in the PR should be combined. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 12, 2018
@asajeffrey
Copy link
Member

Squash and r=me.

Notify history changed after a navigation

Add history drop test
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 12, 2018
@servo-wpt-sync
Copy link
Collaborator

Transplanted upstreamable changes to existing PR.

Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#50.

@cbrewster
Copy link
Contributor Author

@bors-servo r=asajeffrey

@bors-servo
Copy link
Contributor

📌 Commit 787ec4b has been approved by asajeffrey

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-squash Some (or all) of the commits in the PR should be combined. labels Apr 12, 2018
@bors-servo
Copy link
Contributor

⌛ Testing commit 787ec4b with merge e4472f7...

bors-servo pushed a commit that referenced this pull request Apr 12, 2018
Session history fixup

<!-- Please describe your changes on the following line: -->
When a browsing context was removed, its entries were not removed from the joint session history.
The embedder should be notified that the history changed after a navigation matures.

---
<!-- 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
- [ ] These changes fix #__ (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/20629)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel-css

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Apr 12, 2018
@cbrewster
Copy link
Contributor Author

@bors-servo retry
I think this is intermittent, it passes locally.

@bors-servo
Copy link
Contributor

⚡ Previous build results for android, arm32, arm64, linux-dev, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev are reusable. Rebuilding only linux-rel-css...

@bors-servo
Copy link
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: asajeffrey
Pushing e4472f7 to master...

@bors-servo bors-servo merged commit 787ec4b into servo:master Apr 12, 2018
@cbrewster cbrewster deleted the session_history_fixup branch April 13, 2018 15:29
nox pushed a commit to web-platform-tests/wpt that referenced this pull request Apr 19, 2018
Notify history changed after a navigation

Add history drop test

Upstreamed from servo/servo#20629 [ci skip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-tests-failed The changes caused existing tests to fail.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants