From 21a077393f30c2e617a2ef850e4ac6f86004118e Mon Sep 17 00:00:00 2001 From: Butkovits Atila Date: Mon, 22 May 2023 23:29:17 +0300 Subject: [PATCH] Backed out changeset ab9f3266184b (bug 1815186) for causing failures at test_color_to.html. --- .cargo/config.in | 4 +- Cargo.lock | 4 +- Cargo.toml | 4 +- dom/chrome-webidl/InspectorUtils.webidl | 7 -- layout/inspector/InspectorUtils.cpp | 20 ----- layout/inspector/InspectorUtils.h | 5 -- layout/inspector/tests/mochitest.ini | 7 +- layout/inspector/tests/test_color_to.html | 68 -------------- layout/style/ServoCSSParser.cpp | 10 --- layout/style/ServoCSSParser.h | 21 ----- servo/ports/geckolib/glue.rs | 90 +------------------ supply-chain/audits.toml | 17 ++-- .../rust/cssparser/.cargo-checksum.json | 2 +- third_party/rust/cssparser/src/color.rs | 11 ++- third_party/rust/cssparser/src/lib.rs | 8 +- 15 files changed, 29 insertions(+), 249 deletions(-) delete mode 100644 layout/inspector/tests/test_color_to.html diff --git a/.cargo/config.in b/.cargo/config.in index 24eb8c74497b..80deb2b4b31e 100644 --- a/.cargo/config.in +++ b/.cargo/config.in @@ -105,9 +105,9 @@ git = "https://github.com/mozilla/uniffi-rs.git" rev = "bc7ff8977bf38d0fdd1a458810b14f434d4dc4de" replace-with = "vendored-sources" -[source."git+https://github.com/servo/rust-cssparser?rev=8a24b1118747dc76c9ba3a9c88bd2456516c598d"] +[source."git+https://github.com/servo/rust-cssparser?rev=6ce91afdf292c4290118843e7421e146f0a4c48b"] git = "https://github.com/servo/rust-cssparser" -rev = "8a24b1118747dc76c9ba3a9c88bd2456516c598d" +rev = "6ce91afdf292c4290118843e7421e146f0a4c48b" replace-with = "vendored-sources" diff --git a/Cargo.lock b/Cargo.lock index b19bb9f52fa0..00b4319449ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1017,7 +1017,7 @@ dependencies = [ [[package]] name = "cssparser" version = "0.31.0" -source = "git+https://github.com/servo/rust-cssparser?rev=8a24b1118747dc76c9ba3a9c88bd2456516c598d#8a24b1118747dc76c9ba3a9c88bd2456516c598d" +source = "git+https://github.com/servo/rust-cssparser?rev=6ce91afdf292c4290118843e7421e146f0a4c48b#6ce91afdf292c4290118843e7421e146f0a4c48b" dependencies = [ "cssparser-macros", "dtoa-short", @@ -1032,7 +1032,7 @@ dependencies = [ [[package]] name = "cssparser-macros" version = "0.6.0" -source = "git+https://github.com/servo/rust-cssparser?rev=8a24b1118747dc76c9ba3a9c88bd2456516c598d#8a24b1118747dc76c9ba3a9c88bd2456516c598d" +source = "git+https://github.com/servo/rust-cssparser?rev=6ce91afdf292c4290118843e7421e146f0a4c48b#6ce91afdf292c4290118843e7421e146f0a4c48b" dependencies = [ "quote", "syn", diff --git a/Cargo.toml b/Cargo.toml index 09a231fbfb47..d31d5c7de086 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -153,8 +153,8 @@ moz_asserts = { path = "mozglue/static/rust/moz_asserts" } rure = { path = "third_party/rust/rure" } # To-be-published changes. -cssparser = { git = "https://github.com/servo/rust-cssparser", rev = "8a24b1118747dc76c9ba3a9c88bd2456516c598d" } -cssparser-macros = { git = "https://github.com/servo/rust-cssparser", rev = "8a24b1118747dc76c9ba3a9c88bd2456516c598d" } +cssparser = { git = "https://github.com/servo/rust-cssparser", rev = "6ce91afdf292c4290118843e7421e146f0a4c48b" } +cssparser-macros = { git = "https://github.com/servo/rust-cssparser", rev = "6ce91afdf292c4290118843e7421e146f0a4c48b" } # Other overrides chardetng = { git = "https://github.com/hsivonen/chardetng", rev="3484d3e3ebdc8931493aa5df4d7ee9360a90e76b" } diff --git a/dom/chrome-webidl/InspectorUtils.webidl b/dom/chrome-webidl/InspectorUtils.webidl index 5f3c2c6429e4..0c0a356728ad 100644 --- a/dom/chrome-webidl/InspectorUtils.webidl +++ b/dom/chrome-webidl/InspectorUtils.webidl @@ -39,7 +39,6 @@ namespace InspectorUtils { [Throws] sequence getCSSValuesForProperty(UTF8String property); DOMString rgbToColorName(octet r, octet g, octet b); InspectorRGBATuple? colorToRGBA(UTF8String colorString, optional Document? doc = null); - InspectorColorToResult? colorTo(UTF8String fromColor, UTF8String toColorSpace); boolean isValidCSSColor(UTF8String colorString); [Throws] sequence getSubpropertiesForCSSProperty(UTF8String property); [Throws] boolean cssPropertyIsShorthand(UTF8String property); @@ -119,12 +118,6 @@ dictionary InspectorRGBATuple { double a = 1; }; -dictionary InspectorColorToResult { - required DOMString color; - required sequence components; - required boolean adjusted; -}; - // Any update to this enum should probably also update // devtools/shared/css/constants.js enum InspectorPropertyType { diff --git a/layout/inspector/InspectorUtils.cpp b/layout/inspector/InspectorUtils.cpp index 124f0bb010ed..46980379426c 100644 --- a/layout/inspector/InspectorUtils.cpp +++ b/layout/inspector/InspectorUtils.cpp @@ -584,26 +584,6 @@ void InspectorUtils::ColorToRGBA(GlobalObject&, const nsACString& aColorString, tuple.mA = nsStyleUtil::ColorComponentToFloat(NS_GET_A(color)); } -/* static */ -void InspectorUtils::ColorTo(GlobalObject&, const nsACString& aFromColor, - const nsACString& aToColorSpace, - Nullable& aResult) { - nsCString resultColor; - nsTArray resultComponents; - bool resultAdjusted = false; - - if (!ServoCSSParser::ColorTo(aFromColor, aToColorSpace, &resultColor, - &resultComponents, &resultAdjusted)) { - aResult.SetNull(); - return; - } - - auto& result = aResult.SetValue(); - result.mColor.AssignASCII(resultColor); - result.mComponents = std::move(resultComponents); - result.mAdjusted = resultAdjusted; -} - /* static */ bool InspectorUtils::IsValidCSSColor(GlobalObject& aGlobalObject, const nsACString& aColorString) { diff --git a/layout/inspector/InspectorUtils.h b/layout/inspector/InspectorUtils.h index 09f05daf99e1..fc0666f72e01 100644 --- a/layout/inspector/InspectorUtils.h +++ b/layout/inspector/InspectorUtils.h @@ -136,11 +136,6 @@ class InspectorUtils { const Document*, Nullable& aResult); - // Convert a given CSS color string to another color space. - static void ColorTo(GlobalObject&, const nsACString& aFromColor, - const nsACString& aToColorSpace, - Nullable& aResult); - // Check whether a given color is a valid CSS color. static bool IsValidCSSColor(GlobalObject& aGlobal, const nsACString& aColorString); diff --git a/layout/inspector/tests/mochitest.ini b/layout/inspector/tests/mochitest.ini index 3553bf316714..a0956f82fe5b 100644 --- a/layout/inspector/tests/mochitest.ini +++ b/layout/inspector/tests/mochitest.ini @@ -7,21 +7,19 @@ support-files = bug856317.css file_bug522601.html -[test_bug1006595.html] [test_bug462787.html] [test_bug462789.html] [test_bug522601-shadow.xhtml] -[test_bug536379-2.html] [test_bug536379.html] +[test_bug536379-2.html] [test_bug557726.html] [test_bug609549-shadow.xhtml] [test_bug856317.html] [test_bug877690.html] -[test_color_to.html] +[test_bug1006595.html] [test_color_to_rgba.html] [test_containing_block_of.html] [test_css_property_is_shorthand.html] -[test_getCSSPseudoElementNames.html] [test_getCSSStyleRules.html] support-files = file_getCSSStyleRules-default.html @@ -30,6 +28,7 @@ support-files = getCSSStyleRules-2.css [test_getCSSStyleRules_pseudo.html] [test_getCSSStyleRules_slotted.html] +[test_getCSSPseudoElementNames.html] [test_getRelativeRuleLine.html] [test_get_all_style_sheets.html] [test_is_element_themed.html] diff --git a/layout/inspector/tests/test_color_to.html b/layout/inspector/tests/test_color_to.html deleted file mode 100644 index 148c1b19b72a..000000000000 --- a/layout/inspector/tests/test_color_to.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - Test InspectorUtils::ColorTo - - - - - -

- -

-
-
diff --git a/layout/style/ServoCSSParser.cpp b/layout/style/ServoCSSParser.cpp
index 99a26e14309f..1ad14cd38df1 100644
--- a/layout/style/ServoCSSParser.cpp
+++ b/layout/style/ServoCSSParser.cpp
@@ -31,16 +31,6 @@ bool ServoCSSParser::ComputeColor(ServoStyleSet* aStyleSet,
                             aWasCurrentColor, aLoader);
 }
 
-/* static */
-bool ServoCSSParser::ColorTo(const nsACString& aFromColor,
-                             const nsACString& aToColorSpace,
-                             nsACString* aResultColor,
-                             nsTArray* aResultComponents,
-                             bool* aResultAdjusted, css::Loader* aLoader) {
-  return Servo_ColorTo(&aFromColor, &aToColorSpace, aResultColor,
-                       aResultComponents, aResultAdjusted, aLoader);
-}
-
 /* static */
 already_AddRefed ServoCSSParser::ParseProperty(
     nsCSSPropertyID aProperty, const nsACString& aValue,
diff --git a/layout/style/ServoCSSParser.h b/layout/style/ServoCSSParser.h
index 6e8ae0787aa4..5f9ea2f58ee2 100644
--- a/layout/style/ServoCSSParser.h
+++ b/layout/style/ServoCSSParser.h
@@ -78,27 +78,6 @@ class ServoCSSParser {
                            bool* aWasCurrentColor = nullptr,
                            css::Loader* aLoader = nullptr);
 
-  /**
-   * Takes a CSS  and convert it to another color space.
-   *
-   * @param aStyleSet The style set whose nsPresContext will be used to
-   *   compute system colors and other special color values.
-   * @param aFromColor The CSS  we use to convert from.
-   * @param aToColorSpace The CSS  to convert the color into.
-   * @param aResultColor The resulting converted color value.
-   * @param aResultAdjusted Whether the color was adjusted to fit into the SRGB
-       color space.
-   * @param aLoader The CSS loader for document we're parsing a color for,
-   *   so that parse errors can be reported to the console. If nullptr, errors
-   *   won't be reported to the console.
-   * @return Whether aFromColor and aToColorSpace was successfully parsed and
-   *   aResultColor and aResultAdjusted was set.
-   */
-  static bool ColorTo(const nsACString& aFromColor,
-                      const nsACString& aToColorSpace, nsACString* aResultColor,
-                      nsTArray* aResultComponents, bool* aResultAdjusted,
-                      css::Loader* aLoader = nullptr);
-
   /**
    * Parse a string representing a CSS property value into a
    * StyleLockedDeclarationBlock.
diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs
index a38a3d4ecf24..2084c4cb4ef1 100644
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -142,7 +142,7 @@ use style::values::generics::easing::BeforeFlag;
 use style::values::specified::gecko::IntersectionObserverRootMargin;
 use style::values::specified::source_size_list::SourceSizeList;
 use style::values::specified::{AbsoluteLength, NoCalcLength};
-use style::values::{serialize_percentage, specified, AtomIdent, CustomIdent, KeyframesName};
+use style::values::{specified, AtomIdent, CustomIdent, KeyframesName};
 use style_traits::{CssWriter, ParseError, ParsingMode, ToCss};
 use thin_vec::ThinVec;
 use to_shmem::SharedMemoryBuilder;
@@ -7075,94 +7075,6 @@ pub unsafe extern "C" fn Servo_ComputeColor(
     true
 }
 
-#[no_mangle]
-pub unsafe extern "C" fn Servo_ColorTo(
-    from_color: &nsACString,
-    to_color_space: &nsACString,
-    result_color: &mut nsACString,
-    result_components: &mut nsTArray,
-    result_adjusted: &mut bool,
-    loader: *mut Loader,
-) -> bool {
-    // Figure out the color space.
-    let mut input = ParserInput::new(to_color_space.as_str_unchecked());
-    let mut input = Parser::new(&mut input);
-    let to_color_space = match ColorSpace::parse(&mut input) {
-        Ok(color_space) => color_space,
-        Err(_) => {
-            // Can't parse the color space? Fail the conversion.
-            return false;
-        },
-    };
-
-    let mut input = ParserInput::new(from_color.as_str_unchecked());
-    let mut input = Parser::new(&mut input);
-
-    let reporter = loader.as_mut().and_then(|loader| {
-        // Make an ErrorReporter that will report errors as being "from DOM".
-        ErrorReporter::new(ptr::null_mut(), loader, ptr::null_mut())
-    });
-
-    let context = ParserContext::new(
-        Origin::Author,
-        dummy_url_data(),
-        Some(CssRuleType::Style),
-        ParsingMode::DEFAULT,
-        QuirksMode::NoQuirks,
-        /* namespaces = */ Default::default(),
-        reporter.as_ref().map(|e| e as &dyn ParseErrorReporter),
-        None,
-    );
-
-    let specified = match specified::Color::parse(&context, &mut input) {
-        Ok(color) => color,
-        Err(_) => return false,
-    };
-
-    let color = match specified {
-        specified::Color::Absolute(ref absolute) => &absolute.color,
-        _ => {
-            // Can't do anything with a non-absolute color from here, so we
-            // fail the conversion.
-            return false;
-        },
-    };
-
-    let color = color.to_color_space(to_color_space);
-
-    let mut writer = CssWriter::new(result_color);
-    match color.color_space {
-        ColorSpace::Hsl => {
-            writer.write_str("hsl(").unwrap();
-            style_traits::values::ToCss::to_css(&color.components.0, &mut writer).unwrap();
-            writer.write_char(' ').unwrap();
-            serialize_percentage(color.components.1, &mut writer).unwrap();
-            writer.write_char(' ').unwrap();
-            serialize_percentage(color.components.2, &mut writer).unwrap();
-            // cssparser::serialize_alpha(&mut writer, Some(color.alpha), false).unwrap();
-            writer.write_str(")").unwrap();
-        },
-        ColorSpace::Hwb => {
-            writer.write_str("hwb(").unwrap();
-            style_traits::values::ToCss::to_css(&color.components.0, &mut writer).unwrap();
-            writer.write_char(' ').unwrap();
-            serialize_percentage(color.components.1, &mut writer).unwrap();
-            writer.write_char(' ').unwrap();
-            serialize_percentage(color.components.2, &mut writer).unwrap();
-            // cssparser::serialize_alpha(&mut writer, Some(color.alpha), false).unwrap();
-            writer.write_str(")").unwrap();
-        },
-        _ => color.to_css(&mut writer).unwrap(),
-    }
-
-    result_components.assign_from_iter_pod(color.raw_components().iter().copied());
-
-    // For now we don't do gamut mapping, so always false.
-    *result_adjusted = false;
-
-    true
-}
-
 #[no_mangle]
 pub extern "C" fn Servo_ResolveColor(
     color: &computed::Color,
diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml
index e733faa39ed6..8434f93b9028 100644
--- a/supply-chain/audits.toml
+++ b/supply-chain/audits.toml
@@ -782,6 +782,12 @@ was developed by other mozilla folks. Unsafe code there is reasonable (utf-8
 casts for serialization and parsing).
 """
 
+[[audits.cssparser]]
+who = "Emilio Cobos Álvarez "
+criteria = "safe-to-deploy"
+version = "0.31.0@git:6ce91afdf292c4290118843e7421e146f0a4c48b"
+notes = "Local changes authored by me that aren't published yet."
+
 [[audits.cssparser]]
 who = "Bobby Holley "
 criteria = "safe-to-deploy"
@@ -791,12 +797,6 @@ All the changes in this release were authored by Mozilla staff, except the
 uninit_array stuff, which looks fine.
 """
 
-[[audits.cssparser]]
-who = "Tiaan Louw "
-criteria = "safe-to-deploy"
-delta = "0.31.0 -> 0.31.0@git:8a24b1118747dc76c9ba3a9c88bd2456516c598d"
-notes = "To use unpublished changes."
-
 [[audits.cssparser-macros]]
 who = "Emilio Cobos Álvarez "
 criteria = "safe-to-deploy"
@@ -807,9 +807,10 @@ to a match expression.
 """
 
 [[audits.cssparser-macros]]
-who = "Tiaan Louw "
+who = "Emilio Cobos Álvarez "
 criteria = "safe-to-deploy"
-delta = "0.6.0 -> 0.6.0@git:8a24b1118747dc76c9ba3a9c88bd2456516c598d"
+version = "0.6.0@git:6ce91afdf292c4290118843e7421e146f0a4c48b"
+notes = "We are pulling this package from a non crates.io source until the changes are published. No changes were made to the code."
 
 [[audits.cstr]]
 who = "Emilio Cobos Álvarez "
diff --git a/third_party/rust/cssparser/.cargo-checksum.json b/third_party/rust/cssparser/.cargo-checksum.json
index 136b6335a2af..76067ef0ee84 100644
--- a/third_party/rust/cssparser/.cargo-checksum.json
+++ b/third_party/rust/cssparser/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{".github/workflows/main.yml":"73c57dbb2c5471de2fcba828e356d09931ae89176f3bb695029b169dbb3f696f","Cargo.toml":"cffe5d5b5b66f65b9e4ca2aee56cf046604075ccfff0a89ca37ef4bb59164d02","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"53a6805edd80f642473514cb93f1f4197e17a911d66a2dfcefc3dc5e82bac206","docs/.nojekyll":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"08424f5101c04f715b53fd91a2187fe9e7a11287cf6deee485fb6741eace130d","src/cow_rc_str.rs":"22d6829ab54c51486af4bacf5f184a6c95c15febdbbd5630a98b995ed0ee3e55","src/from_bytes.rs":"b1cf15c4e975523fef46b575598737a39f3c63e5ce0b2bfd6ec627c69c6ea54a","src/lib.rs":"8f1657c507380db0281e5aa7eb06f17d7f559c582b265d6589006042ffad18ad","src/macros.rs":"883df01d4a8dfc661b8ffa17fab694ff6fb271e99e9c6b023e73d49bbaa6e5d6","src/nth.rs":"2fc26915f0a36cb22ac45dd9a7ecbdc64c327b2ec135370258ec3db9f9985460","src/parser.rs":"50fa448b316902d5f4aa18725220633c28bb7d82cbaff125177d79d4cf8dae58","src/rules_and_declarations.rs":"cb08533dd4b239a6cbd59d8fcca1447c8089940dd519edea9c9a9b51fa999d49","src/serializer.rs":"3a0155521676deea9a6327c2ed00af6d5dabb29a97e2341d0f565f8c2b66d0a3","src/size_of_tests.rs":"da0cbcaa304f7800e9122e2bce0a11d42a70b9012e646a723cb23ee74a6b858c","src/tests.rs":"6c950841e8c454c50ae439543fa8718f935058a6bb1b1bf77033439daeff08a7","src/tokenizer.rs":"9900460d9bad82b7a41829d01537094203fafc7092c954aac969546ea53d5bba","src/unicode_range.rs":"20d96f06fbb73921e308cc340c9fe065e27f19843005689fb259007a6a372bcc"},"package":null}
\ No newline at end of file
+{"files":{".github/workflows/main.yml":"73c57dbb2c5471de2fcba828e356d09931ae89176f3bb695029b169dbb3f696f","Cargo.toml":"cffe5d5b5b66f65b9e4ca2aee56cf046604075ccfff0a89ca37ef4bb59164d02","LICENSE":"fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85","README.md":"53a6805edd80f642473514cb93f1f4197e17a911d66a2dfcefc3dc5e82bac206","docs/.nojekyll":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","docs/404.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","docs/index.html":"025861f76f8d1f6d67c20ab624c6e418f4f824385e2dd8ad8732c4ea563c6a2e","src/color.rs":"df7d97636896df02b7ba56abf6f74f121d8320615f9e6ef6d43e6f272d3600cb","src/cow_rc_str.rs":"22d6829ab54c51486af4bacf5f184a6c95c15febdbbd5630a98b995ed0ee3e55","src/from_bytes.rs":"b1cf15c4e975523fef46b575598737a39f3c63e5ce0b2bfd6ec627c69c6ea54a","src/lib.rs":"d4e37941cfa90e42deb7d0537483ac0b2bac033adf4bb0007b000cd807c588f5","src/macros.rs":"883df01d4a8dfc661b8ffa17fab694ff6fb271e99e9c6b023e73d49bbaa6e5d6","src/nth.rs":"2fc26915f0a36cb22ac45dd9a7ecbdc64c327b2ec135370258ec3db9f9985460","src/parser.rs":"50fa448b316902d5f4aa18725220633c28bb7d82cbaff125177d79d4cf8dae58","src/rules_and_declarations.rs":"cb08533dd4b239a6cbd59d8fcca1447c8089940dd519edea9c9a9b51fa999d49","src/serializer.rs":"3a0155521676deea9a6327c2ed00af6d5dabb29a97e2341d0f565f8c2b66d0a3","src/size_of_tests.rs":"da0cbcaa304f7800e9122e2bce0a11d42a70b9012e646a723cb23ee74a6b858c","src/tests.rs":"6c950841e8c454c50ae439543fa8718f935058a6bb1b1bf77033439daeff08a7","src/tokenizer.rs":"9900460d9bad82b7a41829d01537094203fafc7092c954aac969546ea53d5bba","src/unicode_range.rs":"20d96f06fbb73921e308cc340c9fe065e27f19843005689fb259007a6a372bcc"},"package":null}
\ No newline at end of file
diff --git a/third_party/rust/cssparser/src/color.rs b/third_party/rust/cssparser/src/color.rs
index d8e00b3b6412..f4484180ef6a 100644
--- a/third_party/rust/cssparser/src/color.rs
+++ b/third_party/rust/cssparser/src/color.rs
@@ -26,10 +26,9 @@ where
     }
 }
 
-/// Serialize the alpha copmonent of a color according to the specification.
 /// 
 #[inline]
-pub fn serialize_color_alpha(
+fn serialize_alpha(
     dest: &mut impl fmt::Write,
     alpha: Option,
     legacy_syntax: bool,
@@ -147,7 +146,7 @@ impl ToCss for RGBA {
         self.blue.unwrap_or(0).to_css(dest)?;
 
         // Legacy syntax does not allow none components.
-        serialize_color_alpha(dest, Some(self.alpha.unwrap_or(0.0)), true)?;
+        serialize_alpha(dest, Some(self.alpha.unwrap_or(0.0)), true)?;
 
         dest.write_char(')')
     }
@@ -368,7 +367,7 @@ macro_rules! impl_lab_like {
                 serialize_none_or(dest, &self.a)?;
                 dest.write_char(' ')?;
                 serialize_none_or(dest, &self.b)?;
-                serialize_color_alpha(dest, self.alpha, false)?;
+                serialize_alpha(dest, self.alpha, false)?;
                 dest.write_char(')')
             }
         }
@@ -459,7 +458,7 @@ macro_rules! impl_lch_like {
                 serialize_none_or(dest, &self.chroma)?;
                 dest.write_char(' ')?;
                 serialize_none_or(dest, &self.hue)?;
-                serialize_color_alpha(dest, self.alpha, false)?;
+                serialize_alpha(dest, self.alpha, false)?;
                 dest.write_char(')')
             }
         }
@@ -585,7 +584,7 @@ impl ToCss for ColorFunction {
         dest.write_char(' ')?;
         serialize_none_or(dest, &self.c3)?;
 
-        serialize_color_alpha(dest, self.alpha, false)?;
+        serialize_alpha(dest, self.alpha, false)?;
 
         dest.write_char(')')
     }
diff --git a/third_party/rust/cssparser/src/lib.rs b/third_party/rust/cssparser/src/lib.rs
index 7ab88e8fca46..1bbcb55547a6 100644
--- a/third_party/rust/cssparser/src/lib.rs
+++ b/third_party/rust/cssparser/src/lib.rs
@@ -68,9 +68,9 @@ fn parse_border_spacing(_context: &ParserContext, input: &mut Parser)
 #![recursion_limit = "200"] // For color::parse_color_keyword
 
 pub use crate::color::{
-    hsl_to_rgb, hwb_to_rgb, parse_color_keyword, parse_color_with, parse_hash_color,
-    serialize_color_alpha, AngleOrNumber, Color, ColorFunction, ColorParser, FromParsedColor, Hsl,
-    Hwb, Lab, Lch, NumberOrPercentage, Oklab, Oklch, PredefinedColorSpace, RGBA,
+    hsl_to_rgb, hwb_to_rgb, parse_color_keyword, parse_color_with, parse_hash_color, AngleOrNumber,
+    Color, ColorFunction, ColorParser, FromParsedColor, Hsl, Hwb, Lab, Lch, NumberOrPercentage,
+    Oklab, Oklch, PredefinedColorSpace, RGBA,
 };
 pub use crate::cow_rc_str::CowRcStr;
 pub use crate::from_bytes::{stylesheet_encoding, EncodingSupport};
@@ -84,7 +84,7 @@ pub use crate::parser::{Delimiter, Delimiters, Parser, ParserInput, ParserState}
 pub use crate::rules_and_declarations::{parse_important, parse_one_declaration};
 pub use crate::rules_and_declarations::{parse_one_rule, StyleSheetParser};
 pub use crate::rules_and_declarations::{AtRuleParser, QualifiedRuleParser};
-pub use crate::rules_and_declarations::{DeclarationParser, RuleBodyItemParser, RuleBodyParser};
+pub use crate::rules_and_declarations::{RuleBodyParser, RuleBodyItemParser, DeclarationParser};
 pub use crate::serializer::{serialize_identifier, serialize_name, serialize_string};
 pub use crate::serializer::{CssStringWriter, ToCss, TokenSerializationType};
 pub use crate::tokenizer::{SourceLocation, SourcePosition, Token};