Commit graph

62880 commits

Author SHA1 Message Date
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
Tim Ledbetter
0fceede029 LibWeb: Ensure document.getElementsByClassName("") returns no elements
Previously, `document.getElementsByClassName("")` would return a
collection containing all elements in the given document.
2024-07-23 08:58:22 +02:00
Tim Ledbetter
faf64bfb41 LibWeb: Move get_elements_by_name implementation to ParentNode
Previously, we had two implementations of the same function in
`Document` and `Element`, which had inadvertantly diverged.
2024-07-23 08:58:22 +02:00
Tim Ledbetter
f666d967d6 LibWeb: Ensure document.getElementById("") returns null
Previously, if a document had an element whose id was the empty string,
then `document.getElementById("")` and `element.getElementById("")`
would return that element.
2024-07-23 08:58:22 +02:00
Ali Mohammad Pur
18499c4eac RequestServer: Make the ThreadPool global
Previously we made one thread pool per ipc client, which is excessive
and can eat up all the available fds very fast.
Fixes #760.
2024-07-23 08:56:59 +02:00
Tim Ledbetter
c396054c87 Meta: Update mailmap with my new ladybird.org email address 2024-07-22 23:01:57 +01:00
Jamie Mansfield
01ff3d4286 Ladybird/Qt: Add missing filters for TVG icons
Ladybird now uses the correct theme colours when hovering over icons.
2024-07-22 12:59:36 -04:00
Andrew Kaster
989b4ac127 CMake: Ensure that dependency targets are built before AppKit UI files 2024-07-22 09:31:22 -06:00
Aliaksandr Kalenik
2ead999f2b LibGfx+LibWeb: Remove typeface classes for WOFF fonts
This change removes wrappers inherited from Gfx::Typeface for WOFF and
WOFF2 fonts. The only purpose they served is owning of ttf ByteBuffer
produced by decoding a WOFF/WOFF2 font. Now new FontData class is
responsible for holding ByteBuffer when a font is constructed from
non-externally owned memory.
2024-07-22 15:05:04 +02:00
mobounya
2497f43989 LibWeb: Update update_for_history_step_application
Update 'update_for_history_step_application' to meet some of the specs
introduced in https://github.com/whatwg/html/pull/9856 and in
https://github.com/whatwg/html/pull/9990
2024-07-22 10:39:46 +02:00
Lucas CHOLLET
1039561280 LibGfx: Use libjxl to decode JPEG XL images
It currently doesn't support animated image.

Note that Gfx::Bitmap has no support for get_pixel when the format is
RGBA8888. This is why it has been removed from the tests.
2024-07-22 09:15:16 +02:00
Tim Ledbetter
d417b75683 LibWeb/SVG: Ensure SVG transform has an inverse before using it
This avoids a crash that occurred when calling `getBBox()` on an SVG
element that had a transform with no inverse.

Found by Domato.
2024-07-22 09:13:25 +02:00
Tim Ledbetter
4cdafea363 LibWeb: Don't crash when SVG viewbox has a width of 0
Previously, `SVGSVGBox` would have a natural aspect ratio of 0 if it
had a viewbox with zero width. This led to a division by zero, causing
a crash.

Found by Domato.
2024-07-22 09:13:25 +02:00
Tim Ledbetter
604f6040a1 LibWeb: Clamp paintable box maximum scroll offset to 0
Previously calling `PaintableBox::set_scroll_offset()` with a
PaintableBox whose content size was larger than its scrollble overflow
rect would cause a crash.

Found by Domato.
2024-07-22 09:13:25 +02:00
Olekoop
6b88e43b3b LibAudio: Implement PlaybackStream for Android using Oboe
https://github.com/google/oboe

There are many ways to implement audio for Android, however this is
the recommended way to do it.
2024-07-21 16:09:36 -06:00