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

Removed root browsing context from constellation #17077

Merged

Conversation

Projects
None yet
6 participants
@asajeffrey
Copy link
Member

commented May 29, 2017

Removed the special root browsing context from the constellation.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #13994
  • These changes do not require tests because this isn't visible from user code

This change is Reviewable

@highfive

This comment has been minimized.

Copy link

commented May 29, 2017

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/document.rs, components/script_traits/script_msg.rs, components/script_traits/script_msg.rs
  • @KiChjang: components/script/dom/document.rs, components/script_traits/script_msg.rs, components/script_traits/script_msg.rs
@highfive

This comment has been minimized.

Copy link

commented May 29, 2017

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@asajeffrey

This comment has been minimized.

Copy link
Member Author

commented May 29, 2017

@highfive highfive assigned paulrouget and unassigned Manishearth May 29, 2017

@paulrouget

This comment has been minimized.

Copy link
Contributor

commented May 30, 2017

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.

@asajeffrey

This comment has been minimized.

Copy link
Member Author

commented May 30, 2017

Thanks! Let me know if there's anything else needed for a minimal one-window-but-multiple-tabs browser.

@paulrouget

This comment has been minimized.

Copy link
Contributor

commented May 31, 2017

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?

@paulrouget

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2017

@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:

  1. by-pass the compositor for non-compositor message. See my plan here: #15934 (comment)
  2. expose TopLevelBrowsingContext to embedder
  3. implement API to create and switch browsing context
  4. add a browsing context parameter to the WindowEvents (when it makes sense)
  5. update the visibility API status based on the active compositor pipeline tree

I got most of this working here: https://github.com/paulrouget/servo/tree/tabs (just prototyping, code is horrible).

@paulrouget

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2017

@asajeffrey don't you think we should clear IOCompositor::pipeline_details when the frame tree is set?

@asajeffrey

This comment has been minimized.

Copy link
Member Author

commented Jun 5, 2017

@highfive highfive assigned cbrewster and unassigned paulrouget Jun 5, 2017

@cbrewster
Copy link
Member

left a 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())

This comment has been minimized.

Copy link
@cbrewster

cbrewster Jun 5, 2017

Member

nit: .filter(BrowsingContext::is_top_level)

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Jun 6, 2017

Author Member

We wish. It's got the wrong type (&BrowsingContext vs BrowsingContext).

This comment has been minimized.

Copy link
@cbrewster

cbrewster Jun 7, 2017

Member

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);

This comment has been minimized.

Copy link
@cbrewster

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.

Copy link
@asajeffrey

asajeffrey Jun 6, 2017

Author Member

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);

This comment has been minimized.

Copy link
@cbrewster

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.

Copy link
@asajeffrey

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.

Copy link
@cbrewster

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.

Copy link
@asajeffrey

asajeffrey Jun 6, 2017

Author Member

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) {

This comment has been minimized.

Copy link
@cbrewster

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.

Copy link
@asajeffrey

asajeffrey Jun 6, 2017

Author Member

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 {

This comment has been minimized.

Copy link
@cbrewster

cbrewster Jun 5, 2017

Member

Yay one less item in this tuple!

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Jun 6, 2017

Author Member

Yay!

@asajeffrey
Copy link
Member Author

left a 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())

This comment has been minimized.

Copy link
@asajeffrey

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.

Copy link
@asajeffrey

asajeffrey Jun 6, 2017

Author Member

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);

This comment has been minimized.

Copy link
@asajeffrey

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.

Copy link
@asajeffrey

asajeffrey Jun 6, 2017

Author Member

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

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Jun 6, 2017

Author Member

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 {

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Jun 6, 2017

Author Member

Yay!

@cbrewster
Copy link
Member

left a comment

LGTM. squash and r=me

@asajeffrey asajeffrey force-pushed the asajeffrey:constellation-no-root-browsing-context branch from 8047f6a to 293c157 Jun 7, 2017

@asajeffrey asajeffrey force-pushed the asajeffrey:constellation-no-root-browsing-context branch from 11ad7cf to 86c09ac Jun 7, 2017

@asajeffrey

This comment has been minimized.

Copy link
Member Author

commented Jun 7, 2017

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2017

📌 Commit 86c09ac has been approved by cbrewster

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2017

⌛️ Testing commit 86c09ac with merge abb6ce3...

bors-servo added a commit that referenced this pull request Jun 7, 2017

Auto merge of #17077 - asajeffrey:constellation-no-root-browsing-cont…
…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 -->
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2017

💔 Test failed - linux-dev

@cbrewster

This comment has been minimized.

Copy link
Member

commented Jun 7, 2017

Checking files for tidiness...

./components/constellation/constellation.rs:2891: Line is longer than 120 characters
@asajeffrey

This comment has been minimized.

Copy link
Member Author

commented Jun 7, 2017

@asajeffrey asajeffrey force-pushed the asajeffrey:constellation-no-root-browsing-context branch from 86c09ac to 2fd925b Jun 8, 2017

@asajeffrey

This comment has been minimized.

Copy link
Member Author

commented Jun 8, 2017

@bors-servo r=cbrewster

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2017

📌 Commit 2fd925b has been approved by cbrewster

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2017

⌛️ Testing commit 2fd925b with merge caa8343...

bors-servo added a commit that referenced this pull request Jun 8, 2017

Auto merge of #17077 - asajeffrey:constellation-no-root-browsing-cont…
…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 -->
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Jun 8, 2017

@bors-servo bors-servo merged commit 2fd925b into servo:master Jun 8, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.