Commit graph

8823 commits

Author SHA1 Message Date
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
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
Tim Ledbetter
e011ddd368 LibWeb/CSS: Parse border-block-* properties
This doesn't currently honor `writing-mode`, `direction` and
`text-orientation`.
2025-03-14 16:09:10 +00:00
Tim Ledbetter
cd1bba353a LibWeb/CSS: Parse border-inline-* properties
This doesn't currently honor `writing-mode`, `direction` and
`text-orientation`.
2025-03-14 16:09:10 +00:00
Tim Ledbetter
18cccd7633 LibWeb/CSS: Don't allow negative values in border-radius property 2025-03-14 15:07:57 +00:00
Tim Ledbetter
632fc73643 LibWeb/CSS: Don't allow negative border radius in box-shadow property 2025-03-14 15:07:57 +00:00
Tim Ledbetter
dc58c11217 LibWeb: Reject invalid background-position-* property values 2025-03-14 15:07:57 +00:00
Tim Ledbetter
764b80a1cc LibWeb/CSS: Reject radial-gradient functions with negative size 2025-03-14 15:07:57 +00:00
mikiubo
f2678bfcb8 LibRegex: Remove orphaned save points in nested LookAhead 2025-03-14 09:41:41 +01:00
Timothy Flynn
80d7350ee5 LibDevTools: Ensure the walker actor only displays nodes it created
The NodeIdentifier struct essentially contains the DOM node ID within
its WebContent process. These will repeat across multiple processes,
thus we cannot use them to search for node actors in the global actor
registry.

Instead, we can store a map of all node actors created by the walker
itself. The NodeIdentifier is then appropriate for actor lookups on
that map. This has the added benefit of not needing to search the entire
actor registry many times while forming the DOM node caches.

This fix allows us to inspect multiple tabs at once.
2025-03-14 09:04:03 +01:00
stelar7
664c57af16 LibWeb/IDB: Implement IDBFactory::databases() 2025-03-14 08:54:39 +01:00
Tim Ledbetter
5559c3cb4f LibWeb/CSS: Parse <single-transition-property> as a <custom-ident>
The specification also treats a transition name of `none` as invalid.
2025-03-14 08:52:25 +01:00
Tim Ledbetter
6298ec6be4 LibWeb: Validate time values when parsing transition value 2025-03-14 08:52:25 +01:00
Tim Ledbetter
37eb2be348 LibWeb/CSS: Disallow negative time values for transition-duration 2025-03-14 08:52:25 +01:00
Tim Ledbetter
b80c0d2114 LibWeb/CSS: Reject invalid grid track placement property values 2025-03-14 08:50:04 +01:00
Tim Ledbetter
411cafa2a9 LibMedia: Add formatter for decoder errors
This is useful for print debugging.
2025-03-14 08:48:01 +01:00
Tim Ledbetter
c270241b09 LibMedia: Propagate errors if demuxer creation fails
Previously, the browser would crash if demuxer creation failed.
2025-03-14 08:48:01 +01:00
Aliaksandr Kalenik
733d124380 LibWeb: Delete root pointer in LayoutState
It's no longer needed after we moved intrinsic sizes cache into layout
nodes.
2025-03-14 01:27:40 +01:00
rmg-x
63249ba96a LibHTTP: Add more reason phrases for 4xx response codes
https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
2025-03-14 01:23:52 +01:00
Aliaksandr Kalenik
56971a4201 LibWeb: Delete FIXME debug log in PolicyList
It adds too much spam in test runner output.
2025-03-13 22:16:47 +01:00
Timothy Flynn
0b86bcfba7 LibDevTools+LibWebView: Implement getting document style sheets 2025-03-13 16:56:28 -04:00
Timothy Flynn
cf601a49bb LibWeb+WebContent: Include rule count in listed CSS style sheets 2025-03-13 16:56:28 -04:00
Timothy Flynn
576eede2b1 LibWeb: Simplify IPC encoding of style sheet DOM node IDs
We were essentially reinventing Optional::map here.
2025-03-13 16:56:28 -04:00
Timothy Flynn
2ee3985fd1 LibDevTools+LibWebView: Implement getting the used fonts for a DOM node
This also includes a request to get all fonts for a page, which we stub
out for now as we don't have the IPC to retrieve all fonts.
2025-03-13 16:56:28 -04:00
Timothy Flynn
f9e83af475 LibDevTools: Re-implement how we handle ordered responses
We must reply to requests received from the client in the order they are
received. The wrench in this requirement is handling requests that must
be performed asynchronously, such as fetching the serialized DOM tree
from the WebContent process.

We currently handle this with a "block token". Async request handlers
hold a token that blocks any subsequent responses from being sent. When
that token is removed (i.e. the async request now has a response to be
sent), the async response is then sent followed by the blocked responses
in-order.

This strategy had a limitation that we could not handle an actor trying
to take 2 block tokens, meaning only one async request could be handled
at a time. This has been fine so far, but an upcoming feature (style
sheet sources) will break this limitation. The client will request N
sources at a time, which would try to take N block tokens.

The new strategy is to assign all requests an ID, and store a list of
request IDs that are awaiting a response. When the server wants to send
a reply, we match the ID of the replied-to message to this list of IDs.
If it is not the first in this list, then we are blocked waiting for an
earlier reply, and just store the response. When the earlier request(s)
receive their response, we can then send out all blocked replies (up to
the next request that has not yet received a response).
2025-03-13 16:56:28 -04:00
Timothy Flynn
24a5e4e7d5 LibDevTools: Move message data into a structure
This is to prepare for an upcoming change where we will need to track
replies to messages by ID. We will be able to add parameters to this
structure without having to edit every single actor subclass header
file.
2025-03-13 16:56:28 -04:00
Luke Wilde
509eaca73d LibWeb: Play audio tracks alongside video tracks with the video element
The underlying media element class already parses out the audio tracks,
regardless of the media type. Let's play them with videos!
2025-03-13 19:33:44 +01:00
Luke Wilde
4df2de2f20 LibMedia/Audio: Use duration in the container if stream doesn't have one 2025-03-13 19:33:44 +01:00
Luke Wilde
b789ba5e5f LibMedia: Demux videos with FFmpeg
This gives us access to container types other than Matroska, the
biggest one being MP4.
2025-03-13 19:33:44 +01:00
Luke Wilde
3412935a62 LibMedia: Move FFmpegIOContext into it's own file
This allows it to be reused for video.
2025-03-13 19:33:44 +01:00
Kevin Mas Ruiz
fa950a5727 LibWeb: Invalidate element with CSS custom props on attribute changes
Element styles should be invalidated when they depend on CSS variables
defined in one of their ancesors or when one of their ancestors change
their class, due to the possibility of adding new CSS variables in
scope.
2025-03-13 19:20:37 +01:00
Luke Wilde
8e1ecd25ae LibWeb: Get the correct CSP navigation type for form submission 2025-03-13 16:19:22 +01:00
Luke Wilde
819bff9ec0 LibWeb: Create policy containers from responses and then run CSP init
This allows us to parse the Content-Security-Policy header and
Referrer-Policy header from navigation responses and actually allow
them to start having an effect.
2025-03-13 16:19:22 +01:00
Luke Wilde
435f839ced LibWeb: Only stash Element's CryptographicNonce if there's a CSP header 2025-03-13 16:19:22 +01:00
Mehran Kamal
670a7ab048 LibWeb/SVG: Implement cap_style, join_style for Skia painting backend 2025-03-13 15:09:41 +01:00
stelar7
a0b252c0dd LibWeb/IDB: Update convert_a_value_to_a_key to latest changes 2025-03-13 11:23:15 +01:00
Tim Ledbetter
ad4ade3f07 LibWeb/CSS: Disallow invalid <counter-name> values
We now parse `<counter-name>` values as a `<custom-ident>`. This
disallows `default` and CSS-wide keywords as counter names. The
specification additionally disallows `none` as a counter name.
2025-03-13 05:23:19 +00:00
Aliaksandr Kalenik
76aa99a626 LibWeb: Update HTMLSlotElement subtree during partial layout tree build
Before this change, the layout tree for slots was only updated after
creating a layout node for the slot itself. This was not enough to
account for partial layout tree rebuilds when the slot content changed.
With this change, we always recurse into the slot content.

Fixes expanding and collapsing of nodes in DOM tree inspector broken in
9b26f7eb0f
2025-03-13 04:29:26 +01:00
Timothy Flynn
49adec1396 LibDevTools: Add a helper to handle asynchronous request replies
This removes some boilerplate around executing async requests, such as
calling dbgln_if on any errors, handling weak pointers to `this`, and
dealing with block tokens.
2025-03-12 12:48:05 -04:00
Timothy Flynn
e1ed8722e0 LibDevTools: Add a helper to acquire required message parameters
This is just to help make the message handlers a bit briefer. I had
considered adding a TRY-like macro to auto-return when the lookup fails,
but since statement expressions cannot return references, that would
result in a copy of all e.g. object and array lookups.
2025-03-12 12:48:05 -04:00
Timothy Flynn
4ce10f3bf4 LibDevTools: Automatically set the "from" field for server responses
The "from" field is required in every response. It is the name of the
actor sending the message. This patch fills in the "from" field in the
Actor base class so that subclasses don't have to.
2025-03-12 12:48:05 -04:00
Timothy Flynn
a7b577126a LibDevTools: Send an unknown actor error for failed DOM node lookups
DevTools will ask us to find nodes by their actor names. If the actor is
missing, we should inform DevTools of the error instead of just dropping
the request.

The diff here is a bit noisy, just due to a leftward shift of code that
used to be in an if-statement.
2025-03-12 12:48:05 -04:00
Timothy Flynn
49b964bf19 LibDevTools: Add missing return statement in the 'duplicateNode' handler 2025-03-12 12:48:05 -04:00