Upgrade Stylo to 2024-04-16 (#32128)

* Upgrade Stylo to 2024-04-16

* Fixup for https://phabricator.services.mozilla.com/D205051

* Fixup for https://phabricator.services.mozilla.com/D203153

* Fixup for https://phabricator.services.mozilla.com/D202460

* Fixup for https://phabricator.services.mozilla.com/D205718

* Fixup for https://phabricator.services.mozilla.com/D206428

* Update test expectations
This commit is contained in:
Oriol Brufau 2024-04-25 16:48:07 +02:00 committed by GitHub
parent 1440406e91
commit 401e49010f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 65 additions and 175 deletions

26
Cargo.lock generated
View file

@ -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",

View file

@ -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"

View file

@ -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

View file

@ -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
}
}

View file

@ -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<CssRuleType>,
) -> Fallible<u32> {
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,
)?;

View file

@ -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

View file

@ -3311,6 +3311,8 @@ impl SelectorsElement for DomRoot<Element> {
},
},
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<Element> {
true
}
fn has_custom_state(&self, _name: &AtomIdent) -> bool {
false
}
}
impl Element {

View file

@ -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<ElementSelectorFlags> {
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<F>(&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
}
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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