diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index 78cb8d741f3..2d85ce23c9b 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -47,14 +47,19 @@ impl<'a> RecalcStyleAndConstructFlows<'a> { #[allow(unsafe_code)] impl<'a, E> DomTraversal for RecalcStyleAndConstructFlows<'a> - where E: TElement, - E::ConcreteNode: LayoutNode, - E::FontMetricsProvider: Send, +where + E: TElement, + E::ConcreteNode: LayoutNode, + E::FontMetricsProvider: Send, { - fn process_preorder(&self, traversal_data: &PerLevelTraversalData, - context: &mut StyleContext, node: E::ConcreteNode, - note_child: F) - where F: FnMut(E::ConcreteNode) + fn process_preorder( + &self, + traversal_data: &PerLevelTraversalData, + context: &mut StyleContext, node: E::ConcreteNode, + note_child: F, + ) + where + F: FnMut(E::ConcreteNode) { // FIXME(pcwalton): Stop allocating here. Ideally this should just be // done by the HTML parser. diff --git a/components/style/context.rs b/components/style/context.rs index 6a970d6d3fb..e6a7b544ab0 100644 --- a/components/style/context.rs +++ b/components/style/context.rs @@ -384,8 +384,9 @@ impl fmt::Display for TraversalStatistics { impl TraversalStatistics { /// Computes the traversal time given the start time in seconds. pub fn finish(&mut self, traversal: &D, parallel: bool, start: f64) - where E: TElement, - D: DomTraversal, + where + E: TElement, + D: DomTraversal, { let threshold = traversal.shared_context().options.style_statistics_threshold; let stylist = traversal.shared_context().stylist; diff --git a/components/style/invalidation/element/element_wrapper.rs b/components/style/invalidation/element/element_wrapper.rs index 6e649588bb2..5483c275697 100644 --- a/components/style/invalidation/element/element_wrapper.rs +++ b/components/style/invalidation/element/element_wrapper.rs @@ -135,7 +135,8 @@ where } impl<'a, E> fmt::Debug for ElementWrapper<'a, E> - where E: TElement, +where + E: TElement, { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { // Ignore other fields for now, can change later if needed. @@ -144,7 +145,8 @@ impl<'a, E> fmt::Debug for ElementWrapper<'a, E> } impl<'a, E> Element for ElementWrapper<'a, E> - where E: TElement, +where + E: TElement, { type Impl = SelectorImpl; diff --git a/components/style/parallel.rs b/components/style/parallel.rs index d7604a6a5cf..fd2ca7bc3a9 100644 --- a/components/style/parallel.rs +++ b/components/style/parallel.rs @@ -77,9 +77,11 @@ type WorkUnit = ArrayVec<[SendNode; WORK_UNIT_MAX]>; #[inline(never)] fn create_thread_local_context<'scope, E, D>( traversal: &'scope D, - slot: &mut Option>) - where E: TElement + 'scope, - D: DomTraversal + slot: &mut Option>, +) +where + E: TElement + 'scope, + D: DomTraversal, { *slot = Some(ThreadLocalStyleContext::new(traversal.shared_context())); } @@ -99,15 +101,18 @@ fn create_thread_local_context<'scope, E, D>( /// a thread-local cache to share styles between siblings. #[inline(always)] #[allow(unsafe_code)] -fn top_down_dom<'a, 'scope, E, D>(nodes: &'a [SendNode], - root: OpaqueNode, - mut traversal_data: PerLevelTraversalData, - scope: &'a rayon::Scope<'scope>, - pool: &'scope rayon::ThreadPool, - traversal: &'scope D, - tls: &'scope ScopedTLS<'scope, ThreadLocalStyleContext>) - where E: TElement + 'scope, - D: DomTraversal, +fn top_down_dom<'a, 'scope, E, D>( + nodes: &'a [SendNode], + root: OpaqueNode, + mut traversal_data: PerLevelTraversalData, + scope: &'a rayon::Scope<'scope>, + pool: &'scope rayon::ThreadPool, + traversal: &'scope D, + tls: &'scope ScopedTLS<'scope, ThreadLocalStyleContext>, +) +where + E: TElement + 'scope, + D: DomTraversal, { debug_assert!(nodes.len() <= WORK_UNIT_MAX); diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index 0ff2dbf28dc..040a93d9a45 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -1096,14 +1096,16 @@ impl StrongRuleNode { /// Returns true if any properties specified by `rule_type_mask` was set by /// an author rule. #[cfg(feature = "gecko")] - pub fn has_author_specified_rules(&self, - mut element: E, - mut pseudo: Option, - guards: &StylesheetGuards, - rule_type_mask: u32, - author_colors_allowed: bool) - -> bool - where E: ::dom::TElement + pub fn has_author_specified_rules( + &self, + mut element: E, + mut pseudo: Option, + guards: &StylesheetGuards, + rule_type_mask: u32, + author_colors_allowed: bool, + ) -> bool + where + E: ::dom::TElement { use gecko_bindings::structs::NS_AUTHOR_SPECIFIED_BACKGROUND; use gecko_bindings::structs::NS_AUTHOR_SPECIFIED_BORDER;