From 6a5fed0471566812f417789070db31f58739c077 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 12 Aug 2014 21:41:45 +0100 Subject: [PATCH] Dissallow !important in @font-face --- src/components/style/font_face.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/style/font_face.rs b/src/components/style/font_face.rs index f46ad635dcb..2c3771ebbcc 100644 --- a/src/components/style/font_face.rs +++ b/src/components/style/font_face.rs @@ -54,8 +54,11 @@ pub fn parse_font_face_rule(rule: AtRule, parent_rules: &mut Vec, base_ match item { DeclAtRule(rule) => log_css_error( rule.location, format!("Unsupported at-rule in declaration list: @{:s}", rule.name).as_slice()), - Declaration(Declaration{ location: location, name: name, value: value, important: _}) => { - + Declaration(Declaration{ location, name, value, important }) => { + if important { + log_css_error(location, "!important is not allowed on @font-face descriptors"); + continue + } let name_lower = name.as_slice().to_ascii_lower(); match name_lower.as_slice() { "font-family" => {