Commit graph

8 commits

Author SHA1 Message Date
Sam Atkins
97e917bdf5 LibWeb/CSS: Allow bare zero for gradient angles
Corresponds to f952e97da9
2025-03-18 20:04:08 +00:00
Tim Ledbetter
764b80a1cc LibWeb/CSS: Reject radial-gradient functions with negative size 2025-03-14 15:07:57 +00:00
Gingeh
31853c13d3 LibWeb: Implement css gradient-interpolation-method 2025-03-06 11:33:12 +00:00
Sam Atkins
c77456a508 LibWeb/CSS: Clarify types of image-parsing methods
parse_image_value() always returns some kind of AbstractImageStyleValue.
2025-02-28 13:50:13 +01:00
Mehran Kamal
cfe6702767 LibWeb/CSS: Fix linear-gradient single color-stop usage
The Web::CSS::Parser's GradientParsing ignores color-stops if
it is only a single one. This change allows to have color-stops
with double positions against a single color.

Further, also allows for `linear-gradient(black)` and similar
other gradient functions
2025-02-03 17:24:10 +00:00
Sam Atkins
bc00ef8314 LibWeb/CSS: Replace Parser "current property" with a stack of contexts
`current_property_id()` is insufficient to determine if a quirk is
allowed. For example, unitless lengths are allowed in certain
properties, but NOT if they are inside a calc() or other function. It's
also incorrect when we are parsing a longhand inside a shorthand. So
instead, replace that with a stack of value-parsing contexts. For now,
this is either properties or CSS functions, but in future can be
expanded to include media features and other places.

This lets us disallow quirks inside functions, like we're supposed to.

It also lays the groundwork for being able to more easily determine
what type a percentage inside a calculation should become, as this is
based on the same stack of contexts.
2025-01-13 10:59:16 +00:00
Sam Atkins
e5c4a4e6c6 LibWeb/CSS: Parse gradient color stop positions directly
Rather than parsing a generic dimension and then converting it, just
parse the one we want to begin with.
2025-01-08 14:28:54 +00:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibWeb/CSS/Parser/GradientParsing.cpp (Browse further)