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:
Martin Robinson 2024-02-26 18:26:41 +01:00 committed by GitHub
parent a9a7e8a5cf
commit e5598590ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 158 additions and 10 deletions

View file

@ -345,6 +345,10 @@ pub trait ThreadSafeLayoutElement<'dom>:
/// lazily_compute_pseudo_element_style, which operates on TElement.
unsafe fn unsafe_get(self) -> Self::ConcreteElement;
/// Get the local name of this element. See
/// <https://dom.spec.whatwg.org/#concept-element-local-name>.
fn get_local_name(&self) -> &LocalName;
fn get_attr(&self, namespace: &Namespace, name: &LocalName) -> Option<&str>;
fn get_attr_enum(&self, namespace: &Namespace, name: &LocalName) -> Option<&AttrValue>;