diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-04-01 06:02:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-01 06:02:08 -0500 |
commit | 449758ef5dd399f7e1a5a9550dcdd614056cee9e (patch) | |
tree | 6c769ff601eeb4d9aa432e08b166d9ec7bd7e55a /components/script/layout_wrapper.rs | |
parent | 2ebddca5921230eafc25acaa5bf47c10756f3e51 (diff) | |
parent | 6da65d605bbf3190e0f5206d589c710502cc7c67 (diff) | |
download | servo-449758ef5dd399f7e1a5a9550dcdd614056cee9e.tar.gz servo-449758ef5dd399f7e1a5a9550dcdd614056cee9e.zip |
Auto merge of #16096 - stshine:die-modify-style-die, r=emilio
Use Servo-specific pseudo elements for anonymous box and text
<!-- Please describe your changes on the following line: -->
Use some fake pseudo elements to style servo-specific boxes in servo. Also, 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 using empty pseudo to do cascading.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #5625 (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because refactoring
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16096)
<!-- Reviewable:end -->
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 9a672ae7da9..1956cd6018d 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -788,16 +788,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() |