Upgrade Stylo to 2025-05-01 (#36835)

This continues #35990

Changelog:
- Upstream:
4558df359b...ca369cbc83
- Servo fixups:
2bc1e5183b...7edd19e2f0

Stylo tracking issue: https://github.com/servo/stylo/issues/178

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-05-05 07:08:49 -07:00 committed by GitHub
parent 1f6050f931
commit 2fa96cf961
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 64 additions and 41 deletions

53
Cargo.lock generated
View file

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

View file

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

View file

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

View file

@ -767,7 +767,9 @@ impl From<StyleSize> for Size<LengthPercentage> {
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<StyleMaxSize> for Size<LengthPercentage> {
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")
},
}
}
}

View file

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

View file

@ -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();

View file

@ -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!(),
}
}

View file

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

View file

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