Commit graph

66662 commits

Author SHA1 Message Date
Aliaksandr Kalenik
ae9257bf3b AK: Define operator== for BitmapView 2025-01-04 20:32:35 +01:00
Aliaksandr Kalenik
e465e922bd LibWeb: Optimize :hover style invalidation
Instead of recalculating styles for all nodes in the common ancestor of
the new and old hovered nodes' subtrees, this change introduces the
following approach:
- While calculating ComputedProperties, a flag is saved if any rule
  applied to an element is affected by the hover state during the
  execution of SelectorEngine::matches().
- When the hovered element changes, styles are marked for recalculation
  only if the flag saved in ComputedProperties indicates that the
  element could be affected by the hover state.
2025-01-04 20:32:35 +01:00
Jaycadox
db58986e5f LibWeb/CSS: Recalculate calc() numeric type when resolving percentages
Previously, `percentage_of` would be called on the previous value,
potentially changing its numeric type, yet this potential change
was never reflected as the old numeric type was always used. Now,
the numeric type will be re-calculated every time after the
percentage is resolved. As well, VERIFY checks have been placed to
uphold the requirements for the numeric types to match what the
actual values are.
2025-01-04 18:47:44 +00:00
Sam Atkins
938ffe183e LibWeb/DOM: Update validate_and_extract to latest spec
The "strictly split" infra algorithm feels like an inefficient way of
doing basically what our existing split() does, except working with
code points instead of bytes. It didn't seem worth it to implement now.
2025-01-04 18:08:15 +00:00
Psychpsyo
33f87288e9 LibWeb: Remove unneeded spec deviation from font loading 2025-01-04 17:58:38 +00:00
Sam Atkins
c60ad5b0b8 LibWeb/DOM: Update node cloning to latest spec
Main difference is that a chunk of the "clone a node" steps are pulled
out into a "clone a single node" algorithm.

Reflects these spec PRs:
https://github.com/whatwg/dom/pull/1332
https://github.com/whatwg/dom/pull/1334

Though this code is quite old so there may also be older spec changes
included here.
2025-01-04 12:14:25 +00:00
Psychpsyo
331b1b22f5 LibWeb: Implement some viewport proximity features 2025-01-04 11:53:39 +00:00
Psychpsyo
8632ce5cdd LibWeb: Hide audio element when controls is not set
When an audio element has no controls attribute,
it should not render at all and take up no space.
2025-01-04 11:47:09 +00:00
Psychpsyo
8f11dfc08a LibWeb: Make select element use option's label, not text content 2025-01-04 11:44:03 +00:00
Tim Ledbetter
8c4e4ec31b LibWeb: Implement OscillatorNode.setPeriodicWave() 2025-01-04 10:12:24 +00:00
Tim Ledbetter
acbae1b118 LibWeb: Set OscillatorNode type in the constructor 2025-01-04 10:12:24 +00:00
Tim Ledbetter
72818300c0 LibWeb: Implement the OscillatorNode.detune attribute 2025-01-04 10:12:24 +00:00
Tim Ledbetter
ed46d247de LibWeb: Initialize OcillatorNode with the correct default options 2025-01-04 10:12:24 +00:00
Shannon Booth
c804d08d34 LibJS: Parse dates like "2025-01-02 14:00:00+0000"
This was getting spammed in the console by a website in the wild.
2025-01-03 14:43:13 -08:00
Feng Yu
57f776fcb7 WebDriver: Actually create a UUID for session_id 2025-01-03 13:15:52 -08:00
Sam Atkins
ed83bb75e9 LibWeb/WebDriver: Use actions queue for undo actions
This reflects part of https://github.com/w3c/webdriver/pull/1853

Also updated to reflect some minor spec text changes.
2025-01-03 13:14:53 -08:00
Sam Atkins
df702bd4d3 LibWeb/WebDriver: Extract "wait for an action queue token" algorithm
This reflects part of https://github.com/w3c/webdriver/pull/1853
2025-01-03 13:14:53 -08:00
Lucas CHOLLET
d879771044 LibWeb/CSS: Consider unresolved calc() when serializing in Normal mode
Unfortunately, there is no explicit and step-by-step spec to perform
the serialization of `color()` declared values, so while being
spec-informed, this is quite ad-hoc.

Fixes 81 subtests in:
 - css/css-color/parsing/color-valid-color-function.html
2025-01-03 16:49:23 +00:00
Lucas CHOLLET
d6abd44522 AK: Merge implementations of operator== for Optional
Instead of having a overload of the operator in each specialization of
Optional, use a free function as a common implementation.
2025-01-03 17:11:22 +01:00
Gingeh
a4abb35776 LibWeb: Revert addition of VERIFY call to isomorphic-decode 2025-01-03 14:54:29 +01:00
Tim Ledbetter
a6f04506e4 LibWeb: Add BaseAudioContext.create_periodic_wave() factory method 2025-01-03 14:54:18 +01:00
Tim Ledbetter
f90b79fa1f LibWeb: Implement PeriodicWave constructor 2025-01-03 14:54:18 +01:00
Tim Ledbetter
10c5b9c07b IDLGenerators: Allow methods with multiple sequence arguments
Previously, a method with multiple sequence arguments would cause a
compile error, as the same variable name was redeclared when iterating
the sequence for each argument. This change disambiguates these
variable names.
2025-01-03 14:54:18 +01:00
Arhcout
aa82ff8044 LibWeb: Add documentation to the date parser format
So we don't have to dig in the parser's code
2025-01-03 11:26:01 +00:00
Tyler Dence
5cfed4524d Inspector+UI: Close inspector with shortcuts
This brings keyboard shortcuts for the inspector up with common
convention in FF and Chrome: Ctrl+Shift+C now also opens the inspector,
and F12, Ctrl+W, and Ctrl+Shift+I now close the inspector when the
inspector window is focused.

Resolves #972
2025-01-03 10:47:13 +00:00
Tim Ledbetter
a24718cc49 Tests: Don't attempt to create echo server if internals is not exposed 2025-01-03 11:15:16 +01:00
Tim Ledbetter
7f8ba951cb Tests: Don't attempt to set test timeout if internals is not exposed
Previously, test output would not be displayed for tests setting a long
timeout, if the internals object was not exposed.
2025-01-03 11:15:16 +01:00
Tim Ledbetter
72ca91ad1a LibWeb: Flesh out AudioBufferSourceNode buffer setter steps 2025-01-03 11:14:47 +01:00
Tim Ledbetter
6cab972248 LibWeb: Add BaseAudioContext.createConstantSource() factory method 2025-01-03 11:13:27 +01:00
Tim Ledbetter
1b160044c4 LibWeb: Add ConstantSourceNode interface 2025-01-03 11:13:27 +01:00
Aliaksandr Kalenik
ccb543ebb8 LibWeb/CSS: Skip build of rule cache for inactive documents
Some websites (Reddit, for example) create lots of temporary documents
for fragment parsing. Before this change, we had to build a rule cache
for these documents just to determine whether there are :has, :defined,
or attribute selectors, while it should be safe to simply return `false`
right away.
2025-01-03 10:59:41 +01:00
Shannon Booth
34b8a9ab75 LibWeb/HTML: Assert microtasks invoked on empty execution context stack
This a requirement from the ECMA-262 spec.
2025-01-03 10:59:20 +01:00
Shannon Booth
ee1b2dced3 LibWeb/XHR: Use HTML EventLoop to wait for response to arrive 2025-01-03 10:59:20 +01:00
Shannon Booth
2fb4fcf4a0 LibWeb/FileAPI: Use HTML EventLoop to wait for promise to be fulfilled
Which will have proper handling of the exection context when performing
a microtask checkpoint. This fixes an assertion to be added in the next
commit where perform_a_microtask_check is invoked on a non-empty
execution context stack.
2025-01-03 10:59:20 +01:00
InvalidUsernameException
01f8ab35f1 LibGC: Rename remaining occurrence of marked vector
In 3bfb0534be `MarkedVector` was renamed to `RootVector`, but some
related symbols were missed. This commit corrects this.
2025-01-02 16:22:29 -07:00
stasoid
49bdda1475 AK: Simplify usage of windows.h and winsock2.h
Use <AK/Windows.h> instead of windows.h/winsock2.h
to avoid timeval-related errors.

Note: winsock2.h includes windows.h
2025-01-02 10:17:51 -07:00
Tim Ledbetter
3eefa464ee LibWeb: Add BaseAudioContext.createChannelSplitter() factory method 2025-01-02 11:39:23 +00:00
Tim Ledbetter
e564d25ffb LibWeb: Add ChannelSplitterNode interface 2025-01-02 11:39:23 +00:00
devgianlu
819178a49e LibWeb: Use correct default key size for HMAC
When the default key size was requested it was expressed in bytes
(instead of bits) and from the digest size instead of the block size.
2025-01-02 11:33:43 +01:00
devgianlu
f5d3d6a7d4 LibWeb: Set algorithm length for HMAC key generation
This assignment was missing from the spec, but has been fixed since
https://github.com/w3c/webcrypto/pull/394.

Also add relevant WPT tests.
2025-01-02 11:33:43 +01:00
devgianlu
ac0036d184 LibWeb: Remove spec error comments for RSAOAEP
The spec has been fixed since https://github.com/w3c/webcrypto/pull/391.
2025-01-02 11:33:43 +01:00
Shannon Booth
2066ed2318 LibWeb: Correctly initialize Storage objects on the Document
Instead of storing all storage objects in static memory, we now
follow the the spec by lazily creating a unique Storage object
on each document object.

Each Storage object now holds a 'proxy' to the underlying backing
storage. For now, this proxy is simply a reference to the backing
object. In the future, it will need to be some type of interface
object that stores on a SQLite database or similar.

Session storage is now correctly stored / tracked as part of the
TraversableNavigable object.

Local storage is still stored in a static map, but eventually this
should be factored into something that is stored at the user agent
level.
2025-01-02 11:31:15 +01:00
Shannon Booth
c536f65160 LibWeb/HTML: Implement the broadcast steps for Storage
This does not work properly yet as we do not create storage objects in a
spec compliant manner.
2025-01-02 11:31:15 +01:00
Shannon Booth
9a1e5e1835 LibWeb/HTML: Make storage broadcast take optional strings
Matching the arguments specified by the spec, needed to properly
represent null values.
2025-01-02 11:31:15 +01:00
Shannon Booth
bbf4739c8e LibWeb/HTML: Store the type of the storage object
This will be needed by the storage broadcast implementation to perform
different steps if the object is for session storage.
2025-01-02 11:31:15 +01:00
Shannon Booth
f3ecd23a21 LibWeb/HTML: Enforce quota limit for local and session storage
Fixes a timeout/crash for the two commited WPT tests.
2025-01-02 11:31:15 +01:00
Shannon Booth
e767029e24 LibWeb/HTML: Use finalize to clean up MessagePort instances 2025-01-02 11:31:15 +01:00
Shannon Booth
0b2c80e503 LibJS: Adjust FIXME for an incorrect assertion in GetModuleNamespace
It turns out that the FIXME which we had left unimplemented is actually
a spec bug.
2025-01-02 11:30:30 +01:00
Shannon Booth
1031f424e9 LibJS: Remove inaccurate comment about use of on_call_stack_emptied
This is no longer done. One of the comments is also innacurate for a
second reason - the call stack is never empty in that case, and is
verified as such only a few lines above.
2025-01-02 11:30:04 +01:00
Shannon Booth
1586d77b76 LibJS: Adopt editorial fix of return types of algorithms returning empty
See: https://github.com/tc39/ecma262/commit/35af90949
2025-01-02 11:30:04 +01:00