Commit graph

76872 commits

Author SHA1 Message Date
Zaggy1024
2d00a28f08 Tests: Simplify the HTMLMediaElement-load-after-decode-error.html test
Use promises to await the expected sequence of events. Also, don't
assume that canplaythrough will fire after error. That depends on the
implementation.
2026-04-10 15:21:07 -05:00
Zaggy1024
d8cff1838a LibMedia: Don't suspend data providers if the manager isn't suspended
This could cause audio or video to get stuck if the suspension ended
while the seek of an enabled track was still ongoing.
2026-04-10 15:21:07 -05:00
Zaggy1024
e96759859e LibMedia: Simplify SeekingStateHandler's logic
One behavior change: seeking with no enabled tracks now properly
resumes.
2026-04-10 15:21:07 -05:00
Sam Atkins
973b919153 LibWeb/CSS: Only serialize a space before combinators that need it
This has no effect on behaviour now, but means we won't have to adjust
this code when adding the invisible pseudo-element combinator.
2026-04-10 15:00:58 +01:00
Sam Atkins
f32ba2b1a5 LibWeb/CSS: Use Selector's methods to query its pseudo-elements
...instead of iterating through its components. This lets us initialize
the MatchingRule directly, now using designated initializers to
distinguish between the different bool fields.

No behaviour changes.
2026-04-10 15:00:58 +01:00
Sam Atkins
62527c1917 LibWeb/CSS: Separate pseudo-class and pseudo-element parsing code
Apart from making the code a bit easier to follow, we'll need to
distinguish between the two in order to insert a pseudo-element
combinator in front of pseudo-elements (including the single-colon
legacy ones).

next_is_pseudo_element() is its own function because it'll be needed in
a couple of other places, again to support pseudo-element combinators.
2026-04-10 15:00:58 +01:00
Sam Atkins
77308d8a5e LibWeb/CSS: VERIFY() that we don't call is_delim() incorrectly
This has bitten me too many times and it is non-intuitive to debug. So
let's make it very clear that something is wrong!
2026-04-10 15:00:58 +01:00
Sam Atkins
a55fc0f403 LibWeb/CSS: Check for OpenParen token, not '(' Delim
'(' never exists as a Delim token, only as an OpenParen or part of a
Block.
2026-04-10 15:00:58 +01:00
Sam Atkins
a997bb9546 LibWeb/CSS: Remove Optional from parse_compound_selector() return type
We always either return a CompoundSelector or an Error here. This
simplifies the user code.
2026-04-10 15:00:58 +01:00
Andreas Kling
879ac36e45 LibJS: Cache stable for-in iteration at bytecode sites
Cache the flattened enumerable key snapshot for each `for..in` site and
reuse a `PropertyNameIterator` when the receiver shape, dictionary
generation, indexed storage kind and length, prototype chain
validity, and magical-length state still match.

Handle packed indexed receivers as well as plain named-property
objects. Teach `ObjectPropertyIteratorNext` in `asmint.asm` to return
cached property values directly and to fall back to the slow iterator
logic when any guard fails.

Treat arrays' hidden non-enumerable `length` property as a visited
name for for-in shadowing, and include the receiver's magical-length
state in the cache key so arrays and plain objects do not share
snapshots.

