mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
style: Indent properly a couple more functions.
This commit is contained in:
parent
a6c6ef91e0
commit
13f61a6e5f
5 changed files with 46 additions and 31 deletions
|
@ -47,14 +47,19 @@ impl<'a> RecalcStyleAndConstructFlows<'a> {
|
|||
|
||||
#[allow(unsafe_code)]
|
||||
impl<'a, E> DomTraversal<E> for RecalcStyleAndConstructFlows<'a>
|
||||
where E: TElement,
|
||||
E::ConcreteNode: LayoutNode,
|
||||
E::FontMetricsProvider: Send,
|
||||
where
|
||||
E: TElement,
|
||||
E::ConcreteNode: LayoutNode,
|
||||
E::FontMetricsProvider: Send,
|
||||
{
|
||||
fn process_preorder<F>(&self, traversal_data: &PerLevelTraversalData,
|
||||
context: &mut StyleContext<E>, node: E::ConcreteNode,
|
||||
note_child: F)
|
||||
where F: FnMut(E::ConcreteNode)
|
||||
fn process_preorder<F>(
|
||||
&self,
|
||||
traversal_data: &PerLevelTraversalData,
|
||||
context: &mut StyleContext<E>, 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.
|
||||
|
|
|
@ -384,8 +384,9 @@ impl fmt::Display for TraversalStatistics {
|
|||
impl TraversalStatistics {
|
||||
/// Computes the traversal time given the start time in seconds.
|
||||
pub fn finish<E, D>(&mut self, traversal: &D, parallel: bool, start: f64)
|
||||
where E: TElement,
|
||||
D: DomTraversal<E>,
|
||||
where
|
||||
E: TElement,
|
||||
D: DomTraversal<E>,
|
||||
{
|
||||
let threshold = traversal.shared_context().options.style_statistics_threshold;
|
||||
let stylist = traversal.shared_context().stylist;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -77,9 +77,11 @@ type WorkUnit<N> = ArrayVec<[SendNode<N>; WORK_UNIT_MAX]>;
|
|||
#[inline(never)]
|
||||
fn create_thread_local_context<'scope, E, D>(
|
||||
traversal: &'scope D,
|
||||
slot: &mut Option<ThreadLocalStyleContext<E>>)
|
||||
where E: TElement + 'scope,
|
||||
D: DomTraversal<E>
|
||||
slot: &mut Option<ThreadLocalStyleContext<E>>,
|
||||
)
|
||||
where
|
||||
E: TElement + 'scope,
|
||||
D: DomTraversal<E>,
|
||||
{
|
||||
*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<E::ConcreteNode>],
|
||||
root: OpaqueNode,
|
||||
mut traversal_data: PerLevelTraversalData,
|
||||
scope: &'a rayon::Scope<'scope>,
|
||||
pool: &'scope rayon::ThreadPool,
|
||||
traversal: &'scope D,
|
||||
tls: &'scope ScopedTLS<'scope, ThreadLocalStyleContext<E>>)
|
||||
where E: TElement + 'scope,
|
||||
D: DomTraversal<E>,
|
||||
fn top_down_dom<'a, 'scope, E, D>(
|
||||
nodes: &'a [SendNode<E::ConcreteNode>],
|
||||
root: OpaqueNode,
|
||||
mut traversal_data: PerLevelTraversalData,
|
||||
scope: &'a rayon::Scope<'scope>,
|
||||
pool: &'scope rayon::ThreadPool,
|
||||
traversal: &'scope D,
|
||||
tls: &'scope ScopedTLS<'scope, ThreadLocalStyleContext<E>>,
|
||||
)
|
||||
where
|
||||
E: TElement + 'scope,
|
||||
D: DomTraversal<E>,
|
||||
{
|
||||
debug_assert!(nodes.len() <= WORK_UNIT_MAX);
|
||||
|
||||
|
|
|
@ -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<E>(&self,
|
||||
mut element: E,
|
||||
mut pseudo: Option<PseudoElement>,
|
||||
guards: &StylesheetGuards,
|
||||
rule_type_mask: u32,
|
||||
author_colors_allowed: bool)
|
||||
-> bool
|
||||
where E: ::dom::TElement
|
||||
pub fn has_author_specified_rules<E>(
|
||||
&self,
|
||||
mut element: E,
|
||||
mut pseudo: Option<PseudoElement>,
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue