Auto merge of #5608 - pgonda:cmdline-disable-style-sharing, r=Ms2ger

Let me know if I should fix anything, or how I could implement a test if needed.  I looked at some testing in servo/ports/command_line.rs but it did not seem to apply.

Thanks!
This commit is contained in:
bors-servo 2015-04-10 03:06:11 -05:00
commit 875f07ff25
2 changed files with 11 additions and 0 deletions

View file

@ -32,6 +32,7 @@ use style::properties::{ComputedValues, cascade};
use style::selector_matching::{Stylist, DeclarationBlock};
use util::arc_ptr_eq;
use util::cache::{LRUCache, SimpleHashCache};
use util::opts;
use util::smallvec::{SmallVec, SmallVec16};
pub struct ApplicableDeclarations {
@ -564,6 +565,9 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
&mut StyleSharingCandidateCache,
parent: Option<LayoutNode>)
-> StyleSharingResult {
if opts::get().disable_share_style_cache {
return StyleSharingResult::CannotShare(false)
}
if !self.is_element() {
return StyleSharingResult::CannotShare(false)
}