mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Upgrade Stylo to 2025-11-01 (#40522)
This continues #39612 Changelog: - Upstream:b98470a5cb...d71fd89b78- Servo fixups:4714bab122...7481d7f7afStylo tracking issue: https://github.com/servo/stylo/issues/264 --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
64
Cargo.lock
generated
64
Cargo.lock
generated
@@ -6576,6 +6576,16 @@ dependencies = [
|
||||
"phf_shared 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_codegen"
|
||||
version = "0.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
|
||||
dependencies = [
|
||||
"phf_generator 0.13.1",
|
||||
"phf_shared 0.13.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_generator"
|
||||
version = "0.11.3"
|
||||
@@ -7627,7 +7637,7 @@ dependencies = [
|
||||
"num-traits",
|
||||
"parking_lot",
|
||||
"phf 0.11.3",
|
||||
"phf_codegen",
|
||||
"phf_codegen 0.11.3",
|
||||
"phf_shared 0.11.3",
|
||||
"regex",
|
||||
"serde_json",
|
||||
@@ -7756,16 +7766,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "selectors"
|
||||
version = "0.32.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.33.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"bitflags 2.10.0",
|
||||
"cssparser",
|
||||
"derive_more",
|
||||
"log",
|
||||
"new_debug_unreachable",
|
||||
"phf 0.11.3",
|
||||
"phf_codegen",
|
||||
"phf 0.13.1",
|
||||
"phf_codegen 0.13.1",
|
||||
"precomputed-hash",
|
||||
"rustc-hash 2.1.1",
|
||||
"servo_arc",
|
||||
@@ -8063,8 +8073,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "servo_arc"
|
||||
version = "0.4.2"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.4.3"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"stable_deref_trait",
|
||||
@@ -8592,8 +8602,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "stylo"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"app_units",
|
||||
"arrayvec",
|
||||
@@ -8649,8 +8659,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "stylo_atoms"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"string_cache",
|
||||
"string_cache_codegen",
|
||||
@@ -8658,13 +8668,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "stylo_config"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
|
||||
[[package]]
|
||||
name = "stylo_derive"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"darling",
|
||||
"proc-macro2",
|
||||
@@ -8675,8 +8685,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "stylo_dom"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"bitflags 2.10.0",
|
||||
"stylo_malloc_size_of",
|
||||
@@ -8684,8 +8694,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "stylo_malloc_size_of"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"app_units",
|
||||
"cssparser",
|
||||
@@ -8701,13 +8711,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "stylo_static_prefs"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
|
||||
[[package]]
|
||||
name = "stylo_traits"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"app_units",
|
||||
"bitflags 2.10.0",
|
||||
@@ -9121,8 +9131,8 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||
|
||||
[[package]]
|
||||
name = "to_shmem"
|
||||
version = "0.2.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"cssparser",
|
||||
"servo_arc",
|
||||
@@ -9135,7 +9145,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "to_shmem_derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-10-01#aac89c57ba333b9244295e2d203648202b294761"
|
||||
source = "git+https://github.com/servo/stylo?branch=2025-11-01#7481d7f7afe698b1ad141755f6f525857da7bc49"
|
||||
dependencies = [
|
||||
"darling",
|
||||
"proc-macro2",
|
||||
@@ -10009,7 +10019,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57ffde1dc01240bdf9992e3205668b235e59421fd085e8a317ed98da0178d414"
|
||||
dependencies = [
|
||||
"phf 0.11.3",
|
||||
"phf_codegen",
|
||||
"phf_codegen 0.11.3",
|
||||
"string_cache",
|
||||
"string_cache_codegen",
|
||||
]
|
||||
|
||||
16
Cargo.toml
16
Cargo.toml
@@ -135,7 +135,7 @@ rustls-pemfile = "2.0"
|
||||
rustls-pki-types = "1.13"
|
||||
script_traits = { path = "components/shared/script" }
|
||||
sec1 = "0.7"
|
||||
selectors = { git = "https://github.com/servo/stylo", branch = "2025-10-01" }
|
||||
selectors = { git = "https://github.com/servo/stylo", branch = "2025-11-01" }
|
||||
serde = "1.0.228"
|
||||
serde_bytes = "0.11"
|
||||
serde_core = "1.0.226"
|
||||
@@ -144,19 +144,19 @@ 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-10-01" }
|
||||
servo_arc = { git = "https://github.com/servo/stylo", branch = "2025-11-01" }
|
||||
skrifa = "0.37.0"
|
||||
smallvec = { version = "1.15", features = ["serde", "union"] }
|
||||
storage_traits = { path = "components/shared/storage" }
|
||||
string_cache = "0.8"
|
||||
strum = "0.27"
|
||||
strum_macros = "0.27"
|
||||
stylo = { git = "https://github.com/servo/stylo", branch = "2025-10-01" }
|
||||
stylo_atoms = { git = "https://github.com/servo/stylo", branch = "2025-10-01" }
|
||||
stylo_config = { git = "https://github.com/servo/stylo", branch = "2025-10-01" }
|
||||
stylo_dom = { git = "https://github.com/servo/stylo", branch = "2025-10-01" }
|
||||
stylo_malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2025-10-01" }
|
||||
stylo_traits = { git = "https://github.com/servo/stylo", branch = "2025-10-01" }
|
||||
stylo = { git = "https://github.com/servo/stylo", branch = "2025-11-01" }
|
||||
stylo_atoms = { git = "https://github.com/servo/stylo", branch = "2025-11-01" }
|
||||
stylo_config = { git = "https://github.com/servo/stylo", branch = "2025-11-01" }
|
||||
stylo_dom = { git = "https://github.com/servo/stylo", branch = "2025-11-01" }
|
||||
stylo_malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2025-11-01" }
|
||||
stylo_traits = { git = "https://github.com/servo/stylo", branch = "2025-11-01" }
|
||||
surfman = { version = "0.10.0", features = ["chains"] }
|
||||
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||
synstructure = "0.13"
|
||||
|
||||
@@ -33,7 +33,9 @@ use style::font_face::{
|
||||
use style::media_queries::Device;
|
||||
use style::properties::style_structs::Font as FontStyleStruct;
|
||||
use style::shared_lock::SharedRwLockReadGuard;
|
||||
use style::stylesheets::{CssRule, DocumentStyleSheet, FontFaceRule, StylesheetInDocument};
|
||||
use style::stylesheets::{
|
||||
CssRule, CustomMediaMap, DocumentStyleSheet, FontFaceRule, StylesheetInDocument,
|
||||
};
|
||||
use style::values::computed::font::{FamilyName, FontFamilyNameSyntax, SingleFontFamily};
|
||||
use url::Url;
|
||||
use webrender_api::{FontInstanceFlags, FontInstanceKey, FontKey, FontVariation};
|
||||
@@ -536,7 +538,11 @@ impl FontContextWebFontMethods for Arc<FontContext> {
|
||||
finished_callback: StylesheetWebFontLoadFinishedCallback,
|
||||
) -> usize {
|
||||
let mut number_loading = 0;
|
||||
for rule in stylesheet.contents(guard).effective_rules(device, guard) {
|
||||
let custom_media = &CustomMediaMap::default();
|
||||
for rule in stylesheet
|
||||
.contents(guard)
|
||||
.effective_rules(device, custom_media, guard)
|
||||
{
|
||||
let CssRule::FontFace(ref lock) = *rule else {
|
||||
continue;
|
||||
};
|
||||
|
||||
@@ -1568,7 +1568,7 @@ impl<'a> BuilderForBoxFragment<'a> {
|
||||
// > negative values. User agents should apply this constraint independently in
|
||||
// > each dimension. If the outline is drawn as multiple disconnected shapes, this
|
||||
// > constraint applies to each shape separately.
|
||||
let offset = outline.outline_offset.px() + width;
|
||||
let offset = outline.outline_offset.to_f32_px() + width;
|
||||
let outline_rect = self.border_rect.inflate(
|
||||
offset.max(-self.border_rect.width() / 2.0 + width),
|
||||
offset.max(-self.border_rect.height() / 2.0 + width),
|
||||
|
||||
@@ -311,7 +311,7 @@ impl FlexContainerConfig {
|
||||
fn resolve_align_self_for_child(&self, child_style: &ComputedValues) -> AlignFlags {
|
||||
self.resolve_reversable_flex_alignment(
|
||||
child_style
|
||||
.resolve_align_self(self.align_items, AlignItems(AlignFlags::STRETCH))
|
||||
.resolve_align_self(self.align_items, AlignFlags::STRETCH)
|
||||
.0,
|
||||
self.flex_wrap_is_reversed,
|
||||
)
|
||||
@@ -319,7 +319,7 @@ impl FlexContainerConfig {
|
||||
|
||||
fn resolve_justify_content_for_child(&self) -> AlignFlags {
|
||||
self.resolve_reversable_flex_alignment(
|
||||
self.justify_content.0.primary(),
|
||||
self.justify_content.primary(),
|
||||
self.flex_direction_is_reversed,
|
||||
)
|
||||
}
|
||||
@@ -718,7 +718,7 @@ impl FlexContainer {
|
||||
let num_lines = initial_line_layouts.len();
|
||||
let resolved_align_content: AlignFlags = {
|
||||
// Computed value from the style system
|
||||
let align_content_style = flex_context.config.align_content.0.primary();
|
||||
let align_content_style = flex_context.config.align_content.primary();
|
||||
let mut is_safe = align_content_style.flags() == AlignFlags::SAFE;
|
||||
|
||||
// From https://drafts.csswg.org/css-align/#distribution-flex
|
||||
@@ -1610,7 +1610,7 @@ impl InitialFlexLineLayout<'_> {
|
||||
// In addition to the spec at https://www.w3.org/TR/css-align-3/ this implementation follows
|
||||
// the resolution of https://github.com/w3c/csswg-drafts/issues/10154
|
||||
let resolved_justify_content: AlignFlags = {
|
||||
let justify_content_style = flex_context.config.justify_content.0.primary();
|
||||
let justify_content_style = flex_context.config.justify_content.primary();
|
||||
|
||||
// Inital values from the style system
|
||||
let mut resolved_justify_content = justify_content_style.value();
|
||||
|
||||
@@ -12,7 +12,7 @@ use style::properties::ComputedValues;
|
||||
use style::properties::longhands::align_items::computed_value::T as AlignItems;
|
||||
use style::properties::longhands::flex_direction::computed_value::T as FlexDirection;
|
||||
use style::properties::longhands::flex_wrap::computed_value::T as FlexWrap;
|
||||
use style::values::computed::{AlignContent, JustifyContent};
|
||||
use style::values::computed::ContentDistribution;
|
||||
use style::values::specified::align::AlignFlags;
|
||||
|
||||
use crate::PropagatedBoxTreeData;
|
||||
@@ -41,9 +41,9 @@ pub(crate) struct FlexContainerConfig {
|
||||
flex_wrap: FlexWrap,
|
||||
flex_wrap_is_reversed: bool,
|
||||
main_start_cross_start_sides_are: MainStartCrossStart,
|
||||
align_content: AlignContent,
|
||||
align_content: ContentDistribution,
|
||||
align_items: AlignItems,
|
||||
justify_content: JustifyContent,
|
||||
justify_content: ContentDistribution,
|
||||
}
|
||||
|
||||
impl FlexContainerConfig {
|
||||
|
||||
@@ -1807,8 +1807,8 @@ fn solve_block_margins_for_in_flow_block_level(pbm: &PaddingBorderMargin) -> (Au
|
||||
/// Resolves the `justify-self` value, preserving flags.
|
||||
fn resolve_justify_self(style: &ComputedValues, parent_style: &ComputedValues) -> AlignFlags {
|
||||
let is_ltr = |style: &ComputedValues| style.writing_mode.line_left_is_inline_start();
|
||||
let alignment = match style.clone_justify_self().0.0 {
|
||||
AlignFlags::AUTO => parent_style.clone_justify_items().computed.0,
|
||||
let alignment = match style.clone_justify_self().0 {
|
||||
AlignFlags::AUTO => parent_style.clone_justify_items().computed.0.0,
|
||||
alignment => alignment,
|
||||
};
|
||||
let alignment_value = match alignment.value() {
|
||||
|
||||
@@ -69,7 +69,7 @@ use style::selector_parser::{PseudoElement, RestyleDamage, SnapshotMap};
|
||||
use style::servo::media_queries::FontMetricsProvider;
|
||||
use style::shared_lock::{SharedRwLock, SharedRwLockReadGuard, StylesheetGuards};
|
||||
use style::stylesheets::{
|
||||
DocumentStyleSheet, Origin, Stylesheet, StylesheetInDocument, UrlExtraData,
|
||||
CustomMediaMap, DocumentStyleSheet, Origin, Stylesheet, StylesheetInDocument, UrlExtraData,
|
||||
UserAgentStylesheets,
|
||||
};
|
||||
use style::stylist::Stylist;
|
||||
@@ -779,7 +779,8 @@ impl LayoutThread {
|
||||
stylesheet: &DocumentStyleSheet,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
) {
|
||||
if !stylesheet.is_effective_for_device(self.stylist.device(), guard) {
|
||||
let custom_media = &CustomMediaMap::default();
|
||||
if !stylesheet.is_effective_for_device(self.stylist.device(), custom_media, guard) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -478,7 +478,7 @@ impl HoistedAbsolutelyPositionedBox {
|
||||
// in the inline axis.
|
||||
let inline_box_offsets = box_offset.inline_sides();
|
||||
let inline_alignment = match inline_box_offsets.either_specified() {
|
||||
true => style.clone_justify_self().0.0,
|
||||
true => style.clone_justify_self().0,
|
||||
false => self.resolved_alignment.inline,
|
||||
};
|
||||
|
||||
@@ -502,7 +502,7 @@ impl HoistedAbsolutelyPositionedBox {
|
||||
// against this containing block.
|
||||
let block_box_offsets = box_offset.block_sides();
|
||||
let block_alignment = match block_box_offsets.either_specified() {
|
||||
true => style.clone_align_self().0.0,
|
||||
true => style.clone_align_self().0,
|
||||
false => self.resolved_alignment.block,
|
||||
};
|
||||
let block_axis_solver = AbsoluteAxisSolver {
|
||||
|
||||
@@ -23,7 +23,9 @@ use style::servo::selector_parser::PseudoElement;
|
||||
use style::values::CSSFloat;
|
||||
use style::values::computed::basic_shape::ClipPath;
|
||||
use style::values::computed::image::Image as ComputedImageLayer;
|
||||
use style::values::computed::{AlignItems, BorderStyle, Color, Inset, LengthPercentage, Margin};
|
||||
use style::values::computed::{
|
||||
BorderStyle, Color, Inset, ItemPlacement, LengthPercentage, Margin, SelfAlignment,
|
||||
};
|
||||
use style::values::generics::box_::Perspective;
|
||||
use style::values::generics::position::{GenericAspectRatio, PreferredRatio};
|
||||
use style::values::generics::transform::{GenericRotate, GenericScale, GenericTranslate};
|
||||
@@ -351,9 +353,9 @@ pub(crate) trait ComputedValuesExt {
|
||||
fn bidi_control_chars(&self) -> (&'static str, &'static str);
|
||||
fn resolve_align_self(
|
||||
&self,
|
||||
resolved_auto_value: AlignItems,
|
||||
resolved_normal_value: AlignItems,
|
||||
) -> AlignItems;
|
||||
resolved_auto_value: ItemPlacement,
|
||||
resolved_normal_value: AlignFlags,
|
||||
) -> SelfAlignment;
|
||||
fn depends_on_block_constraints_due_to_relative_positioning(
|
||||
&self,
|
||||
writing_mode: WritingMode,
|
||||
@@ -666,7 +668,7 @@ impl ComputedValuesExt for ComputedValues {
|
||||
// form an independent block formatting context. This should really only happen
|
||||
// for block containers, but we do not support subgrid containers yet which is the
|
||||
// only other case.
|
||||
if self.get_position().align_content.0.primary() != AlignFlags::NORMAL {
|
||||
if self.get_position().align_content.primary() != AlignFlags::NORMAL {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -978,14 +980,14 @@ impl ComputedValuesExt for ComputedValues {
|
||||
|
||||
fn resolve_align_self(
|
||||
&self,
|
||||
resolved_auto_value: AlignItems,
|
||||
resolved_normal_value: AlignItems,
|
||||
) -> AlignItems {
|
||||
match self.clone_align_self().0.0 {
|
||||
AlignFlags::AUTO => resolved_auto_value,
|
||||
resolved_auto_value: ItemPlacement,
|
||||
resolved_normal_value: AlignFlags,
|
||||
) -> SelfAlignment {
|
||||
SelfAlignment(match self.clone_align_self().0 {
|
||||
AlignFlags::AUTO => resolved_auto_value.0,
|
||||
AlignFlags::NORMAL => resolved_normal_value,
|
||||
value => AlignItems(value),
|
||||
}
|
||||
value => value,
|
||||
})
|
||||
}
|
||||
|
||||
fn depends_on_block_constraints_due_to_relative_positioning(
|
||||
|
||||
@@ -531,12 +531,12 @@ impl TaffyContainer {
|
||||
)),
|
||||
LogicalVec2 {
|
||||
inline: resolve_alignment(
|
||||
child.style.clone_align_self().0.0,
|
||||
child.style.clone_align_self().0,
|
||||
align_items.0,
|
||||
),
|
||||
block: resolve_alignment(
|
||||
child.style.clone_justify_self().0.0,
|
||||
justify_items.computed.0,
|
||||
child.style.clone_justify_self().0,
|
||||
justify_items.computed.0.0,
|
||||
),
|
||||
},
|
||||
container_ctx.style.writing_mode,
|
||||
|
||||
@@ -373,12 +373,12 @@ impl<T: Deref<Target = ComputedValues>> taffy::GridContainerStyle for TaffyStylo
|
||||
|
||||
#[inline]
|
||||
fn align_content(&self) -> Option<taffy::AlignContent> {
|
||||
convert::content_alignment(self.style.get_position().align_content.0)
|
||||
convert::content_alignment(self.style.get_position().align_content)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn justify_content(&self) -> Option<taffy::JustifyContent> {
|
||||
convert::content_alignment(self.style.get_position().justify_content.0)
|
||||
convert::content_alignment(self.style.get_position().justify_content)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
@@ -388,7 +388,7 @@ impl<T: Deref<Target = ComputedValues>> taffy::GridContainerStyle for TaffyStylo
|
||||
|
||||
#[inline]
|
||||
fn justify_items(&self) -> Option<taffy::AlignItems> {
|
||||
convert::item_alignment(self.style.get_position().justify_items.computed.0)
|
||||
convert::item_alignment(self.style.get_position().justify_items.computed.0.0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,11 +413,11 @@ impl<T: Deref<Target = ComputedValues>> taffy::GridItemStyle for TaffyStyloStyle
|
||||
|
||||
#[inline]
|
||||
fn align_self(&self) -> Option<taffy::AlignSelf> {
|
||||
convert::item_alignment(self.style.get_position().align_self.0.0)
|
||||
convert::item_alignment(self.style.get_position().align_self.0)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn justify_self(&self) -> Option<taffy::AlignSelf> {
|
||||
convert::item_alignment(self.style.get_position().justify_self.0.0)
|
||||
convert::item_alignment(self.style.get_position().justify_self.0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -997,13 +997,12 @@ malloc_size_of_is_stylo_malloc_size_of!(style::selector_parser::Snapshot);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::shared_lock::SharedRwLock);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::stylesheets::DocumentStyleSheet);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::stylist::Stylist);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::computed::AlignContent);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::computed::BorderStyle);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::computed::ContentDistribution);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::computed::FontStretch);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::computed::FontStyle);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::computed::FontWeight);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::computed::font::SingleFontFamily);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::computed::JustifyContent);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::specified::align::AlignFlags);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::specified::box_::Overflow);
|
||||
malloc_size_of_is_stylo_malloc_size_of!(style::values::specified::font::FontSynthesis);
|
||||
|
||||
@@ -128,6 +128,7 @@ impl CSSRule {
|
||||
StyleCssRule::Scope(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::StartingStyle(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::PositionTry(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::CustomMedia(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::NestedDeclarations(s) => DomRoot::upcast(CSSNestedDeclarations::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
@@ -218,6 +219,7 @@ impl CSSRule {
|
||||
StyleCssRule::Scope(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::StartingStyle(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::PositionTry(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::CustomMedia(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::NestedDeclarations(s) => {
|
||||
if let Some(rule) = self.downcast::<CSSNestedDeclarations>() {
|
||||
rule.update_rule(s.clone(), guard);
|
||||
|
||||
@@ -12,7 +12,6 @@ use net_traits::ReferrerPolicy;
|
||||
use script_bindings::root::Dom;
|
||||
use servo_arc::Arc;
|
||||
use style::media_queries::MediaList as StyleMediaList;
|
||||
use style::shared_lock::DeepCloneWithLock;
|
||||
use style::stylesheets::{
|
||||
AllowImportRules, Origin, Stylesheet, StylesheetContents, StylesheetInDocument, UrlExtraData,
|
||||
};
|
||||
@@ -252,11 +251,11 @@ impl HTMLStyleElement {
|
||||
let lock = stylesheet_with_shared_contents.shared_lock.clone();
|
||||
let guard = stylesheet_with_shared_contents.shared_lock.read();
|
||||
let stylesheet_with_owned_contents = Arc::new(Stylesheet {
|
||||
contents: lock.wrap(Arc::new(
|
||||
contents: lock.wrap(
|
||||
stylesheet_with_shared_contents
|
||||
.contents(&guard)
|
||||
.deep_clone_with_lock(&lock, &guard),
|
||||
)),
|
||||
.deep_clone(&lock, None, &guard),
|
||||
),
|
||||
shared_lock: lock,
|
||||
media: stylesheet_with_shared_contents.media.clone(),
|
||||
disabled: AtomicBool::new(
|
||||
|
||||
@@ -10,7 +10,7 @@ use servo_arc::Arc;
|
||||
use style::media_queries::{MediaList as StyleMediaList, MediaQuery};
|
||||
use style::parser::ParserContext;
|
||||
use style::shared_lock::{Locked, SharedRwLock};
|
||||
use style::stylesheets::{CssRuleType, Origin, UrlExtraData};
|
||||
use style::stylesheets::{CssRuleType, CustomMediaEvaluator, Origin, UrlExtraData};
|
||||
use style_traits::{ParseError, ParsingMode, ToCss};
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::MediaListBinding::MediaListMethods;
|
||||
@@ -141,7 +141,11 @@ impl MediaList {
|
||||
let mut parser_input = ParserInput::new(media_query);
|
||||
let mut parser = Parser::new(&mut parser_input);
|
||||
let media_list = StyleMediaList::parse(&context, &mut parser);
|
||||
media_list.evaluate(document.window().layout().device(), quirks_mode)
|
||||
media_list.evaluate(
|
||||
document.window().layout().device(),
|
||||
quirks_mode,
|
||||
&mut CustomMediaEvaluator::none(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use std::rc::Rc;
|
||||
|
||||
use dom_struct::dom_struct;
|
||||
use style::media_queries::MediaList;
|
||||
use style::stylesheets::CustomMediaEvaluator;
|
||||
use style_traits::ToCss;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::EventListenerBinding::EventListener;
|
||||
@@ -79,8 +80,11 @@ impl MediaQueryList {
|
||||
|
||||
pub(crate) fn evaluate(&self) -> bool {
|
||||
let quirks_mode = self.document.quirks_mode();
|
||||
self.media_query_list
|
||||
.evaluate(self.document.window().layout().device(), quirks_mode)
|
||||
self.media_query_list.evaluate(
|
||||
self.document.window().layout().device(),
|
||||
quirks_mode,
|
||||
&mut CustomMediaEvaluator::none(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -631,7 +631,7 @@ impl<'dom> style::dom::TElement for ServoLayoutElement<'dom> {
|
||||
{
|
||||
let alignment_establishes_new_block_formatting_context =
|
||||
|style: &ComputedValues| {
|
||||
style.get_position().align_content.0.primary() != AlignFlags::NORMAL
|
||||
style.get_position().align_content.primary() != AlignFlags::NORMAL
|
||||
};
|
||||
|
||||
let old_column = old.get_column();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
use style::media_queries::Device;
|
||||
use style::shared_lock::SharedRwLockReadGuard;
|
||||
use style::stylesheet_set::{AuthorStylesheetSet, DocumentStylesheetSet};
|
||||
use style::stylesheets::StylesheetInDocument;
|
||||
use style::stylesheets::{CustomMediaMap, StylesheetInDocument};
|
||||
|
||||
/// Functionality common to DocumentStylesheetSet and AuthorStylesheetSet.
|
||||
pub(crate) enum StylesheetSetRef<'a, S>
|
||||
@@ -31,9 +31,14 @@ where
|
||||
sheet: S,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
) {
|
||||
let custom_media = &CustomMediaMap::default();
|
||||
match self {
|
||||
StylesheetSetRef::Author(set) => set.append_stylesheet(device, sheet, guard),
|
||||
StylesheetSetRef::Document(set) => set.append_stylesheet(device, sheet, guard),
|
||||
StylesheetSetRef::Author(set) => {
|
||||
set.append_stylesheet(device, custom_media, sheet, guard)
|
||||
},
|
||||
StylesheetSetRef::Document(set) => {
|
||||
set.append_stylesheet(device, custom_media, sheet, guard)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,12 +50,13 @@ where
|
||||
before_sheet: S,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
) {
|
||||
let custom_media = &CustomMediaMap::default();
|
||||
match self {
|
||||
StylesheetSetRef::Author(set) => {
|
||||
set.insert_stylesheet_before(device, sheet, before_sheet, guard)
|
||||
set.insert_stylesheet_before(device, custom_media, sheet, before_sheet, guard)
|
||||
},
|
||||
StylesheetSetRef::Document(set) => {
|
||||
set.insert_stylesheet_before(device, sheet, before_sheet, guard)
|
||||
set.insert_stylesheet_before(device, custom_media, sheet, before_sheet, guard)
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -62,9 +68,14 @@ where
|
||||
sheet: S,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
) {
|
||||
let custom_media = &CustomMediaMap::default();
|
||||
match self {
|
||||
StylesheetSetRef::Author(set) => set.remove_stylesheet(device, sheet, guard),
|
||||
StylesheetSetRef::Document(set) => set.remove_stylesheet(device, sheet, guard),
|
||||
StylesheetSetRef::Author(set) => {
|
||||
set.remove_stylesheet(device, custom_media, sheet, guard)
|
||||
},
|
||||
StylesheetSetRef::Document(set) => {
|
||||
set.remove_stylesheet(device, custom_media, sheet, guard)
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,6 +194,7 @@ skip = [
|
||||
|
||||
# duplicated by cssparser
|
||||
"phf",
|
||||
"phf_codegen",
|
||||
"phf_generator",
|
||||
"phf_shared",
|
||||
]
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
[outline-offset-rounding.tentative.html]
|
||||
[0.1px]
|
||||
expected: FAIL
|
||||
|
||||
[-0.1px]
|
||||
expected: FAIL
|
||||
|
||||
[0.25px]
|
||||
expected: FAIL
|
||||
|
||||
[-0.25px]
|
||||
expected: FAIL
|
||||
|
||||
[0.5px]
|
||||
expected: FAIL
|
||||
|
||||
[-0.5px]
|
||||
expected: FAIL
|
||||
|
||||
[0.9px]
|
||||
expected: FAIL
|
||||
|
||||
[-0.9px]
|
||||
expected: FAIL
|
||||
|
||||
[1.25px]
|
||||
expected: FAIL
|
||||
|
||||
[-1.25px]
|
||||
expected: FAIL
|
||||
|
||||
[1.5px]
|
||||
expected: FAIL
|
||||
|
||||
[-1.5px]
|
||||
expected: FAIL
|
||||
|
||||
[2.75px]
|
||||
expected: FAIL
|
||||
|
||||
[-2.75px]
|
||||
expected: FAIL
|
||||
@@ -1,3 +0,0 @@
|
||||
[is.html]
|
||||
[Invalidate :is() in non-subject compound]
|
||||
expected: FAIL
|
||||
Reference in New Issue
Block a user