Commit graph

66671 commits

Author SHA1 Message Date
Shannon Booth
172d5f6987 LibWeb: Implement definition of remaining global event handlers 2025-01-05 16:19:19 +00:00
stasoid
9884cd0628 AK: Stub out AK::demangle on Windows 2025-01-05 15:02:32 +00:00
rmg-x
ba6b5adde3 UI/Qt: Add menu action to clear all cookies 2025-01-05 13:58:27 +00:00
rmg-x
dc34aeb764 LibWebView: Add method to remove all cookies globally
The inspector widget has this functionality, but it's limited to the
site you're currently viewing. This commit adds an option for removing
all cookies globally.

Previously, the workaround was to open a sqlite shell and run:
`DELETE FROM Cookies;` on the database yourself.
2025-01-05 13:58:27 +00:00
Andreas Kling
49a7a0f378 LibWeb: Avoid invalidation on .textContent setter no-op
When setting the textContent of an element with no children to null or
the empty string, nothing happens. Even so, we were still invalidating
style, layout and collections, causing pointless churn.

Skipping invalidation in this case also revealed that we were missing
invalidation when changing the selected state of HTMLOptionElement.
This was all caught by existing tests already in-tree. :^)
2025-01-05 13:36:17 +01:00
Shannon Booth
8214371ad5 LibWeb/HTML: Default ErrorEvent error to undefined
This was a change in the HTML spec, see:

https://github.com/whatwg/html/commit/032523196
2025-01-05 12:02:40 +01:00
Ivan Zuzak
cb9e3d5c9b Documentation: Mention TODOs and FIXMEs as potential sources of work
As many other projects, Ladybird has more than a few TODO and FIXME
comments sprinkled throughout the codebase. These can be a great
inspiration or starting point for contributors looking for work, so
we mention them in the docs on contributing to the project.
2025-01-05 12:02:16 +01:00
Aliaksandr Kalenik
8fdfadb0c9 LibWeb: Optimize inherited style update caused by animation
It is possible to skip inherited style recalculation for children if
parent's recalculation does not cause any changes.

Improves performance on Github where we could avoid dozens of inherited
style calculations that do not produce any visible changes.
2025-01-05 11:31:03 +01:00
Aliaksandr Kalenik
482e5deb85 LibWeb: Further optimize :hover style invalidation
Previously, we optimized hover style invalidation to mark for style
updates only those elements that were matched by :hover selectors in the
last style calculation.

This change takes it a step further by invalidating only the elements
where the set of selectors that use :hover changes after hovered element
is modified. The implementation is as follows:
1. Collect all elements whose styles might be affected by a change in
   the hovered element.
2. Retrieve a list of all selectors that use :hover.
3. Test each selector against each element and record which selectors
   match.
4. Update m_hovered_node to the newly hovered element.
5. Repeat step 3.
6. For each element, compare the previous and current sets of matched
   selectors. If they differ, mark the element for style recalculation.
2025-01-04 20:32:35 +01:00
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