From 832807f15f14e750172875b24bbc2a47896cc17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 21 May 2023 22:01:52 +0200 Subject: [PATCH] style: Reserve -- as a custom property name I think this should be fairly low risk, let's try to get it done sooner rather than later. Differential Revision: https://phabricator.services.mozilla.com/D116456 --- components/style/custom_properties.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index b5461e1cbae..c031a0e3d87 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -88,7 +88,7 @@ pub type Name = Atom; /// /// pub fn parse_name(s: &str) -> Result<&str, ()> { - if s.starts_with("--") { + if s.starts_with("--") && s.len() > 2 { Ok(&s[2..]) } else { Err(())