aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/script_layout/wrapper_traits.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-02-26 18:26:41 +0100
committerGitHub <noreply@github.com>2024-02-26 17:26:41 +0000
commite5598590baa3a0b283cdf18772bcec26b48aec1a (patch)
treeea7e9ab0ca1bd08465ddeae5cd15898784263f25 /components/shared/script_layout/wrapper_traits.rs
parenta9a7e8a5cfbd57b7b164a027f5afdcacc298751d (diff)
downloadservo-e5598590baa3a0b283cdf18772bcec26b48aec1a.tar.gz
servo-e5598590baa3a0b283cdf18772bcec26b48aec1a.zip
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.
Diffstat (limited to 'components/shared/script_layout/wrapper_traits.rs')
-rw-r--r--components/shared/script_layout/wrapper_traits.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/shared/script_layout/wrapper_traits.rs b/components/shared/script_layout/wrapper_traits.rs
index 54cafc26bea..3274bdb641e 100644
--- a/components/shared/script_layout/wrapper_traits.rs
+++ b/components/shared/script_layout/wrapper_traits.rs
@@ -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>;