1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00
Commit graph

3367 commits

Author SHA1 Message Date
Tim Ledbetter
c1a3b95176 LibWeb: Set transition property name when firing transition events 2025-04-29 12:23:31 +02:00
Gingeh
aa9f556500 LibWeb: Light dismiss dialogs on click 2025-04-28 19:41:38 -06:00
Gingeh
1f1884da54 LibWeb: Light dismiss popovers on click 2025-04-28 19:41:38 -06:00
Hikmat Jafarli
bd9d489370 LibWeb: Re-evaluate the style block when the type attribute changes 2025-04-29 01:01:02 +02:00
Andreas Kling
4d17707b26 LibJS: Store bytecode VM program counter in ExecutionContext
This way it's always automatically correct, and we don't have to
manually flush it in push_execution_context().

~7% speedup on the MicroBench/call* tests :^)
2025-04-28 21:12:48 +02: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
teaalltr
a3e485e2d0 LibWeb: Add fast_is for span and div 2025-04-28 19:46:05 +01:00
Shannon Booth
8a3c66d8a6 LibWeb: Make a bunch of CSP classes not realm associated
These are not associated with a javascript realm, so to avoid
confusion about which realm these need to be created in, make
all of these objects a GC::Cell, and deal with the fallout.
2025-04-28 12:41:28 +02:00
Tim Ledbetter
04fde1c550 LibWeb: Ensure lang pseudoclass matches multiple segment subcodes 2025-04-28 11:29:30 +01:00
Tim Ledbetter
74c803c87b LibWeb: Ensure |= value selector handles multiple segments correctly
Previously, the `|=` would not compare strings containing `-`
characters correctly because it would only compare the element
attribute up to the first `-` character.
2025-04-28 11:29:30 +01:00
Tim Ledbetter
f854f644a7 LibWeb: Don't crash when interpolating non <number> scale values 2025-04-28 11:46:34 +02:00
stelar7
edf64b801c LibWeb/IDB: Add store to the current transaction when created 2025-04-28 11:31:31 +02:00
stelar7
47d6b568fd LibWeb/IDB: Dont keep trailing separator when splitting key paths 2025-04-28 11:31:31 +02:00
stelar7
577f799240 LibWeb/IDB: Fix a bug where the KeyGenerator was not incremented 2025-04-28 11:31:31 +02:00
stelar7
facfcd87c2 LibWeb/IDB: Introduce an Invalid KeyType
This cleans up the code around failure/invalid/exception a bit
2025-04-28 11:31:31 +02:00
stelar7
61384473ca LibWeb/IDB: Implement IDBDatabase::transaction() 2025-04-28 11:31:31 +02:00
Andreas Kling
a05be67e4a LibJS: Let invokers (callers) of [[Call]] allocate ExecutionContext
Instead of letting every [[Call]] implementation allocate an
ExecutionContext, we now make that a responsibility of the caller.

The main point of this exercise is to allow the Call instruction
to write function arguments directly into the callee ExecutionContext
instead of copying them later.

This makes function calls significantly faster:
- 10-20% faster on micro-benchmarks (depending on argument count)
- 4% speedup on Kraken
- 2% speedup on Octane
- 5% speedup on JetStream
2025-04-28 01:23:56 +02:00
Shannon Booth
420949b134 LibWeb/HTML: Make Navigation navigate event trusted
Fixes WPT test:

https://wpt.live/navigation-api/navigate-event/signal-abort-intercept.html
2025-04-27 07:54:02 -04:00
Shannon Booth
6032827fe7 LibWeb/HTML: Inform navigation API about frame container destruction 2025-04-27 07:54:02 -04:00
Tim Ledbetter
8a398e7a88 LibWeb: Parse all transition-property value as keyword
We were previously parsing this value, as a custom-ident, meaning that
the code path for handling the `all` case wasn't being followed.
2025-04-27 09:49:00 +01:00
Timothy Flynn
ac1c2a956a LibWeb: Implement caching of reflected element array attributes
For attributes like Element.ariaControlsElements, which are a reflection
of FrozenArray<Element>, we must return the same JS::Array object every
time the attribute is invoked - until its contents have changed. This
patch implements caching of the reflected array in accordance with the
spec.
2025-04-26 17:29:38 -04:00
Shannon Booth
6d622a6c04 LibWeb/DOM: Use as_if<T> in a bunch more places in DOM::Node 2025-04-26 08:45:37 -06:00
Shannon Booth
31a3bc3681 LibWeb: Implement 'State-preserving atomic move integration'
This was recently added to both the HTML and DOM specifications,
introducing the new moveBefore DOM API, as well as the new internal
'removing steps'.

