Commit graph

62794 commits

Author SHA1 Message Date
Jamie Mansfield
f774d75f89 LibWeb/DOM: Check if name is valid in Element.toggleAttribute
This resolves a test in https://wpt.live/dom/nodes/attributes.html.
2024-07-25 06:46:28 +02:00
Tim Ledbetter
0127190dcf LibWeb: Perform DOMTokenList token validation in the correct order 2024-07-25 06:43:31 +02:00
Tim Ledbetter
ec1f7779cb LibWeb: Follow the specification steps to serialize a DOMTokenList
This ensures that calling `element.classList.toString()` always
produces the correct value.
2024-07-25 06:43:31 +02:00
Tim Ledbetter
21e21abeed LibWeb: Update Element class list is when class attribute is removed 2024-07-25 06:43:31 +02:00
Mohamed amine Bounya
6e77fff698 LibWeb: Bring 'construct_entry_list' closer to specs 2024-07-25 06:42:43 +02:00
Diego Frias
4e8376d07e LibWasm: Remove unused vector methods of the interpreter 2024-07-24 23:23:09 +02:00
Diego Frias
9cc3e7d32d LibWasm: Fix SIMD shuffle and swizzle
`swizzle` had the wrong operands, and the vector masking boolean logic
was incorrect in the internal `shuffle_or_0` implementation. `shuffle`
was previously implemented as a dynamic swizzle, when it uses an
immediate operand for lane indices in the spec.
2024-07-24 23:23:09 +02:00
Diego Frias
d841742c35 LibWasm: Fix SIMD bit shift right
Set the sign in the vector's element type (even though it's a bit
redundant).
2024-07-24 23:23:09 +02:00
Aliaksandr Kalenik
40f9c9f82a LibWeb: Remove optional prepare step from DisplayListPlayer
This was only needed by removed LibGfx painter to ensure capacity of a
vector with border corner clippers.
2024-07-24 17:49:14 +02:00
Aliaksandr Kalenik
54cb888e2f LibWeb: Remove step to prepare bitmap cache in display list player
This was only used by old OpenGL GPU painter.
2024-07-24 17:49:14 +02:00
Aliaksandr Kalenik
a10576d016 LibWeb: Remove step to prepare glyphs texture in display list player
This was only used by old OpenGL GPU painter.
2024-07-24 17:49:14 +02:00
Sam Atkins
6160400ab7 Revert "WebContent: Limit the Console client to the top-level navigable"
This reverts commit 758f4887bc.

This commit was causing ASAN to complain about a use-after-poison, see
https://github.com/LadybirdBrowser/ladybird/issues/809
2024-07-24 16:44:52 +01:00
Aliaksandr Kalenik
6ae9b54f11 LibWeb: Remove stacking context painting failure handling
CommandResult was needed by LibGfx display list player that could have
failed to allocate a temporary bitmap for painting a stacking context
with CSS transforms. This is no longer an issue with Skia painter, so
we can delete CommandResult::SkipStackingContext handling path.
2024-07-24 14:57:19 +02:00
sideshowbarker
70e053bbf4 LibWeb: WebIDL::OverloadResolution, minor code streamlining 2024-07-24 11:23:58 +02:00
sideshowbarker
cc7c49e235 LibWeb: WebIDL::OverloadResolution::resolve_overload, add dbgln FIXMEs
Relates to https://github.com/LadybirdBrowser/ladybird/issues/801
2024-07-24 11:23:58 +02:00
Shannon Booth
52ccd69e49 WebAudio: Avoid throwing exception for stubbed AudioNode.connect
This stubs out enough to get https://athenacrisis.com/ far enough to
actually load :^)
2024-07-24 11:14:46 +02:00
Shannon Booth
52be4925bc WebAudio: Avoid throwing exception for stubbed setValueAtTime
Instead, just log an error and continue on gracefully, returning an
instance of ourselves as spec'd.
2024-07-24 11:14:46 +02:00
Shannon Booth
a51095f705 WebAudio: Add stub for AudioDestinationNode.destination
This is called by https://athenacrisis.com/ and passed through to
AudioNode.connect, which expects an AudioNode.

Implement this function enough so that we return an AudioNode so that
AudioNode.connect does not throw a TypeError.
2024-07-24 11:14:46 +02:00
Shannon Booth
5eb80b8697 WebAudio: Add IDL interface for AudioDestinationNode
This is an AudioNode representing the final audio destination and is
what the user will ultimately hear.

