Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRemoved root browsing context from constellation #17077
Conversation
highfive
commented
May 29, 2017
highfive
commented
May 29, 2017
|
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 |
|
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()) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Jun 6, 2017
Author
Member
We wish. It's got the wrong type (&BrowsingContext vs BrowsingContext).
This comment has been minimized.
This comment has been minimized.
| .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); |
This comment has been minimized.
This comment has been minimized.
cbrewster
Jun 5, 2017
Member
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?
This comment has been minimized.
This comment has been minimized.
| @@ -1495,6 +1490,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> | |||
| }; | |||
|
|
|||
| // Create the new pipeline, attached to the parent and push to pending changes | |||
| self.handle_load_start_msg(load_info.info.new_pipeline_id); | |||
This comment has been minimized.
This comment has been minimized.
cbrewster
Jun 5, 2017
Member
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.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Jun 6, 2017
Author
Member
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 :)
| @@ -1680,14 +1682,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> | |||
| if let Err(e) = result { | |||
| self.handle_send_error(parent_pipeline_id, e); | |||
| } | |||
| Some(source_id) | |||
| None | |||
This comment has been minimized.
This comment has been minimized.
cbrewster
Jun 5, 2017
Member
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?
This comment has been minimized.
This comment has been minimized.
| return None; | ||
| } | ||
| }; | ||
| let (top_level_id, window_size, timestamp) = match self.browsing_contexts.get(&browsing_context_id) { |
This comment has been minimized.
This comment has been minimized.
cbrewster
Jun 5, 2017
Member
These values are only used in the None branch of the match, can we move them there?
This comment has been minimized.
This comment has been minimized.
| 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 { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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()) |
This comment has been minimized.
This comment has been minimized.
asajeffrey
Jun 6, 2017
Author
Member
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); |
This comment has been minimized.
This comment has been minimized.
| @@ -1495,6 +1490,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> | |||
| }; | |||
|
|
|||
| // Create the new pipeline, attached to the parent and push to pending changes | |||
| self.handle_load_start_msg(load_info.info.new_pipeline_id); | |||
This comment has been minimized.
This comment has been minimized.
asajeffrey
Jun 6, 2017
Author
Member
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) { |
This comment has been minimized.
This comment has been minimized.
| @@ -1680,14 +1682,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> | |||
| if let Err(e) = result { | |||
| self.handle_send_error(parent_pipeline_id, e); | |||
| } | |||
| Some(source_id) | |||
| None | |||
This comment has been minimized.
This comment has been minimized.
| 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 { |
This comment has been minimized.
This comment has been minimized.
|
LGTM. squash and r=me |
8047f6a
to
293c157
11ad7cf
to
86c09ac
|
IRC conversation with @cbrewster: http://logs.glob.uno/?c=mozilla%23servo&s=7+Jun+2017&e=7+Jun+2017#c691847 @bors-servo r=cbrewster |
|
|
…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 -->
|
|
|
|
Oh for pity's sake...
|
86c09ac
to
2fd925b
|
@bors-servo r=cbrewster |
|
|
…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 -->
|
|
asajeffrey commentedMay 29, 2017
•
edited by nox
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