diff options
author | Bobby Holley <bobbyholley@gmail.com> | 2016-10-25 15:56:29 -0700 |
---|---|---|
committer | Bobby Holley <bobbyholley@gmail.com> | 2016-10-27 09:15:35 -0700 |
commit | a5cabda484a145738ccdb720568862d41b616fb1 (patch) | |
tree | a05612dd545fee3191ac9f78699894ada11a5378 /components/script/layout_wrapper.rs | |
parent | 97fd61f51260c273882e37cad76156d84ce909a3 (diff) | |
download | servo-a5cabda484a145738ccdb720568862d41b616fb1.tar.gz servo-a5cabda484a145738ccdb720568862d41b616fb1.zip |
Teach Servo to compute text node style from layout.
MozReview-Commit-ID: IolVN5puF1i
Diffstat (limited to 'components/script/layout_wrapper.rs')
-rw-r--r-- | components/script/layout_wrapper.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index cad48e36a64..1f715399d4a 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -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() } |