Repository navigation
cleanup embedder/compositor/constellation/script messages - #17425
Conversation
|
Heads up! This PR modifies the following files:
|
6b1a4b6 to
cff0a33
Compare
|
/cc @gterzian |
asajeffrey
left a comment
There was a problem hiding this comment.
Yay, this looks a lot better! The addition of TopLevelBrowserIds seems to have cleaned the code up a lot!
| self.on_key_event(ch, key, state, modifiers); | ||
| // FIXME(paul): this should be a message sent from embedder | ||
| // Steal a few key events for webrender debug options. | ||
| if modifiers.contains(CONTROL) && state == KeyState::Pressed { |
There was a problem hiding this comment.
It would be really nice if we didn't need this sort of hand-crafted code in servo itself, can we find a way to move it into the embedding app?
| fn handle_request(&mut self) { | ||
| enum Request { | ||
| Script(FromScriptMsg), | ||
| Script((PipelineId, FromScriptMsg)), |
There was a problem hiding this comment.
Nit: Script(PipelineId, FromScriptMsg) rather than Script((PipelineId, FromScriptMsg))?
There was a problem hiding this comment.
This is not consistent with NetworkListener. Also, it's going to make the following select map a bit more complex.
|
Thank you. I'll go ahead and finalize this PR and then ask for a formal review. |
cff0a33 to
5bca2c7
Compare
|
@gterzian can you give me an informal review of this PR? I'd like to get your input before asking for a review to Alan. |
|
I still need to figure out what to do in Also, I'd very much like to rename |
45676b0 to
983dc5d
Compare
|
@paulrouget Ok here are my comments. Have you considered:
Those proposals could seen as candidates to replace the current dance taking place in By the way this is a good example of why it could be useful for Servo to handle |
Agreed.
Agreed.
I don't think we want servo to have the ability to create new browsers. What we want is Servo to tell the embedder to handle a new url, and then up to the embedder to create a new browser. To get the browser_id back, we would use this mechanism instead:
What do you think?
Ok
This should actually disappear.
Let's not use a callback for this but an IpcSender as I suggested earlier. Because we want to know which browser_id correspond to which NewBrowser request. Think about this case: send(NewBrowser(url1));
send(NewBrowser(url2));
…
fn new_browser_created(browser_id) {
// here we don't know which browser_id correspond to request number 1 and request number 2.
}
I think that's already the case, isn't it?
I think we should at least use WindowEvents instead of new |
Yes makes sense.
Ok I see, so servo would ask the embedder to "handle a url", to which the embedder could respond by sending a
Yes it's the case, although it's servo that calls it's own |
983dc5d to
72ac293
Compare
|
@gterzian Can you take a look at the 2 last commits? Using |
72ac293 to
5e4e948
Compare
|
I see. Perhaps some of the cumbersomeness can be removed later by finding a way to get rid of the initial |
|
Maybe one way to get rid of the initial |
|
I guess |
5e4e948 to
fd3dbad
Compare
|
We'll see later about the cosmetic changes. As for now, I'll keep your initial suggestion and use an event. For consistency. Later, we will take the time to re-consider the decision to use messages for embedder -> libservo communication, and callbacks for libservo -> embedder communication. |
59bead6 to
9e568f2
Compare
c5cd31f to
94184f4
Compare
8e0b67a to
7490396
Compare
7490396 to
10b5266
Compare
|
I made 2 changes:
|
|
@bors-servo r=asajeffrey |
|
📌 Commit 10b5266 has been approved by |
cleanup embedder/compositor/constellation/script messages Fix: #17226 #17200 #17201 This is work in progress. Some tests still fail. I'd like to get early feedback as it's a pretty large PR. There is nothing fundamentally new. Basically, I added TopLevelBrowsingContrextId to the relevant messages between the embedder, the compositor and the constellation, and enforced the PipelineId to be attached to each ScriptMsg (see #17201). I unaliased all the ScriptMsg. It was getting difficult to understand the nature of the message as ScriptMsg was used aliased CompositorMsg sometimes (CompositorMsg is an actually type of message already). I renamed constellation_chan to script_to_constellation_chan, again, for clarification. This cleanup code is necessary for #15934 and for tabs support. /cc @asajeffrey can I ask you to look at this? No need for a formal review, I need feedback at this stage. <!-- 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/17425) <!-- 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 |
make sure proper frame tree is sent when iframes change We ran into a hittest issue because the frame tree was not correctly updated after #17425. The frame tree should be updated on tab change (via send_frame_tree) or when the frame sub tree changes and it's the active one (via update_frame_tree_if_active). --- <!-- 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 #18101 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/18149) <!-- Reviewable:end -->
Fix: #17226 #17200 #17201
This is work in progress. Some tests still fail.
I'd like to get early feedback as it's a pretty large PR.
There is nothing fundamentally new. Basically, I added TopLevelBrowsingContrextId to the relevant messages between the embedder, the compositor and the constellation, and enforced the PipelineId to be attached to each ScriptMsg (see #17201).
I unaliased all the ScriptMsg. It was getting difficult to understand the nature of the message as ScriptMsg was used aliased CompositorMsg sometimes (CompositorMsg is an actually type of message already). I renamed constellation_chan to script_to_constellation_chan, again, for clarification.
This cleanup code is necessary for #15934 and for tabs support.
/cc @asajeffrey can I ask you to look at this? No need for a formal review, I need feedback at this stage.
This change is