See:

 * 432e8fb
 * eaf2ac7
2025-04-26 08:45:37 -06:00
Shannon Booth
a47c4dbc63 LibWeb/DOM: Factor out 'live range pre remove steps' AO
This was a refactoring made in the DOM spec as part of the
introduction of the move before API.
2025-04-26 08:45:37 -06:00
Timothy Flynn
0e2036d6c2 LibWeb: Temporarily disable site isolation for subframes
We don't yet support out-of-process subframes. Explicitly disable even
attempting to isolate subframes. Otherwise, navigating a subframe to a
non-same-site URL would actually cause the top-level frame to navigate
with our current implementation.
2025-04-26 10:15:47 -04:00
Timothy Flynn
e52c09ad4c LibWeb: Avoid copying a URL needlessly during subframe navigation
Noticed a clangd warning for this while looking at a subframe site
isolation issue.
2025-04-26 10:15:47 -04:00
Andreas Kling
d8ea16d94e LibWeb: Don't assume calc() simplification worked on invalid tree
Fixes #4469
2025-04-25 16:55:05 +02:00
Timothy Flynn
4e298db4f5 LibWeb: Update FIXMEs about FrozenArray with more up-to-date description
We could support FrozenArray pretty easily here, but we would regress on
SameObject handling.
2025-04-25 16:43:43 +02:00
Timothy Flynn
ad34fdad48 LibWeb: Convert trivial attributes to FrozenArray 2025-04-25 16:43:43 +02:00
Timothy Flynn
62167d923c LibWeb: Convert ARIA attributes to FrozenArray 2025-04-25 16:43:43 +02:00
Andreas Kling
cf704cfbfc LibWeb: Implement interpolation for CSS scale values
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
Shannon Booth
a2cca59516 LibWeb+LibWebView+Services: Add IPC for starting WebWorker of a type
The provides some of the plumbing for a WebContent process to spin
up a WebWorker that is not just a dedicated worker.
2025-04-25 14:07:51 +02:00
Shannon Booth
041ff0c7ff LibWeb/HTML: Hook up a WorkerAgent for web workers 2025-04-25 14:07:51 +02:00
Shannon Booth
5290ebfe19 LibJS: Switch Agent [[CanBlock]] slot to a enum member
It turns out it was a mistake to make this a virtual since
ServiceWorkerAgents are effectively the exact same as
DedicatedWorkerAgents and SharedWorkerAgents just with [[CanBlock]]
set to false.
2025-04-25 14:07:51 +02:00
Shannon Booth
7dd7e5b438 LibJS+LibWeb: Defer initialization of the Agent after VM constructor
This helps unwind a niggly depedency where the VM owns and constructs
the Heap and the Agent. But the agent wants to have customized
construction that depends on the heap. Solve this by defering
the initialization of the Agent to after we have constructed the
VM and the heap.
2025-04-25 14:07:51 +02:00
Shannon Booth
8263a9863f LibJS+LibWeb: Do not return error from VM::create
This never returns an error to propogate, also allowing ErrorOr
to be removed from creating the main thread VM.
2025-04-25 14:07:51 +02:00
Shannon Booth
084cceab5c LibWeb: Split out SimilarOriginWindowAgent from HTML::Agent
To allow for adding the concept of a WorkerAgent to be reused
between shared and dedicated workers. An event loop is the
commonality between the different agent types, though, there
are some differences between those event loops which we customize
on the construction of the HTML::EventLoop.
2025-04-25 14:07:51 +02:00
Shannon Booth
939bb10828 LibWeb/HTML: Rename WorkerAgent to WorkerAgentParent
This is to differentiate the agent representation for the parent
process for the WorkerAgent in the child process which is actually
hooked up to the javascript VM.

