Commit graph

68644 commits

Author SHA1 Message Date
Sam Atkins
db597843d6 LibWeb/CSS: Correct parsing of @supports selector()
A couple of fixes here:
- Parse a `<complex-selector>` instead of a `<selector-list>`
- Don't match if any unknown `::-webkit-*` pseudo-elements are found
2025-03-17 10:00:19 +00:00
Sam Atkins
b6fb4baeb7 LibWeb/CSS: Implement @supports font-format() and font-tech()
These let authors query whether we support font formats and features.
2025-03-17 10:00:19 +00:00
Sam Atkins
adfe8a9dcb LibWeb/CSS: Add functions that report font format/technology support
Both `@supports` and `@font-face` need this. There may be some automatic
way of querying whether our renderer supports these, but I couldn't
figure it out, so here's a basic hard-coded list. I think the font-tech
list has false negatives, as I don't know enough about fonts to
determine what we support accurately.
2025-03-17 10:00:19 +00:00
Sam Atkins
1e6f703b30 LibWeb/CSS: Compare MediaFeatureValues using references not copies 2025-03-17 10:00:19 +00:00
Sam Atkins
e125ab360e LibWeb/CSS: Merge MediaFeature data members
A MediaFeature either has a MediaFeatureValue, or a Range, or nothing.
Combining these into a Variant reduces the size from 176 bytes to 128,
and also makes constructing these a little less awkward.
2025-03-17 10:00:19 +00:00
Sam Atkins
0f5e054f97 LibWeb: Implement generic boolean logic for media/supports queries
CSS Values 5 now defines a `<boolean-expr[]>` type that is used in place
of the bespoke grammar that previously existed for `@media` and
`@supports` queries. This commit implements some BooleanExpression
types to represent the nodes in a `<boolean-expr[]>`, and reimplements
`@media` and `@supports` queries using this.

The one part of this implementation I'm not convinced on is that the
`evaluate()` methods take a `HTML::Window*`. This is a compromise
because `@media` requires a Window, and `@supports` does not require
anything at all. As more users of `<boolean-expr[]>` get implemented in
the future, it will become clear if this is sufficient, or if we need
to do something smarter.

As a bonus, this actually improves our serialization of media queries!
2025-03-17 10:00:19 +00:00
Sam Atkins
84a695c958 LibWeb/CSS: Evaluate Supports query components during parsing
Instead of parsing the parts of a `@supports` query, then only
evaluating them when constructing the Supports itself, we can instead
evaluate them as we parse them. This simplifies things as we no longer
need to pass a Realm around, and don't have to re-parse the conditions
again with a new Parser instance.
2025-03-17 10:00:19 +00:00
Sam Atkins
95730c66aa LibWeb: Make non-replaced flex items make use of transferred size
Corresponds to 9beaea1f2a
2025-03-17 09:35:58 +00:00
Sam Atkins
3dd079b308 LibWeb/HTML: Add stub for WebDriver BiDi to intercept file dialogs
Corresponds to 09ad1b9894
2025-03-17 09:34:48 +00:00
Piotr Bartoszewicz
7a2cc28932 Nix: Change incorrect package name in /Toolchain/Nix/shell.nix 2025-03-16 15:30:33 -06:00
Aliaksandr Kalenik
2e256d2eac LibWeb: Invalidate text-decoration-thickness as paint-only property
Fixes underinvalidation caused by resolving text-decoration-thickness
during layout commit, while this property can be invalidated
independently of layout.
2025-03-16 22:25:26 +01:00
Luke Wilde
61c1e4a855 LibWebView: Keep javascript URL navigations in the same process
JavaScript URLs run in the same document context the navigation was
started in, so they're not eligible to be moved to a new WebContent
process.

