mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
layout: Simplify ThreadSafeLayout::text_content
This commit is contained in:
parent
2e05190e68
commit
5577a083ec
1 changed files with 2 additions and 8 deletions
|
@ -1077,13 +1077,7 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
|||
|
||||
fn text_content(&self) -> TextContent {
|
||||
if self.pseudo.is_replaced_content() {
|
||||
let data = &self.borrow_layout_data().unwrap().style_data;
|
||||
|
||||
let style = if self.pseudo.is_before() {
|
||||
data.per_pseudo.get(&PseudoElement::Before).unwrap()
|
||||
} else {
|
||||
data.per_pseudo.get(&PseudoElement::After).unwrap()
|
||||
};
|
||||
let style = self.resolved_style();
|
||||
|
||||
return match style.as_ref().get_counters().content {
|
||||
content::T::Content(ref value) if !value.is_empty() => {
|
||||
|
@ -1109,7 +1103,7 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
|||
return TextContent::Text(data);
|
||||
}
|
||||
|
||||
panic!("not text!")
|
||||
unreachable!("not text!")
|
||||
}
|
||||
|
||||
fn selection(&self) -> Option<Range<ByteIndex>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue