Repository navigation
Conversation
|
Heads up! This PR modifies the following files:
|
| self.traverse_history(TraversalDirection::Forward(1)); | ||
| } | ||
|
|
||
| // https://html.spec.whatwg.org/multipage/#dom-history-pushtstae |
There was a problem hiding this comment.
This link seems to go nowhere? (also, it looks like it was manually written, given pushtsae instead of pushstate.
There was a problem hiding this comment.
Woops, yeah a typo it should be https://html.spec.whatwg.org/multipage/#dom-history-pushstate
16ad29a to
5cded23
Compare
|
☔ The latest upstream changes (presumably #13711) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Review status: 0 of 32 files reviewed at latest revision, 9 unresolved discussions, some commit checks failed. components/constellation/constellation.rs, line 221 at r14 (raw file):
Make this optional? components/constellation/constellation.rs, line 221 at r14 (raw file):
Rather than storing multiple components/constellation/constellation.rs, line 248 at r14 (raw file):
If we made the history state id optional, we'd get rid of the hard-coded state id. components/constellation/constellation.rs, line 269 at r14 (raw file):
We should be able to avoid cloning here, using components/constellation/constellation.rs, line 342 at r14 (raw file):
If we used a vector of pushed states, then each pipeline would only have one entry in the frame tree. components/constellation/constellation.rs, line 864 at r14 (raw file):
At some point, this would need the url and title? components/constellation/constellation.rs, line 1557 at r14 (raw file):
Add a warning? components/constellation/constellation.rs, line 2255 at r14 (raw file):
Oh good, distributed gc. At least I think we don't have to deal with cycles, as we can reclaim Frame objects when their iframe becomes detached from the DOM. Comments from Reviewable |
|
Reviewed 1 of 3 files at r8, 1 of 6 files at r10. components/script/dom/browsingcontext.rs, line 78 at r14 (raw file):
I think all we need to store is the hash map from Comments from Reviewable |
|
Reviewed 1 of 3 files at r1, 1 of 3 files at r8, 1 of 6 files at r10, 1 of 4 files at r12, 1 of 1 files at r13, 1 of 1 files at r14. components/script/dom/browsingcontext.rs, line 78 at r14 (raw file):
|
|
Reviewed 21 of 23 files at r11, 1 of 4 files at r12. tests/wpt/metadata/html/browsers/history/the-history-interface/005.html.ini, line 3 at r14 (raw file):
TIMEOUT? tests/wpt/metadata/html/browsers/history/the-history-interface/007.html.ini, line 10 at r14 (raw file):
Yay, passing tests! tests/wpt/metadata/html/browsers/history/the-history-interface/combination_history_004.html.ini, line 3 at r14 (raw file):
TIMEOUT? Comments from Reviewable |
|
Reviewed 2 of 23 files at r11. tests/wpt/metadata/html/browsers/history/the-history-interface/history_back.html.ini, line 3 at r14 (raw file):
TIMEOUT? Comments from Reviewable |
|
This is looking pretty good! The main question is whether to store a vector of pushed states or just a single pushed state in the constellation. Also, I'm not sure how we're handling the url and title? Review status: all files reviewed at latest revision, 14 unresolved discussions, some commit checks failed. Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 14 unresolved discussions, some commit checks failed. components/constellation/constellation.rs, line 221 at r14 (raw file):
|
|
Review status: all files reviewed at latest revision, 13 unresolved discussions, some commit checks failed. components/constellation/constellation.rs, line 221 at r14 (raw file):
|
5cded23 to
11ff2cc
Compare
|
Added popstate event, I still need to investigate the failures and see if its an issue with my implementation. |
|
☔ The latest upstream changes (presumably #13646) made this pull request unmergeable. Please resolve the merge conflicts. |
f0e7d97 to
6d7e5f2
Compare
|
Rebased. I enable 001 and 002 which were disabled due to #12580 and added them to the intermittent checker. I fixed which state value was turned and the test results look much better now. Review status: 1 of 40 files reviewed at latest revision, 13 unresolved discussions, some commit checks pending. components/constellation/constellation.rs, line 221 at r14 (raw file):
|
|
@bors-servo try |
[WIP] Implement History State <!-- Please describe your changes on the following line: --> This is a work in progress, I still need to figure out how to handle `title` and `url` in push/replace state as well as throwing the proper errors according to the spec. Also when the URL changes there needs to be a way to change the actual document url. @asajeffrey this is my first draft idea of how to handle history states, let me know what you think. r? @asajeffrey --- <!-- 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 - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/13781) <!-- Reviewable:end -->
|
💔 Test failed - windows-dev |
|
☔ The latest upstream changes (presumably #14473) made this pull request unmergeable. Please resolve the merge conflicts. |
3b2aa9b to
7f730c9
Compare
|
☔ The latest upstream changes (presumably #14698) made this pull request unmergeable. Please resolve the merge conflicts. |
Add HistoryStateId Added state id to browsing context add history state removal Updated test expectations fix tidy issues and remove document parameter fix spec link Add popstate event address review comments enable 001 and 002 history interface tests Add 001 and 002 to the intermittent check rebased. fix tidy issues Update test expectations rebase Store and set Url, compare FrameState during traversal
7f730c9 to
92bf862
Compare
| } | ||
|
|
||
| fn handle_history_state_pushed(&mut self, pipeline_id: PipelineId, state_id: HistoryStateId) { | ||
| if !self.pipeline_is_in_current_frame(pipeline_id) { |
There was a problem hiding this comment.
Might be worth doing this check after looking up the frame, to avoid looking up the frame twice.
| pub pipeline_id: PipelineId, | ||
|
|
||
| /// The id that maps to the history state entry in the script thread | ||
| pub state_id: HistoryStateId, |
There was a problem hiding this comment.
Is the state_id optional?
There was a problem hiding this comment.
I suppose we could make it optional and have the BC return null for history.state if the active state_id is None
| } | ||
|
|
||
| /// Add an entry representing a new history state. | ||
| pub fn push_state(&mut self, state_id: HistoryStateId) { |
There was a problem hiding this comment.
Shouldn't we also be pushing a URL?
| pub frame_id: FrameId, | ||
|
|
||
| /// The id that maps to the history state entry in the script thread | ||
| pub state_id: HistoryStateId, |
| pub fn replace_pipeline(&mut self, pipeline_id: PipelineId, url: ServoUrl) { | ||
| self.pipeline_id = Some(pipeline_id); | ||
| self.url = url; | ||
| self.state_id = HistoryStateId(0); |
| @@ -33,24 +44,38 @@ use std::cell::Cell; | |||
| pub struct BrowsingContext { | |||
There was a problem hiding this comment.
This data shouldn't be stored in the browsing context.
|
|
||
| active_state: Cell<HistoryStateId>, | ||
|
|
||
| next_state_id: Cell<HistoryStateId>, |
| state: HandleValue) { | ||
| let mut states = self.states.borrow_mut(); | ||
| states.insert(self.active_state.get(), HistoryState::new(Some(state), Some(title), url)); | ||
| // NOTE: We do not need to notify the constellation, as the history state id |
There was a problem hiding this comment.
Not sure about that, what if the document is discarded then reloaded? The constellation needs to know the new URL.
| self.states.borrow_mut().insert(next_id, HistoryState::new(Some(state), Some(title), url)); | ||
| self.active_state.set(next_id); | ||
|
|
||
| // Notify the constellation about this new entry so it can be added to the |
There was a problem hiding this comment.
Do we need to fire a mozbrowser event?
| }; | ||
|
|
||
| // 6.4 | ||
| if url.scheme() != document_url.scheme() || |
There was a problem hiding this comment.
Can use the url ranges to select everything up to the port?
| [history.length should update when setting location.hash] | ||
| expected: FAIL | ||
|
|
||
| [history.pushState must exist] |
| expected: FAIL | ||
|
|
||
| [replaceState should not actually load the new URL] | ||
| expected: FAIL |
There was a problem hiding this comment.
Can we get this to pass?
|
☔ The latest upstream changes (presumably #15133) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Superseded by #15261 |
This is a work in progress, I still need to figure out how to handle
titleandurlin push/replace state as well as throwing the proper errors according to the spec. Also when the URL changes there needs to be a way to change the actual document url.@asajeffrey this is my first draft idea of how to handle history states, let me know what you think.
r? @asajeffrey
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is