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
Removed root browsing context from constellation #17077
Removed root browsing context from constellation #17077
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: .filter(BrowsingContext::is_top_level)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wish. It's got the wrong type (&BrowsingContext
vs BrowsingContext
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tis a shame
.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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values are only used in the None
branch of the match, can we move them there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay one less item in this tuple!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. squash and r=me
8047f6a
to
293c157
Compare
11ad7cf
to
86c09ac
Compare
IRC conversation with @cbrewster: http://logs.glob.uno/?c=mozilla%23servo&s=7+Jun+2017&e=7+Jun+2017#c691847 @bors-servo r=cbrewster |
📌 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 -d
does not report any errors./mach test-tidy
does not report any errorsThis change is