Skip to content

Commit e40ea81

Browse files
AtkinsSJawesomekling
authored andcommitted
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.
1 parent 8924b1f commit e40ea81

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,70 +2872,70 @@ Result<NonnullRefPtr<StyleValue>, Parser::ParsingResult> Parser::parse_css_value
28722872
case PropertyID::Background:
28732873
if (auto parsed_value = parse_background_value(m_context, component_values))
28742874
return parsed_value.release_nonnull();
2875-
break;
2875+
return ParsingResult::SyntaxError;
28762876
case PropertyID::BackgroundImage:
28772877
if (auto parsed_value = parse_background_image_value(m_context, component_values))
28782878
return parsed_value.release_nonnull();
2879-
break;
2879+
return ParsingResult::SyntaxError;
28802880
case PropertyID::BackgroundRepeat:
28812881
if (auto parsed_value = parse_background_repeat_value(m_context, component_values))
28822882
return parsed_value.release_nonnull();
2883-
break;
2883+
return ParsingResult::SyntaxError;
28842884
case PropertyID::Border:
28852885
case PropertyID::BorderBottom:
28862886
case PropertyID::BorderLeft:
28872887
case PropertyID::BorderRight:
28882888
case PropertyID::BorderTop:
28892889
if (auto parsed_value = parse_border_value(m_context, component_values))
28902890
return parsed_value.release_nonnull();
2891-
break;
2891+
return ParsingResult::SyntaxError;
28922892
case PropertyID::BorderTopLeftRadius:
28932893
case PropertyID::BorderTopRightRadius:
28942894
case PropertyID::BorderBottomRightRadius:
28952895
case PropertyID::BorderBottomLeftRadius:
28962896
if (auto parsed_value = parse_border_radius_value(m_context, component_values))
28972897
return parsed_value.release_nonnull();
2898-
break;
2898+
return ParsingResult::SyntaxError;
28992899
case PropertyID::BorderRadius:
29002900
if (auto parsed_value = parse_border_radius_shorthand_value(m_context, component_values))
29012901
return parsed_value.release_nonnull();
2902-
break;
2902+
return ParsingResult::SyntaxError;
29032903
case PropertyID::BoxShadow:
29042904
if (auto parsed_value = parse_box_shadow_value(m_context, component_values))
29052905
return parsed_value.release_nonnull();
2906-
break;
2906+
return ParsingResult::SyntaxError;
29072907
case PropertyID::Flex:
29082908
if (auto parsed_value = parse_flex_value(m_context, component_values))
29092909
return parsed_value.release_nonnull();
2910-
break;
2910+
return ParsingResult::SyntaxError;
29112911
case PropertyID::FlexFlow:
29122912
if (auto parsed_value = parse_flex_flow_value(m_context, component_values))
29132913
return parsed_value.release_nonnull();
2914-
break;
2914+
return ParsingResult::SyntaxError;
29152915
case PropertyID::Font:
29162916
if (auto parsed_value = parse_font_value(m_context, component_values))
29172917
return parsed_value.release_nonnull();
2918-
break;
2918+
return ParsingResult::SyntaxError;
29192919
case PropertyID::FontFamily:
29202920
if (auto parsed_value = parse_font_family_value(m_context, component_values))
29212921
return parsed_value.release_nonnull();
2922-
break;
2922+
return ParsingResult::SyntaxError;
29232923
case PropertyID::ListStyle:
29242924
if (auto parsed_value = parse_list_style_value(m_context, component_values))
29252925
return parsed_value.release_nonnull();
2926-
break;
2926+
return ParsingResult::SyntaxError;
29272927
case PropertyID::Overflow:
29282928
if (auto parsed_value = parse_overflow_value(m_context, component_values))
29292929
return parsed_value.release_nonnull();
2930-
break;
2930+
return ParsingResult::SyntaxError;
29312931
case PropertyID::TextDecoration:
29322932
if (auto parsed_value = parse_text_decoration_value(m_context, component_values))
29332933
return parsed_value.release_nonnull();
2934-
break;
2934+
return ParsingResult::SyntaxError;
29352935
case PropertyID::Transform:
29362936
if (auto parsed_value = parse_transform_value(m_context, component_values))
29372937
return parsed_value.release_nonnull();
2938-
break;
2938+
return ParsingResult::SyntaxError;
29392939
default:
29402940
break;
29412941
}

0 commit comments

Comments
 (0)