Fixes the "Login as demo user" link on https://demo.immich.app/
2025-03-16 10:59:41 -04:00
Andrew Kaster
c8787e6a9f LibCore: Add swift bindings for EventLoop as an Executor and Actor 2025-03-15 21:51:22 -06:00
Timothy Flynn
3af63bc5a3 Everywhere: Replace miscellaneous references to the chrome process 2025-03-15 19:57:27 -04:00
Timothy Flynn
d94bb99c50 Documentation: Remove outdated comment on using the Qt UI for WPT
We now run the tests headlessly.
2025-03-15 19:57:27 -04:00
Timothy Flynn
18eee7e3f0 LibWebView: Rename the Chrome process type to Browser 2025-03-15 19:57:27 -04:00
Timothy Flynn
e20d7be15f LibWeb+UI: Rename ChromeInputData to BrowserInputData 2025-03-15 19:57:27 -04:00
Timothy Flynn
47d6747945 LibWebView+UI: Rename ChromeProcess to BrowserProcess 2025-03-15 19:57:27 -04:00
Timothy Flynn
e00c0c176e LibWebView+UI: Rename ChromeOptions to BrowserOptions 2025-03-15 19:57:27 -04:00
Timothy Flynn
6078143241 LibWeb+WebContent: Remove "chrome" from generated page template strings 2025-03-15 19:57:27 -04:00
Timothy Flynn
9de6987134 Documentation: Update steps to enable DevTools via the UI 2025-03-15 19:09:40 +01:00
Timothy Flynn
0065dde749 UI/Qt: Add UI components to enable DevTools at runtime 2025-03-15 19:09:40 +01:00
Timothy Flynn
28574e2812 UI/AppKit: Add UI components to enable DevTools at runtime 2025-03-15 19:09:40 +01:00
Timothy Flynn
df7917d705 LibWebView: Change the DevTools server to be a runtime-enabled feature 2025-03-15 19:09:40 +01:00
Timothy Flynn
810d04b3f4 LibWeb+LibWebView+WebContent: Remove the built-in Inspector 2025-03-15 19:09:40 +01:00
Timothy Flynn
1c696e7893 UI/Qt: Remove the built-in Inspector widget 2025-03-15 19:09:40 +01:00
Timothy Flynn
03735cf11d UI/AppKit: Remove the built-in Inspector widget 2025-03-15 19:09:40 +01:00
Mehran Kamal
bb87de58a0 LibWeb+LibGfx: Paint line_cap, line_join for Canvas Strokes 2025-03-15 14:02:27 +01:00
Mehran Kamal
12968ff025 LibGfx: Move to_skia_cap, to_skia_join to SkiaUtils 2025-03-15 14:02:27 +01:00
Aliaksandr Kalenik
23151de217 LibWeb/Layout: Fix min{max}-content size calculation for grid items
Instead of directly invoking `to_px()`,
`calculate_min_content_contribution()` needs to use
`calculate_inner_width()` and `calculate_inner_height()`, which are
aware of how to correctly handle `min-content` and `max-content` values.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/3469
2025-03-15 13:51:16 +01:00
Aliaksandr Kalenik
08c155cd3f LibWeb: Resolve "height: auto" using preferred aspect ratio if possible
Fixes https://github.com/LadybirdBrowser/ladybird/issues/2276
2025-03-15 13:51:16 +01:00
Aliaksandr Kalenik
227b4c38b7 LibWeb: Use parent's available space for anonymous blocks in BFC
Height resolution assumes that when available space is definite, it
matches the size of non-anonymous containing block. With this change, we
correctly maintain this assumption when box is wrapped in anonymous
node.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/3422
2025-03-15 13:31:07 +01:00
Aliaksandr Kalenik
9e287465b9 LibWeb: Fix CSS transform invalidation when transitioning to none
Fixes https://github.com/LadybirdBrowser/ladybird/issues/2707
2025-03-15 13:30:45 +01:00
Shannon Booth
a9e20cb6c3 LibURL/Pattern: Use ConstructorStringParser to construct URLPatternInit 2025-03-15 07:39:03 -04:00
Shannon Booth
e369756e9c LibURL/Pattern: Implement the constructor string parser
This is missing one small bit of functionality where the not-yet
impplemented component compilation is required.
2025-03-15 07:39:03 -04:00
Shannon Booth
f05c0509c3 AK: Add ability to check Optional equality with an OptionalNone
While we don't want to be writing this type of code in 'normal'
code this is useful to do in tests as:

EXPECT_EQ(my_optional, OptionalNone {});

Has a much better error on assertion failure when compared with:

EXPECT(!my_optional.has_value());
2025-03-15 07:39:03 -04:00
Shannon Booth
e70272ddef LibURL/Pattern: Implement URL Pattern canonicalization
These are used to normalize URL components.
2025-03-15 07:39:03 -04:00
Shannon Booth
f775ee8a93 LibURL: Rename 'cannot be a base URL' state to 'opaque path' state
This follows a rename made in the URL specification.
2025-03-15 07:39:03 -04:00
Shannon Booth
f8f21319f9 LibURL/Pattern: Implement the URL Pattern Tokenizer
The tokenizer is used for both pattern string and constructor string
parsing of URL Patterns.
2025-03-15 07:39:03 -04:00
Sam Atkins
70e3a48892 LibWeb: Stub out "focus-without-user-activation" feature policy
For now this always returns that focus is allowed, as that matches our
previous behavior.

Corresponds to d7053d86ad
2025-03-14 20:33:25 +00: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
f1c88000da LibWeb/HTML: Early-out of input activation behavior for immutable inputs
The spec text change corresponds to e6e914d086

But while I'm here I might as well just implement it. :^)
2025-03-14 20:33:25 +00:00
Sam Atkins
6b8adb522c LibWeb: Set iframe border to 0px when frameborder attribute is invalid
Corresponds to 6e19cef90e
2025-03-14 20:33:25 +00:00
Sam Atkins
415dd1be06 LibWeb/HTML: Remove "flag" word from usage of "page showing"
Corresponds to 30935f3474
2025-03-14 20:33:25 +00:00
Tim Ledbetter
b9ac99d2eb Revert "LibRegex: Remove orphaned save points in nested LookAhead"
This reverts commit f2678bfcb8.
2025-03-14 19:57:33 +00:00
Timothy Flynn
0a5f68eba6 LibWebView: Disable site isolation and spare processes when debugging
These features make it difficult to debug a single WebContent instance.
2025-03-14 18:53:50 +01:00
Sam Atkins
0efd1729af LibWeb/HTML: Update navigation request's reserved client
Fill in a couple of FIXMEs to discard an old reserved client, and/or
create a new one, in `create_navigation_params_by_fetching()`.
2025-03-14 18:05:42 +01:00
Sam Atkins
5a4f15d8f5 LibWeb/HTML: Add environment discarding steps
Exactly one place seems to define these at the moment: service worker
clients. Since we don't have a type for these and just use
EnvironmentSettingsObject, I've put it there.
2025-03-14 18:05:42 +01:00
Sam Atkins
a15a55e858 WebWorker: Correct name of inside settings variable
The spec calls this `inside settings` so calling it `inner_settings` was
a bit confusing.
2025-03-14 18:05:42 +01:00
Timothy Flynn
9586a7500c LibWeb: Protect audio codec callbacks against its own destruction
The plugin may go out of scope before the callbacks we've queued have
fired. It is undefined behavior for these callbacks to access the plugin
data after that has occurred.

This patch protects these callbacks with weak pointers. Note that the
plugin is not ref-counted, so we cannot use `strong_ref` here.
2025-03-14 12:02:29 -05:00