diff --git a/Cargo.lock b/Cargo.lock index 4cfad65d0aa..7481f6a62de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1207,7 +1207,7 @@ dependencies = [ [[package]] name = "derive_common" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "darling", "proc-macro2", @@ -3551,7 +3551,7 @@ dependencies = [ [[package]] name = "malloc_size_of" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "accountable-refcell", "app_units", @@ -5164,7 +5164,7 @@ dependencies = [ [[package]] name = "selectors" version = "0.24.0" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "bitflags 2.5.0", "cssparser", @@ -5452,7 +5452,7 @@ dependencies = [ [[package]] name = "servo_arc" version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "nodrop", "serde", @@ -5462,7 +5462,7 @@ dependencies = [ [[package]] name = "servo_atoms" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "string_cache", "string_cache_codegen", @@ -5660,7 +5660,7 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "size_of_test" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "static_assertions", ] @@ -5786,7 +5786,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "static_prefs" version = "0.1.0" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" [[package]] name = "strict-num" @@ -5823,7 +5823,7 @@ dependencies = [ [[package]] name = "style" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "app_units", "arrayvec", @@ -5882,7 +5882,7 @@ dependencies = [ [[package]] name = "style_config" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "lazy_static", ] @@ -5890,7 +5890,7 @@ dependencies = [ [[package]] name = "style_derive" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "darling", "derive_common", @@ -5921,7 +5921,7 @@ dependencies = [ [[package]] name = "style_traits" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "app_units", "bitflags 2.5.0", @@ -6284,7 +6284,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "to_shmem" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "cssparser", "servo_arc", @@ -6297,7 +6297,7 @@ dependencies = [ [[package]] name = "to_shmem_derive" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810" +source = "git+https://github.com/servo/stylo?branch=2024-04-16#ad60f6fba27c749c08e9d24da3af70f9793c5417" dependencies = [ "darling", "derive_common", diff --git a/Cargo.toml b/Cargo.toml index 3db5be3150c..64efacad82e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ keyboard-types = "0.6" lazy_static = "1.4" libc = "0.2" log = "0.4" -malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2024-03-01", features = ["servo"] } +malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2024-04-16", features = ["servo"] } malloc_size_of_derive = "0.1" mime = "0.3.13" mime_guess = "2.0.3" @@ -87,31 +87,31 @@ rustls = { version = "0.21.11", features = ["dangerous_configuration"] } rustls-pemfile = "1.0.4" script_layout_interface = { path = "components/shared/script_layout" } script_traits = { path = "components/shared/script" } -selectors = { git = "https://github.com/servo/stylo", branch = "2024-03-01" } +selectors = { git = "https://github.com/servo/stylo", branch = "2024-04-16" } serde = "1.0.198" serde_bytes = "0.11" serde_json = "1.0" servo-media = { git = "https://github.com/servo/media" } servo-media-dummy = { git = "https://github.com/servo/media" } servo-media-gstreamer = { git = "https://github.com/servo/media" } -servo_arc = { git = "https://github.com/servo/stylo", branch = "2024-03-01" } -servo_atoms = { git = "https://github.com/servo/stylo", branch = "2024-03-01" } -size_of_test = { git = "https://github.com/servo/stylo", branch = "2024-03-01" } +servo_arc = { git = "https://github.com/servo/stylo", branch = "2024-04-16" } +servo_atoms = { git = "https://github.com/servo/stylo", branch = "2024-04-16" } +size_of_test = { git = "https://github.com/servo/stylo", branch = "2024-04-16" } smallbitvec = "2.5.3" smallvec = "1.13" sparkle = "0.1.26" string_cache = "0.8" string_cache_codegen = "0.5" -style = { git = "https://github.com/servo/stylo", branch = "2024-03-01", features = ["servo"] } -style_config = { git = "https://github.com/servo/stylo", branch = "2024-03-01" } -style_traits = { git = "https://github.com/servo/stylo", branch = "2024-03-01", features = ["servo"] } +style = { git = "https://github.com/servo/stylo", branch = "2024-04-16", features = ["servo"] } +style_config = { git = "https://github.com/servo/stylo", branch = "2024-04-16" } +style_traits = { git = "https://github.com/servo/stylo", branch = "2024-04-16", features = ["servo"] } # NOTE: the sm-angle feature only 2024-03-01rms! surfman = { version = "0.9", features = ["chains", "sm-angle", "sm-angle-default"] } syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] } synstructure = "0.13" thin-vec = "0.2.13" time = "0.1.41" -to_shmem = { git = "https://github.com/servo/stylo", branch = "2024-03-01" } +to_shmem = { git = "https://github.com/servo/stylo", branch = "2024-04-16" } tokio = "1" tokio-rustls = "0.24" tungstenite = "0.20" diff --git a/components/script/dom/cssgroupingrule.rs b/components/script/dom/cssgroupingrule.rs index eb542c6205c..60babba658c 100644 --- a/components/script/dom/cssgroupingrule.rs +++ b/components/script/dom/cssgroupingrule.rs @@ -5,7 +5,7 @@ use dom_struct::dom_struct; use servo_arc::Arc; use style::shared_lock::{Locked, SharedRwLock}; -use style::stylesheets::{CssRuleTypes, CssRules as StyleCssRules}; +use style::stylesheets::{CssRuleType, CssRuleTypes, CssRules as StyleCssRules}; use crate::dom::bindings::codegen::Bindings::CSSGroupingRuleBinding::CSSGroupingRuleMethods; use crate::dom::bindings::error::{ErrorResult, Fallible}; @@ -70,8 +70,16 @@ impl CSSGroupingRuleMethods for CSSGroupingRule { // TODO: this should accumulate the rule types of all ancestors. let rule_type = self.cssrule.as_specific().ty(); let containing_rule_types = CssRuleTypes::from(rule_type); - self.rulelist() - .insert_rule(&rule, index, containing_rule_types) + let parse_relative_rule_type = match rule_type { + CssRuleType::Style | CssRuleType::Scope => Some(rule_type), + _ => None, + }; + self.rulelist().insert_rule( + &rule, + index, + containing_rule_types, + parse_relative_rule_type, + ) } // https://drafts.csswg.org/cssom/#dom-cssgroupingrule-deleterule diff --git a/components/script/dom/cssrule.rs b/components/script/dom/cssrule.rs index 4c7c0b7bd0a..25281bf4d96 100644 --- a/components/script/dom/cssrule.rs +++ b/components/script/dom/cssrule.rs @@ -117,6 +117,8 @@ impl CSSRule { StyleCssRule::FontPaletteValues(_) => unimplemented!(), // TODO StyleCssRule::Property(_) => unimplemented!(), // TODO StyleCssRule::Margin(_) => unimplemented!(), // TODO + StyleCssRule::Scope(_) => unimplemented!(), // TODO + StyleCssRule::StartingStyle(_) => unimplemented!(), // TODO } } diff --git a/components/script/dom/cssrulelist.rs b/components/script/dom/cssrulelist.rs index 3390601b1dd..72c1da22292 100644 --- a/components/script/dom/cssrulelist.rs +++ b/components/script/dom/cssrulelist.rs @@ -8,8 +8,8 @@ use dom_struct::dom_struct; use servo_arc::Arc; use style::shared_lock::Locked; use style::stylesheets::{ - AllowImportRules, CssRuleTypes, CssRules, CssRulesHelpers, KeyframesRule, RulesMutateError, - StylesheetLoader as StyleStylesheetLoader, + AllowImportRules, CssRuleType, CssRuleTypes, CssRules, CssRulesHelpers, KeyframesRule, + RulesMutateError, StylesheetLoader as StyleStylesheetLoader, }; use crate::dom::bindings::cell::DomRefCell; @@ -97,6 +97,7 @@ impl CSSRuleList { rule: &str, idx: u32, containing_rule_types: CssRuleTypes, + parse_relative_rule_type: Option, ) -> Fallible { let css_rules = if let RulesSource::Rules(ref rules) = self.rules { rules @@ -122,6 +123,7 @@ impl CSSRuleList { &parent_stylesheet.contents, index, containing_rule_types, + parse_relative_rule_type, loader.as_ref().map(|l| l as &dyn StyleStylesheetLoader), AllowImportRules::Yes, )?; diff --git a/components/script/dom/cssstylesheet.rs b/components/script/dom/cssstylesheet.rs index 9fee49f3945..a83c90e0f78 100644 --- a/components/script/dom/cssstylesheet.rs +++ b/components/script/dom/cssstylesheet.rs @@ -129,7 +129,7 @@ impl CSSStyleSheetMethods for CSSStyleSheet { return Err(Error::Security); } self.rulelist() - .insert_rule(&rule, index, CssRuleTypes::default()) + .insert_rule(&rule, index, CssRuleTypes::default(), None) } // https://drafts.csswg.org/cssom/#dom-cssstylesheet-deleterule diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 8edf819325c..971c478c1b2 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -3311,6 +3311,8 @@ impl SelectorsElement for DomRoot { }, }, + NonTSPseudoClass::CustomState(ref state) => self.has_custom_state(&state.0), + // FIXME(heycam): This is wrong, since extended_filtering accepts // a string containing commas (separating each language tag in // a list) but the pseudo-class instead should be parsing and @@ -3432,6 +3434,10 @@ impl SelectorsElement for DomRoot { true } + + fn has_custom_state(&self, _name: &AtomIdent) -> bool { + false + } } impl Element { diff --git a/components/script/layout_dom/element.rs b/components/script/layout_dom/element.rs index 8d1c6713849..3e71e1eb773 100644 --- a/components/script/layout_dom/element.rs +++ b/components/script/layout_dom/element.rs @@ -414,15 +414,16 @@ impl<'dom> style::dom::TElement for ServoLayoutElement<'dom> { self.element.get_selector_flags().contains(flags) } - fn relative_selector_search_direction(&self) -> Option { - let flags = self.element.get_selector_flags().intersection( - ElementSelectorFlags::RELATIVE_SELECTOR_SEARCH_DIRECTION_ANCESTOR_SIBLING, - ); - if flags.is_empty() { - None - } else { - Some(flags) - } + fn relative_selector_search_direction(&self) -> ElementSelectorFlags { + self.element + .get_selector_flags() + .intersection(ElementSelectorFlags::RELATIVE_SELECTOR_SEARCH_DIRECTION_ANCESTOR_SIBLING) + } + + fn each_custom_state(&self, _callback: F) + where + F: FnMut(&AtomIdent), + { } } @@ -551,6 +552,7 @@ impl<'dom> ::selectors::Element for ServoLayoutElement<'dom> { NonTSPseudoClass::Link | NonTSPseudoClass::AnyLink => self.is_link(), NonTSPseudoClass::Visited => false, + NonTSPseudoClass::CustomState(ref state) => self.has_custom_state(&state.0), NonTSPseudoClass::Lang(ref lang) => self.match_element_lang(None, lang), NonTSPseudoClass::ServoNonZeroBorder => !matches!( @@ -651,6 +653,10 @@ impl<'dom> ::selectors::Element for ServoLayoutElement<'dom> { each_relevant_element_hash(*self, |hash| filter.insert_hash(hash & BLOOM_HASH_MASK)); true } + + fn has_custom_state(&self, _name: &AtomIdent) -> bool { + false + } } /// A wrapper around elements that ensures layout can only @@ -893,4 +899,8 @@ impl<'dom> ::selectors::Element for ServoThreadSafeLayoutElement<'dom> { }); true } + + fn has_custom_state(&self, _name: &AtomIdent) -> bool { + false + } } diff --git a/tests/wpt/meta-legacy-layout/css/css-animations/parsing/animation-valid.html.ini b/tests/wpt/meta-legacy-layout/css/css-animations/parsing/animation-valid.html.ini deleted file mode 100644 index d8f84798d62..00000000000 --- a/tests/wpt/meta-legacy-layout/css/css-animations/parsing/animation-valid.html.ini +++ /dev/null @@ -1,24 +0,0 @@ -[animation-valid.html] - [e.style['animation'\] = "cubic-bezier(0, -2, 1, 3)" should set the property value] - expected: FAIL - - [e.style['animation'\] = "4" should set the property value] - expected: FAIL - - [e.style['animation'\] = "reverse" should set the property value] - expected: FAIL - - [e.style['animation'\] = "both" should set the property value] - expected: FAIL - - [e.style['animation'\] = "paused" should set the property value] - expected: FAIL - - [e.style['animation'\] = "none" should set the property value] - expected: FAIL - - [e.style['animation'\] = "anim" should set the property value] - expected: FAIL - - [e.style['animation'\] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set the property value] - expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-values/round-function.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/round-function.html.ini index d74bf07bfca..2761cd24b6b 100644 --- a/tests/wpt/meta-legacy-layout/css/css-values/round-function.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-values/round-function.html.ini @@ -292,27 +292,3 @@ [calc(1 / round(up, -1, infinity) should be used-value-equivalent to calc(-infinity)] expected: FAIL - - [round(1.5) should be used-value-equivalent to 2] - expected: FAIL - - [round(up, 1.5) should be used-value-equivalent to 2] - expected: FAIL - - [round(down, 1.5) should be used-value-equivalent to 1] - expected: FAIL - - [round(to-zero, 1.5) should be used-value-equivalent to 1] - expected: FAIL - - [round(-1.5) should be used-value-equivalent to -1] - expected: FAIL - - [round(up, -1.5) should be used-value-equivalent to -1] - expected: FAIL - - [round(down, -1.5) should be used-value-equivalent to -2] - expected: FAIL - - [round(to-zero, -1.5) should be used-value-equivalent to -1] - expected: FAIL diff --git a/tests/wpt/meta/css/css-animations/parsing/animation-computed.html.ini b/tests/wpt/meta/css/css-animations/parsing/animation-computed.html.ini deleted file mode 100644 index 37c6d0b9244..00000000000 --- a/tests/wpt/meta/css/css-animations/parsing/animation-computed.html.ini +++ /dev/null @@ -1,42 +0,0 @@ -[animation-computed.html] - [Property animation value '1s'] - expected: FAIL - - [Property animation value 'anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)'] - expected: FAIL - - [Property animation value 'none'] - expected: FAIL - - [Property animation value 'cubic-bezier(0, -2, 1, 3)'] - expected: FAIL - - [Property animation value '1s -3s'] - expected: FAIL - - [Property animation value 'anim'] - expected: FAIL - - [Property animation value 'paused'] - expected: FAIL - - [Property animation value 'both'] - expected: FAIL - - [Property animation value '4'] - expected: FAIL - - [Property animation value 'reverse'] - expected: FAIL - - [Default animation value] - expected: FAIL - - [Property animation value 'ease-in-out'] - expected: FAIL - - [Property animation value 'none, none'] - expected: FAIL - - [Animation with a delay but no duration] - expected: FAIL diff --git a/tests/wpt/meta/css/css-animations/parsing/animation-valid.html.ini b/tests/wpt/meta/css/css-animations/parsing/animation-valid.html.ini deleted file mode 100644 index d8f84798d62..00000000000 --- a/tests/wpt/meta/css/css-animations/parsing/animation-valid.html.ini +++ /dev/null @@ -1,24 +0,0 @@ -[animation-valid.html] - [e.style['animation'\] = "cubic-bezier(0, -2, 1, 3)" should set the property value] - expected: FAIL - - [e.style['animation'\] = "4" should set the property value] - expected: FAIL - - [e.style['animation'\] = "reverse" should set the property value] - expected: FAIL - - [e.style['animation'\] = "both" should set the property value] - expected: FAIL - - [e.style['animation'\] = "paused" should set the property value] - expected: FAIL - - [e.style['animation'\] = "none" should set the property value] - expected: FAIL - - [e.style['animation'\] = "anim" should set the property value] - expected: FAIL - - [e.style['animation'\] = "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)" should set the property value] - expected: FAIL diff --git a/tests/wpt/meta/css/css-values/round-function.html.ini b/tests/wpt/meta/css/css-values/round-function.html.ini index 3a0077e9066..d5064fd4930 100644 --- a/tests/wpt/meta/css/css-values/round-function.html.ini +++ b/tests/wpt/meta/css/css-values/round-function.html.ini @@ -4,27 +4,3 @@ [calc(1 / round(up, -1, infinity) should be used-value-equivalent to calc(-infinity)] expected: FAIL - - [round(1.5) should be used-value-equivalent to 2] - expected: FAIL - - [round(up, 1.5) should be used-value-equivalent to 2] - expected: FAIL - - [round(down, 1.5) should be used-value-equivalent to 1] - expected: FAIL - - [round(to-zero, 1.5) should be used-value-equivalent to 1] - expected: FAIL - - [round(-1.5) should be used-value-equivalent to -1] - expected: FAIL - - [round(up, -1.5) should be used-value-equivalent to -1] - expected: FAIL - - [round(down, -1.5) should be used-value-equivalent to -2] - expected: FAIL - - [round(to-zero, -1.5) should be used-value-equivalent to -1] - expected: FAIL