diff options
author | Pu Xingyu <pu.stshine@gmail.com> | 2017-03-23 21:03:41 +0800 |
---|---|---|
committer | Pu Xingyu <pu.stshine@gmail.com> | 2017-04-01 14:05:11 +0800 |
commit | 951c0506909ac5e6e180a97329a47c41ab6c458b (patch) | |
tree | 6bc3fc93ab50814651eaf025bbe9f207058f6e7e /components/script/layout_wrapper.rs | |
parent | 1677d479f61351ad22149eb577de6713a16b9908 (diff) | |
download | servo-951c0506909ac5e6e180a97329a47c41ab6c458b.tar.gz servo-951c0506909ac5e6e180a97329a47c41ab6c458b.zip |
Use empty pseudo to cascade only inheritable properties for text
Since for nested inline elements non-inheritable properties are
properly stored in the inline context of an inline fragment, so get
rid of them on the style.
Diffstat (limited to 'components/script/layout_wrapper.rs')
-rw-r--r-- | components/script/layout_wrapper.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index 661d3289671..72e59c0c6eb 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -780,16 +780,7 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> { self.node.type_id() } - fn style_for_text_node(&self) -> Arc<ComputedValues> { - // Text nodes get a copy of the parent style. Inheriting all non- - // inherited properties into the text node is odd from a CSS - // perspective, but makes fragment construction easier (by making - // properties like vertical-align on fragments have values that - // match the parent element). This is an implementation detail of - // Servo layout that is not central to how fragment construction - // works, but would be difficult to change. (Text node style is - // also not visible to script.) - debug_assert!(self.is_text_node()); + fn parent_style(&self) -> Arc<ComputedValues> { let parent = self.node.parent_node().unwrap().as_element().unwrap(); let parent_data = parent.get_data().unwrap().borrow(); parent_data.styles().primary.values().clone() |