Skip to content

Commit

Permalink
Merge branch 'main' into white-space-shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Apr 29, 2024
2 parents ffd8a16 + a1f8c19 commit 26c1e94
Show file tree
Hide file tree
Showing 37 changed files with 626 additions and 980 deletions.
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ keyboard-types = "0.6"
lazy_static = "1.4"
libc = "0.2"
log = "0.4"
malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2024-04-16", features = ["servo"] }
malloc_size_of = { git = "https://github.com/servo/stylo", rev = "6faedad67ac2e320b51ac72a165b0ceb52caf918", features = ["servo"] }
malloc_size_of_derive = "0.1"
mime = "0.3.13"
mime_guess = "2.0.3"
Expand All @@ -87,31 +87,31 @@ rustls = { version = "0.21.12", features = ["dangerous_configuration"] }
rustls-pemfile = "1.0.4"
script_layout_interface = { path = "components/shared/script_layout" }
script_traits = { path = "components/shared/script" }
selectors = { git = "https://github.com/servo/stylo", branch = "2024-04-16" }
selectors = { git = "https://github.com/servo/stylo", rev = "6faedad67ac2e320b51ac72a165b0ceb52caf918" }
serde = "1.0.198"
serde_bytes = "0.11"
serde_json = "1.0"
servo-media = { git = "https://github.com/servo/media" }
servo-media-dummy = { git = "https://github.com/servo/media" }
servo-media-gstreamer = { git = "https://github.com/servo/media" }
servo_arc = { git = "https://github.com/servo/stylo", branch = "2024-04-16" }
servo_atoms = { git = "https://github.com/servo/stylo", branch = "2024-04-16" }
size_of_test = { git = "https://github.com/servo/stylo", branch = "2024-04-16" }
servo_arc = { git = "https://github.com/servo/stylo", rev = "6faedad67ac2e320b51ac72a165b0ceb52caf918" }
servo_atoms = { git = "https://github.com/servo/stylo", rev = "6faedad67ac2e320b51ac72a165b0ceb52caf918" }
size_of_test = { git = "https://github.com/servo/stylo", rev = "6faedad67ac2e320b51ac72a165b0ceb52caf918" }
smallbitvec = "2.5.3"
smallvec = "1.13"
sparkle = "0.1.26"
string_cache = "0.8"
string_cache_codegen = "0.5"
style = { git = "https://github.com/servo/stylo", branch = "2024-04-16", features = ["servo"] }
style_config = { git = "https://github.com/servo/stylo", branch = "2024-04-16" }
style_traits = { git = "https://github.com/servo/stylo", branch = "2024-04-16", features = ["servo"] }
style = { git = "https://github.com/servo/stylo", rev = "6faedad67ac2e320b51ac72a165b0ceb52caf918", features = ["servo"] }
style_config = { git = "https://github.com/servo/stylo", rev = "6faedad67ac2e320b51ac72a165b0ceb52caf918" }
style_traits = { git = "https://github.com/servo/stylo", rev = "6faedad67ac2e320b51ac72a165b0ceb52caf918", features = ["servo"] }
# NOTE: the sm-angle feature only 2024-03-01rms!
surfman = { version = "0.9", features = ["chains", "sm-angle", "sm-angle-default"] }
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
synstructure = "0.13"
thin-vec = "0.2.13"
time = "0.1.41"
to_shmem = { git = "https://github.com/servo/stylo", branch = "2024-04-16" }
to_shmem = { git = "https://github.com/servo/stylo", rev = "6faedad67ac2e320b51ac72a165b0ceb52caf918" }
tokio = "1"
tokio-rustls = "0.24"
tungstenite = "0.20"
Expand Down
8 changes: 8 additions & 0 deletions components/compositing/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
},
)
.expect("Infallible with a new WebViewManager");
let msg = ConstellationMsg::WebViewOpened(top_level_browsing_context_id);
if let Err(e) = state.constellation_chan.send(msg) {
warn!("Sending event to constellation failed ({:?}).", e);
}
webviews
.show(top_level_browsing_context_id)
.expect("Infallible due to add");
Expand Down Expand Up @@ -1183,6 +1187,10 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
error!("{webview_id}: Creating webview that already exists");
return;
}
let msg = ConstellationMsg::WebViewOpened(top_level_browsing_context_id);
if let Err(e) = self.constellation_chan.send(msg) {
warn!("Sending event to constellation failed ({:?}).", e);
}
}

