style: Move ExtraStyleData into CascadeData.

It logically belongs there, and the only reason it wasn't there before we were
working around it.

MozReview-Commit-ID: 5a5iksHAIdN
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-09-13 17:07:13 +02:00
parent d461347adf
commit 541977efb3
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 69 additions and 42 deletions

View file

@ -12,13 +12,13 @@ use gecko_bindings::structs::{StyleSheetInfo, ServoStyleSheetInner};
use gecko_bindings::structs::nsIDocument;
use gecko_bindings::sugar::ownership::{HasArcFFI, HasBoxFFI, HasFFI, HasSimpleFFI};
use invalidation::media_queries::{MediaListKey, ToMediaListKey};
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use malloc_size_of::MallocSizeOfOps;
use media_queries::{Device, MediaList};
use properties::ComputedValues;
use servo_arc::Arc;
use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard};
use stylesheets::{PerOrigin, StylesheetContents, StylesheetInDocument};
use stylist::{ExtraStyleData, Stylist};
use stylesheets::{StylesheetContents, StylesheetInDocument};
use stylist::Stylist;
/// Little wrapper to a Gecko style sheet.
#[derive(Debug, Eq, PartialEq)]
@ -113,9 +113,6 @@ impl StylesheetInDocument for GeckoStyleSheet {
pub struct PerDocumentStyleDataImpl {
/// Rule processor.
pub stylist: Stylist,
/// List of effective @font-face and @counter-style rules.
pub extra_style_data: PerOrigin<ExtraStyleData>,
}
/// The data itself is an `AtomicRefCell`, which guarantees the proper semantics
@ -132,7 +129,6 @@ impl PerDocumentStyleData {
PerDocumentStyleData(AtomicRefCell::new(PerDocumentStyleDataImpl {
stylist: Stylist::new(device, quirks_mode.into()),
extra_style_data: Default::default(),
}))
}
@ -160,7 +156,6 @@ impl PerDocumentStyleDataImpl {
self.stylist.flush(
&StylesheetGuards::same(guard),
/* ua_sheets = */ None,
&mut self.extra_style_data,
document_element,
)
}
@ -189,7 +184,6 @@ impl PerDocumentStyleDataImpl {
/// Measure heap usage.
pub fn add_size_of_children(&self, ops: &mut MallocSizeOfOps, sizes: &mut ServoStyleSetSizes) {
self.stylist.add_size_of_children(ops, sizes);
sizes.mStylistOther += self.extra_style_data.size_of(ops);
}
}