Merge branch 'master' into master

This commit is contained in:
sagu 2021-03-15 07:04:48 +01:00 committed by GitHub
commit b0b2acb8f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
173 changed files with 3833 additions and 2289 deletions

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#![allow(unused_imports)]
#[macro_use]
extern crate lazy_static;
@ -127,6 +129,8 @@ fn test_hang_monitoring() {
}
#[test]
// https://github.com/servo/servo/issues/28270
#[cfg(not(target_os = "windows"))]
fn test_hang_monitoring_unregister() {
let _lock = SERIAL.lock().unwrap();
@ -161,6 +165,8 @@ fn test_hang_monitoring_unregister() {
}
#[test]
// https://github.com/servo/servo/issues/28270
#[cfg(not(target_os = "windows"))]
fn test_hang_monitoring_exit_signal() {
let _lock = SERIAL.lock().unwrap();

View file

@ -40,8 +40,8 @@ sparkle = "0.1.25"
style = { path = "../style" }
style_traits = { path = "../style_traits" }
# NOTE: the sm-angle feature only enables angle on windows, not other platforms!
surfman = { version = "0.3", features = ["sm-angle","sm-angle-default"] }
surfman-chains = "0.5"
surfman = { version = "0.4", features = ["sm-angle","sm-angle-default"] }
surfman-chains = "0.6"
surfman-chains-api = "0.2"
time = { version = "0.1.0", optional = true }
webrender = { git = "https://github.com/servo/webrender" }

View file

@ -835,7 +835,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
}
}
pub fn on_resize_window_event(&mut self) {
pub fn on_resize_window_event(&mut self) -> bool {
debug!("compositor resize requested");
let old_coords = self.embedder_coordinates;
@ -847,11 +847,12 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
}
if self.embedder_coordinates.viewport == old_coords.viewport {
return;
return false;
}
self.send_window_size(WindowSizeType::Resize);
self.composite_if_necessary(CompositingReason::Resize);
return true;
}
pub fn on_mouse_window_event_class(&mut self, mouse_window_event: MouseWindowEvent) {

View file

@ -210,7 +210,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
/// All structs containing #[unrooted_must_root_lint::must_root] types
/// must be #[unrooted_must_root_lint::must_root] themselves
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item) {
if has_lint_attr(&self.symbols, &item.attrs, self.symbols.must_root) {
let attrs = cx.tcx.hir().attrs(item.hir_id());
if has_lint_attr(&self.symbols, &attrs, self.symbols.must_root) {
return;
}
if let hir::ItemKind::Struct(def, ..) = &item.kind {
@ -235,7 +236,8 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
fn check_variant(&mut self, cx: &LateContext, var: &hir::Variant) {
let ref map = cx.tcx.hir();
let parent_item = map.expect_item(map.get_parent_item(var.id));
if !has_lint_attr(&self.symbols, &parent_item.attrs, self.symbols.must_root) {
let attrs = cx.tcx.hir().attrs(parent_item.hir_id());
if !has_lint_attr(&self.symbols, &attrs, self.symbols.must_root) {
match var.data {
hir::VariantData::Tuple(fields, ..) => {
for field in fields {
@ -268,10 +270,10 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
id: HirId,
) {
let in_new_function = match kind {
visit::FnKind::ItemFn(n, _, _, _, _) | visit::FnKind::Method(n, _, _, _) => {
visit::FnKind::ItemFn(n, _, _, _) | visit::FnKind::Method(n, _, _) => {
&*n.as_str() == "new" || n.as_str().starts_with("new_")
},
visit::FnKind::Closure(_) => return,
visit::FnKind::Closure => return,
};
if !in_derive_expn(span) {

View file

@ -78,7 +78,7 @@ servo_url = { path = "../url" }
sparkle = "0.1"
style = { path = "../style", features = ["servo"] }
style_traits = { path = "../style_traits", features = ["servo"] }
surfman = "0.3"
surfman = "0.4"
webdriver_server = { path = "../webdriver_server", optional = true }
webgpu = { path = "../webgpu" }
webrender = { git = "https://github.com/servo/webrender" }

View file

@ -549,7 +549,7 @@ where
}
}
fn handle_window_event(&mut self, event: WindowEvent) {
fn handle_window_event(&mut self, event: WindowEvent) -> bool {
match event {
WindowEvent::Idle => {},
@ -558,7 +558,7 @@ where
},
WindowEvent::Resize => {
self.compositor.on_resize_window_event();
return self.compositor.on_resize_window_event();
},
WindowEvent::AllowNavigationResponse(pipeline_id, allowed) => {
@ -745,6 +745,7 @@ where
}
},
}
return false;
}
fn receive_messages(&mut self) {
@ -776,18 +777,20 @@ where
::std::mem::replace(&mut self.embedder_events, Vec::new())
}
pub fn handle_events(&mut self, events: Vec<WindowEvent>) {
pub fn handle_events(&mut self, events: Vec<WindowEvent>) -> bool {
if self.compositor.receive_messages() {
self.receive_messages();
}
let mut need_resize = false;
for event in events {
self.handle_window_event(event);
need_resize |= self.handle_window_event(event);
}
if self.compositor.shutdown_state != ShutdownState::FinishedShuttingDown {
self.compositor.perform_updates();
} else {
self.embedder_events.push((None, EmbedderMsg::Shutdown));
}
need_resize
}
pub fn repaint_synchronously(&mut self) {

View file

@ -12,6 +12,6 @@ path = "lib.rs"
[dependencies]
euclid = "0.20"
surfman = "0.3"
surfman-chains = "0.5"
surfman = "0.4"
surfman-chains = "0.6"