This node is used as one of the connecting nodes in athenacrisis.com

Add a placeholder for the interface without anything backing it for now.
2024-07-24 11:14:46 +02:00
Andreas Kling
9a7e6158af LibJS: Fix crash in bytecode generator on https://twinings.co.uk/
If the current block has already been terminated, we should just skip
creating a per-iteration environment.
2024-07-24 11:13:53 +02:00
Aliaksandr Kalenik
c5afe70f77 LibWeb: Add optimized painting command for repeated background
With this change, instead of recording a display list item for each
instance of a repeated background, a new DrawRepeatedImmutableBitmap
type is used. This allows the painter to use optimized repeated image
painting and, when the GPU backend is used, avoid re-uploading the image
texture for each repetition.

Some screenshot tests are affected, but there are no visible
regressions.

https://null.com/games/chainstaff works a lof faster with this change.
2024-07-24 11:13:04 +02:00
Tim Ledbetter
a4b289ebac UI/Qt: Don't crash when launching Inspector with Qt networking enabled 2024-07-23 14:48:56 -04:00
Andreas Kling
4c326fc5f6 LibWeb: Implement :host and :host(<compound-selector>) selector matching
The :host family of pseudo class selectors select the shadow host
element when matching against a rule from within the element's shadow
tree.

This is a bit convoluted due to the fact that the document-level
StyleComputer keeps track of *all* style rules, and not just the
document-level ones.

In the future, we should refactor style storage so that shadow roots
have their own style scope, and we can simplify a lot of this.
2024-07-23 18:03:46 +02:00
Andreas Kling
274c46a3c9 LibWeb: Don't infer descendant combinator for <compound-selector>
This fixes an issue where :host(foo) would parse as if "foo" was the
on the right side of a descendant combinator.

Not testable yet, but will be in the next commit.
2024-07-23 18:03:46 +02:00
Timothy Flynn
758f4887bc WebContent: Limit the Console client to the top-level navigable client
We don't want to set the intrinsic Console object's client to non-top-
level clients, created for e.g. SVG elements or subframes. We also want
to make sure the Console client is updated if the top-level document has
changed.
2024-07-23 18:00:27 +02:00
Sam Atkins
64d45afd8a LibWeb: Check CanvasTextDrawingStyles.font assignment is valid
Checking that the string parsed for the `font` property is not enough,
the spec also wants to rule out CSS-wide keywords like `inherit`. The
simplest way to do so is to check if it's a ShorthandStyleValue, which
also rules out use of `var()`; this matches other browsers' behaviour.

The newly-added test would previously crash, and now doesn't. :^)
2024-07-23 18:00:12 +02:00
simonkrauter
54066ec5a4 LibWeb: Use absolute padding box to calculate max scroll offset
In `PaintableBox::set_scroll_offset()` the scrollport size was measured
by `content_size()` instead of `absolute_padding_box_rect()`.

Fixes #788
2024-07-23 17:59:17 +02:00
sideshowbarker
1d03944a9c CI: Make notes-push workflow return zero even when “git push” fails
It’s possible but unlikely that a push of generated notes back to the
remote can fail with a message like

> [remote rejected] ... cannot > lock ref 'refs/notes/commits': is at
> f3648f50bb but expected 47686bf473

See https://github.com/LadybirdBrowser/ladybird/actions/runs/10054314539

So this change makes the call to “git push” for notes not return 0 even
if it fails — because it’s not actually a fatal error when it happens,
and not something we need to stop and fix. Instead, it fixes itself.

Specifically: If one CI job for a PR merge/push to master generates
some notes but fails to push them to the origin, the notes don’t get
dropped on the floor and lost.

Instead, the notes-generator tool looks at the entire history; and if it
finds commits that don’t have notes — even if those commits are not part
of the PR push/merge it’s operating on — it generates notes for those.

In other words, if notes for one PR push/job fail for some reason to get
pushed back to the remote, they get regenerated by the next PR push/job.
2024-07-23 11:47:55 +02:00
Andreas Kling
14beda00c9 LibJS: Rename Value::typeof() to Value::typeof_()
This to avoid clashing with the GCC typeof extension, which apparently
confuses clang-format.
2024-07-23 11:47:37 +02:00
Andreas Kling
d0b11af387 LibJS: Make typeof a lot faster by caching all possible results
The typeof operator has a very small set of possible resulting strings,
so let's make it much faster by caching those strings on the VM.

~8x speed-up on this microbenchmark:

    for (let i = 0; i < 10_000_000; ++i) {
        typeof i;
    }
2024-07-23 11:47:37 +02:00
Andreas Kling
3b7534b362 LibWeb: Use correct scope when removing style sheet inside a shadow tree
Before this change, removing a style element from inside a shadow tree
would cause it to be unregistered with the document-level list of sheets
instead of the shadow-root-level list.

This would eventually lead to a verification failure if someone tried to
update the text contents of that style element, since it was still in
the shadow-root-level list, but now with a null owner element.

Fixes a crash on https://www.swedbank.se/
2024-07-23 11:12:18 +02:00
Andreas Kling
ebacb921da LibWeb: Verify something was removed in StyleSheetList::remove_sheet()
This would have saved me an hour of debugging, so putting it here for
the next person. :^)
2024-07-23 11:12:18 +02:00
Jamie Mansfield
835986de7b LibWeb/WebGL: Stub missing properties in WebGLRenderingContextBase 2024-07-23 09:04:57 +02:00
Timothy Flynn
d58a8b5146 LibWebView+UI: Raise the chrome process open file limit
The default limit (at least on Linux) causes us to run out of file
descriptors at around 15 tabs. Increase this limit to 8k. This is a
rather arbitrary number, but matches the limit set by Chrome.
2024-07-23 09:04:42 +02:00
Timothy Flynn
4451b4fda0 LibCore: Log errors from pipe2 when creating an event loop 2024-07-23 09:04:42 +02:00
Timothy Flynn
0d6115e8ae LibCore: Add system call wrappers around getrlimit and setrlimit 2024-07-23 09:04:42 +02:00
bbb651
7b10eb7225 LibWeb: Add new expected window properties to test
Adds `AudioBufferSourceNode` and `BiquadFilterNode` to the
all-window-properties test.
2024-07-23 09:02:43 +02:00
bbb651
64663d53fa WebAudio: Stub BiquadFilterNode 2024-07-23 09:02:43 +02:00
bbb651
6672fb4b47 WebAudio: Stub AudioBufferSourceNode 2024-07-23 09:02:43 +02:00
Kenneth Myhra
92f6336fe8 Tests/LibWeb: Move existing Fetch tests in under the Fetch folder 2024-07-23 09:02:21 +02:00
Kenneth Myhra
b8fa572c67 LibWeb: Implement formData() method steps for x-www-form-urlencoded
The Response interface of the Fetch API can now parse form urlencoded
bodies when Content-Type is set to 'application/x-www-form-urlencoded'.
2024-07-23 09:02:21 +02:00
Aliaksandr Kalenik
7047fcf761 LibWeb: Separate paint-only property resolution by paintable type
Having resolution of all properties for all paintable types in a single
function was hard to iterate on, so this change separates it into
smaller functions per paintable type.
2024-07-23 09:00:48 +02:00
Lucas CHOLLET
aba435a652 LibGfx/JPEGXL: Add support for animated images 2024-07-23 08:59:34 +02:00
Lucas CHOLLET
d9a2c62ed4 LibGfx/JPEGXL: Make JPEGXLLoadingContext non [copy,move]able 2024-07-23 08:59:34 +02:00
Timothy Flynn
b659b62dec Documentation: Add pkg-config to Debian dependencies 2024-07-23 08:59:05 +02:00
Timothy Flynn
40a617dbab CI: Remove a couple unneeded system dependencies
libqt6svg6-dev - We don't use Qt's SVG support any longer.

qt6-multimedia-dev - We already install libpulse-dev, so the Qt6
multimedia package is unused.
2024-07-23 08:59:05 +02:00
Timothy Flynn
61da7d2213 Documentation: Recommend installing PulseAudio on Debian by default 2024-07-23 08:59:05 +02:00
Timothy Flynn
5b38057802 CI+Documentation: Alphabetically sort system dependencies 2024-07-23 08:59:05 +02:00
Tim Ledbetter
bd1213d0c5 LibWeb: Return a NodeList from document.getElementsByName()
This aligns our implementation with the specification.
2024-07-23 08:58:22 +02:00
Tim Ledbetter
e40352b6b5 LibWeb: Ensure document.getElementsByName("") returns no elements
Previously, if a document had any element with a name attribute that
was  set to the empty string, then `document.getElementsByName("")` and
`element.getElementsByName("")` would return a collection including
those elements.
2024-07-23 08:58:22 +02:00