diff --git a/Cargo.lock b/Cargo.lock index b8ac73f4f73..759830e6d06 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4017,6 +4017,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.15" @@ -6457,8 +6466,8 @@ dependencies = [ [[package]] name = "selectors" -version = "0.27.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +version = "0.28.0" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "bitflags 2.9.0", "cssparser", @@ -6753,7 +6762,7 @@ dependencies = [ [[package]] name = "servo_arc" version = "0.4.1" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "serde", "stable_deref_trait", @@ -7212,8 +7221,8 @@ dependencies = [ [[package]] name = "stylo" -version = "0.2.1" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +version = "0.3.0" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "app_units", "arrayvec", @@ -7227,7 +7236,7 @@ dependencies = [ "fxhash", "icu_segmenter", "indexmap", - "itertools 0.10.5", + "itertools 0.14.0", "itoa", "lazy_static", "log", @@ -7270,8 +7279,8 @@ dependencies = [ [[package]] name = "stylo_atoms" -version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +version = "0.3.0" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "string_cache", "string_cache_codegen", @@ -7279,13 +7288,13 @@ dependencies = [ [[package]] name = "stylo_config" -version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +version = "0.3.0" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" [[package]] name = "stylo_derive" -version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +version = "0.3.0" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "darling", "proc-macro2", @@ -7296,8 +7305,8 @@ dependencies = [ [[package]] name = "stylo_dom" -version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +version = "0.3.0" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "bitflags 2.9.0", "stylo_malloc_size_of", @@ -7305,8 +7314,8 @@ dependencies = [ [[package]] name = "stylo_malloc_size_of" -version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +version = "0.3.0" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "app_units", "cssparser", @@ -7322,13 +7331,13 @@ dependencies = [ [[package]] name = "stylo_static_prefs" -version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +version = "0.3.0" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" [[package]] name = "stylo_traits" -version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +version = "0.3.0" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "app_units", "bitflags 2.9.0", @@ -7711,7 +7720,7 @@ dependencies = [ [[package]] name = "to_shmem" version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "cssparser", "servo_arc", @@ -7724,7 +7733,7 @@ dependencies = [ [[package]] name = "to_shmem_derive" version = "0.1.0" -source = "git+https://github.com/servo/stylo?branch=2025-03-15#03ffc85c45f53a3b11994f7c14adce7b90aa9c34" +source = "git+https://github.com/servo/stylo?branch=2025-05-01#7edd19e2f09570c6734161b4bb7d47859c8699bf" dependencies = [ "darling", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index b43c38b21b9..0ed813078f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,7 +118,7 @@ rustls-pemfile = "2.0" rustls-pki-types = "1.11" script_layout_interface = { path = "components/shared/script_layout" } script_traits = { path = "components/shared/script" } -selectors = { git = "https://github.com/servo/stylo", branch = "2025-03-15" } +selectors = { git = "https://github.com/servo/stylo", branch = "2025-05-01" } serde = "1.0.219" serde_bytes = "0.11" serde_json = "1.0" @@ -126,7 +126,7 @@ 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-tracing = { path = "components/servo_tracing" } -servo_arc = { git = "https://github.com/servo/stylo", branch = "2025-03-15" } +servo_arc = { git = "https://github.com/servo/stylo", branch = "2025-05-01" } smallbitvec = "2.6.0" smallvec = "1.15" snapshot = { path = "./components/shared/snapshot" } @@ -135,12 +135,12 @@ string_cache = "0.8" string_cache_codegen = "0.5" strum = "0.26" strum_macros = "0.26" -stylo = { git = "https://github.com/servo/stylo", branch = "2025-03-15" } -stylo_atoms = { git = "https://github.com/servo/stylo", branch = "2025-03-15" } -stylo_config = { git = "https://github.com/servo/stylo", branch = "2025-03-15" } -stylo_dom = { git = "https://github.com/servo/stylo", branch = "2025-03-15" } -stylo_malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2025-03-15" } -stylo_traits = { git = "https://github.com/servo/stylo", branch = "2025-03-15" } +stylo = { git = "https://github.com/servo/stylo", branch = "2025-05-01" } +stylo_atoms = { git = "https://github.com/servo/stylo", branch = "2025-05-01" } +stylo_config = { git = "https://github.com/servo/stylo", branch = "2025-05-01" } +stylo_dom = { git = "https://github.com/servo/stylo", branch = "2025-05-01" } +stylo_malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2025-05-01" } +stylo_traits = { git = "https://github.com/servo/stylo", branch = "2025-05-01" } surfman = { git = "https://github.com/servo/surfman", rev = "f7688b4585f9e0b5d4bf8ee8e4a91e82349610b1", features = ["chains"] } syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] } synstructure = "0.13" diff --git a/components/layout/flow/mod.rs b/components/layout/flow/mod.rs index 772b150ae1c..0c326c4cc6d 100644 --- a/components/layout/flow/mod.rs +++ b/components/layout/flow/mod.rs @@ -2238,7 +2238,9 @@ fn block_size_is_zero_or_intrinsic(size: &StyleSize, containing_block: &Containi lp.is_definitely_zero() || (lp.0.has_percentage() && !containing_block.size.block.is_definite()) }, - StyleSize::AnchorSizeFunction(_) => unreachable!("anchor-size() should be disabled"), + StyleSize::AnchorSizeFunction(_) | StyleSize::AnchorContainingCalcFunction(_) => { + unreachable!("anchor-size() should be disabled") + }, } } diff --git a/components/layout/geom.rs b/components/layout/geom.rs index 49f031cbd18..6a09519b7ed 100644 --- a/components/layout/geom.rs +++ b/components/layout/geom.rs @@ -767,7 +767,9 @@ impl From for Size { StyleSize::FitContent => Size::FitContent, StyleSize::FitContentFunction(lp) => Size::FitContentFunction(lp.0), StyleSize::Stretch => Size::Stretch, - StyleSize::AnchorSizeFunction(_) => unreachable!("anchor-size() should be disabled"), + StyleSize::AnchorSizeFunction(_) | StyleSize::AnchorContainingCalcFunction(_) => { + unreachable!("anchor-size() should be disabled") + }, } } } @@ -782,7 +784,9 @@ impl From for Size { StyleMaxSize::FitContent => Size::FitContent, StyleMaxSize::FitContentFunction(lp) => Size::FitContentFunction(lp.0), StyleMaxSize::Stretch => Size::Stretch, - StyleMaxSize::AnchorSizeFunction(_) => unreachable!("anchor-size() should be disabled"), + StyleMaxSize::AnchorSizeFunction(_) | StyleMaxSize::AnchorContainingCalcFunction(_) => { + unreachable!("anchor-size() should be disabled") + }, } } } diff --git a/components/layout/layout_impl.rs b/components/layout/layout_impl.rs index efd31057127..b8d91c38027 100644 --- a/components/layout/layout_impl.rs +++ b/components/layout/layout_impl.rs @@ -69,7 +69,7 @@ use style::traversal::DomTraversal; use style::traversal_flags::TraversalFlags; use style::values::computed::font::GenericFontFamily; use style::values::computed::{CSSPixelLength, FontSize, Length, NonNegativeLength}; -use style::values::specified::font::KeywordInfo; +use style::values::specified::font::{KeywordInfo, QueryFontMetricsFlags}; use style::{Zero, driver}; use style_traits::{CSSPixel, SpeculativePainter}; use stylo_atoms::Atom; @@ -1100,8 +1100,7 @@ impl FontMetricsProvider for LayoutFontMetricsProvider { _vertical: bool, font: &Font, base_size: CSSPixelLength, - _in_media_query: bool, - _retrieve_math_scales: bool, + _flags: QueryFontMetricsFlags, ) -> FontMetrics { let font_context = &self.0; let font_group = self diff --git a/components/layout/style_ext.rs b/components/layout/style_ext.rs index 68a4481a2be..354da54d39b 100644 --- a/components/layout/style_ext.rs +++ b/components/layout/style_ext.rs @@ -375,6 +375,9 @@ impl ComputedValuesExt for ComputedValues { Inset::Auto => LengthPercentageOrAuto::Auto, Inset::AnchorFunction(_) => unreachable!("anchor() should be disabled"), Inset::AnchorSizeFunction(_) => unreachable!("anchor-size() should be disabled"), + Inset::AnchorContainingCalcFunction(_) => { + unreachable!("anchor() and anchor-size() should be disabled") + }, } } let position = self.get_position(); @@ -495,7 +498,9 @@ impl ComputedValuesExt for ComputedValues { match inset { Margin::LengthPercentage(v) => LengthPercentageOrAuto::LengthPercentage(v), Margin::Auto => LengthPercentageOrAuto::Auto, - Margin::AnchorSizeFunction(_) => unreachable!("anchor-size() should be disabled"), + Margin::AnchorSizeFunction(_) | Margin::AnchorContainingCalcFunction(_) => { + unreachable!("anchor-size() should be disabled") + }, } } let margin = self.get_margin(); diff --git a/components/layout/taffy/stylo_taffy/convert.rs b/components/layout/taffy/stylo_taffy/convert.rs index 03fbec292a4..5780be17c82 100644 --- a/components/layout/taffy/stylo_taffy/convert.rs +++ b/components/layout/taffy/stylo_taffy/convert.rs @@ -59,6 +59,7 @@ pub fn dimension(val: &stylo::Size) -> taffy::Dimension { // Anchor positioning will be flagged off for time being stylo::Size::AnchorSizeFunction(_) => unreachable!(), + stylo::Size::AnchorContainingCalcFunction(_) => unreachable!(), } } @@ -77,6 +78,7 @@ pub fn max_size_dimension(val: &stylo::MaxSize) -> taffy::Dimension { // Anchor positioning will be flagged off for time being stylo::MaxSize::AnchorSizeFunction(_) => unreachable!(), + stylo::MaxSize::AnchorContainingCalcFunction(_) => unreachable!(), } } @@ -88,6 +90,7 @@ pub fn margin(val: &stylo::MarginVal) -> taffy::LengthPercentageAuto { // Anchor positioning will be flagged off for time being stylo::MarginVal::AnchorSizeFunction(_) => unreachable!(), + stylo::MarginVal::AnchorContainingCalcFunction(_) => unreachable!(), } } @@ -100,6 +103,7 @@ pub fn inset(val: &stylo::InsetVal) -> taffy::LengthPercentageAuto { // Anchor positioning will be flagged off for time being stylo::InsetVal::AnchorSizeFunction(_) => unreachable!(), stylo::InsetVal::AnchorFunction(_) => unreachable!(), + stylo::InsetVal::AnchorContainingCalcFunction(_) => unreachable!(), } } diff --git a/tests/unit/style/custom_properties.rs b/tests/unit/style/custom_properties.rs index 4556e930d02..b7c53535ea5 100644 --- a/tests/unit/style/custom_properties.rs +++ b/tests/unit/style/custom_properties.rs @@ -25,6 +25,7 @@ use style::stylesheets::layer_rule::LayerOrder; use style::stylist::Stylist; use style::values::computed::font::GenericFontFamily; use style::values::computed::{Context, Length}; +use style::values::specified::font::QueryFontMetricsFlags; use test::{self, Bencher}; use url::Url; @@ -37,8 +38,7 @@ impl FontMetricsProvider for DummyMetricsProvider { _vertical: bool, _font: &Font, _base_size: Length, - _in_media_query: bool, - _retrieve_math_scales: bool, + _flags: QueryFontMetricsFlags, ) -> FontMetrics { Default::default() } diff --git a/tests/unit/style/stylist.rs b/tests/unit/style/stylist.rs index 9fa422b2294..e5447968151 100644 --- a/tests/unit/style/stylist.rs +++ b/tests/unit/style/stylist.rs @@ -26,6 +26,7 @@ use style::stylist::{ use style::thread_state::{self, ThreadState}; use style::values::computed::Length; use style::values::computed::font::GenericFontFamily; +use style::values::specified::font::QueryFontMetricsFlags; use stylo_atoms::Atom; use url::Url; @@ -38,8 +39,7 @@ impl FontMetricsProvider for DummyMetricsProvider { _vertical: bool, _font: &Font, _base_size: Length, - _in_media_query: bool, - _retrieve_math_scales: bool, + _flags: QueryFontMetricsFlags, ) -> FontMetrics { Default::default() }