Add `test-js` and `test-js-bytecode` coverage for mixed numeric and
named keys, packed receiver transitions, re-entry, iterator reuse, GC
retention, array length shadowing, and same-site cache reuse.
2026-04-10 15:12:53 +02:00
Andreas Kling
114eeddea1 AsmIntGen: Avoid clobbering r11 in store_operand
The x86_64 asm interpreter mapped t8 to r11, but store_operand
also used r11 as its scratch register for operand loads. When a
handler stored a JS value from t8, the scratch load overwrote the
value first and wrote raw operand bits into the register file.
2026-04-10 15:12:53 +02:00
Timothy Flynn
f79401bf9c CI: Change vcpkg cache key to depend on vcpkg.json
The vcpkg cache should rarely change - only when new dependencies are
added or a version changes. Both of these events involve modifying the
vcpkg.json file. So instead of uploading duplicated vcpkg caches in each
workflow, let's only upload changed caches.
2026-04-10 07:26:05 -04:00
Timothy Flynn
9524d92a9f CI: Remove quotes from cache keys
These get tricky with nested quotes when adding a hashFiles invocation.
Let's remove quotes from all keys to keep them consistent.
2026-04-10 07:26:05 -04:00
Timothy Flynn
a2fc4c1e10 CI: Remove always-true conditions from cache actions
After 80517124a4, we must always provide
these paths now.
2026-04-10 07:26:05 -04:00
Zaggy1024
cb852a7e19 LibWeb: Don't fast seek when seeking media to its current position
This ensures that we don't seek away from the end of the file if we're
already there and fastSeek() is called with a timestamp at or past the
end.
2026-04-10 04:08:28 -05:00
Tim Ledbetter
a8144a2608 LibWeb: Use null-document task when checking is unloading is canceled
Previously, `CheckUnloadingCanceledState::start_phase2()` used
`queue_global_task()` to fire `beforeunload` on each relevant document.
However, tasks associated with a document are only runnable when the
document is fully active and it is possible for the document to become
not fully-active before the task is run. This caused a 15 second delay
in `CheckUnloadingCanceledState` while we waited for a timeout, which
could cause test timeouts when under heavy load.
2026-04-10 00:02:53 +02:00
Callum Law
919dba87b9 LibWeb: Support calculated <flex> values
This spec note reads to me as explicitly disallowing combining
`<length>` and `<flex>` (i.e. `calc(1px + 1fr)`). This behavior is
already implemented (as it is for all other combination of units i.e.
`<length>` and `<time>`).
2026-04-09 21:41:49 +01:00
Callum Law
8d4e1a97cf LibWeb: Remove unused is_computationally_independent methods
`Size` and `LengthPercentage` are no longer stored within any
`StyleValue` classes so these methods are unused
2026-04-09 21:41:49 +01:00
Callum Law
281028944e LibWeb: Store GridTrackSize::m_value as a StyleValue
This simplifies handling (particularly around absolutization and
interpolation) and allows us to support calculated flex values (which
will come in a later commit).
2026-04-09 21:41:49 +01:00
Callum Law
21ffc8e1fe LibWeb: Implement composition for FlexStyleValue
Non-functional change for now but will be required once `GridTrackSize`
stores flex values as `StyleValue`s
2026-04-09 21:41:49 +01:00
Callum Law
e376310a70 LibWeb: Implement interpolation for FlexStyleValue
Non-functional change for now but will be required once `GridTrackSize`
stores flex values as `StyleValue`s
2026-04-09 21:41:49 +01:00
Callum Law
f4e7e193da LibWeb: Implement composition for FitContentStyleValue 2026-04-09 21:41:49 +01:00
Callum Law
af17641b0a LibWeb: Implement interpolation for FitContentStyleValue 2026-04-09 21:41:49 +01:00
Callum Law
c6de8def49 LibWeb: Add Size::from_style_value method 2026-04-09 21:41:49 +01:00
Callum Law
06b22d620d LibWeb: Add Flex::from_style_value method 2026-04-09 21:41:49 +01:00
Callum Law
5807d201b7 LibWeb: Implement absolutization of FitContentStyleValue 2026-04-09 21:41:49 +01:00
Callum Law
aa7c30b7a9 LibWeb: Store fit-content() argument as StyleValue
This brings us in line with other `StyleValue` classes and will make it
easier to implement absolutization in a later commit
2026-04-09 21:41:49 +01:00
Callum Law
2d3c705c17 LibWeb: Split FitContentStyleValue into an implementation file
Brings us in line with the other `StyleValue` classes
2026-04-09 21:41:49 +01:00
Andreas Kling
4c1e2222df LibJS: Fast-path safe writes into holey array holes
Teach the asm PutByValue path to materialize in-bounds holey array
elements directly when the receiver is a normal extensible Array with
the default prototype chain and no indexed interference. This avoids
bouncing through generic property setting while preserving the lazy
holey length model.

Keep the fast path narrow so inherited setters, inherited non-writable
properties, and non-extensible arrays still fall back to the generic
semantics. Add regression coverage for those cases alongside the large
holey array stress tests.
2026-04-09 20:06:42 +02:00
Andreas Kling
036819da22 LibJS: Grow indexed elements more aggressively
Increase indexed element growth from 25% to 50% so lazily realized
holey arrays need fewer reallocations and copies during dense fills.
This keeps the lazy length model from paying as much incremental growth
overhead on benchmarks that pre-size with Array(length) and then write
sequentially within bounds.
2026-04-09 20:06:42 +02:00
Andreas Kling
da1c943161 LibJS: Make holey array lengths lazy
Treat setting a large array length as a logical length change instead of
forcing dictionary indexed storage or materializing every hole up front.
This keeps dense fills on Array(length) on the holey indexed path and
only falls back to sparse storage when later writes actually create a
large realized gap.

The asm indexed get/put fast paths assumed holey arrays always had a
materialized backing store. Guard those paths with a capacity check so
lazy holey arrays fall back safely until an index has been realized.

Add regression coverage for very large holey arrays and for densely
filling a large holey array after pre-sizing it with Array(length).
2026-04-09 20:06:42 +02:00
Shannon Booth
02911253dd LibWeb+LibIPC: Preserve MessagePort queue state across transfer
A MessagePort can be transferred while it already has local queued
state such as incoming messages drained from its transport,
outgoing messages posted before a transport exists, and a pending
shutdown to apply once the port is enabled.

Serialize and restore that state as part of transfer so it moves with
the port instead of being left behind on the old transport.

Also mark transports that are being transferred so shutdown of the old
endpoint during handoff is not reported as peer EOF. That shutdown is
part of moving the transport to the new owner, not peer disconnected.

Co-Authored-By: Alexander Kalenik <kalenik.aliaksandr@gmail.com>
2026-04-09 19:59:16 +02:00
Shannon Booth
3a8d4d902f LibWeb: Use promise reactions instead of spin_until in FileReader 2026-04-09 19:50:38 +02:00
Shannon Booth
fd4d594856 LibWeb: Default FileReader mime type to application/octet-string
This is not specified, but other browsers appear to have aligned
on falling back to this mime type if it is unknown.
2026-04-09 19:50:38 +02:00
Aliaksandr Kalenik
ffbbc7f49a LibIPC: Remove send timeout from Mach port transport
Remove the 5-second send timeout from mach_msg() to align Mach port
transport behavior with the Unix domain socket transport, which blocks
indefinitely on send.

The timeout also made it impossible to attach a debugger to a child
process on macOS: if you didn't attach within the 5-second window, the
send would time out and the connection would be marked as EOF.
2026-04-09 17:47:47 +02:00
Suraj Yadav
11f82ee3b7 LibWebView: Support multiple --debug-process arguments 2026-04-09 11:00:10 -04:00
Tim Ledbetter
9b21701c78 LibWebView: Add a --screenshot-delay option
Previously, `--headless=screenshot` always took a screenshot after 1
second. This option allows the user to specify the number of seconds to
wait before taking the screenshot.
2026-04-09 10:52:10 -04:00
Timothy Flynn
b544e42809 LibWebView+UI: Add an about:bookmarks page to manage bookmarks
This page renders the bookmarks as a tree and hook context menu events
up to the UI's bookmarks bar context menus to allow editing bookmarks.
Users can also drag-and-drop bookmark items around.
2026-04-09 10:08:06 -04:00
Timothy Flynn
cd76622452 UI/Qt: Close all open bookmark menus when the bookmarks change
Qt will leave any existing menu open, which may be stale. We already do
the same in AppKit.
2026-04-09 10:08:06 -04:00
Timothy Flynn
8e8cff91f6 LibWebView: Add a method to serialize bookmark items to JSON 2026-04-09 10:08:06 -04:00
Timothy Flynn
efbd60bc21 LibWebView: Add a method to move a bookmark item
This allows moving an item within its own folder or to another folder.
2026-04-09 10:08:06 -04:00
Timothy Flynn
6bf2279dfe Base: Extract some about:settings CSS classes to a common file
We will re-use the card classes in about:bookmarks.
2026-04-09 10:08:06 -04:00
Timothy Flynn
2f3199adbf LibURL+LibWeb: Add a helper to check if a URL is a WebUI URL
Let's not have to know off-hand that we need to update Environments.cpp
when adding a new WebUI. It's more obvious just below where we define
the URLs.
2026-04-09 10:08:06 -04:00
Timothy Flynn
39d7abee2f LibWeb: Do not initiate selections when ctrl is pressed on macOS
On macOS, this will have opened a context menu. On other platforms, this
would start a multi-region selection.
2026-04-09 10:08:06 -04:00
Timothy Flynn
57e711978d LibWeb: Do not initiate drag-and-drop when ctrl is pressed 2026-04-09 10:08:06 -04:00
Timothy Flynn
fd0f3adcb5 LibWeb: Remove steps to set a cache request's initiator and destination
These requests are meant to mimic calling fetch() directly, thus these
fields should be the empty string, which is the default value.

See: https://github.com/w3c/ServiceWorker/commit/d04904e
2026-04-09 16:05:09 +02:00
R-Goc
094e4bacf8 LibWeb: Deduplicate gap_to_px
This commit creates one common gap_to_px function. This resolves problem
in the unity build.
2026-04-09 08:33:40 -04:00
R-Goc
d1cd391017 LibWeb: Deduplicate inline_axis functions
This commit deduplicates inline_axis_is_reversed and
block_axis_is_reversed.
2026-04-09 08:33:40 -04:00
Aliaksandr Kalenik
75af441bff Everywhere: Replace SharedBackingStore with Gfx::SharedImage
Generalize the backing store sharing abstraction into SharedImage, which
represents shared GPU memory independently of Skia and can be used to
share memory between different processes or different GPU contexts.
2026-04-09 01:18:59 +02:00
Zaggy1024
19a5c719ca Tests: Skip indexeddb-gc-closes-unreachable-connection for now 2026-04-08 16:13:22 -05:00