self.send_root_pipeline_display_list();
Expand Down
5 changes: 4 additions & 1 deletion components/compositing/windowing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ impl EmbedderCoordinates {
/// This should be used when drawing directly to the framebuffer with OpenGL commands.
pub fn flip_rect(&self, rect: &DeviceIntRect) -> DeviceIntRect {
let mut result = *rect;
result.min.y = self.framebuffer.height - result.min.y - result.size().height;
let min_y = self.framebuffer.height - result.max.y;
let max_y = self.framebuffer.height - result.min.y;
result.min.y = min_y;
result.max.y = max_y;
result
}

Expand Down
56 changes: 9 additions & 47 deletions components/constellation/constellation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,15 @@ where
FromCompositorMsg::NewWebView(url, top_level_browsing_context_id) => {
self.handle_new_top_level_browsing_context(url, top_level_browsing_context_id);
},
// A top level browsing context is created and opened in both constellation and
// compositor.
FromCompositorMsg::WebViewOpened(top_level_browsing_context_id) => {
let msg = (
Some(top_level_browsing_context_id),
EmbedderMsg::WebViewOpened(top_level_browsing_context_id),
);
self.embedder_proxy.send(msg);
},
// Close a top level browsing context.
FromCompositorMsg::CloseWebView(top_level_browsing_context_id) => {
self.handle_close_top_level_browsing_context(top_level_browsing_context_id);
Expand All @@ -1471,48 +1480,6 @@ where
}
self.handle_panic(top_level_browsing_context_id, error, None);
},
FromCompositorMsg::MoveResizeWebView(top_level_browsing_context_id, rect) => {
if self.webviews.get(top_level_browsing_context_id).is_none() {
return warn!(
"{}: MoveResizeWebView on unknown top-level browsing context",
top_level_browsing_context_id
);
}
self.compositor_proxy.send(CompositorMsg::MoveResizeWebView(
top_level_browsing_context_id,
rect,
));
},
FromCompositorMsg::ShowWebView(webview_id, hide_others) => {
if self.webviews.get(webview_id).is_none() {
return warn!(
"{}: ShowWebView on unknown top-level browsing context",
webview_id
);
}
self.compositor_proxy
.send(CompositorMsg::ShowWebView(webview_id, hide_others));
},
FromCompositorMsg::HideWebView(webview_id) => {
if self.webviews.get(webview_id).is_none() {
return warn!(
"{}: HideWebView on unknown top-level browsing context",
webview_id
);
}
self.compositor_proxy
.send(CompositorMsg::HideWebView(webview_id));
},
FromCompositorMsg::RaiseWebViewToTop(webview_id, hide_others) => {
if self.webviews.get(webview_id).is_none() {
return warn!(
"{}: RaiseWebViewToTop on unknown top-level browsing context",
webview_id
);
}
self.compositor_proxy
.send(CompositorMsg::RaiseWebViewToTop(webview_id, hide_others));
},
FromCompositorMsg::FocusWebView(top_level_browsing_context_id) => {
if self.webviews.get(top_level_browsing_context_id).is_none() {
return warn!("{top_level_browsing_context_id}: FocusWebView on unknown top-level browsing context");
Expand Down Expand Up @@ -2975,11 +2942,6 @@ where
) {
let window_size = self.window_size.initial_viewport;
let pipeline_id = PipelineId::new();
let msg = (
Some(top_level_browsing_context_id),
EmbedderMsg::WebViewOpened(top_level_browsing_context_id),
);
self.embedder_proxy.send(msg);
let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id);
let load_data = LoadData::new(
LoadOrigin::Constellation,
Expand Down
5 changes: 1 addition & 4 deletions components/constellation/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ mod from_compositor {
Self::Reload(..) => target!("Reload"),
Self::LogEntry(..) => target!("LogEntry"),
Self::NewWebView(..) => target!("NewWebView"),
Self::WebViewOpened(..) => target!("WebViewOpened"),
Self::CloseWebView(..) => target!("CloseWebView"),
Self::SendError(..) => target!("SendError"),
Self::MoveResizeWebView(..) => target!("MoveResizeWebView"),
Self::ShowWebView(..) => target!("ShowWebView"),
Self::HideWebView(..) => target!("HideWebView"),
Self::RaiseWebViewToTop(..) => target!("RaiseWebViewToTop"),
Self::FocusWebView(..) => target!("FocusWebView"),
Self::BlurWebView => target!("BlurWebView"),
Self::ForwardEvent(_, event) => event.log_target(),
Expand Down

0 comments on commit 26c1e94

Please sign in to comment.