Andreas Kling
902e76baff
LibWeb: Ignore whitespace around easing function argument values
...
This makes our css-animations.html test file actually parse :^)
2023-07-25 07:20:29 +02:00
Aliaksandr Kalenik
a8587fe54e
LibWeb: Add support for "place-items" CSS property
...
Adds support for place-items property which allows to specify both
align-items and justify-items in a single declaration.
2023-07-17 18:58:05 +02:00
Alan Kemp
3fd870a429
LibWeb: Create EdgeStyleValue for BackgroundPositionXY with no offset
...
When specifying either `background-position-x: right` or
`background-position-y: bottom` without an offset value no
EdgeStyleValue was created.
However, the spec says the offset should be optional.
Now, if you do not provide an offset, it creates the EdgeStyleValue
with a default offset of 0 pixels.
2023-07-17 14:53:52 +01:00
Sam Atkins
8fc545992d
LibWeb: Use generated math-function-parsing code
2023-07-15 10:23:33 +02:00
Sam Atkins
618c0402a7
LibWeb: Generate parsing code for CSS math functions
2023-07-15 10:23:33 +02:00
Sam Atkins
136dc7a1c3
LibWeb: Extract CalculationNode::constant_type_from_string() function
...
This is needed by some upcoming generated code. Renamed "PI" member to
"Pi" while I was at it.
2023-07-15 10:23:33 +02:00
Sam Atkins
e4a2bd7a44
LibWeb: Move RoundingMode to Enums.json
...
In the spec this is a `<rounding-strategy>`, so let's use that name.
This also fixes a bug where we were serializing `to-zero` as
`toward-zero`.
2023-07-15 10:23:33 +02:00
Andreas Kling
3194f10ad0
LibWeb: Explicitly instantiate a CSS parser template function
...
We're gonna call parse_a_comma_separated_list_of_component_values from
another cpp file soon, so let's prepare for that by instantiating the
specific version we need.
2023-07-15 10:23:33 +02:00
Ali Mohammad Pur
efa55673cd
Meta/CodeGenerators+LibWeb: Add support for 'easing-function' CSS values
...
This commit makes it possible to let properties accept easing functions
as values, which will be used in a later commit to implement
animation-timing-function.
2023-07-13 05:10:41 +02:00
Ali Mohammad Pur
dd073b2711
Meta/CodeGenerators+LibWeb: Implement parsing CSS easing functions
...
This only implements the parser bits, no functionality is implemented,
and no properties are parsed because of this.
2023-07-13 05:10:41 +02:00
Ali Mohammad Pur
b00a23b0b6
LibWeb: Fix a spec link in CSS/Parser
...
This pointed to the wrong part of the spec, make it point to the right
part instead :P
2023-07-11 09:38:37 +03:30
Ali Mohammad Pur
d60d149e62
LibWeb: Move some static functions from CSS/Parser.cpp into a new file
2023-07-11 09:38:37 +03:30
Ali Mohammad Pur
06c6c40df9
LibWeb+LibJS: Move some code around to make CSS/Parser parse faster
...
This makes it possible to include fewer full definitions of things,
which makes the file about 30% faster to compile.
2023-07-11 09:38:37 +03:30
Timothy Flynn
c911781c21
Everywhere: Remove needless trailing semi-colons after functions
...
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
Timothy Flynn
aff81d318b
Everywhere: Run clang-format
...
The following command was used to clang-format these files:
clang-format-16 -i $(find . \
-not \( -path "./\.*" -prune \) \
-not \( -path "./Base/*" -prune \) \
-not \( -path "./Build/*" -prune \) \
-not \( -path "./Toolchain/*" -prune \) \
-not \( -path "./Ports/*" -prune \) \
-type f -name "*.cpp" -o -name "*.h")
2023-07-08 10:32:56 +01:00
Andreas Kling
5955a504e0
LibWeb: Allow font-family names to start with -
...
We achieve this by making properties that accept a custom-ident value
skip the "someone else's vendor prefix" check for values that start with
a `-` character.
This fixes an issue where e.g `font-family: Arial, -apple-system` would
be rejected by the parser completely. We now treat `-apple-system` like
an identifier in such cases.
Also add `valid-types` metadata for the `font-family` property so this
actually works. :^)
2023-07-06 14:30:06 +02:00
Andreas Kling
dfdb31f5b0
LibWeb: Accept MIME types starting with "application/font" for CSS fonts
...
Although "application/font-woff" is apparently "deprecated", it's very
much still in use on the web, so we should not be rejecting it.
2023-07-06 14:30:06 +02:00
Sam Atkins
f21a30e45f
LibWeb: Use CSSNumericType for CalculatedStyleValue resolved type
2023-07-06 09:28:16 +02:00
Sam Atkins
4d84080fdc
LibWeb: Implement "Determine the type of a calculation" algorithm
...
This is sitting alongside our old implementation for the moment.
2023-07-06 09:28:16 +02:00
Andreas Kling
088cc4ea73
LibWeb: Parse CSS :host selector
...
Let's at least parse it, even if we don't implement matching for it yet.
2023-07-05 12:42:02 +02:00
Andreas Kling
6b3b056476
LibWeb: Support CSS font shorthand with up to 4 consecutive normal
...
All of the following properties in the font shorthand can be `normal`:
- font-style
- font-variant
- font-weight
- font-stretch
This means that we must allow up to four consecutive `normal` at the
start of a font shorthand value.
2023-07-04 16:25:23 +02:00
Sam Atkins
8c50d5d248
LibWeb: Remove misleading log message about unimplemented functions
...
`parse_a_calc_function_node()` only detects math functions, but
regularly encounters unrelated functions like `rgba()`. Since we now
support all the math functions, this message is just misleading spam.
2023-06-30 14:39:36 +01:00
Sam Atkins
d0808e5d94
LibWeb: Correct @font-face
debug log messages
2023-06-30 14:39:36 +01:00
FalseHonesty
110eeb8591
LibWeb: Support calc(...) in box-shadow's values of type Length
...
The CSS box-shadow property takes 2-4 properties that are `<length>`s,
those being:
- offset-x
- offset-y
- blur-radius
- spread-radius
Previously these were resolved directly to concrete Lengths at parse
time, but now they will be parsed as LengthStyleValues and/or
CalculatedStyleValues and be stored that way until styles are later
resolved.
2023-06-25 10:27:08 +01:00
Aliaksandr Kalenik
a8211abc1e
LibWeb: Support CSS functions other than calc() for grid sizes
...
Makes grid size parser to handle not only calc() but min(), max() and
other CSS functions we support.
2023-06-21 06:14:51 +02:00
Andi Gallo
db121c7af1
LibWeb: Handle leading whitespace in grid-template-* block components
...
We're already handling whitespace between components, do the same for
leading whitespace. Fixes crash on https://distill.pub/2021/gnn-intro .
2023-06-18 13:41:15 +02:00
stelar7
d6db924d47
LibWeb: Implement CSS rem()
2023-06-17 12:13:28 +01:00
stelar7
dc042662d1
LibWeb: Implement CSS mod()
2023-06-17 12:13:28 +01:00
stelar7
b2230c826b
LibWeb: Implement CSS round()
2023-06-17 12:13:28 +01:00
stelar7
5727e276ea
LibWeb: Implement CSS exp()
2023-06-16 14:58:47 +01:00
stelar7
6dde49404a
LibWeb: Implement CSS log()
2023-06-16 14:58:47 +01:00
stelar7
fa37bb8b76
LibWeb: Implement CSS hypot()
2023-06-16 14:58:47 +01:00
stelar7
0d30fb5a6e
LibWeb: Implement CSS sqrt()
2023-06-16 14:58:47 +01:00
stelar7
9aed8ec7f0
LibWeb: Implement CSS pow()
2023-06-16 14:58:47 +01:00
Sam Atkins
8ef25989b6
LibWeb: Parse identifiers last in parse_paint_value()
...
Previously, using an identifier color like `currentColor` would fail to
parse, since we look at ident tokens (and reject unrecognised ones)
before trying to parse colors.
2023-06-16 15:39:32 +02:00
Sam Atkins
5cdcd135ab
LibWeb: Add parsing for CSS <paint>
values
...
This gets rid of a couple of FIXMEs in Properties.json :^)
2023-06-16 07:03:57 +02:00
stelar7
a9a62ad8c9
LibWeb: Implement CSS atan2()
2023-06-15 16:54:14 +01:00
stelar7
1aa84dfddd
LibWeb: Implement CSS atan()
2023-06-15 16:54:14 +01:00
stelar7
784e1cfb72
LibWeb: Implement CSS acos()
2023-06-15 16:54:14 +01:00
stelar7
708b5ef447
LibWeb: Implement CSS asin()
2023-06-15 16:54:14 +01:00
stelar7
64f0349a9e
LibWeb: Implement CSS tan()
2023-06-15 16:54:14 +01:00
stelar7
46a5efe388
LibWeb: Implement CSS cos()
2023-06-15 16:54:14 +01:00
stelar7
c73f476915
LibWeb: Implement CSS sin()
2023-06-15 16:54:14 +01:00
stelar7
ba7af82c5c
LibWeb: Parse css math constants
2023-06-15 15:40:55 +01:00
stelar7
e1e382152c
LibWeb: Implement CSS sign()
2023-06-15 12:26:34 +01:00
stelar7
79fc4c8a82
LibWeb: Implement CSS abs()
2023-06-15 12:26:34 +01:00
Hendiadyoin1
eeb15fc10b
LibWeb: Stop lying about string types
2023-06-13 01:49:02 +02:00
Andreas Kling
741c7aef21
LibWeb: Support more CSS functions in grid track size lists
...
Instead of hard-coding a check for "calc", we now call out to
parse_dynamic_value() which allows use of other functions like min(),
max(), clamp(), etc.
2023-06-12 17:51:08 +02:00
Sam Atkins
6fd3b39bef
LibWeb: Parse aspect-ratio
property
...
Parse it, store the result in the ComputedValues, and also expose it to
ResolvedCSSStyleDeclaration.
2023-06-09 20:37:51 +02:00
Sam Atkins
5e3da93f1a
LibWeb: Add RatioStyleValue and parsing
2023-06-09 20:37:51 +02:00