mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: [css-nesting] Parse parent selector
This parses the ampersand as a parent selector behind an (off-by-default) selectors feature. The plan is to call replace_parent_selector while we're doing the CascadeData rebuilds, which is where we can have all the ancestor nesting information. No behavior change. Differential Revision: https://phabricator.services.mozilla.com/D167237
This commit is contained in:
parent
b024f5b2e7
commit
29c6094c80
5 changed files with 345 additions and 76 deletions
|
@ -1048,6 +1048,32 @@ impl<H, T> Arc<HeaderSliceWithLength<H, [T]>> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<H, T> UniqueArc<HeaderSliceWithLength<H, [T]>> {
|
||||
#[inline]
|
||||
pub fn from_header_and_iter<I>(header: HeaderWithLength<H>, items: I) -> Self
|
||||
where
|
||||
I: Iterator<Item = T> + ExactSizeIterator,
|
||||
{
|
||||
Self(Arc::from_header_and_iter(header, items))
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to the header.
|
||||
pub fn header_mut(&mut self) -> &mut H {
|
||||
// We know this to be uniquely owned
|
||||
unsafe { &mut (*self.0.ptr()).data.header.header }
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to the slice.
|
||||
pub fn data_mut(&mut self) -> &mut [T] {
|
||||
// We know this to be uniquely owned
|
||||
unsafe { &mut (*self.0.ptr()).data.slice }
|
||||
}
|
||||
|
||||
pub fn shareable_thin(self) -> ThinArc<H, T> {
|
||||
Arc::into_thin(self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl<H: PartialEq, T: PartialEq> PartialEq for ThinArc<H, T> {
|
||||
#[inline]
|
||||
fn eq(&self, other: &ThinArc<H, T>) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue