Upgrade Stylo to 2024-11-01 (#34322)

* Upgrade Stylo to 2024-11-01

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

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

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

* Update test expectations

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2024-11-21 16:14:45 +01:00 committed by GitHub
parent a6db3cb702
commit 97f53021b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 44 additions and 90 deletions

26
Cargo.lock generated
View file

@ -1640,7 +1640,7 @@ dependencies = [
[[package]]
name = "dom"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"bitflags 2.6.0",
]
@ -4276,7 +4276,7 @@ dependencies = [
[[package]]
name = "malloc_size_of"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"accountable-refcell",
"app_units",
@ -6311,8 +6311,8 @@ dependencies = [
[[package]]
name = "selectors"
version = "0.25.0"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
version = "0.26.0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"bitflags 2.6.0",
"cssparser",
@ -6600,7 +6600,7 @@ dependencies = [
[[package]]
name = "servo_arc"
version = "0.4.0"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"serde",
"stable_deref_trait",
@ -6609,7 +6609,7 @@ dependencies = [
[[package]]
name = "servo_atoms"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"string_cache",
"string_cache_codegen",
@ -6953,7 +6953,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "static_prefs"
version = "0.1.0"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
[[package]]
name = "strck"
@ -7012,7 +7012,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "style"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"app_units",
"arrayvec",
@ -7070,7 +7070,7 @@ dependencies = [
[[package]]
name = "style_config"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"lazy_static",
]
@ -7078,7 +7078,7 @@ dependencies = [
[[package]]
name = "style_derive"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"darling",
"proc-macro2",
@ -7108,7 +7108,7 @@ dependencies = [
[[package]]
name = "style_traits"
version = "0.0.1"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"app_units",
"bitflags 2.6.0",
@ -7459,7 +7459,7 @@ dependencies = [
[[package]]
name = "to_shmem"
version = "0.1.0"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"cssparser",
"servo_arc",
@ -7472,7 +7472,7 @@ dependencies = [
[[package]]
name = "to_shmem_derive"
version = "0.1.0"
source = "git+https://github.com/servo/stylo?branch=2024-10-04#bedab74ee38a04c9b8a8fe97e963a133ef5228c0"
source = "git+https://github.com/servo/stylo?branch=2024-11-01#6605bdbb042735492efaa7530c40378cc1c21afa"
dependencies = [
"darling",
"proc-macro2",

View file

@ -81,7 +81,7 @@ keyboard-types = "0.7"
libc = "0.2"
log = "0.4"
mach2 = "0.4"
malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2024-10-04", features = ["servo"] }
malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2024-11-01", features = ["servo"] }
malloc_size_of_derive = "0.1"
memmap2 = "0.9.5"
mime = "0.3.13"
@ -106,24 +106,24 @@ rustls = { version = "0.21.12", 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-10-04" }
selectors = { git = "https://github.com/servo/stylo", branch = "2024-11-01" }
serde = "1.0.215"
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-10-04", features = ["servo"] }
servo_atoms = { git = "https://github.com/servo/stylo", branch = "2024-10-04" }
servo_arc = { git = "https://github.com/servo/stylo", branch = "2024-11-01", features = ["servo"] }
servo_atoms = { git = "https://github.com/servo/stylo", branch = "2024-11-01" }
smallbitvec = "2.5.3"
smallvec = "1.13"
static_assertions = "1.1"
string_cache = "0.8"
string_cache_codegen = "0.5"
style = { git = "https://github.com/servo/stylo", branch = "2024-10-04", features = ["servo"] }
style_config = { git = "https://github.com/servo/stylo", branch = "2024-10-04" }
style_dom = { git = "https://github.com/servo/stylo", package = "dom", branch = "2024-10-04" }
style_traits = { git = "https://github.com/servo/stylo", branch = "2024-10-04", features = ["servo"] }
style = { git = "https://github.com/servo/stylo", branch = "2024-11-01", features = ["servo"] }
style_config = { git = "https://github.com/servo/stylo", branch = "2024-11-01" }
style_dom = { git = "https://github.com/servo/stylo", package = "dom", branch = "2024-11-01" }
style_traits = { git = "https://github.com/servo/stylo", branch = "2024-11-01", features = ["servo"] }
surfman = { git = "https://github.com/servo/surfman", rev = "c8d6b4b65aeab739ee7651602e29c8d58ceee123", features = ["chains"] }
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
synstructure = "0.13"
@ -131,7 +131,7 @@ thin-vec = "0.2.13"
tikv-jemalloc-sys = "0.6.0"
tikv-jemallocator = "0.6.0"
time_03 = { package = "time", version = "0.3", features = ["large-dates", "local-offset", "serde"] }
to_shmem = { git = "https://github.com/servo/stylo", branch = "2024-10-04" }
to_shmem = { git = "https://github.com/servo/stylo", branch = "2024-11-01" }
tokio = "1"
tokio-rustls = "0.24"
tracing = "0.1.40"

View file

@ -188,6 +188,7 @@ impl TextRunScanner {
{
let in_fragment = self.clump.front().unwrap();
let font_style = in_fragment.style().clone_font();
let computed_font_size = font_style.font_size.computed_size();
let inherited_text_style = in_fragment.style().get_inherited_text();
font_group = font_context.font_group(font_style);
compression = match in_fragment.white_space_collapse() {
@ -198,7 +199,10 @@ impl TextRunScanner {
WhiteSpaceCollapse::PreserveBreaks => CompressionMode::CompressWhitespace,
};
text_transform = inherited_text_style.text_transform;
letter_spacing = inherited_text_style.letter_spacing;
letter_spacing = inherited_text_style
.letter_spacing
.0
.resolve(computed_font_size);
word_spacing = inherited_text_style
.word_spacing
.to_length()
@ -337,7 +341,7 @@ impl TextRunScanner {
// example, `finally` with a wide `letter-spacing` renders as `f i n a l l y` and not
// `fi n a l l y`.
let mut flags = ShapingFlags::empty();
if letter_spacing.0.px() != 0. {
if letter_spacing.px() != 0. {
flags.insert(ShapingFlags::IGNORE_LIGATURES_SHAPING_FLAG);
}
if text_rendering == TextRendering::Optimizespeed {
@ -348,10 +352,10 @@ impl TextRunScanner {
flags.insert(ShapingFlags::KEEP_ALL_FLAG);
}
let options = ShapingOptions {
letter_spacing: if letter_spacing.0.px() == 0. {
letter_spacing: if letter_spacing.px() == 0. {
None
} else {
Some(Au::from(letter_spacing.0))
Some(Au::from(letter_spacing))
},
word_spacing,
script: Script::Common,

View file

@ -348,8 +348,12 @@ impl TextRun {
bidi_info: &BidiInfo,
) {
let inherited_text_style = self.parent_style.get_inherited_text().clone();
let letter_spacing = if inherited_text_style.letter_spacing.0.px() != 0. {
Some(app_units::Au::from(inherited_text_style.letter_spacing.0))
let letter_spacing = inherited_text_style
.letter_spacing
.0
.resolve(self.parent_style.clone_font().font_size.computed_size());
let letter_spacing = if letter_spacing.px() != 0. {
Some(app_units::Au::from(letter_spacing))
} else {
None
};

View file

@ -2,18 +2,19 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use style::values::generics::text::Spacing;
use style::values::specified::text::Spacing;
use crate::parsing::parse;
#[test]
fn negative_letter_spacing_should_parse_properly() {
use style::properties::longhands::letter_spacing;
use style::values::specified::length::{FontRelativeLength, Length, NoCalcLength};
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
use style::values::specified::LetterSpacing;
let negative_value = parse_longhand!(letter_spacing, "-0.5em");
let expected = Spacing::Value(Length::NoCalc(NoCalcLength::FontRelative(
FontRelativeLength::Em(-0.5),
let expected = LetterSpacing(Spacing::Value(LengthPercentage::Length(
NoCalcLength::FontRelative(FontRelativeLength::Em(-0.5)),
)));
assert_eq!(negative_value, expected);
}
@ -22,10 +23,11 @@ fn negative_letter_spacing_should_parse_properly() {
fn negative_word_spacing_should_parse_properly() {
use style::properties::longhands::word_spacing;
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
use style::values::specified::WordSpacing;
let negative_value = parse_longhand!(word_spacing, "-0.5em");
let expected = Spacing::Value(LengthPercentage::Length(NoCalcLength::FontRelative(
FontRelativeLength::Em(-0.5),
let expected = WordSpacing(Spacing::Value(LengthPercentage::Length(
NoCalcLength::FontRelative(FontRelativeLength::Em(-0.5)),
)));
assert_eq!(negative_value, expected);
}

View file

@ -1,2 +0,0 @@
[letter-spacing-percent-001.html]
expected: FAIL

View file

@ -1,12 +0,0 @@
[letter-spacing-computed.html]
[Property letter-spacing value '110%']
expected: FAIL
[Property letter-spacing value '-5%']
expected: FAIL
[Property letter-spacing value 'calc(10% - 20%)']
expected: FAIL
[Property letter-spacing value 'calc(10px - (5% + 10%)']
expected: FAIL

View file

@ -1,12 +0,0 @@
[letter-spacing-valid.html]
[e.style['letter-spacing'\] = "120%" should set the property value]
expected: FAIL
[e.style['letter-spacing'\] = "-10%" should set the property value]
expected: FAIL
[e.style['letter-spacing'\] = "calc(2ch - 30%)" should set the property value]
expected: FAIL
[e.style['letter-spacing'\] = "calc(40% + 50px)" should set the property value]
expected: FAIL

View file

@ -1,3 +0,0 @@
[calc-letter-spacing.html]
[testing letter-spacing: calc(100%)]
expected: FAIL

View file

@ -1,3 +0,0 @@
[calc-serialization-002.html]
[testing calc((min(10px, 20%) + max(1rem, 2%)) * 2)]
expected: FAIL

View file

@ -40,6 +40,3 @@
['scale(calc(hypot(1) * 0.5))' as a computed value should serialize as 'matrix(0.5, 0, 0, 0.5, 0, 0)'.]
expected: FAIL
['hypot(2px, 40%)' as a specified value should serialize as 'hypot(2px, 40%)'.]
expected: FAIL

View file

@ -4,9 +4,3 @@
['max((min(10%, 30px) + 10px) * 2 + 10px, 5em + 5%)' as a computed value should serialize as 'max(10px + (10px + min(10%, 30px)) * 2, 5% + 80px)'.]
expected: FAIL
['max((min(10%, 30px) + 10px) * 2 + 10px, 5em + 5%)' as a specified value should serialize as 'max(10px + (2 * (10px + min(10%, 30px))), 5% + 5em)'.]
expected: FAIL
['max((min(10%, 30px) + 10px) * 2 + 10px, 5em + 5%)' as a computed value should serialize as 'max(10px + (2 * (10px + min(10%, 30px))), 5% + 80px)'.]
expected: FAIL

View file

@ -1,3 +0,0 @@
[round-function.html]
[round(down, (7 - 1) / 3, 1) should be used-value-equivalent to 2]
expected: FAIL

View file

@ -1,2 +0,0 @@
[negated-always-matches-negated-first-of-type-when-ancestor-changes.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[negated-always-matches-negated-last-of-type-when-ancestor-changes.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[negated-is-never-matches-negated-first-of-type-when-ancestor-changes.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[negated-is-never-matches-negated-last-of-type-when-ancestor-changes.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[negated-negated-first-of-type-when-ancestor-changes.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[negated-negated-last-of-type-when-ancestor-changes.html]
expected: FAIL