Measure selectors.

This patch adds measurement of Selectors within StyleRule. This requires
exposing the pointer within ThinArc.

The patch also adds measurement of the several CssRule variants, in order to
measure nested CssRules (and PropertyDeclarationBlocks) within them:
DocumentRule, MediaRule, PageRule, SupportsRule.
This commit is contained in:
Nicholas Nethercote 2017-09-07 13:24:40 +10:00
parent 812cac78f0
commit 61877b7316
8 changed files with 95 additions and 15 deletions

View file

@ -423,7 +423,6 @@ impl<Impl: SelectorImpl> Selector<Impl> {
))
}
/// Returns an iterator over this selector in matching order (right-to-left).
/// When a combinator is reached, the iterator will return None, and
/// next_sequence() may be called to continue to the next sequence.
@ -494,6 +493,11 @@ impl<Impl: SelectorImpl> Selector<Impl> {
pub fn len(&self) -> usize {
self.0.slice.len()
}
/// Returns the address on the heap of the ThinArc for memory reporting.
pub fn thin_arc_heap_ptr(&self) -> *const ::std::os::raw::c_void {
self.0.heap_ptr()
}
}
#[derive(Clone)]