Support ::part selector (#37307)

This is pretty much just wiring up the necessary stylo methods. Note
that the `exportparts` attribute is not yet supported, I'll do that in a
followup change

Testing: Covered by existing web platform tests.
This is the first half of https://github.com/servo/servo/issues/35349

Fixes https://github.com/servo/servo/issues/37325

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-06-09 12:17:28 +02:00 committed by GitHub
parent 73ee36be00
commit 0fa3de3937
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 119 additions and 348 deletions

44
Cargo.lock generated
View file

@ -1070,7 +1070,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
dependencies = [
"lazy_static",
"windows-sys 0.59.0",
"windows-sys 0.48.0",
]
[[package]]
@ -2025,7 +2025,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18"
dependencies = [
"libc",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@ -2599,7 +2599,7 @@ dependencies = [
"gobject-sys",
"libc",
"system-deps",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@ -4051,7 +4051,7 @@ checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9"
dependencies = [
"hermit-abi 0.5.0",
"libc",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@ -4313,7 +4313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
dependencies = [
"cfg-if",
"windows-targets 0.52.6",
"windows-targets 0.48.5",
]
[[package]]
@ -6308,7 +6308,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@ -6653,7 +6653,7 @@ dependencies = [
[[package]]
name = "selectors"
version = "0.28.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"bitflags 2.9.1",
"cssparser",
@ -6948,7 +6948,7 @@ dependencies = [
[[package]]
name = "servo_arc"
version = "0.4.1"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"serde",
"stable_deref_trait",
@ -7409,7 +7409,7 @@ dependencies = [
[[package]]
name = "stylo"
version = "0.3.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"app_units",
"arrayvec",
@ -7467,7 +7467,7 @@ dependencies = [
[[package]]
name = "stylo_atoms"
version = "0.3.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"string_cache",
"string_cache_codegen",
@ -7476,12 +7476,12 @@ dependencies = [
[[package]]
name = "stylo_config"
version = "0.3.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
[[package]]
name = "stylo_derive"
version = "0.3.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"darling",
"proc-macro2",
@ -7493,7 +7493,7 @@ dependencies = [
[[package]]
name = "stylo_dom"
version = "0.3.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"bitflags 2.9.1",
"stylo_malloc_size_of",
@ -7502,7 +7502,7 @@ dependencies = [
[[package]]
name = "stylo_malloc_size_of"
version = "0.3.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"app_units",
"cssparser",
@ -7519,12 +7519,12 @@ dependencies = [
[[package]]
name = "stylo_static_prefs"
version = "0.3.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
[[package]]
name = "stylo_traits"
version = "0.3.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"app_units",
"bitflags 2.9.1",
@ -7698,7 +7698,7 @@ dependencies = [
"getrandom 0.2.16",
"once_cell",
"rustix",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@ -7933,7 +7933,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "to_shmem"
version = "0.2.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"cssparser",
"servo_arc",
@ -7946,7 +7946,7 @@ dependencies = [
[[package]]
name = "to_shmem_derive"
version = "0.1.0"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#945b70e9a1984cd44ee56b7a674c302b19a4f620"
source = "git+https://github.com/servo/stylo?branch=2025-05-01#2954cec3ae951723f9b346d8720010d30072b725"
dependencies = [
"darling",
"proc-macro2",
@ -8745,9 +8745,9 @@ dependencies = [
[[package]]
name = "web_atoms"
version = "0.1.2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b9c5f0bc545ea3b20b423e33b9b457764de0b3730cd957f6c6aa6c301785f6e"
checksum = "57ffde1dc01240bdf9992e3205668b235e59421fd085e8a317ed98da0178d414"
dependencies = [
"phf",
"phf_codegen",
@ -9132,7 +9132,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
"windows-sys 0.59.0",
"windows-sys 0.48.0",
]
[[package]]

View file

@ -861,8 +861,14 @@ pub(crate) fn get_attr_for_layout<'dom>(
pub(crate) trait LayoutElementHelpers<'dom> {
fn attrs(self) -> &'dom [LayoutDom<'dom, Attr>];
fn has_class_for_layout(self, name: &AtomIdent, case_sensitivity: CaseSensitivity) -> bool;
fn has_class_or_part_for_layout(
self,
name: &AtomIdent,
attr_name: &LocalName,
case_sensitivity: CaseSensitivity,
) -> bool;
fn get_classes_for_layout(self) -> Option<&'dom [Atom]>;
fn get_parts_for_layout(self) -> Option<&'dom [Atom]>;
fn synthesize_presentational_hints_for_legacy_attributes<V>(self, hints: &mut V)
where
@ -905,8 +911,13 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
}
#[inline]
fn has_class_for_layout(self, name: &AtomIdent, case_sensitivity: CaseSensitivity) -> bool {
get_attr_for_layout(self, &ns!(), &local_name!("class")).is_some_and(|attr| {
fn has_class_or_part_for_layout(
self,
name: &AtomIdent,
attr_name: &LocalName,
case_sensitivity: CaseSensitivity,
) -> bool {
get_attr_for_layout(self, &ns!(), attr_name).is_some_and(|attr| {
attr.to_tokens()
.unwrap()
.iter()
@ -920,6 +931,11 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
.map(|attr| attr.to_tokens().unwrap())
}
fn get_parts_for_layout(self) -> Option<&'dom [Atom]> {
get_attr_for_layout(self, &ns!(), &local_name!("part"))
.map(|attr| attr.to_tokens().unwrap())
}
fn synthesize_presentational_hints_for_legacy_attributes<V>(self, hints: &mut V)
where
V: Push<ApplicableDeclarationBlock>,
@ -1995,6 +2011,16 @@ impl Element {
})
}
pub(crate) fn is_part(&self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool {
self.get_attribute(&ns!(), &LocalName::from("part"))
.is_some_and(|attr| {
attr.value()
.as_tokens()
.iter()
.any(|atom| case_sensitivity.eq_atom(name, atom))
})
}
pub(crate) fn set_atomic_attribute(
&self,
local_name: &LocalName,
@ -4051,6 +4077,13 @@ impl ElementMethods<crate::DomTypeHolder> for Element {
rooted!(in(*cx) let slottable = Slottable(Dom::from_ref(self.upcast::<Node>())));
slottable.find_a_slot(true)
}
/// <https://drafts.csswg.org/css-shadow-parts/#dom-element-part>
fn Part(&self) -> DomRoot<DOMTokenList> {
self.ensure_rare_data()
.part
.or_init(|| DOMTokenList::new(self, &local_name!("part"), None, CanGc::note()))
}
}
impl VirtualMethods for Element {
@ -4190,7 +4223,9 @@ impl VirtualMethods for Element {
match *name {
local_name!("id") => AttrValue::from_atomic(value.into()),
local_name!("name") => AttrValue::from_atomic(value.into()),
local_name!("class") => AttrValue::from_serialized_tokenlist(value.into()),
local_name!("class") | local_name!("part") => {
AttrValue::from_serialized_tokenlist(value.into())
},
_ => self
.super_type()
.unwrap()
@ -4564,8 +4599,8 @@ impl SelectorsElement for SelectorWrapper<'_> {
.is_some_and(|atom| case_sensitivity.eq_atom(id, atom))
}
fn is_part(&self, _name: &AtomIdent) -> bool {
false
fn is_part(&self, name: &AtomIdent) -> bool {
Element::is_part(self, name, CaseSensitivity::CaseSensitive)
}
fn imported_part(&self, _: &AtomIdent) -> Option<AtomIdent> {

View file

@ -437,7 +437,7 @@ impl HTMLElementMethods<crate::DomTypeHolder> for HTMLElement {
document.request_focus(None, FocusInitiator::Local, can_gc);
}
// https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent
/// <https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent>
fn GetOffsetParent(&self, can_gc: CanGc) -> Option<DomRoot<Element>> {
if self.is::<HTMLBodyElement>() || self.is::<HTMLHtmlElement>() {
return None;

View file

@ -1583,6 +1583,7 @@ pub(crate) unsafe fn from_untrusted_node_address(candidate: UntrustedNodeAddress
pub(crate) trait LayoutNodeHelpers<'dom> {
fn type_id_for_layout(self) -> NodeTypeId;
fn parent_node_ref(self) -> Option<LayoutDom<'dom, Node>>;
fn composed_parent_node_ref(self) -> Option<LayoutDom<'dom, Node>>;
fn first_child_ref(self) -> Option<LayoutDom<'dom, Node>>;
fn last_child_ref(self) -> Option<LayoutDom<'dom, Node>>;
@ -1645,7 +1646,7 @@ pub(crate) trait LayoutNodeHelpers<'dom> {
impl<'dom> LayoutDom<'dom, Node> {
#[inline]
#[allow(unsafe_code)]
fn parent_node_ref(self) -> Option<LayoutDom<'dom, Node>> {
pub(crate) fn parent_node_ref(self) -> Option<LayoutDom<'dom, Node>> {
unsafe { self.unsafe_get().parent_node.get_inner_as_layout() }
}
}
@ -1661,6 +1662,12 @@ impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node> {
(*self).is::<Element>()
}
#[inline]
#[allow(unsafe_code)]
fn parent_node_ref(self) -> Option<LayoutDom<'dom, Node>> {
unsafe { self.unsafe_get().parent_node.get_inner_as_layout() }
}
#[inline]
fn composed_parent_node_ref(self) -> Option<LayoutDom<'dom, Node>> {
let parent = self.parent_node_ref();

View file

@ -11,6 +11,7 @@ use crate::dom::bindings::root::{Dom, MutNullableDom};
use crate::dom::customelementregistry::{
CustomElementDefinition, CustomElementReaction, CustomElementState,
};
use crate::dom::domtokenlist::DOMTokenList;
use crate::dom::elementinternals::ElementInternals;
use crate::dom::htmlslotelement::SlottableData;
use crate::dom::intersectionobserver::IntersectionObserverRegistration;
@ -76,4 +77,10 @@ pub(crate) struct ElementRareData {
/// > which is initialized to an empty list. This list holds IntersectionObserverRegistration records, which have:
pub(crate) registered_intersection_observers: Vec<IntersectionObserverRegistration>,
pub(crate) cryptographic_nonce: String,
/// <https://drafts.csswg.org/css-shadow-parts/#element-forwarded-part-name-list>
pub(crate) forwarded_part_names: Vec<(String, String)>,
/// <https://drafts.csswg.org/css-shadow-parts/#dom-element-part>
pub(crate) part: MutNullableDom<DOMTokenList>,
}

View file

@ -216,11 +216,15 @@ impl<'dom> style::dom::TElement for ServoLayoutElement<'dom> {
}
fn has_part_attr(&self) -> bool {
false
self.element
.get_attr_for_layout(&ns!(), &local_name!("part"))
.is_some()
}
fn exports_any_part(&self) -> bool {
false
self.element
.get_attr_for_layout(&ns!(), &local_name!("exportparts"))
.is_some()
}
fn style_attribute(&self) -> Option<ArcBorrow<StyleLocked<PropertyDeclarationBlock>>> {
@ -292,6 +296,17 @@ impl<'dom> style::dom::TElement for ServoLayoutElement<'dom> {
}
}
fn each_part<F>(&self, mut callback: F)
where
F: FnMut(&AtomIdent),
{
if let Some(parts) = self.element.get_parts_for_layout() {
for part in parts {
callback(AtomIdent::cast(part))
}
}
}
fn has_dirty_descendants(&self) -> bool {
unsafe {
self.as_node()
@ -728,8 +743,12 @@ impl<'dom> ::selectors::Element for ServoLayoutElement<'dom> {
}
#[inline]
fn is_part(&self, _name: &AtomIdent) -> bool {
false
fn is_part(&self, name: &AtomIdent) -> bool {
self.element.has_class_or_part_for_layout(
name,
&local_name!("part"),
CaseSensitivity::CaseSensitive,
)
}
fn imported_part(&self, _: &AtomIdent) -> Option<AtomIdent> {
@ -738,7 +757,8 @@ impl<'dom> ::selectors::Element for ServoLayoutElement<'dom> {
#[inline]
fn has_class(&self, name: &AtomIdent, case_sensitivity: CaseSensitivity) -> bool {
self.element.has_class_for_layout(name, case_sensitivity)
self.element
.has_class_or_part_for_layout(name, &local_name!("class"), case_sensitivity)
}
fn is_html_slot_element(&self) -> bool {

View file

@ -119,9 +119,7 @@ impl<'dom> style::dom::TNode for ServoLayoutNode<'dom> {
type ConcreteShadowRoot = ServoShadowRoot<'dom>;
fn parent_node(&self) -> Option<Self> {
self.node
.composed_parent_node_ref()
.map(Self::from_layout_js)
self.node.parent_node_ref().map(Self::from_layout_js)
}
fn first_child(&self) -> Option<Self> {
@ -302,8 +300,8 @@ impl<'dom> ThreadSafeLayoutNode<'dom> for ServoThreadSafeLayoutNode<'dom> {
}
fn parent_style(&self) -> Arc<ComputedValues> {
let parent = self.node.parent_node().unwrap().as_element().unwrap();
let parent_data = parent.borrow_data().unwrap();
let parent_element = self.node.traversal_parent().unwrap();
let parent_data = parent_element.borrow_data().unwrap();
parent_data.styles.primary().clone()
}

View file

@ -144,3 +144,8 @@ Element includes NonDocumentTypeChildNode;
Element includes ParentNode;
Element includes ActivatableElement;
Element includes ARIAMixin;
// https://drafts.csswg.org/css-shadow-parts/#idl
partial interface Element {
[SameObject, PutForwards=value] readonly attribute DOMTokenList part;
};

View file

@ -1,7 +1,4 @@
[highlight-pseudos.html]
["::part(my-part)::selection" should be a valid selector]
expected: FAIL
["::target-text" should be a valid selector]
expected: FAIL

View file

@ -1,6 +0,0 @@
[all-hosts.html]
[::part with host selector styles in first host]
expected: FAIL
[::part with host selector styles in second host]
expected: FAIL

View file

@ -1,2 +1,2 @@
[animation-part.html]
expected: FAIL
expected: TIMEOUT

View file

@ -1,3 +0,0 @@
[complex-matching.html]
[Complex selector for host works]
expected: FAIL

View file

@ -1,12 +1,3 @@
[grouping-with-checked.html]
[Styles applied to ::part(...)]
expected: FAIL
[Styles applied to ::part(...):checked]
expected: FAIL
[Styles applied via grouped selector including matched ::part(...):checked]
expected: FAIL
[Styles applied via grouped selector including unmatched ::part(...):checked]
expected: FAIL

View file

@ -1,12 +0,0 @@
[grouping-with-disabled.html]
[Styles applied to ::part(...)]
expected: FAIL
[Styles applied to ::part(...):disabled]
expected: FAIL
[Styles applied via grouped selector including matched ::part(...):disabled]
expected: FAIL
[Styles applied via grouped selector including unmatched ::part(...):disabled]
expected: FAIL

View file

@ -1,3 +0,0 @@
[host-part-001.html]
[:host::part works]
expected: FAIL

View file

@ -1,3 +0,0 @@
[host-part-002.html]
[:host::part has correct cascading behavior]
expected: FAIL

View file

@ -1,3 +0,0 @@
[host-part-nesting.html]
[:host::part works in nesting]
expected: FAIL

View file

@ -1,12 +0,0 @@
[idlharness.html]
[Element interface: attribute part]
expected: FAIL
[Element interface: element must inherit property "part" with the proper type]
expected: FAIL
[Element interface: htmlElement must inherit property "part" with the proper type]
expected: FAIL
[Element interface: svgElement must inherit property "part" with the proper type]
expected: FAIL

View file

@ -1,3 +0,0 @@
[inner-host.html]
[Part in outer host is styled by document style sheet]
expected: FAIL

View file

@ -1,16 +1,7 @@
[interaction-with-pseudo-elements.html]
[::before in selected host is styled]
expected: FAIL
[::after in selected host is styled]
expected: FAIL
[::placeholder in selected host is styled]
expected: FAIL
[::selection in selected host is styled]
expected: FAIL
[::first-line in selected host is styled]
expected: FAIL

View file

@ -1,3 +0,0 @@
[invalidation-change-part-name-idl-domtokenlist.html]
[Part in selected host changed color via part IDL DOMTokenList attribute.]
expected: FAIL

View file

@ -1,3 +0,0 @@
[invalidation-change-part-name-idl-setter.html]
[Part in selected host changed color via part IDL attribute setter.]
expected: FAIL

View file

@ -1,3 +0,0 @@
[invalidation-complex-selector.html]
[Part in selected host changed color]
expected: FAIL

View file

@ -1,3 +0,0 @@
[multiple-parts.html]
[Double-part in selected host is styled]
expected: FAIL

View file

@ -1,12 +0,0 @@
[part-name-idl.html]
[Access to .part returns an empty DOMTokenList.]
expected: FAIL
[Multiple names give a DOMTokenList with multiple entries.]
expected: FAIL
[DOMTokenList created by access is persisted.]
expected: FAIL
[Changes in DOMTokenList are refected in attribute.]
expected: FAIL

View file

@ -1,2 +0,0 @@
[part-nested-pseudo.html]
expected: FAIL

View file

@ -1,82 +1,28 @@
[pseudo-classes-after-part.html]
["::part(mypart):active" should be a valid selector]
expected: FAIL
["::part(mypart):active-view-transition" should be a valid selector]
expected: FAIL
["::part(mypart):active-view-transition-type(mytype)" should be a valid selector]
expected: FAIL
["::part(mypart):any-link" should be a valid selector]
expected: FAIL
["::part(mypart):autofill" should be a valid selector]
expected: FAIL
["::part(mypart):checked" should be a valid selector]
expected: FAIL
["::part(mypart):default" should be a valid selector]
expected: FAIL
["::part(mypart):defined" should be a valid selector]
expected: FAIL
["::part(mypart):dir(ltr)" should be a valid selector]
expected: FAIL
["::part(mypart):disabled" should be a valid selector]
expected: FAIL
["::part(mypart):enabled" should be a valid selector]
expected: FAIL
["::part(mypart):focus" should be a valid selector]
expected: FAIL
["::part(mypart):focus-visible" should be a valid selector]
expected: FAIL
["::part(mypart):focus-within" should be a valid selector]
expected: FAIL
["::part(mypart):fullscreen" should be a valid selector]
expected: FAIL
["::part(mypart):future" should be a valid selector]
expected: FAIL
["::part(mypart):hover" should be a valid selector]
expected: FAIL
["::part(mypart):indeterminate" should be a valid selector]
expected: FAIL
["::part(mypart):in-range" should be a valid selector]
expected: FAIL
["::part(mypart):invalid" should be a valid selector]
expected: FAIL
["::part(mypart):lang(en)" should be a valid selector]
expected: FAIL
["::part(mypart):link" should be a valid selector]
expected: FAIL
["::part(mypart):modal" should be a valid selector]
expected: FAIL
["::part(mypart):open" should be a valid selector]
expected: FAIL
["::part(mypart):optional" should be a valid selector]
expected: FAIL
["::part(mypart):out-of-range" should be a valid selector]
expected: FAIL
["::part(mypart):past" should be a valid selector]
expected: FAIL
@ -86,56 +32,11 @@
["::part(mypart):picture-in-picture" should be a valid selector]
expected: FAIL
["::part(mypart):placeholder-shown" should be a valid selector]
expected: FAIL
["::part(mypart):playing" should be a valid selector]
expected: FAIL
["::part(mypart):popover-open" should be a valid selector]
expected: FAIL
["::part(mypart):read-only" should be a valid selector]
expected: FAIL
["::part(mypart):read-write" should be a valid selector]
expected: FAIL
["::part(mypart):required" should be a valid selector]
expected: FAIL
["::part(mypart):state(mystate)" should be a valid selector]
expected: FAIL
["::part(mypart):target" should be a valid selector]
expected: FAIL
["::part(mypart):user-invalid" should be a valid selector]
expected: FAIL
["::part(mypart):user-valid" should be a valid selector]
expected: FAIL
["::part(mypart):valid" should be a valid selector]
expected: FAIL
["::part(mypart):visited" should be a valid selector]
expected: FAIL
["::part(mypart):xr-overlay" should be a valid selector]
expected: FAIL
["::part(mypart):not(:hover)" should be a valid selector]
expected: FAIL
["::part(mypart):is(:hover)" should be a valid selector]
expected: FAIL
["::part(mypart):where(:hover)" should be a valid selector]
expected: FAIL
["::part(mypart):is(:first-child)" should be a valid selector]
expected: FAIL
["::part(mypart):where(:first-child)" should be a valid selector]
expected: FAIL

View file

@ -1,13 +1,4 @@
[pseudo-elements-after-part.html]
["::part(mypart)::after" should be a valid selector]
expected: FAIL
["::part(mypart)::backdrop" should be a valid selector]
expected: FAIL
["::part(mypart)::before" should be a valid selector]
expected: FAIL
["::part(mypart)::cue" should be a valid selector]
expected: FAIL
@ -29,18 +20,12 @@
["::part(mypart)::highlight(myhighlight)" should be a valid selector]
expected: FAIL
["::part(mypart)::marker" should be a valid selector]
expected: FAIL
["::part(mypart)::placeholder" should be a valid selector]
expected: FAIL
["::part(mypart)::search-text" should be a valid selector]
expected: FAIL
["::part(mypart)::selection" should be a valid selector]
expected: FAIL
["::part(mypart)::spelling-error" should be a valid selector]
expected: FAIL
@ -95,21 +80,12 @@
[computed style for ::part()::search-text]
expected: FAIL
[computed style for ::part()::selection]
expected: FAIL
[computed style for ::part()::spelling-error]
expected: FAIL
[computed style for ::part()::target-text]
expected: FAIL
[::part styles with ::part(mypart)::after {\n display: block;\n content: "";\n height: 77px;\n } and <div part='mypart'></div>]
expected: FAIL
[::part styles with ::part(mypart)::before {\n display: block;\n content: "";\n height: 46px;\n } and <div part='mypart'></div>]
expected: FAIL
[::part styles with ::part(mypart)::details-content {\n height: 371px;\n } and <details part='mypart'><summary style="height:47px">summary</summary>details</details>]
expected: FAIL
@ -121,6 +97,3 @@
[::part styles with ::part(mypart) {\n font: 20px/1 Ahem;\n }\n ::part(mypart)::first-line {\n font-size: 86px;\n } and <div part=mypart>X<br>X</div>]
expected: FAIL
[::part styles with ::part(mypart)::marker {\n font: 63px/1.0 Ahem;\n content: "X";\n } and <li style="list-style-position: inside" part="mypart"></li>]
expected: FAIL

View file

@ -1,9 +0,0 @@
[serialization.html]
[Escape start parenthesis in ::part name.]
expected: FAIL
[Escape start space in ::part name.]
expected: FAIL
[Collapse spaces in ::part names list.]
expected: FAIL

View file

@ -1,3 +0,0 @@
[simple-inline.html]
[Part in selected host is styled]
expected: FAIL

View file

@ -1,3 +0,0 @@
[simple.html]
[Part in selected host is styled]
expected: FAIL

View file

@ -1,3 +0,0 @@
[style-sharing.html]
[Part in selected host does not incorrectly share style with non-part]
expected: FAIL

View file

@ -1,2 +0,0 @@
[part-pseudo.html]
expected: FAIL

View file

@ -1,12 +0,0 @@
[parse-is-where.html]
["::part(foo):is(:hover)" should be a valid selector]
expected: FAIL
["::part(foo):where(:hover)" should be a valid selector]
expected: FAIL
["::part(foo):is([attr='value'\])" should be a valid selector]
expected: FAIL
["::part(foo):where([attr='value'\])" should be a valid selector]
expected: FAIL

View file

@ -1,37 +1,4 @@
[parse-part.html]
["::part(--foo)" should be a valid selector]
expected: FAIL
["::part(bar)" should be a valid selector]
expected: FAIL
["::part(--)" should be a valid selector]
expected: FAIL
["::part(--0)" should be a valid selector]
expected: FAIL
["::part(foo bar)" should be a valid selector]
expected: FAIL
["::part(-foo bar)" should be a valid selector]
expected: FAIL
["::part(foo):focus" should be a valid selector]
expected: FAIL
["::part(foo):hover" should be a valid selector]
expected: FAIL
["::part(foo):focus-within" should be a valid selector]
expected: FAIL
["::part(foo)::before" should be a valid selector]
expected: FAIL
["::part(foo)::after" should be a valid selector]
expected: FAIL
["::part(foo)::placeholder" should be a valid selector]
expected: FAIL
@ -44,12 +11,6 @@
["::part(foo)::file-selector-button" should be a valid selector]
expected: FAIL
["::part(foo):is(:focus)" should be a valid selector]
expected: FAIL
[":lang(en)::part(foo)" should be a valid selector]
expected: FAIL
[":dir(ltr)::part(foo)" should be a valid selector]
expected: FAIL
@ -58,21 +19,3 @@
["::part(foo):dir(ltr)" should be a valid selector]
expected: FAIL
["::part(foo):is(ul)" should be a valid selector]
expected: FAIL
["::part(foo):is(nav ul)" should be a valid selector]
expected: FAIL
["::part(foo):where(ul)" should be a valid selector]
expected: FAIL
["::part(foo):where(nav ul)" should be a valid selector]
expected: FAIL
["::part(foo):disabled" should be a valid selector]
expected: FAIL
["::part(foo):checked" should be a valid selector]
expected: FAIL

View file

@ -0,0 +1,6 @@
[offsetParent-across-shadow-boundaries.html]
[offsetParent must find the first offset parent which is a shadow-including ancestor of the context object even some shadow tree of open mode did not have any offset parent]
expected: FAIL
[offsetParent must find the first offset parent which is a shadow-including ancestor of the context object even some shadow tree of closed mode did not have any offset parent]
expected: FAIL