mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
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:
parent
d461347adf
commit
541977efb3
4 changed files with 69 additions and 42 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue