diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2021-09-22 11:45:04 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-23 17:47:40 +0200 |
commit | e40ea819d98a8723f8343738b39678d22dc8635f (patch) | |
tree | b76ea6f62dc92349310755ac8416b816cbc9238e /Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | |
parent | 8924b1f532a618559f4abd6b9c313cc7652e7aad (diff) | |
download | serenity-e40ea819d98a8723f8343738b39678d22dc8635f.zip |
LibWeb: Prevent special-case CSS property parsing fallback
We don't want a property like `background` to fall back to parsing as a
single value or StyleValueList if `parse_background_style_value()`
fails. We just want it to fail.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index cce3323e74..4b5ecf53c3 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -2872,15 +2872,15 @@ Result<NonnullRefPtr<StyleValue>, Parser::ParsingResult> Parser::parse_css_value case PropertyID::Background: if (auto parsed_value = parse_background_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::BackgroundImage: if (auto parsed_value = parse_background_image_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::BackgroundRepeat: if (auto parsed_value = parse_background_repeat_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::Border: case PropertyID::BorderBottom: case PropertyID::BorderLeft: @@ -2888,54 +2888,54 @@ Result<NonnullRefPtr<StyleValue>, Parser::ParsingResult> Parser::parse_css_value case PropertyID::BorderTop: if (auto parsed_value = parse_border_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::BorderTopLeftRadius: case PropertyID::BorderTopRightRadius: case PropertyID::BorderBottomRightRadius: case PropertyID::BorderBottomLeftRadius: if (auto parsed_value = parse_border_radius_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::BorderRadius: if (auto parsed_value = parse_border_radius_shorthand_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::BoxShadow: if (auto parsed_value = parse_box_shadow_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::Flex: if (auto parsed_value = parse_flex_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::FlexFlow: if (auto parsed_value = parse_flex_flow_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::Font: if (auto parsed_value = parse_font_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::FontFamily: if (auto parsed_value = parse_font_family_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::ListStyle: if (auto parsed_value = parse_list_style_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::Overflow: if (auto parsed_value = parse_overflow_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::TextDecoration: if (auto parsed_value = parse_text_decoration_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; case PropertyID::Transform: if (auto parsed_value = parse_transform_value(m_context, component_values)) return parsed_value.release_nonnull(); - break; + return ParsingResult::SyntaxError; default: break; } |