mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
layout: Take into account display: table
etc in offset* queries (#32448)
* layout: Take into account `display: table` etc in offset* queries The specification says that for deciding whether an element should be used for offset* queries, a browser should take into account whether the element is a table cell or table. This change makes that happen. Co-authored-by: Oriol Brufau <obrufau@igalia.com> * Only tag HTML elements if they are in the HTML namespace --------- Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
35bbcc0d95
commit
f4c9b310d5
11 changed files with 60 additions and 127 deletions
|
@ -69,6 +69,10 @@ impl<'dom> ServoLayoutElement<'dom> {
|
|||
ServoLayoutElement { element: el }
|
||||
}
|
||||
|
||||
pub(super) fn is_html_element(&self) -> bool {
|
||||
self.element.is_html_element()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_attr_enum(&self, namespace: &Namespace, name: &LocalName) -> Option<&AttrValue> {
|
||||
self.element.get_attr_for_layout(namespace, name)
|
||||
|
@ -139,7 +143,7 @@ impl<'dom> style::dom::TElement for ServoLayoutElement<'dom> {
|
|||
}
|
||||
|
||||
fn is_html_element(&self) -> bool {
|
||||
self.element.is_html_element()
|
||||
ServoLayoutElement::is_html_element(self)
|
||||
}
|
||||
|
||||
fn is_mathml_element(&self) -> bool {
|
||||
|
|
|
@ -313,6 +313,11 @@ impl<'dom> ThreadSafeLayoutNode<'dom> for ServoThreadSafeLayoutNode<'dom> {
|
|||
})
|
||||
}
|
||||
|
||||
fn as_html_element(&self) -> Option<ServoThreadSafeLayoutElement<'dom>> {
|
||||
self.as_element()
|
||||
.filter(|element| element.element.is_html_element())
|
||||
}
|
||||
|
||||
fn style_data(&self) -> Option<&'dom StyleData> {
|
||||
self.node.style_data()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue