mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Don't strip out all empty fragments
Empty fragments may need to be layed out to draw borders, padding/background, and insertion points. (Fragments that consist of discardable whitespace and control characters, on the other hand, can still be discarded.) This ends up preserving some useless empty fragments. It's possible we could avoid this by storing some sort of flag on "important" empty fragments, so we can discard the rest.
This commit is contained in:
parent
1807fd3cc5
commit
1695d14a9e
3 changed files with 8 additions and 11 deletions
|
@ -1861,6 +1861,7 @@ fn control_chars_to_fragment(node: &InlineFragmentNodeInfo,
|
|||
let info = SpecificFragmentInfo::UnscannedText(
|
||||
box UnscannedTextFragmentInfo::new(String::from(text), None));
|
||||
let mut style = node.style.clone();
|
||||
properties::modify_style_for_replaced_content(&mut style);
|
||||
properties::modify_style_for_text(&mut style);
|
||||
Fragment::from_opaque_node_and_style(node.address,
|
||||
node.pseudo,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue