mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
selectors: Never match ::slotted on <slot>s.
This fixes the test from https://github.com/w3c/web-platform-tests/pull/9212 in Gecko.
This commit is contained in:
parent
bc7dd644f6
commit
61e60a87e5
7 changed files with 36 additions and 7 deletions
|
@ -916,8 +916,12 @@ impl LayoutElementHelpers for LayoutDom<Element> {
|
|||
}
|
||||
|
||||
impl Element {
|
||||
pub fn is_html_element(&self) -> bool {
|
||||
self.namespace == ns!(html)
|
||||
}
|
||||
|
||||
pub fn html_element_in_html_document(&self) -> bool {
|
||||
self.namespace == ns!(html) && self.upcast::<Node>().is_in_html_doc()
|
||||
self.is_html_element() && self.upcast::<Node>().is_in_html_doc()
|
||||
}
|
||||
|
||||
pub fn local_name(&self) -> &LocalName {
|
||||
|
@ -2713,6 +2717,10 @@ impl<'a> SelectorsElement for DomRoot<Element> {
|
|||
fn is_html_element_in_html_document(&self) -> bool {
|
||||
self.html_element_in_html_document()
|
||||
}
|
||||
|
||||
fn is_html_slot_element(&self) -> bool {
|
||||
self.is_html_element() && self.local_name() == &local_name!("slot")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue