mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Teach Servo to compute text node style from layout.
MozReview-Commit-ID: IolVN5puF1i
This commit is contained in:
parent
97fd61f512
commit
a5cabda484
2 changed files with 35 additions and 4 deletions
|
@ -825,6 +825,14 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
|||
self.node.type_id()
|
||||
}
|
||||
|
||||
fn style_for_text_node(&self) -> Arc<ComputedValues> {
|
||||
debug_assert!(self.is_text_node());
|
||||
let parent = self.node.parent_node().unwrap();
|
||||
let parent_data = parent.get_style_data().unwrap().borrow();
|
||||
let parent_style = &parent_data.current_styles().primary;
|
||||
ComputedValues::style_for_child_text_node(parent_style)
|
||||
}
|
||||
|
||||
fn debug_id(self) -> usize {
|
||||
self.node.debug_id()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue