From 46a9c92b700fefac4d9d65e2845c41872ed2c7dd Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 15 Dec 2015 18:13:54 +0530 Subject: [PATCH] Avoid whitespace collapse for text inputs (fixes #8772) --- components/style/properties.mako.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index 2b419180476..72b57a931ef 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -6993,6 +6993,10 @@ pub fn modify_style_for_input_text(style: &mut Arc) { margin_style.margin_right = computed::LengthOrPercentageOrAuto::Length(Au(0)); margin_style.margin_bottom = computed::LengthOrPercentageOrAuto::Length(Au(0)); margin_style.margin_left = computed::LengthOrPercentageOrAuto::Length(Au(0)); + + // whitespace inside text input should not be collapsed + let inherited_text = Arc::make_mut(&mut style.inheritedtext); + inherited_text.white_space = longhands::white_space::computed_value::T::pre; } /// Adjusts the `clip` property so that an inline absolute hypothetical fragment doesn't clip its