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:
Matt Brubeck 2016-04-15 16:00:07 -07:00
parent 1807fd3cc5
commit 1695d14a9e
3 changed files with 8 additions and 11 deletions

View file

@ -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,