Callum Law
6a9c8d7767
LibWeb: Don't resolve colors with unresolved components
...
`CSSColorValue`s which have unresolved `calc` components should be able
to be resolved. Previously we would always resolve them but with
incorrect values.
This is useful as we will now be able to now whether we should serialize
colors in their normalized form or not.
Slight regression in that we now serialize (RGB, HSL and HWB) colors
with components that rely on compute-time information as an empty
string, but that will be fixed in the next commit.
2025-07-16 13:05:33 +01:00
Timothy Flynn
5baa85cbee
LibWeb: Add missing ValueInlines include to CanvasSettings.cpp
...
This missing include is causing an error in distribution builds.
2025-07-06 08:16:01 -04:00
Tim Ledbetter
5413716802
LibWeb: Don't crash when setting offscreen canvas size to 0
...
Previously, this would crash because `Gfx::Bitmap` can't have a zero
size.
2025-07-04 16:10:38 +01:00
Callum Law
9ab7c5d08d
LibWeb: Support relative lengths in calc
color values
...
Gains us ~40 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
Totto16
8404df55d8
LibWeb: Add OffscreenCanvas tests
...
The tests cover working in Worker and some basic functionality
2025-06-30 09:46:21 -06:00
Totto16
f1a096d6e4
LibWeb: Add OffscreenCanvas to IDL types
...
Add OffscreenCanvas to TexImageSource and CanvasImageSource.
Implement all the necessary features to make it work in all cases where
these types are used.
2025-06-30 09:46:21 -06:00
Totto16
2ad3ce5d37
LibWeb: Implement basics for OffscreenCanvas
...
This implements the basic interface, classes and functions for
OffscreenCanvas. Many are still stubbed out and have many FIXMEs in
them, but it is a basic skeleton.
2025-06-30 09:46:21 -06:00
Totto16
193ab3757b
LibWeb: Factor out canvas rendering options algorihtms
...
Factor out canvas parsing algorihtm for CanvasRenderingContext2DSettings
from JS::Value. This was only used in one place but needs to be usable
from other places too in the future.
2025-06-30 09:46:21 -06:00
Totto16
49500ac386
LibWeb: Factor out canvas serialization algorihtm
...
Factor out canvas serialization algorihtm from HTMLCanvasElement to
seperate file. This makes it usable by other things too.
2025-06-30 09:46:21 -06:00
Sam Atkins
423cdd447d
LibWeb+LibGfx: Apply editorial punctuation/whitespace/markup fixes
...
Corresponds to d426109ea1
and fd08f81d06
2025-06-25 03:12:19 +12:00
Totto16
cee874caaf
LibWeb: Factor out CanvasSettings mixin into separate file
...
This refactors this mixin, that was introduced in #4506 to be the same
as all other mixins, so that it can be used for #3788
2025-06-17 16:54:04 -06:00
Lucien Fiorini
0fcb574041
LibGfx+LibWeb: Turn Gfx::Filter into a SkImageFilter wrapper
2025-06-01 23:22:10 +02: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
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
Aliaksandr Kalenik
2c64c6d773
LibWeb: Store FontCascadeList instead of Font in CanvasState
...
This is required to implement per-glyph font fallbacks in the upcoming
changes.
2025-04-21 09:51:16 +02:00
Andrew Kaster
280ae45210
LibWeb: Pass ImageData as non-const to CanvasImageData mixin methods
...
CRC2D needs to manipulate the ImageData object in put_image_data()
2025-04-16 10:41:44 -06:00
Andrew Kaster
6d11414957
LibWeb: Make storage of CSS::StyleValues const-correct
...
Now we consistently use `RefPtr<StyleValue const>` for all StyleValues.
2025-04-16 10:41:44 -06:00
Viktor Szépe
5cc371d54c
LibWeb: Fix typos - act II
2025-04-09 15:05:20 +01:00
Sam Atkins
7902d13c28
LibWeb/HTML: Add FIXMEs for CanvasTextDrawingStyle lang attribute
...
Corresponds to aa586d0ba9
2025-03-14 20:33:25 +00:00
Sam Atkins
03bccb5ff1
LibWeb/HTML: Add spec comment to CRC2D::put_image_data()
...
Also rename imagedata -> imageData, as done here:
6a3787f6cf
2025-02-22 14:59:39 +00:00
Sam Atkins
6a4d80b9b6
LibWeb/CSS: Integrate ParsingContext into the Parser
...
This is not really a context, but more of a set of parameters for
creating a Parser. So, treat it as such: Rename it to ParsingParams,
and store its values and methods directly in the Parser instead of
keeping the ParsingContext around.
This has a nice side-effect of not including DOM/Document.h everywhere
that needs a Parser.
2025-02-06 16:47:25 +00:00
Glenn Skrzypczak
8575bddfe6
LibWeb/Canvas: Support globalCompositionOperation
...
Canvas now supports compositing and various blending modes via the
`globalCompositeOperation` attribute.
2025-02-05 11:26:58 +00:00
Lucien Fiorini
a6ef6550f3
LibWeb+LibGfx: Implement Canvas2D filters
2024-12-18 18:54:20 +01:00
Andreas Kling
e85c3c97fb
LibWeb: Add mode flag to CSSStyleValue::to_string()
...
This will be used to differentiate between serialization for resolved
style (i.e window.getComputedStyle()) and serialization for all other
purposes.
2024-12-07 08:31:03 +00:00
Sam Atkins
bc77f84359
LibWeb: Stop passing Realm unnecessarily to parse CSS properties
...
Also use the parse_css_value() helper in cases where we previously
constructed a Parser manually.
2024-12-05 19:59:57 +01:00
Lucien Fiorini
e8cc0dc998
LibWeb+LibGfx: Implement shadowBlur for Canvas2D
2024-12-05 17:07:13 +01:00
Pavel Shliak
134dc57458
LibWeb: Ensure segments are copied only once in set_line_dash
2024-12-04 16:33:54 +00:00
Shannon Booth
f87041bf3a
LibGC+Everywhere: Factor out a LibGC from LibJS
...
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:
* JS::NonnullGCPtr -> GC::Ref
* JS::GCPtr -> GC::Ptr
* JS::HeapFunction -> GC::Function
* JS::CellImpl -> GC::Cell
* JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00
Timothy Flynn
93712b24bf
Everywhere: Hoist the Libraries folder to the top-level
2024-11-10 12:50:45 +01:00