mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Support ::part
selector (#37307)
This is pretty much just wiring up the necessary stylo methods. Note that the `exportparts` attribute is not yet supported, I'll do that in a followup change Testing: Covered by existing web platform tests. This is the first half of https://github.com/servo/servo/issues/35349 Fixes https://github.com/servo/servo/issues/37325 --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
73ee36be00
commit
0fa3de3937
36 changed files with 119 additions and 348 deletions
|
@ -119,9 +119,7 @@ impl<'dom> style::dom::TNode for ServoLayoutNode<'dom> {
|
|||
type ConcreteShadowRoot = ServoShadowRoot<'dom>;
|
||||
|
||||
fn parent_node(&self) -> Option<Self> {
|
||||
self.node
|
||||
.composed_parent_node_ref()
|
||||
.map(Self::from_layout_js)
|
||||
self.node.parent_node_ref().map(Self::from_layout_js)
|
||||
}
|
||||
|
||||
fn first_child(&self) -> Option<Self> {
|
||||
|
@ -302,8 +300,8 @@ impl<'dom> ThreadSafeLayoutNode<'dom> for ServoThreadSafeLayoutNode<'dom> {
|
|||
}
|
||||
|
||||
fn parent_style(&self) -> Arc<ComputedValues> {
|
||||
let parent = self.node.parent_node().unwrap().as_element().unwrap();
|
||||
let parent_data = parent.borrow_data().unwrap();
|
||||
let parent_element = self.node.traversal_parent().unwrap();
|
||||
let parent_data = parent_element.borrow_data().unwrap();
|
||||
parent_data.styles.primary().clone()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue