From 786b08a669a7b3f661e1f0b2a7db2ce4dfaa4a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 23 Feb 2021 10:43:03 +0000 Subject: [PATCH] style: Increase custom property size limit a bit. Differential Revision: https://phabricator.services.mozilla.com/D105978 --- components/style/custom_properties.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index 4a0bf5bed7a..0d0a4322333 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -174,11 +174,11 @@ impl VariableValue { /// Prevent values from getting terribly big since you can use custom /// properties exponentially. /// - /// This number (1MB) is somewhat arbitrary, but silly enough that no - /// sane page would hit it. We could limit by number of total + /// This number (2MB) is somewhat arbitrary, but silly enough that no + /// reasonable page should hit it. We could limit by number of total /// substitutions, but that was very easy to work around in practice /// (just choose a larger initial value and boom). - const MAX_VALUE_LENGTH_IN_BYTES: usize = 1024 * 1024; + const MAX_VALUE_LENGTH_IN_BYTES: usize = 2 * 1024 * 1024; if self.css.len() + css.len() > MAX_VALUE_LENGTH_IN_BYTES { return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));