Gingeh
1b7323fc2d
LibWeb: Interpolate legacy colors in sRGB
2025-07-04 15:28:08 +01:00
Callum Law
778759517e
LibWeb: Support calc
s which resolve to numbers as hue values in colors
...
Gains us 5 new WPT tests.
2025-07-04 13:18:55 +01:00
Callum Law
62d138ebf7
LibWeb: Allow passing a resolution context to CSSStyleValue::to_color
...
This will be used for resolving any calculated style values within the
various `CSSColorValue` sub-classes.
No functionality changes.
2025-07-04 13:18:55 +01:00
Tim Ledbetter
923deb0c01
LibWeb: Parse border-image
shorthand property
2025-07-03 10:19:44 +01:00
Tim Ledbetter
245905b833
LibWeb: Parse the border-image-slice
property
2025-07-03 10:19:44 +01:00
Callum Law
8e9753eadb
LibWeb: Correctly compute consistent type when simplifying hypot
...
Previously we would never get a valid `consistent_type` as we were
trying to make the node types consistent with the initial empty type
which isn't possible.
Gains us 7 WPT tests.
2025-06-30 14:53:04 +02:00
Callum Law
536f8c395c
LibWeb: Set numeric type of asin, acos, atan calculation results
...
Previously we were omitting the numeric type which meant these functions
weren't valid in some cases e.g. within rotate() functions.
2025-06-25 05:19:07 +01:00
Sam Atkins
c1d4323cf7
LibWeb: Support counter-* properties on pseudo-elements
...
There are multiple things happening here which are interconnected:
- We now use AbstractElement to refer to the source of a counter, which
means we also need to pass that around to compute `content`.
- Give AbstractElement new helper methods that are needed by
CountersSet, so it doesn't have to care whether it's dealing with a
true Element or PseudoElement.
- The CountersSet algorithms now walk the layout tree instead of DOM
tree, so TreeBuilder needs to wait until the layout node exists
before it resolves counters for it.
- Resolve counters when creating a pseudo-element's layout node. We
awkwardly compute the `content` value up to twice: Once to figure out
what kind of node we need to make, and then if it's a string, we do
so again after counters are resolved so we can get the true value of
any `counter()` functions. This will need adjusting in the future but
it works for now.
2025-06-19 12:35:31 +01:00
Tim Ledbetter
fa1e02e5d7
LibWeb: Allow calc()
values in cubic-bezier()
easing functions
2025-06-18 08:57:06 +02:00
Tim Ledbetter
c5a3eaaf45
LibWeb: Allow calc()
values in steps()
easing functions
2025-06-18 08:57:06 +02:00
Veeti Paananen
21b531598d
LibWeb/CSS: Fix reference bug when canonicalizing linear easing stops
...
+2 WPT tests
2025-06-18 08:53:10 +02:00
Sam Atkins
7fe854c131
LibWeb/CSS: Link CalculationContext to new spec definition
...
Corresponds to ad244f3413
There's nothing that we need to do differently I think, but it's nice to
have a clear spec definition to refer to. :^)
2025-06-17 12:38:27 +01:00
Callum Law
12c9da2d3f
LibWeb: Serialize grid/grid-template as "none" when applicable
...
This exposes a bunch of false-positives in the
grid-{shorthand,template}-invalid.html WPT tests, but gains us some
new passes as well.
2025-06-16 12:37:40 +01:00
Callum Law
f8f4da3b90
LibWeb: Don't serialize shorthand with non-uniform CSS-wide keywords
2025-06-16 12:37:40 +01:00
Callum Law
335190e925
LibWeb: Handle nested shorthands in all-same-CSS-wide-keyword to_string
...
Previously we only checked direct sub-properties, not accounting for the
nested case.
2025-06-16 12:37:40 +01:00
Tim Ledbetter
d89a67ffee
LibWeb: Don't serialize omitted box-shadow
and text-shadow
values
2025-06-15 16:05:12 +02:00
Callum Law
d31a58a7d6
LibWeb: Add support for the 'all' CSS property
...
The "longhands" array is populated in the code generator to avoid the
overhead of manually maintaining the list in Properties.json
There is one subtest that still fails in
'cssstyledeclaration-csstext-all-shorthand', this is related to
us not maintaining the relative order of CSS declarations for custom vs
non-custom properties.
2025-06-12 15:25:35 +01:00
Callum Law
0a53aaa3b6
LibWeb: Omit initial values from background CSS property serialization
2025-06-09 10:43:50 +01:00
Sam Atkins
d611806f18
LibWeb/CSS: Parse and use tech() in @font-face { src }
2025-06-05 12:10:29 +01:00
Timothy Flynn
7d99a92135
LibWeb: Absolutize CSS image URLs for computed style resolution
...
CI / Lagom (arm64, Sanitizer_CI, false, macOS, macos-15, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macOS, macOS-arm64, macos-15) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, Linux, Linux-x86_64, blacksmith-8vcpu-ubuntu-2404) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
For getComputedStyle(), we must return an absolute URL for image style
values. We currently return the raw parsed URL.
This fixes loading the marker icons on https://usermap.serenityos.org .
2025-06-03 19:30:43 -04:00
Tim Ledbetter
e2d0d8e2b9
LibWeb/CSS: Implement the scrollbar-color
property
...
This allows the user to set the scrollbar thumb and track colors.
2025-06-02 00:17:51 +02:00
Lucien Fiorini
0fcb574041
LibGfx+LibWeb: Turn Gfx::Filter into a SkImageFilter wrapper
2025-06-01 23:22:10 +02:00
Callum Law
94f5a51820
LibWeb: Convert white-space
CSS property to shorthand
...
This exposed a few bugs which caused the following tests to behave
incorrectly:
- `tab-size-text-wrap.html`: This previously relied on a bug where we
incorrectly treated `white-space: pre` as allowing text wrapping. The
fix here is to implement the text-wrap CSS shorthand property.
- `execCommand-preserveWhitespace.html`: We don't correctly serialize
shorthand properties. This is covered by an existing FIXME in
`CSSStyleProperties::serialized()`
- `white-space-shorthand.html`: The last 5 subtests here fail as we
don't correctly handle shorthand properties in
`CSSStyleProperties::remove_property()`. This is covered by an
existing FIXME in said function.
2025-05-29 12:04:28 +02:00
Sam Atkins
f5cd853597
LibWeb/CSS: Avoid calling to_font_weight() when serializing font
...
This function attempts to resolve `lighter` and `bolder`, which we don't
want to do when serializing - that should happen in style computation.
This has the unexpected bonus of 37 more WPT passes!
2025-05-24 13:35:30 +01:00
Sam Atkins
fe7bac73f0
LibWeb/CSS: Stub out a function for serializing ComponentValue sequences
...
This is very hacky and wrong, but it means there's one place to fix,
instead of one for UnresolvedStyleValue, and one for invalid
MediaFeatureValues which I'm about to implement.
2025-05-23 10:17:58 +01:00
Andreas Kling
d7cd8f0fc7
LibWeb: Make CSS sign(A) ignore A's unit and just look at the raw value
...
This allows stuff like sign(1em) even when we don't have something to
resolve the em unit against.
+25 new WPT subtest passes.
2025-05-20 13:28:40 +02:00
Andreas Kling
4ef34ebd96
LibWeb: Make CSS sign(A) behave correctly for negative zero
...
We were incorrectly returning 0 instead of -0 for sign(-0).
+7 new WPT subtest passes.
2025-05-20 13:28:40 +02:00
Sam Atkins
443f9e5afb
LibWeb/CSS: Make dimension types serialize in resolved form
...
Some dimensions would always serialize in a canonical unit, others never
did, and others we manually would do so in their StyleValue. This
commit moves all of that into the dimension types, which means for
example that Length can apply its special rounding.
Our local serialization test now produces the same output as other
browsers. :^)
2025-05-17 07:53:24 +01:00
Sam Atkins
eec4365542
LibWeb/CSS: Extract SerializationMode into its own header
...
Prep for using this to serialize dimension types, and perhaps other
things in the future.
2025-05-17 07:53:24 +01:00
Sam Atkins
398d2f9981
LibWeb/CSS: Implement pending-substitution value
...
This is a special value temporarily assigned to longhands when their
shorthand is unresolved, and then later replaced once that is resolved.
2025-05-14 11:46:47 +01:00
Sam Atkins
d1dadd43a1
LibWeb/CSS: Implement guaranteed-invalid value
...
This is a special value produced when var/attr substitution fails, and
is also the initial value for custom properties.
2025-05-14 11:46:47 +01:00
Timothy Flynn
7280ed6312
Meta: Enforce newlines around namespaces
...
This has come up several times during code review, so let's just enforce
it using a new clang-format 20 option.
2025-05-14 02:01:59 -06:00
Sam Atkins
560317b3d0
LibWeb/CSS: Update spec comment in calc() simplification algorithm
...
This was corrected in 8bcf3ada9e
2025-05-03 14:54:33 +01:00
Sam Atkins
9e2e796f2d
LibWeb/CSS: Use CSS::URL for font-fetching
...
ParsedFontFace and FontLoader now both keep track of which
CSSStyleSheet (if any) was the source of the font-face, so the URLs can
be completed correctly.
2025-05-03 12:01:43 +01:00
Tim Ledbetter
c0f9b11070
LibWeb: Parse oblique font-style
with an angle value
2025-05-03 12:05:22 +02:00
Tim Ledbetter
542c3cbe51
LibWeb: Implement the transition-behavior
CSS property
...
This specifies whether transitions should be started for transitions
whose animation behavior is discrete.
2025-05-02 11:07:19 +01:00
Psychpsyo
82387e2127
LibWeb: Avoid changing button border color on disable/hover
2025-04-30 20:13:14 +01:00
Tim Ledbetter
27baaa13e9
LibWeb: Support parsing and serializing 3D translate values
2025-04-30 19:36:56 +02:00
Tim Ledbetter
d804f1311c
LibWeb: Don't serialize scale
z value if it is 1
2025-04-30 19:36:56 +02:00
Sam Atkins
326933cd93
LibWeb/CSS: Use CSS::URL for <url>
and <paint>
types
2025-04-30 17:38:38 +01:00
Tim Ledbetter
e7ae9c8ebf
LibWeb: Parse all
as keyword in transition
shorthand
...
This ensures that the parsing of the `transition` shorthand property
behaves in the same way as the `transition-property` longhand.4
2025-04-28 20:51:36 +02:00
Andreas Kling
d8ea16d94e
LibWeb: Don't assume calc() simplification worked on invalid tree
...
Fixes #4469
2025-04-25 16:55:05 +02:00
Andreas Kling
cf704cfbfc
LibWeb: Implement interpolation for CSS scale
values
...
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
And let's handle the 3rd (Z) scale parameter as well, while we're here.
At least 242 new passes on WPT.
2025-04-25 14:08:12 +02:00
Andreas Kling
1772adb600
LibWeb: Don't crash on non-finite values in CSS clamp() function
...
Stops a WPT test from crashing, giving us 29 new subtest passes. :^)
2025-04-24 18:26:54 +02:00
Tim Ledbetter
0beb22f19e
LibWeb: Implement interpolation of edge values
2025-04-23 09:13:45 +01:00
Tim Ledbetter
6f5b107fcc
LibWeb: Resolve absolute calc()
values in color functions
...
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Currently, `calc()` values with relative units are not handled
correctly and will output an error to the console.
2025-04-22 12:20:26 +02:00
Tim Ledbetter
9cf04f40f6
LibWeb: Implement the color-mix()
function
...
This takes 2 color values and returns the result of mixing them by a
given amount.
2025-04-22 12:19:51 +02:00
Tim Ledbetter
e860dd4f65
LibWeb: Implement serialization of lch-like color values
2025-04-20 16:51:20 +02:00
Tim Ledbetter
5074d90888
LibWeb: Implement serialization of lab-like color values
2025-04-20 16:51:20 +02:00
Andreas Kling
57809b1100
LibWeb: Skip dynamic_cast in CSSRGB after we already did a type check
2025-04-18 14:45:56 +02:00