style: Move all the style sharing code outside matching.rs

This is just a code health change. I want to move it away to keep matching.rs as
simple as possible.
This commit is contained in:
Emilio Cobos Álvarez 2017-05-20 23:53:30 +02:00
parent d98abe1397
commit 311c403522
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
6 changed files with 585 additions and 499 deletions

View file

@ -8,9 +8,10 @@ use atomic_refcell::{AtomicRefCell, AtomicRefMut};
use context::{SharedStyleContext, StyleContext, ThreadLocalStyleContext};
use data::{ElementData, ElementStyles, StoredRestyleHint};
use dom::{DirtyDescendants, NodeInfo, OpaqueNode, TElement, TNode};
use matching::{ChildCascadeRequirement, MatchMethods, StyleSharingBehavior};
use matching::{ChildCascadeRequirement, MatchMethods};
use restyle_hints::{HintComputationContext, RestyleHint};
use selector_parser::RestyleDamage;
use sharing::StyleSharingBehavior;
#[cfg(feature = "servo")] use servo_config::opts;
use std::borrow::BorrowMut;
@ -723,7 +724,7 @@ fn compute_style<E, D>(_traversal: &D,
D: DomTraversal<E>,
{
use data::RestyleKind::*;
use matching::StyleSharingResult::*;
use sharing::StyleSharingResult::*;
context.thread_local.statistics.elements_styled += 1;
let kind = data.restyle_kind();