I am not sure if this is a good name, but I can't really think of
anything better which is consistent with the names used by the rest
of the codebase.
2025-04-25 14:07:51 +02:00
Jelle Raaijmakers
2fc1cafb8a LibWeb: Exclude fixed positioned boxes from scrollable overflow
Sometimes fixed positioned boxes would extend the viewport's scrollable
overflow, which according to the spec should never happen. There are
some nuances to this, such as properly determining the fixed positioning
containing block for a fixed position box, but for now this prevents
some pages from being overly scrollable.

Fixes horizontal scrollability of https://tweakers.net.
2025-04-25 14:07:38 +02:00
stelar7
5ae069a031 LibWeb/IDB: Use correct state to check for throw condition 2025-04-25 07:23:41 -04:00
stelar7
d28a4434d0 LibWeb/IDB: Dont include databases with version 0 in databases() 2025-04-25 07:23:41 -04:00
Shannon Booth
8ac096c0e2 LibWeb/HTML: Fix parsing of protocol in Location.protocol setter
This never worked properly when implemented as it would always
throw an error for an invalid scheme on URL parsing.

Fixes at least some tests in:

https://wpt.live/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html

And all tests in:

https://wpt.live/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-weird.html

And maybe tests in some other places too, but these are not imported
as the tests are written with delays that makes them take a long time
to run, and some of them rely on HTTP(s).
2025-04-25 07:21:02 -04:00
Shannon Booth
3bb36d9379 LibWeb/ServiceWorker: Implement ServiceWorkerGlobalScope event handlers 2025-04-25 11:02:53 +02:00
Shannon Booth
50b7e0807d LibWeb/ServiceWorker: Add ServiceWorker event names 2025-04-25 11:02:53 +02:00
Andreas Kling
27efb3b140 LibWeb: When declarative shadow attachment fails, continue in right spot
If attachment fails for whatever reason (e.g the host element is not
allowed to be a host), the HTML spec tells us to insert the template
element anyway and proceed.

Before this change, we were recomputing the insertion location at this
point, which caused it to be *inside* the template element. Inserting
the template element into itself didn't work, and so the DOM would end
up incorrect.

The fix here is to simply use the insertion point we determined earlier
in the same function, before putting a template element on the stack of
open elements. We already do this elsewhere.

Fixes at least 228 subtests on WPT. :^)
2025-04-25 11:01:17 +02:00
Andreas Kling
1102a31866 LibWeb: Improve DOM dump formatting for HTML template elements
Let's dump both the template contents, and any DOM nodes inside the
template element itself, since both are valid states produced by the
HTML parser.
2025-04-25 11:01:17 +02:00
Andreas Kling
10cff06a95 LibWeb: Move presentation attrs from SVGGraphicsElement to SVGElement
This matches how other browser behave and fixes a bunch of WPT tests.
2025-04-25 10:18:34 +02:00
Timothy Flynn
fe6d8131ae LibWeb: Return correct type from CSSNestedDeclarations::style
We implement CSSStyleProperties so let's use it.
2025-04-25 08:48:29 +02:00
Timothy Flynn
13ac6c4fde LibWeb: Implement ariaActiveDescendantElement spiritually closer to spec
We are meant to store a weak reference to the element indicated by this
attribute, rather than a GC-protected strong reference. This also hoists
the "get the attr-associated element" AO into its own function, rather
than being hidden in IDL, to match "get the attr-associated elements".
2025-04-25 01:20:12 +01:00
Timothy Flynn
f985ac8884 LibWeb: Implement element-referencing ARIA attributes
There are ARIA attributes, e.g. ariaControlsElements, which refer to a
list of elements by their ID. For example:

    <div aria-controls="item1 item2">

The div.ariaControlsElements attribute would be a list of elements whose
ID matches the values in the aria-controls attribute.
2025-04-25 01:20:12 +01:00