Support the <meter> element (#35524)

* Allow attaching UA shadow roots to any element

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Implement a UA shadow tree for the <meter> element

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Add UA styles for the meter element

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Include spec text when computing meter state

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-02-21 17:28:12 +01:00 committed by GitHub
parent 6ccdf7d19f
commit 085cd981aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 207 additions and 27 deletions

View file

@ -526,10 +526,9 @@ impl Element {
// If elements local name is not a valid shadow host name,
// then throw a "NotSupportedError" DOMException.
if !is_valid_shadow_host_name(self.local_name()) {
match self.local_name() {
&local_name!("video") | &local_name!("audio")
if is_ua_widget == IsUserAgentWidget::Yes => {},
_ => return Err(Error::NotSupported),
// UA shadow roots may be attached to anything
if is_ua_widget != IsUserAgentWidget::Yes {
return Err(Error::NotSupported);
}
}
@ -3975,6 +3974,9 @@ impl SelectorsElement for DomRoot<Element> {
NonTSPseudoClass::Indeterminate |
NonTSPseudoClass::Invalid |
NonTSPseudoClass::Modal |
NonTSPseudoClass::MozMeterOptimum |
NonTSPseudoClass::MozMeterSubOptimum |
NonTSPseudoClass::MozMeterSubSubOptimum |
NonTSPseudoClass::Optional |
NonTSPseudoClass::OutOfRange |
NonTSPseudoClass::PlaceholderShown |