mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
layout: Add line height from preserved segment breaks in quirks mode (#31419)
In quirks mode, preserved segment breaks should add line height to lines. This matches the behavior of WebKit and Blink, but not Gecko. This also handles the special-case of `<br>` elements, which are implemented with preserved segment breaks via `white-space: pre-line`. This is an implementation detail though because `<br>` has a special behavior if the line isn't empty -- it doesn't add any line height in this case.
This commit is contained in:
parent
a9a7e8a5cf
commit
e5598590ba
12 changed files with 158 additions and 10 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use html5ever::LocalName;
|
||||
use html5ever::{local_name, LocalName};
|
||||
use script_layout_interface::wrapper_traits::{ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::properties::ComputedValues;
|
||||
|
@ -79,6 +79,9 @@ where
|
|||
Some(element) if element.is_body_element_of_html_element_root() => {
|
||||
FragmentFlags::IS_BODY_ELEMENT_OF_HTML_ELEMENT_ROOT
|
||||
},
|
||||
Some(element) if element.get_local_name() == &local_name!("br") => {
|
||||
FragmentFlags::IS_BR_ELEMENT
|
||||
},
|
||||
_ => FragmentFlags::empty(),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue