mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: fix invalidation of sibling combinators in different slots
This extends the code to deal with sibling invalidation to handle the case where the flat tree doesn't match the DOM tree. In the test-case for example, dom is: * details * summary id=a * summary But flat tree is: * details * slot * summary id=a * slot * summary Differential Revision: https://phabricator.services.mozilla.com/D159150
This commit is contained in:
parent
6cb665df95
commit
f14f1fa440
6 changed files with 66 additions and 11 deletions
|
@ -211,6 +211,18 @@ pub trait TNode: Sized + Copy + Clone + Debug + NodeInfo + PartialEq {
|
|||
self.parent_node().and_then(|n| n.as_element())
|
||||
}
|
||||
|
||||
/// Get this node's parent element, or shadow host if it's a shadow root.
|
||||
fn parent_element_or_host(&self) -> Option<Self::ConcreteElement> {
|
||||
let parent = self.parent_node()?;
|
||||
if let Some(e) = parent.as_element() {
|
||||
return Some(e);
|
||||
}
|
||||
if let Some(root) = parent.as_shadow_root() {
|
||||
return Some(root.host());
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
/// Converts self into an `OpaqueNode`.
|
||||
fn opaque(&self) -> OpaqueNode;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue