diff options
35 files changed, 75 insertions, 116 deletions
diff --git a/components/compositing/build.rs b/components/compositing/build.rs index d8a6d73163e..3fe277ca541 100644 --- a/components/compositing/build.rs +++ b/components/compositing/build.rs @@ -47,6 +47,6 @@ fn main() { _ => panic!("Cannot find package definitions in lockfile"), } }, - Err(e) => panic!(e), + Err(e) => panic!("{}", e), } } diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 53889d6e944..6aa69af70d6 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -141,9 +141,6 @@ pub struct IOCompositor<Window: WindowMethods + ?Sized> { /// the compositor. pub shutdown_state: ShutdownState, - /// Tracks the last composite time. - last_composite_time: u64, - /// Tracks whether the zoom action has happened recently. zoom_action: bool, @@ -320,7 +317,6 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { frame_tree_id: FrameTreeId(0), constellation_chan: state.constellation_chan, time_profiler_chan: state.time_profiler_chan, - last_composite_time: 0, ready_to_save_state: ReadyState::Unknown, webrender: state.webrender, webrender_document: state.webrender_document, @@ -1580,8 +1576,6 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { warn!("Failed to present surface: {:?}", err); } - self.last_composite_time = precise_time_ns(); - self.composition_request = CompositionRequest::NoCompositingNecessary; self.process_animations(); diff --git a/components/config/pref_util.rs b/components/config/pref_util.rs index ba4dd78f6e8..07b623372f8 100644 --- a/components/config/pref_util.rs +++ b/components/config/pref_util.rs @@ -113,12 +113,7 @@ macro_rules! impl_from_pref { if let $variant(value) = other { value.into() } else { - panic!( - format!("Cannot convert {:?} to {:?}", - other, - std::any::type_name::<$t>() - ) - ); + panic!("Cannot convert {:?} to {:?}", other, std::any::type_name::<$t>()) } } } diff --git a/components/config_plugins/lib.rs b/components/config_plugins/lib.rs index 943a5ffc99c..1618637ce8b 100644 --- a/components/config_plugins/lib.rs +++ b/components/config_plugins/lib.rs @@ -132,12 +132,14 @@ impl Build { .get_field_name_mapping() .map(|pref_attr| pref_attr.value()) .unwrap_or_else(|| { - path_stack - .iter() - .chain(iter::once(&field.name)) - .map(Ident::to_string) - .intersperse(String::from(".")) - .collect() + Itertools::intersperse( + path_stack + .iter() + .chain(iter::once(&field.name)) + .map(Ident::to_string), + String::from("."), + ) + .collect() }) } diff --git a/components/devtools/actors/framerate.rs b/components/devtools/actors/framerate.rs index 6203be2c57e..e57def1eea9 100644 --- a/components/devtools/actors/framerate.rs +++ b/components/devtools/actors/framerate.rs @@ -11,13 +11,12 @@ use msg::constellation_msg::PipelineId; use serde_json::{Map, Value}; use std::mem; use std::net::TcpStream; -use time::precise_time_ns; pub struct FramerateActor { name: String, pipeline: PipelineId, script_sender: IpcSender<DevtoolScriptControlMsg>, - start_time: Option<u64>, + is_recording: bool, ticks: Vec<HighResolutionStamp>, } @@ -51,7 +50,6 @@ impl FramerateActor { name: actor_name.clone(), pipeline: pipeline_id, script_sender: script_sender, - start_time: None, is_recording: false, ticks: Vec::new(), }; @@ -79,7 +77,6 @@ impl FramerateActor { return; } - self.start_time = Some(precise_time_ns()); self.is_recording = true; let msg = DevtoolScriptControlMsg::RequestAnimationFrame(self.pipeline, self.name()); @@ -91,7 +88,6 @@ impl FramerateActor { return; } self.is_recording = false; - self.start_time = None; } } diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs index d2eac788c60..30afb676056 100644 --- a/components/layout/table_wrapper.rs +++ b/components/layout/table_wrapper.rs @@ -157,7 +157,7 @@ impl TableWrapperFlow { .zip(guesses.iter()) { intermediate_column_inline_size.size = guess.calculate(selection); - intermediate_column_inline_size.percentage = 0.0; + // intermediate_column_inline_size.percentage = 0.0; total_used_inline_size = total_used_inline_size + intermediate_column_inline_size.size } @@ -382,7 +382,7 @@ impl Flow for TableWrapperFlow { .map( |column_intrinsic_inline_size| IntermediateColumnInlineSize { size: column_intrinsic_inline_size.minimum_length, - percentage: column_intrinsic_inline_size.percentage, + // percentage: column_intrinsic_inline_size.percentage, }, ) .collect::<Vec<_>>(); @@ -822,7 +822,9 @@ impl ExcessInlineSizeDistributionInfo { /// An intermediate column size assignment. struct IntermediateColumnInlineSize { size: Au, - percentage: f32, + // This used to be stored here but nothing used it, + // which started emitting a compiler warning: https://github.com/servo/servo/pull/28202 + // percentage: f32, } /// Returns the computed inline size of the table wrapper represented by `block`. diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 7cb926f10a4..74deb9fb907 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -189,9 +189,6 @@ pub struct LayoutThread { /// The root of the flow tree. root_flow: RefCell<Option<FlowRef>>, - /// The document-specific shared lock used for author-origin stylesheets - document_shared_lock: Option<SharedRwLock>, - /// A counter for epoch messages epoch: Cell<Epoch>, @@ -543,7 +540,6 @@ impl LayoutThread { generation: Cell::new(0), outstanding_web_fonts: Arc::new(AtomicUsize::new(0)), root_flow: RefCell::new(None), - document_shared_lock: None, // Epoch starts at 1 because of the initial display list for epoch 0 that we send to WR epoch: Cell::new(Epoch(1)), viewport_size: Size2D::new(Au(0), Au(0)), @@ -1261,7 +1257,6 @@ impl LayoutThread { // Calculate the actual viewport as per DEVICE-ADAPT § 6 // If the entire flow tree is invalid, then it will be reflowed anyhow. let document_shared_lock = document.style_shared_lock(); - self.document_shared_lock = Some(document_shared_lock.clone()); let author_guard = document_shared_lock.read(); let ua_stylesheets = &*UA_STYLESHEETS; diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs index ce23c087056..41ceddc5d44 100644 --- a/components/layout_thread_2020/lib.rs +++ b/components/layout_thread_2020/lib.rs @@ -167,9 +167,6 @@ pub struct LayoutThread { /// The fragment tree. fragment_tree: RefCell<Option<Arc<FragmentTree>>>, - /// The document-specific shared lock used for author-origin stylesheets - document_shared_lock: Option<SharedRwLock>, - /// A counter for epoch messages epoch: Cell<Epoch>, @@ -510,7 +507,6 @@ impl LayoutThread { outstanding_web_fonts: Arc::new(AtomicUsize::new(0)), box_tree: Default::default(), fragment_tree: Default::default(), - document_shared_lock: None, // Epoch starts at 1 because of the initial display list for epoch 0 that we send to WR epoch: Cell::new(Epoch(1)), viewport_size: Size2D::new(Au(0), Au(0)), @@ -947,7 +943,6 @@ impl LayoutThread { // Calculate the actual viewport as per DEVICE-ADAPT § 6 // If the entire flow tree is invalid, then it will be reflowed anyhow. let document_shared_lock = document.style_shared_lock(); - self.document_shared_lock = Some(document_shared_lock.clone()); let author_guard = document_shared_lock.read(); let ua_stylesheets = &*UA_STYLESHEETS; diff --git a/components/net/tests/data_loader.rs b/components/net/tests/data_loader.rs index aa985a17d2b..9490c818384 100644 --- a/components/net/tests/data_loader.rs +++ b/components/net/tests/data_loader.rs @@ -44,7 +44,7 @@ fn assert_parse( filtered: FilteredMetadata::Basic(m), .. }) => m, - result => panic!(result), + result => panic!("{:?}", result), }; assert_eq!(metadata.content_type.map(Serde::into_inner), content_type); assert_eq!(metadata.charset.as_ref().map(String::deref), charset); diff --git a/components/net_traits/response.rs b/components/net_traits/response.rs index 0c12546bebe..46d2a6751c5 100644 --- a/components/net_traits/response.rs +++ b/components/net_traits/response.rs @@ -312,7 +312,7 @@ impl Response { metadata.referrer_policy = response.referrer_policy.clone(); metadata.redirected = response.actual_response().url_list.len() > 1; metadata - }; + } if let Some(error) = self.get_network_error() { return Err(error.clone()); diff --git a/components/profile/mem.rs b/components/profile/mem.rs index bb4688f397c..44956176e8a 100644 --- a/components/profile/mem.rs +++ b/components/profile/mem.rs @@ -101,10 +101,7 @@ impl Profiler { let name_clone = name.clone(); match self.reporters.insert(name, reporter) { None => true, - Some(_) => panic!(format!( - "RegisterReporter: '{}' name is already in use", - name_clone - )), + Some(_) => panic!("RegisterReporter: '{}' name is already in use", name_clone), } }, @@ -112,7 +109,7 @@ impl Profiler { // Panic if it hasn't previously been registered. match self.reporters.remove(&name) { Some(_) => true, - None => panic!(format!("UnregisterReporter: '{}' name is unknown", &name)), + None => panic!("UnregisterReporter: '{}' name is unknown", &name), } }, diff --git a/components/style/gecko/url.rs b/components/style/gecko/url.rs index 678adb39b09..2e694b3a2d6 100644 --- a/components/style/gecko/url.rs +++ b/components/style/gecko/url.rs @@ -21,8 +21,8 @@ use style_traits::{CssWriter, ParseError, ToCss}; use to_shmem::{self, SharedMemoryBuilder, ToShmem}; /// A CSS url() value for gecko. -#[css(function = "url")] #[derive(Clone, Debug, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] +#[css(function = "url")] #[repr(C)] pub struct CssUrl(pub Arc<CssUrlData>); diff --git a/components/style/media_queries/media_list.rs b/components/style/media_queries/media_list.rs index 5d150f7db99..abc2ae6dbc8 100644 --- a/components/style/media_queries/media_list.rs +++ b/components/style/media_queries/media_list.rs @@ -14,8 +14,8 @@ use cssparser::{Delimiter, Parser}; use cssparser::{ParserInput, Token}; /// A type that encapsulates a media query list. -#[css(comma, derive_debug)] #[derive(Clone, MallocSizeOf, ToCss, ToShmem)] +#[css(comma, derive_debug)] pub struct MediaList { /// The list of media queries. #[css(iterable)] diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 505cd0c0856..1e6c1400a18 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -170,9 +170,6 @@ /// Making this type generic allows the compiler to figure out the /// animated value for us, instead of having to implement it /// manually for every type we care about. - % if separator == "Comma": - #[css(comma)] - % endif #[derive( Clone, Debug, @@ -182,6 +179,9 @@ ToResolvedValue, ToCss, )] + % if separator == "Comma": + #[css(comma)] + % endif pub struct OwnedList<T>( % if not allow_empty: #[css(iterable)] @@ -198,9 +198,6 @@ % else: pub use self::ComputedList as List; - % if separator == "Comma": - #[css(comma)] - % endif #[derive( Clone, Debug, @@ -208,6 +205,9 @@ PartialEq, ToCss, )] + % if separator == "Comma": + #[css(comma)] + % endif pub struct ComputedList( % if not allow_empty: #[css(iterable)] @@ -324,10 +324,10 @@ } /// The specified value of ${name}. + #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] % if separator == "Comma": #[css(comma)] % endif - #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] pub struct SpecifiedValue( % if not allow_empty: #[css(iterable)] diff --git a/components/style/stylesheets/document_rule.rs b/components/style/stylesheets/document_rule.rs index 2f8c5bc48d7..ce326808b63 100644 --- a/components/style/stylesheets/document_rule.rs +++ b/components/style/stylesheets/document_rule.rs @@ -215,8 +215,8 @@ impl DocumentMatchingFunction { /// The `@document` rule's condition is written as a comma-separated list of /// URL matching functions, and the condition evaluates to true whenever any /// one of those functions evaluates to true. -#[css(comma)] #[derive(Clone, Debug, ToCss, ToShmem)] +#[css(comma)] pub struct DocumentCondition(#[css(iterable)] Vec<DocumentMatchingFunction>); impl DocumentCondition { diff --git a/components/style/stylesheets/keyframes_rule.rs b/components/style/stylesheets/keyframes_rule.rs index 9efd7f39ccc..97394802320 100644 --- a/components/style/stylesheets/keyframes_rule.rs +++ b/components/style/stylesheets/keyframes_rule.rs @@ -149,8 +149,8 @@ impl KeyframePercentage { /// A keyframes selector is a list of percentages or from/to symbols, which are /// converted at parse time to percentages. -#[css(comma)] #[derive(Clone, Debug, Eq, PartialEq, ToCss, ToShmem)] +#[css(comma)] pub struct KeyframeSelector(#[css(iterable)] Vec<KeyframePercentage>); impl KeyframeSelector { diff --git a/components/style/values/animated/font.rs b/components/style/values/animated/font.rs index a3eb1fe1e15..1f0eb749fc7 100644 --- a/components/style/values/animated/font.rs +++ b/components/style/values/animated/font.rs @@ -116,7 +116,7 @@ impl<'a> FontSettingTagIter<'a> { let mut sorted_tags = Vec::from_iter(tags.iter()); sorted_tags.sort_by_key(|k| k.tag.0); sorted_tags - }; + } Ok(FontSettingTagIter { a_state: FontSettingTagIterState::new(as_new_sorted_tags(&a_settings.0)), diff --git a/components/style/values/generics/basic_shape.rs b/components/style/values/generics/basic_shape.rs index 60619b46e2c..5af1580ffdf 100644 --- a/components/style/values/generics/basic_shape.rs +++ b/components/style/values/generics/basic_shape.rs @@ -91,7 +91,6 @@ impl Default for ShapeBox { /// A value for the `clip-path` property. #[allow(missing_docs)] -#[animation(no_bound(U))] #[derive( Animate, Clone, @@ -106,6 +105,7 @@ impl Default for ShapeBox { ToResolvedValue, ToShmem, )] +#[animation(no_bound(U))] #[repr(u8)] pub enum GenericClipPath<BasicShape, U> { #[animation(error)] @@ -126,7 +126,6 @@ pub use self::GenericClipPath as ClipPath; /// A value for the `shape-outside` property. #[allow(missing_docs)] -#[animation(no_bound(I))] #[derive( Animate, Clone, @@ -141,6 +140,7 @@ pub use self::GenericClipPath as ClipPath; ToResolvedValue, ToShmem, )] +#[animation(no_bound(I))] #[repr(u8)] pub enum GenericShapeOutside<BasicShape, I> { #[animation(error)] @@ -193,7 +193,6 @@ pub use self::GenericBasicShape as BasicShape; /// <https://drafts.csswg.org/css-shapes/#funcdef-inset> #[allow(missing_docs)] -#[css(function = "inset")] #[derive( Animate, Clone, @@ -207,6 +206,7 @@ pub use self::GenericBasicShape as BasicShape; ToResolvedValue, ToShmem, )] +#[css(function = "inset")] #[repr(C)] pub struct InsetRect<LengthPercentage, NonNegativeLengthPercentage> { pub rect: Rect<LengthPercentage>, @@ -216,7 +216,6 @@ pub struct InsetRect<LengthPercentage, NonNegativeLengthPercentage> { /// <https://drafts.csswg.org/css-shapes/#funcdef-circle> #[allow(missing_docs)] -#[css(function)] #[derive( Animate, Clone, @@ -231,6 +230,7 @@ pub struct InsetRect<LengthPercentage, NonNegativeLengthPercentage> { ToResolvedValue, ToShmem, )] +#[css(function)] #[repr(C)] pub struct Circle<H, V, NonNegativeLengthPercentage> { pub position: GenericPosition<H, V>, @@ -239,7 +239,6 @@ pub struct Circle<H, V, NonNegativeLengthPercentage> { /// <https://drafts.csswg.org/css-shapes/#funcdef-ellipse> #[allow(missing_docs)] -#[css(function)] #[derive( Animate, Clone, @@ -254,6 +253,7 @@ pub struct Circle<H, V, NonNegativeLengthPercentage> { ToResolvedValue, ToShmem, )] +#[css(function)] #[repr(C)] pub struct Ellipse<H, V, NonNegativeLengthPercentage> { pub position: GenericPosition<H, V>, @@ -293,7 +293,6 @@ pub use self::GenericShapeRadius as ShapeRadius; /// A generic type for representing the `polygon()` function /// /// <https://drafts.csswg.org/css-shapes/#funcdef-polygon> -#[css(comma, function = "polygon")] #[derive( Clone, Debug, @@ -306,6 +305,7 @@ pub use self::GenericShapeRadius as ShapeRadius; ToResolvedValue, ToShmem, )] +#[css(comma, function = "polygon")] #[repr(C)] pub struct GenericPolygon<LengthPercentage> { /// The filling rule for a polygon. @@ -364,7 +364,6 @@ pub enum FillRule { /// The path function defined in css-shape-2. /// /// https://drafts.csswg.org/css-shapes-2/#funcdef-path -#[css(comma)] #[derive( Animate, Clone, @@ -379,6 +378,7 @@ pub enum FillRule { ToResolvedValue, ToShmem, )] +#[css(comma)] #[repr(C)] pub struct Path { /// The filling rule for the svg path. diff --git a/components/style/values/generics/effects.rs b/components/style/values/generics/effects.rs index dd9da8759be..f5666f30552 100644 --- a/components/style/values/generics/effects.rs +++ b/components/style/values/generics/effects.rs @@ -35,7 +35,6 @@ pub use self::GenericBoxShadow as BoxShadow; /// A generic value for a single `filter`. #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] -#[animation(no_bound(U))] #[derive( Clone, ComputeSquaredDistance, @@ -49,6 +48,7 @@ pub use self::GenericBoxShadow as BoxShadow; ToResolvedValue, ToShmem, )] +#[animation(no_bound(U))] #[repr(C, u8)] pub enum GenericFilter<Angle, NonNegativeFactor, ZeroToOneFactor, Length, Shadow, U> { /// `blur(<length>)` diff --git a/components/style/values/generics/font.rs b/components/style/values/generics/font.rs index e19c796d17b..226613d4545 100644 --- a/components/style/values/generics/font.rs +++ b/components/style/values/generics/font.rs @@ -77,7 +77,6 @@ pub struct VariationValue<Number> { } /// A value both for font-variation-settings and font-feature-settings. -#[css(comma)] #[derive( Clone, Debug, @@ -90,6 +89,7 @@ pub struct VariationValue<Number> { ToResolvedValue, ToShmem, )] +#[css(comma)] pub struct FontSettings<T>(#[css(if_empty = "normal", iterable)] pub Box<[T]>); impl<T> FontSettings<T> { diff --git a/components/style/values/generics/image.rs b/components/style/values/generics/image.rs index fba1f3f3c78..6f550bc21f6 100644 --- a/components/style/values/generics/image.rs +++ b/components/style/values/generics/image.rs @@ -264,7 +264,6 @@ impl ToCss for PaintWorklet { /// /// `-moz-image-rect(<uri>, top, right, bottom, left);` #[allow(missing_docs)] -#[css(comma, function = "-moz-image-rect")] #[derive( Clone, Debug, @@ -276,6 +275,7 @@ impl ToCss for PaintWorklet { ToResolvedValue, ToShmem, )] +#[css(comma, function = "-moz-image-rect")] #[repr(C)] pub struct GenericMozImageRect<NumberOrPercentage, MozImageRectUrl> { pub url: MozImageRectUrl, diff --git a/components/style/values/generics/svg.rs b/components/style/values/generics/svg.rs index 26a33228e86..43ba77f1ff4 100644 --- a/components/style/values/generics/svg.rs +++ b/components/style/values/generics/svg.rs @@ -42,7 +42,6 @@ pub use self::GenericSVGPaintFallback as SVGPaintFallback; /// An SVG paint value /// /// <https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint> -#[animation(no_bound(Url))] #[derive( Animate, Clone, @@ -58,6 +57,7 @@ pub use self::GenericSVGPaintFallback as SVGPaintFallback; ToResolvedValue, ToShmem, )] +#[animation(no_bound(Url))] #[repr(C)] pub struct GenericSVGPaint<Color, Url> { /// The paint source. @@ -81,7 +81,6 @@ impl<C, U> Default for SVGPaint<C, U> { /// /// Whereas the spec only allows PaintServer to have a fallback, Gecko lets the /// context properties have a fallback as well. -#[animation(no_bound(U))] #[derive( Animate, Clone, @@ -98,6 +97,7 @@ impl<C, U> Default for SVGPaint<C, U> { ToResolvedValue, ToShmem, )] +#[animation(no_bound(U))] #[repr(C, u8)] pub enum GenericSVGPaintKind<C, U> { /// `none` diff --git a/components/style/values/generics/transform.rs b/components/style/values/generics/transform.rs index ef414c1f9a0..e5739b6ef56 100644 --- a/components/style/values/generics/transform.rs +++ b/components/style/values/generics/transform.rs @@ -47,7 +47,6 @@ pub use self::GenericMatrix as Matrix; #[allow(missing_docs)] #[cfg_attr(rustfmt, rustfmt_skip)] -#[css(comma, function = "matrix3d")] #[derive( Clone, Copy, @@ -62,6 +61,7 @@ pub use self::GenericMatrix as Matrix; ToResolvedValue, ToShmem, )] +#[css(comma, function = "matrix3d")] #[repr(C)] pub struct GenericMatrix3D<T> { pub m11: T, pub m12: T, pub m13: T, pub m14: T, diff --git a/components/style_derive/animate.rs b/components/style_derive/animate.rs index 59b19214971..9549100ad08 100644 --- a/components/style_derive/animate.rs +++ b/components/style_derive/animate.rs @@ -112,14 +112,14 @@ fn derive_variant_arm( } } -#[darling(attributes(animation), default)] #[derive(Default, FromDeriveInput)] +#[darling(attributes(animation), default)] pub struct AnimationInputAttrs { pub no_bound: Option<PathList>, } -#[darling(attributes(animation), default)] #[derive(Default, FromVariant)] +#[darling(attributes(animation), default)] pub struct AnimationVariantAttrs { pub error: bool, // Only here because of structs, where the struct definition acts as a @@ -127,8 +127,8 @@ pub struct AnimationVariantAttrs { pub no_bound: Option<PathList>, } -#[darling(attributes(animation), default)] #[derive(Default, FromField)] +#[darling(attributes(animation), default)] pub struct AnimationFieldAttrs { pub constant: bool, pub field_bound: bool, diff --git a/components/style_derive/compute_squared_distance.rs b/components/style_derive/compute_squared_distance.rs index b4e67f6c984..022ab115eea 100644 --- a/components/style_derive/compute_squared_distance.rs +++ b/components/style_derive/compute_squared_distance.rs @@ -118,8 +118,8 @@ fn derive_variant_arm( }; } -#[darling(attributes(distance), default)] #[derive(Default, FromField)] +#[darling(attributes(distance), default)] struct DistanceFieldAttrs { field_bound: bool, } diff --git a/components/style_derive/parse.rs b/components/style_derive/parse.rs index ebf46a3735e..345decce28c 100644 --- a/components/style_derive/parse.rs +++ b/components/style_derive/parse.rs @@ -8,15 +8,15 @@ use proc_macro2::TokenStream; use syn::{self, DeriveInput, Path}; use synstructure::{Structure, VariantInfo}; -#[darling(attributes(parse), default)] #[derive(Default, FromVariant)] +#[darling(attributes(parse), default)] pub struct ParseVariantAttrs { pub aliases: Option<String>, pub condition: Option<Path>, } -#[darling(attributes(parse), default)] #[derive(Default, FromField)] +#[darling(attributes(parse), default)] pub struct ParseFieldAttrs { field_bound: bool, } diff --git a/components/style_derive/specified_value_info.rs b/components/style_derive/specified_value_info.rs index 79e88e9459a..b9473c64008 100644 --- a/components/style_derive/specified_value_info.rs +++ b/components/style_derive/specified_value_info.rs @@ -166,22 +166,22 @@ fn derive_struct_fields<'a>( true } -#[darling(attributes(value_info), default)] #[derive(Default, FromDeriveInput)] +#[darling(attributes(value_info), default)] struct ValueInfoInputAttrs { ty: Option<Ident>, other_values: Option<String>, } -#[darling(attributes(value_info), default)] #[derive(Default, FromVariant)] +#[darling(attributes(value_info), default)] struct ValueInfoVariantAttrs { starts_with_keyword: bool, other_values: Option<String>, } -#[darling(attributes(value_info), default)] #[derive(Default, FromField)] +#[darling(attributes(value_info), default)] struct ValueInfoFieldAttrs { other_values: Option<String>, } diff --git a/components/style_derive/to_computed_value.rs b/components/style_derive/to_computed_value.rs index fe6bddb7ed2..5fe2be5af75 100644 --- a/components/style_derive/to_computed_value.rs +++ b/components/style_derive/to_computed_value.rs @@ -195,8 +195,8 @@ pub struct ToValueAttrs { pub no_field_bound: bool, } -#[darling(attributes(compute), default)] #[derive(Default, FromField)] +#[darling(attributes(compute), default)] struct ComputedValueAttrs { field_bound: bool, no_field_bound: bool, diff --git a/components/style_derive/to_css.rs b/components/style_derive/to_css.rs index dfd5bc8193f..b16d2cf7f30 100644 --- a/components/style_derive/to_css.rs +++ b/components/style_derive/to_css.rs @@ -236,8 +236,8 @@ fn derive_single_field_expr( expr } -#[darling(attributes(css), default)] #[derive(Default, FromDeriveInput)] +#[darling(attributes(css), default)] pub struct CssInputAttrs { pub derive_debug: bool, // Here because structs variants are also their whole type definition. @@ -246,8 +246,8 @@ pub struct CssInputAttrs { pub comma: bool, } -#[darling(attributes(css), default)] #[derive(Default, FromVariant)] +#[darling(attributes(css), default)] pub struct CssVariantAttrs { pub function: Option<Override<String>>, // Here because structs variants are also their whole type definition. @@ -258,8 +258,8 @@ pub struct CssVariantAttrs { pub skip: bool, } -#[darling(attributes(css), default)] #[derive(Default, FromField)] +#[darling(attributes(css), default)] pub struct CssFieldAttrs { pub if_empty: Option<String>, pub field_bound: bool, diff --git a/components/style_derive/to_resolved_value.rs b/components/style_derive/to_resolved_value.rs index f7ba2645e89..e049f91152a 100644 --- a/components/style_derive/to_resolved_value.rs +++ b/components/style_derive/to_resolved_value.rs @@ -44,8 +44,8 @@ pub fn derive(input: DeriveInput) -> TokenStream { ) } -#[darling(attributes(resolve), default)] #[derive(Default, FromField)] +#[darling(attributes(resolve), default)] struct ResolvedValueAttrs { field_bound: bool, no_field_bound: bool, diff --git a/components/to_shmem_derive/to_shmem.rs b/components/to_shmem_derive/to_shmem.rs index c3410bcc7e0..157730c5a51 100644 --- a/components/to_shmem_derive/to_shmem.rs +++ b/components/to_shmem_derive/to_shmem.rs @@ -65,14 +65,14 @@ pub fn derive(mut input: syn::DeriveInput) -> TokenStream { } } -#[darling(attributes(shmem), default)] #[derive(Default, FromDeriveInput)] +#[darling(attributes(shmem), default)] pub struct ShmemInputAttrs { pub no_bounds: bool, } -#[darling(attributes(shmem), default)] #[derive(Default, FromField)] +#[darling(attributes(shmem), default)] pub struct ShmemFieldAttrs { pub field_bound: bool, } diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index 645ea96e3f0..b6582cfab5b 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -138,12 +138,11 @@ pub struct WebDriverSession { implicit_wait_timeout: u64, page_loading_strategy: String, - secure_tls: bool, + strict_file_interactability: bool, + unhandled_prompt_behavior: String, - // https://w3c.github.io/webdriver/#dfn-active-input-sources - active_input_sources: Vec<InputSourceState>, // https://w3c.github.io/webdriver/#dfn-input-state-table input_state_table: HashMap<String, InputSourceState>, // https://w3c.github.io/webdriver/#dfn-input-cancel-list @@ -165,11 +164,9 @@ impl WebDriverSession { implicit_wait_timeout: 0, page_loading_strategy: "normal".to_string(), - secure_tls: true, strict_file_interactability: false, unhandled_prompt_behavior: "dismiss and notify".to_string(), - active_input_sources: Vec::new(), input_state_table: HashMap::new(), input_cancel_list: Vec::new(), } @@ -532,8 +529,8 @@ impl Handler { ); match processed.get("acceptInsecureCerts") { - Some(accept_insecure_certs) => { - session.secure_tls = !accept_insecure_certs.as_bool().unwrap() + Some(_accept_insecure_certs) => { + // FIXME do something here? }, None => { processed.insert( @@ -1374,7 +1371,6 @@ impl Handler { let session = self.session_mut()?; session.input_state_table = HashMap::new(); - session.active_input_sources = Vec::new(); Ok(WebDriverResponse::Void) } diff --git a/ports/libsimpleservo/api/src/lib.rs b/ports/libsimpleservo/api/src/lib.rs index c87a63f4445..3088160513b 100644 --- a/ports/libsimpleservo/api/src/lib.rs +++ b/ports/libsimpleservo/api/src/lib.rs @@ -174,7 +174,7 @@ pub struct ServoGlue { // and exit if it is empty afterwards. browsers: Vec<BrowserId>, events: Vec<WindowEvent>, - current_url: Option<ServoUrl>, + context_menu_sender: Option<IpcSender<ContextMenuResult>>, } @@ -306,7 +306,6 @@ pub fn init( browser_id: None, browsers: vec![], events: vec![], - current_url: Some(url.clone()), context_menu_sender: None, }; let browser_id = BrowserId::new(); @@ -636,7 +635,6 @@ impl ServoGlue { self.callbacks .host_callbacks .on_url_changed(entries[current].clone().to_string()); - self.current_url = Some(entries[current].clone()); }, EmbedderMsg::LoadStart => { self.callbacks.host_callbacks.on_load_started(); diff --git a/ports/libsimpleservo/capi/src/lib.rs b/ports/libsimpleservo/capi/src/lib.rs index 9710b5e1241..7ff2c328e16 100644 --- a/ports/libsimpleservo/capi/src/lib.rs +++ b/ports/libsimpleservo/capi/src/lib.rs @@ -188,7 +188,7 @@ where Some(ref mut s) => (f)(s), None => Err("Servo not available in this thread"), }) { - Err(e) => panic!(e), + Err(e) => panic!("{}", e), Ok(r) => r, } } diff --git a/ports/winit/browser.rs b/ports/winit/browser.rs index 85752defcbf..93cf63fdef4 100644 --- a/ports/winit/browser.rs +++ b/ports/winit/browser.rs @@ -42,21 +42,13 @@ pub struct Browser<Window: WindowPortsMethods + ?Sized> { browsers: Vec<BrowserId>, title: Option<String>, - status: Option<String>, - favicon: Option<ServoUrl>, - loading_state: Option<LoadingState>, + window: Rc<Window>, event_queue: Vec<WindowEvent>, clipboard_ctx: Option<ClipboardContext>, shutdown_requested: bool, } -enum LoadingState { - Connecting, - Loading, - Loaded, -} - impl<Window> Browser<Window> where Window: WindowPortsMethods + ?Sized, @@ -67,9 +59,6 @@ where current_url: None, browser_id: None, browsers: Vec::new(), - status: None, - favicon: None, - loading_state: None, window: window, clipboard_ctx: match ClipboardContext::new() { Ok(c) => Some(c), @@ -278,8 +267,8 @@ where pub fn handle_servo_events(&mut self, events: Vec<(Option<BrowserId>, EmbedderMsg)>) { for (browser_id, msg) in events { match msg { - EmbedderMsg::Status(status) => { - self.status = status; + EmbedderMsg::Status(_status) => { + // FIXME: surface this status string in the UI somehow }, EmbedderMsg::ChangePageTitle(title) => { self.title = title; @@ -440,11 +429,11 @@ where EmbedderMsg::SetCursor(cursor) => { self.window.set_cursor(cursor); }, - EmbedderMsg::NewFavicon(url) => { - self.favicon = Some(url); + EmbedderMsg::NewFavicon(_url) => { + // FIXME: show favicons in the UI somehow }, EmbedderMsg::HeadParsed => { - self.loading_state = Some(LoadingState::Loading); + // FIXME: surface the loading state in the UI somehow }, EmbedderMsg::HistoryChanged(urls, current) => { self.current_url = Some(urls[current].clone()); @@ -453,10 +442,10 @@ where self.window.set_fullscreen(state); }, EmbedderMsg::LoadStart => { - self.loading_state = Some(LoadingState::Connecting); + // FIXME: surface the loading state in the UI somehow }, EmbedderMsg::LoadComplete => { - self.loading_state = Some(LoadingState::Loaded); + // FIXME: surface the loading state in the UI somehow }, EmbedderMsg::CloseBrowser => { // TODO: close the appropriate "tab". |