mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Implement GeckoElement::assigned_slot.
This allows to selector-match ::slotted, though we still don't parse it. Bug: 1425755 Reviewed-by: heycam MozReview-Commit-ID: ItELHkf2PMl
This commit is contained in:
parent
deb06a3298
commit
040379208e
2 changed files with 15 additions and 0 deletions
|
@ -1795,11 +1795,21 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
||||||
parent_node.and_then(|n| n.as_element())
|
parent_node.and_then(|n| n.as_element())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn pseudo_element_originating_element(&self) -> Option<Self> {
|
fn pseudo_element_originating_element(&self) -> Option<Self> {
|
||||||
debug_assert!(self.implemented_pseudo_element().is_some());
|
debug_assert!(self.implemented_pseudo_element().is_some());
|
||||||
self.closest_non_native_anonymous_ancestor()
|
self.closest_non_native_anonymous_ancestor()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn assigned_slot(&self) -> Option<Self> {
|
||||||
|
let slot = self.get_extended_slots()?._base.mAssignedSlot.mRawPtr;
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
Some(GeckoElement(&slot.as_ref()?._base._base._base._base))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn first_child_element(&self) -> Option<Self> {
|
fn first_child_element(&self) -> Option<Self> {
|
||||||
let mut child = self.as_node().first_child();
|
let mut child = self.as_node().first_child();
|
||||||
|
|
|
@ -351,6 +351,11 @@ impl<'a, E> Element for ElementWrapper<'a, E>
|
||||||
.map(|e| ElementWrapper::new(e, self.snapshot_map))
|
.map(|e| ElementWrapper::new(e, self.snapshot_map))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn assigned_slot(&self) -> Option<Self> {
|
||||||
|
self.element.assigned_slot()
|
||||||
|
.map(|e| ElementWrapper::new(e, self.snapshot_map))
|
||||||
|
}
|
||||||
|
|
||||||
fn blocks_ancestor_combinators(&self) -> bool {
|
fn blocks_ancestor_combinators(&self) -> bool {
|
||||||
self.element.blocks_ancestor_combinators()
|
self.element.blocks_ancestor_combinators()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue