diff --git a/Cargo.lock b/Cargo.lock index 9d5edf126f9..efa4b563abd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1270,7 +1270,7 @@ dependencies = [ [[package]] name = "derive_common" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "darling", "proc-macro2", @@ -3725,7 +3725,7 @@ dependencies = [ [[package]] name = "malloc_size_of" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "accountable-refcell", "app_units", @@ -5321,7 +5321,7 @@ dependencies = [ [[package]] name = "selectors" version = "0.24.0" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "bitflags 2.5.0", "cssparser", @@ -5609,7 +5609,7 @@ dependencies = [ [[package]] name = "servo_arc" version = "0.2.0" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "nodrop", "serde", @@ -5619,7 +5619,7 @@ dependencies = [ [[package]] name = "servo_atoms" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "string_cache", "string_cache_codegen", @@ -5802,7 +5802,7 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "size_of_test" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "static_assertions", ] @@ -5943,7 +5943,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "static_prefs" version = "0.1.0" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" [[package]] name = "strict-num" @@ -5980,7 +5980,7 @@ dependencies = [ [[package]] name = "style" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "app_units", "arrayvec", @@ -6038,7 +6038,7 @@ dependencies = [ [[package]] name = "style_config" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "lazy_static", ] @@ -6046,7 +6046,7 @@ dependencies = [ [[package]] name = "style_derive" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "darling", "derive_common", @@ -6077,7 +6077,7 @@ dependencies = [ [[package]] name = "style_traits" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "app_units", "bitflags 2.5.0", @@ -6427,7 +6427,7 @@ dependencies = [ [[package]] name = "to_shmem" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "cssparser", "servo_arc", @@ -6440,7 +6440,7 @@ dependencies = [ [[package]] name = "to_shmem_derive" version = "0.0.1" -source = "git+https://github.com/servo/stylo?branch=2024-05-15#71b0b0ac1d42b221fccee9034da06bfbf481f0d0" +source = "git+https://github.com/servo/stylo?branch=2024-05-31#e8a14bce9453ad5939eb0c34de150ad2f10d1bc2" dependencies = [ "darling", "derive_common", diff --git a/Cargo.toml b/Cargo.toml index 208afc47d00..af7bce0ec9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,7 @@ keyboard-types = "0.7" lazy_static = "1.4" libc = "0.2" log = "0.4" -malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2024-05-15", features = ["servo"] } +malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2024-05-31", features = ["servo"] } malloc_size_of_derive = "0.1" mime = "0.3.13" mime_guess = "2.0.3" @@ -95,31 +95,31 @@ 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-05-15" } +selectors = { git = "https://github.com/servo/stylo", branch = "2024-05-31" } serde = "1.0.203" 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-05-15" } -servo_atoms = { git = "https://github.com/servo/stylo", branch = "2024-05-15" } -size_of_test = { git = "https://github.com/servo/stylo", branch = "2024-05-15" } +servo_arc = { git = "https://github.com/servo/stylo", branch = "2024-05-31" } +servo_atoms = { git = "https://github.com/servo/stylo", branch = "2024-05-31" } +size_of_test = { git = "https://github.com/servo/stylo", branch = "2024-05-31" } 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-05-15", features = ["servo"] } -style_config = { git = "https://github.com/servo/stylo", branch = "2024-05-15" } -style_traits = { git = "https://github.com/servo/stylo", branch = "2024-05-15", features = ["servo"] } +style = { git = "https://github.com/servo/stylo", branch = "2024-05-31", features = ["servo"] } +style_config = { git = "https://github.com/servo/stylo", branch = "2024-05-31" } +style_traits = { git = "https://github.com/servo/stylo", branch = "2024-05-31", features = ["servo"] } # NOTE: the sm-angle feature only enables ANGLE on Windows, not other platforms! 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-05-15" } +to_shmem = { git = "https://github.com/servo/stylo", branch = "2024-05-31" } tokio = "1" tokio-rustls = "0.24" tungstenite = "0.20" diff --git a/components/layout/text.rs b/components/layout/text.rs index 873622f0b38..86f549d464a 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -773,7 +773,7 @@ fn apply_style_transform_if_necessary( last_whitespace: bool, is_first_run: bool, ) { - match text_transform.case_ { + match text_transform.case() { TextTransformCase::None => {}, TextTransformCase::Uppercase => { let original = string[first_character_position..].to_owned(); diff --git a/components/layout_2020/flow/inline/construct.rs b/components/layout_2020/flow/inline/construct.rs index 31c52d217dd..a210e534abe 100644 --- a/components/layout_2020/flow/inline/construct.rs +++ b/components/layout_2020/flow/inline/construct.rs @@ -6,7 +6,7 @@ use std::borrow::Cow; use std::char::{ToLowercase, ToUppercase}; use style::computed_values::white_space_collapse::T as WhiteSpaceCollapse; -use style::values::computed::{TextDecorationLine, TextTransform}; +use style::values::computed::TextDecorationLine; use style::values::specified::text::TextTransformCase; use unicode_segmentation::UnicodeSegmentation; @@ -185,10 +185,13 @@ impl InlineFormattingContextBuilder { self.last_inline_box_ended_with_collapsible_white_space, ); - let text_transform = info.style.clone_text_transform(); + // TODO: Not all text transforms are about case, this logic should stop ignoring + // TextTransform::FULL_WIDTH and TextTransform::FULL_SIZE_KANA. + let text_transform = info.style.clone_text_transform().case(); let capitalized_text: String; - let char_iterator: Box> = - if text_transform.case_ == TextTransformCase::Capitalize { + let char_iterator: Box> = match text_transform { + TextTransformCase::None => Box::new(collapsed), + TextTransformCase::Capitalize => { // `TextTransformation` doesn't support capitalization, so we must capitalize the whole // string at once and make a copy. Here `on_word_boundary` indicates whether or not the // inline formatting context as a whole is on a word boundary. This is different from @@ -198,13 +201,13 @@ impl InlineFormattingContextBuilder { let collapsed_string: String = collapsed.collect(); capitalized_text = capitalize_string(&collapsed_string, self.on_word_boundary); Box::new(capitalized_text.chars()) - } else if !text_transform.is_none() { + }, + _ => { // If `text-transform` is active, wrap the `WhitespaceCollapse` iterator in // a `TextTransformation` iterator. Box::new(TextTransformation::new(collapsed, text_transform)) - } else { - Box::new(collapsed) - }; + }, + }; let white_space_collapse = info.style.clone_white_space_collapse(); let new_text: String = char_iterator @@ -509,14 +512,14 @@ pub struct TextTransformation { /// The input character iterator. char_iterator: InputIterator, /// The `text-transform` value to use. - text_transform: TextTransform, + text_transform: TextTransformCase, /// If an uppercasing or lowercasing produces more than one character, this /// caches them so that they can be returned in subsequent iterator calls. pending_case_conversion_result: Option, } impl TextTransformation { - pub fn new(char_iterator: InputIterator, text_transform: TextTransform) -> Self { + pub fn new(char_iterator: InputIterator, text_transform: TextTransformCase) -> Self { Self { char_iterator, text_transform, @@ -542,7 +545,7 @@ where self.pending_case_conversion_result = None; for character in self.char_iterator.by_ref() { - match self.text_transform.case_ { + match self.text_transform { TextTransformCase::None => return Some(character), TextTransformCase::Uppercase => { let mut pending_result = @@ -562,8 +565,7 @@ where }, // `text-transform: capitalize` currently cannot work on a per-character basis, // so must be handled outside of this iterator. - // TODO: Add support for `full-width` and `full-size-kana`. - _ => return Some(character), + TextTransformCase::Capitalize => return Some(character), } } None diff --git a/components/script/dom/documentorshadowroot.rs b/components/script/dom/documentorshadowroot.rs index 560f8c43e3d..e3eb4a34de1 100644 --- a/components/script/dom/documentorshadowroot.rs +++ b/components/script/dom/documentorshadowroot.rs @@ -12,6 +12,7 @@ use servo_atoms::Atom; use style::invalidation::media_queries::{MediaListKey, ToMediaListKey}; use style::media_queries::MediaList; use style::shared_lock::{SharedRwLock as StyleSharedRwLock, SharedRwLockReadGuard}; +use style::stylesheets::scope_rule::ImplicitScopeRoot; use style::stylesheets::{Stylesheet, StylesheetContents}; use super::bindings::trace::HashMapTracedValues; @@ -65,6 +66,10 @@ impl ::style::stylesheets::StylesheetInDocument for StyleSheetInDocument { fn contents(&self) -> &StylesheetContents { self.sheet.contents() } + + fn implicit_scope_root(&self) -> Option { + None + } } // https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin diff --git a/tests/unit/style/stylist.rs b/tests/unit/style/stylist.rs index 93e44879b87..2b6f1a9437c 100644 --- a/tests/unit/style/stylist.rs +++ b/tests/unit/style/stylist.rs @@ -18,7 +18,7 @@ use style::servo::media_queries::FontMetricsProvider; use style::shared_lock::SharedRwLock; use style::stylesheets::StyleRule; use style::stylist::{ - needs_revalidation_for_testing, ContainerConditionId, LayerId, Rule, Stylist, + needs_revalidation_for_testing, ContainerConditionId, LayerId, Rule, ScopeConditionId, Stylist, }; use style::thread_state::{self, ThreadState}; use style::values::computed::Length; @@ -78,6 +78,7 @@ fn get_mock_rules(css_selectors: &[&str]) -> (Vec>, SharedRwLock) { LayerId::root(), ContainerConditionId::none(), /* in_starting_style = */ false, + ScopeConditionId::none(), ) }) .collect() diff --git a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-color-mix-function.html.ini b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-color-mix-function.html.ini index 0426b4afca9..54c1222f1ed 100644 --- a/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-color-mix-function.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-color/parsing/color-computed-color-mix-function.html.ini @@ -382,9 +382,3 @@ [Property color value 'color-mix(in oklch, oklch(10 20 120deg / 0) 10%, oklch(30 40 30deg))'] expected: FAIL - - [Property color value 'color-mix(in lch, white, blue)'] - expected: FAIL - - [Property color value 'color-mix(in lch, white 10%, blue)'] - expected: FAIL diff --git a/tests/wpt/meta/css/css-color/parsing/color-computed-color-mix-function.html.ini b/tests/wpt/meta/css/css-color/parsing/color-computed-color-mix-function.html.ini index 0426b4afca9..54c1222f1ed 100644 --- a/tests/wpt/meta/css/css-color/parsing/color-computed-color-mix-function.html.ini +++ b/tests/wpt/meta/css/css-color/parsing/color-computed-color-mix-function.html.ini @@ -382,9 +382,3 @@ [Property color value 'color-mix(in oklch, oklch(10 20 120deg / 0) 10%, oklch(30 40 30deg))'] expected: FAIL - - [Property color value 'color-mix(in lch, white, blue)'] - expected: FAIL - - [Property color value 'color-mix(in lch, white 10%, blue)'] - expected: FAIL