mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:58:12 +00:00
![]() Previously, we have not been validating the values for CSS declarations inside the Parser. This causes issues, since we should be discarding invalid style declarations, so that previous ones are used instead. For example, in this code: ```css .foo { width: 2em; width: orange; } ``` ... the `width: orange` declaration overwrites the `width: 2em` one, even though it is invalid. According to the spec, `width: orange` should be rejected at parse time, and discarded, leaving `width: 2em` as the resulting value. Many properties (mostly shorthands) are parsed specially, and so they are already rejected if they are invalid. But for simple properties, we currently accept any value. With `property_accepts_value()`, we can check if the value is valid in `parse_css_value()`, and reject it if it is not. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
Generate_CSS_PropertyID_cpp.cpp | ||
Generate_CSS_PropertyID_h.cpp | ||
Generate_CSS_ValueID_cpp.cpp | ||
Generate_CSS_ValueID_h.cpp | ||
WrapperGenerator.cpp |