Removed root browsing context from constellation#17077
Removed root browsing context from constellation#17077bors-servo merged 1 commit intoservo:masterfrom
Conversation
|
r? @paulrouget |
|
I'm looking at this. It will take me a day or two. I'd like to see how close we are to support tabs with this. |
|
Thanks! Let me know if there's anything else needed for a minimal one-window-but-multiple-tabs browser. |
|
So now, if I'm not mistaken, the compositor has a pipeline tree while the constellation has a pipeline forest. That means the compositor will get plenty of messages from or for pipeline it doesn't know about. I think it brings us back to #15934 (Create a dedicated channel for constellation -> embedder communication). Can we land support for multiple browsing contexts without fixing #15934 first? |
|
@asajeffrey I managed to get tabs working. Thank you! The only issue is what I mentioned in my previous comment, but I will take care of that later. r=me, but you need a proper review though (I'm not a reviewer). Once this has landed, this is what I will work on:
I got most of this working here: https://github.com/paulrouget/servo/tree/tabs (just prototyping, code is horrible). |
|
@asajeffrey don't you think we should clear |
|
r? @cbrewster |
cbrewster
left a comment
There was a problem hiding this comment.
Looks good other than a couple nits/questions!
| self.close_browsing_context(root_browsing_context_id, ExitPipelineMode::Normal); | ||
| // Close the top-level browsing contexts | ||
| let top_level_browsing_context_ids: Vec<TopLevelBrowsingContextId> = self.browsing_contexts.values() | ||
| .filter(|browsing_context| browsing_context.is_top_level()) |
There was a problem hiding this comment.
nit: .filter(BrowsingContext::is_top_level)
There was a problem hiding this comment.
We wish. It's got the wrong type (&BrowsingContext vs BrowsingContext).
| .collect(); | ||
| for top_level_browsing_context_id in top_level_browsing_context_ids { | ||
| debug!("Removing top-level browsing context {}.", top_level_browsing_context_id); | ||
| let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); |
There was a problem hiding this comment.
If we know the browsing contexts are top level, can't we just get their id rather than the top_level_id to avoid this conversion?
| }; | ||
|
|
||
| // Create the new pipeline, attached to the parent and push to pending changes | ||
| self.handle_load_start_msg(load_info.info.new_pipeline_id); |
There was a problem hiding this comment.
If we need to be calling self.handle_load_start_msg before we push a pending change, it might make sense to add a new method for adding pending changes that way we don't forget to call self.handle_load_start_msg.
This could be saved for another PR since it isn't directly related to these changes. Possible E-Easy.
There was a problem hiding this comment.
Yes, there's quite a bit of boilerplate we could DRY. This should be a separate PR though. Not sure anything in the constellation is E-Easy :)
| self.handle_send_error(parent_pipeline_id, e); | ||
| } | ||
| Some(source_id) | ||
| None |
There was a problem hiding this comment.
I'm not very familiar with webdriver, but its the only user of the pipeline id returned from this method. Does this change break anything there?
There was a problem hiding this comment.
Er, I don't think so. webdriver isn't very tested though :/
| return None; | ||
| } | ||
| }; | ||
| let (top_level_id, window_size, timestamp) = match self.browsing_contexts.get(&browsing_context_id) { |
There was a problem hiding this comment.
These values are only used in the None branch of the match, can we move them there?
| let (evicted_id, new_context, navigated, location_changed) = if let Some(instant) = change.replace_instant { | ||
| let url = change.load_data.url.clone(); | ||
|
|
||
| let (evicted_id, new_context, navigated) = if let Some(instant) = change.replace_instant { |
There was a problem hiding this comment.
Yay one less item in this tuple!
asajeffrey
left a comment
There was a problem hiding this comment.
Pushed changes.
| self.close_browsing_context(root_browsing_context_id, ExitPipelineMode::Normal); | ||
| // Close the top-level browsing contexts | ||
| let top_level_browsing_context_ids: Vec<TopLevelBrowsingContextId> = self.browsing_contexts.values() | ||
| .filter(|browsing_context| browsing_context.is_top_level()) |
There was a problem hiding this comment.
We wish. It's got the wrong type (&BrowsingContext vs BrowsingContext).
| .collect(); | ||
| for top_level_browsing_context_id in top_level_browsing_context_ids { | ||
| debug!("Removing top-level browsing context {}.", top_level_browsing_context_id); | ||
| let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); |
| }; | ||
|
|
||
| // Create the new pipeline, attached to the parent and push to pending changes | ||
| self.handle_load_start_msg(load_info.info.new_pipeline_id); |
There was a problem hiding this comment.
Yes, there's quite a bit of boilerplate we could DRY. This should be a separate PR though. Not sure anything in the constellation is E-Easy :)
| return None; | ||
| } | ||
| }; | ||
| let (top_level_id, window_size, timestamp) = match self.browsing_contexts.get(&browsing_context_id) { |
| self.handle_send_error(parent_pipeline_id, e); | ||
| } | ||
| Some(source_id) | ||
| None |
There was a problem hiding this comment.
Er, I don't think so. webdriver isn't very tested though :/
| let (evicted_id, new_context, navigated, location_changed) = if let Some(instant) = change.replace_instant { | ||
| let url = change.load_data.url.clone(); | ||
|
|
||
| let (evicted_id, new_context, navigated) = if let Some(instant) = change.replace_instant { |
8047f6a to
293c157
Compare
11ad7cf to
86c09ac
Compare
|
📌 Commit 86c09ac has been approved by |
…ext, r=cbrewster Removed root browsing context from constellation <!-- Please describe your changes on the following line: --> Removed the special root browsing context from the constellation. --- <!-- 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 #13994 - [X] These changes do not require tests because this isn't visible from user code <!-- 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/17077) <!-- Reviewable:end -->
|
💔 Test failed - linux-dev |
|
|
Oh for pity's sake...
|
86c09ac to
2fd925b
Compare
|
@bors-servo r=cbrewster |
|
📌 Commit 2fd925b has been approved by |
…ext, r=cbrewster Removed root browsing context from constellation <!-- Please describe your changes on the following line: --> Removed the special root browsing context from the constellation. --- <!-- 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 #13994 - [X] These changes do not require tests because this isn't visible from user code <!-- 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/17077) <!-- Reviewable:end -->
|
☀️ 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 |
Removed the special root browsing context from the constellation.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is