Commit graph

56824 commits

Author SHA1 Message Date
Timothy Flynn
d8f84ef76c CI: Disable running aarch64 tests in CI for now
These tests almost always fail, and all we do is try to boot. Disable it
for now until it can pass more reliably. Note we still compile aarch64,
so the build shouldn't break unnoticed.
2023-12-01 09:35:54 -05:00
Bastiaan van der Plaat
b21ec0afac Ladybird/AppKit: Select all text of location search field on focus 2023-12-01 09:26:37 -05:00
Todderod
e335354b30 LibJS: Call builtins directly in the bytecode interpreter
Allows the bytecode interpreter to call the builtins c++
implementation directly without making a javascript call
just as the JIT.

Kraken test speedups: imaging-gaussian-blur.js (1.5x) and
audio-oscillator.js (1.2x)
2023-12-01 13:01:26 +01:00
Lucas CHOLLET
ce6cd4f45f LibGfx/GIF: Use LZWDecoder::decode_all() 2023-12-01 12:58:14 +01:00
Lucas CHOLLET
cc816b486c LibGfx/TIFF: Use LZWDecoder::decode_all() 2023-12-01 12:58:14 +01:00
Lucas CHOLLET
2a5cb5becb LibCompress: Add LZWDecoder::decode_all()
This method takes bytes as input and decompress everything to a
ByteBuffer. It uses two control codes (clear and end of data) as
described in the GIF, TIFF and PDF specifications.
2023-12-01 12:58:14 +01:00
Tim Schumacher
e9e89d7e4e AK: Optimize BitStream refilling a bit further
This tries to optimize the refill code by making it easier to digest for
the branch predictor. This includes not looping as much across function
calls and marking our EOF case to be unlikely.

Co-Authored-By: Lucas Chollet <lucas.chollet@free.fr>
2023-12-01 12:48:18 +01:00
Tim Schumacher
197331c922 AK: Reject BitStream reads beyond EOF by default
The only exception to this is the lossless WebP decoder, which
legitimately relies on this behavior, even upstream.
2023-12-01 12:48:18 +01:00
Tim Schumacher
cb03d3d78f AK: Allow rejecting BitStream reads beyond EOF 2023-12-01 12:48:18 +01:00
Tim Schumacher
270b1176de Tests: Add a test to codify BitStream behavior beyond stream limits 2023-12-01 12:48:18 +01:00
Tim Schumacher
de49413bdf AK: Don't slice off the first byte of a BitStream read 2023-12-01 12:48:18 +01:00
Lucas CHOLLET
4280f4d2c7 LibGfx/TIFF: Automatically export all enums associated with tags 2023-12-01 12:45:03 +01:00
Sam Atkins
9c12112916 LibWeb: Re-enable the css-background-repeat.html ref test
Assuming that my changes to make iframes delay the load event are
correct, and that nothing else was causing the flakiness, this test
should be OK now! (Famous last words.)
2023-12-01 10:28:02 +01:00
Sam Atkins
2805e16c1c LibWeb: Let NavigableContainers delay the document load event 2023-12-01 10:28:02 +01:00
Sam Atkins
72376ad15a LibWeb: Add special "potentially delay the load event" logic for iframes
`<iframe>`s only potentially delay the load event when their
`current_navigation_was_lazy_loaded` flag is false, so let's wire that
up to the flag's setter, and actually call it!
2023-12-01 10:28:02 +01:00
Sam Atkins
7f509317fd LibWeb: Allow NavigableContainers to report whether to delay load event
Four elements match the "potentially delay the load event" check in the
spec: `<embed>`, `<frame>`, `<iframe>`, and `<object>`. These four are
the same set of elements that are NavigableContainers (or will be once
we implement them) so let's put this logic there.

Note that other things can delay the load event, this is just the name
the spec gives to this particular behaviour.
2023-12-01 10:28:02 +01:00
Sam Atkins
6c5450f9ce LibWeb: Report if anything is delaying load event, not the count
Some elements that delay the load event are more complicated than a
simple count will allow for. We'll implement those in a bit!
2023-12-01 10:28:02 +01:00
Sam Atkins
6154681718 LibWeb: Flesh out some of process_the_iframe_attributes() 2023-12-01 10:28:02 +01:00
Sam Atkins
1d6f06b203 LibWeb: Make HTMLIFrameElement a LazyLoadingElement
This replaces its previous partial implementation of the lazy loading
scaffolding. It still doesn't actually load lazily yet.
2023-12-01 10:28:02 +01:00
Sam Atkins
cc633123ca LibWeb: Extract shared lazy-loading behavior into a base class
`<iframe>` and `<img>` tags share the same spec for several aspects of
lazy-loading: how the `loading` attribute works, the "will lazy load
element" steps, and a member for storing the lazy-load resumption
steps. So let's share the implementation by using a base class.

This mostly involves moving things around. However, we also change the
`start_intersection_observing_a_lazy_loading_element()` method to take
a LazyLoadingElement, and operate on one, instead of always casting to
HTMLImageElement.

We do unfortunately have to do some shenanigans to make the cast work,
by adding a virtual function stub in DOM::Element.
2023-12-01 10:28:02 +01:00
Aliaksandr Kalenik
cc2008ea0d LibWeb: Skip painting of empty stacking contexts in GPU painter
Fixes crashing on https://twinings.co.uk/ that was happening because
of 0 size texture allocation.
2023-12-01 09:28:10 +01:00
Aliaksandr Kalenik
c28f6828c9 LibAccelGfx+LibWeb: Support non-translation transforms in GPU painter
This change introduces GPU painter support for rotate(), skew(),
scale(), and other transformations that could be applied to stacking
context.
2023-12-01 09:28:10 +01:00
Daniel Bertalan
45d81dceed Everywhere: Replace ElfW(type) macro usage with Elf_type
This works around a `clang-format-17` bug which caused certain usages to
be misformatted and fail to compile.

Fixes #8315
2023-12-01 10:02:39 +02:00
Daniel Bertalan
2151e6c8b4 LibELF: Define ELFSIZE macro
This makes the rest of the `ELFABI.h` header define the
bit-width-independent `Elf_type` macros.
2023-12-01 10:02:39 +02:00
Aliaksandr Kalenik
961b067df8 LibWeb/CSS: Add support for translateZ() transform property 2023-11-30 22:54:02 +01:00
Maja Kądziołka
3ed48e6008 Kernel/HID: Don't refer to a USB mouse as PS2
Following 77441079dd, the code in Kernel/Devices/HID/MouseDevice.cpp
is used by both USB and PS2 rodents. Make sure not to emit misleading
debug messages that could suggest that a USB mouse is a PS/2 one.
2023-11-30 13:30:12 -07:00
Sönke Holz
173a085e48 Kernel: Only unmap prekernel on x86_64
Other arches don't use the prekernel, so don't try to unmap it on
non-x86 platforms.
For some reason, this didn't cause aarch64 to crash, but on riscv64 this
would cause a panic.
2023-11-30 13:14:18 -07:00
Sönke Holz
3852f4f136 Kernel: Only try to use VGA text mode on x86_64 2023-11-30 13:13:54 -07:00
Sönke Holz
93b6111f47 Kernel/aarch64: Unbreak RPi framebuffer boot console
342c707 introduced an additional check whether this flag is set
before trying to use the multiboot-provided framebuffer console.
2023-11-30 13:13:54 -07:00
Timothy Flynn
026363024f LibJS: Stub out Atomics.notify
We don't have the facilities to implement this method fully (namely, a
fully realized SharedArrayBuffer). But we can implement enough to
validate the values passed in by the user.
2023-11-30 09:51:46 -05:00
Timothy Flynn
78edaad97d LibJS: Stub out Atomics.wait and Atomics.waitAsync
We don't have the facilities to implement these methods fully (namely, a
fully realized SharedArrayBuffer). But we can implement enough to
validate the values passed in by the user.
2023-11-30 09:51:46 -05:00
Timothy Flynn
a7073c3f1f LibJS: Skip test262 tests with the CanBlockIsFalse flag
From test262 documentation, this flag means:

    The test file should only be run when the [[CanBlock]] property of
    the Agent Record executing the file is `false`.

This patch stubs out the accessor for that internal slot and skips tests
with the CanBlockIsFalse if that internal slot is true.
2023-11-30 09:51:46 -05:00
Timothy Flynn
a7ff65a0c6 LibWebView: Use querySelectorAll to find hoverable tree nodes
We don't need a live HTMLCollection here, so let's use querySelectorAll
to instead iterate over a static NodeList.
2023-11-30 14:08:53 +01:00
Timothy Flynn
030b90b79d LibWebView: Move the Inspector JS and CSS to independent files
These are much easier to work with in their own files with syntax
highlighting and other IDE-friendliness.
2023-11-30 14:08:53 +01:00
Timothy Flynn
353642168a LibWebView: Don't wait for the DOM and a11y trees to load the Inspector
Provides a nicer experience on pages with large trees so that the window
isn't just a large blank screen while it is loading. Instead, send the
trees to the Inspector WebView once they have arrived and have been
transformed to HTML.

We Base64 encode the HTML to avoid needing to deal with all kinds of
nested quotes that may appear in the HTML. We could instead send the
JSON to the WebView, but generating the HTML in C++ feels a bit easier
for now.
2023-11-30 14:08:53 +01:00
Andreas Kling
6c9912c341 LibGfx: Parse hex, rgb() and rgba() colors before named colors
This avoids doing a bunch of unnecessary string comparison work in case
we have something that can't be a named color anyway.
2023-11-30 10:36:40 +01:00
Aliaksandr Kalenik
504aef470a LibWeb: Restore painter state if push_stacking_context() has failed
If `SkipStackingContext` is returned we also need to restore saved
painter state because corresponding pop_stacking_context command that
is supposed to do that will be skipped.

Fixes https://github.com/SerenityOS/serenity/issues/22092
2023-11-30 10:32:33 +01:00
Stephan Vedder
2732dd3633 LibVideo: Fix string reading in Matroska
A string should never be longer than it's strlen according to
the specification
2023-11-30 08:53:05 +00:00
Stephan Vedder
1f55cc942d LibVideo: Add the concept of codec identifiers
This is required for detecting which decoder should be used.
Only a small subset of codecs identifiers is added for now
2023-11-30 08:53:05 +00:00
Timothy Flynn
ff48b7333c LibWeb: Remove shadow roots from elements that are removed from the DOM
We currently create a shadow tree once for each DOM element that renders
with a shadow tree (e.g. <input>, <details>). If such an element is
removed from the DOM, we must remove its shadow tree. Otherwise, the
shadow tree will refer to the old document in perpetuity.

If the node is added back to a DOM, then recreate the shadow tree.
2023-11-30 08:49:15 +00:00
Timothy Flynn
3cde479416 LibWeb: Add missing visitations to DOM::Document 2023-11-30 08:49:15 +00:00
Timothy Flynn
5913efbb45 LibWeb: Add a visit_edges() override to AbstractBrowsingContext
AbstractBrowsingContext has a subclass RemoteBrowsingContext without a
visit_edges() override (and it doesn't really need one). But currently,
we rely on subclasses visiting AbstractBrowsingContext's opener BC.

This adds a visit_edges() to AbstractBrowsingContext to explicitly visit
the opener BC itself.
2023-11-30 08:49:15 +00:00
Timothy Flynn
b54786ee95 LibJSGCVerifier: Use more general shebang line and clarify instructions
My system's python3 is not in /bin/.

The README did not indicate that a clang-toolchain build of Serenity is
required, so this patch adds that explicit instruction.
2023-11-30 08:49:15 +00:00
Andrew Kaster
0104c8d052 LibWeb: Handle window.open() when passed a navigable name 2023-11-29 23:07:37 +01:00
Kenneth Myhra
e3f5bbcbbe Tests/LibWeb: Move existing XHR Text tests in under the XHR folder 2023-11-29 21:51:35 +01:00
Kenneth Myhra
3d86e16407 Tests/LibWeb: Verify instantiation behavior of Blob w/empty constructor
This verifies that a Blob instantiated with an empty constructor creates
a Blob with Blob.size equal to 0 and Blob.type equal to "".
2023-11-29 21:51:35 +01:00
Kenneth Myhra
36fddab68e Tests/LibWeb: Verify XHR.response is an instance of Blob
This verifies that XHR.response is an instance of Blob when
XHR.responseType is set to 'blob'.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
09487679eb Tests/LibWeb: Verify XHR.response is an instance of Document
This verifies that XHR.response is an instance of Document when
XHR.responseType is set to 'document' and the response contains HTML.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
990f73708d Tests/LibWeb: Verify XHR.response is an instance of ArrayBuffer
This verifies that XHR.response is an instance of ArrayBuffer when
XHR.responseType is set to 'arraybuffer'.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
68fa8f52b4 Tests/LibWeb: Verify XHR.open() throws on forbidden method
This verifies that XHR.open() throws a Security Error when 'CONNECT',
'TRACE', or 'TRACK' is passed as the method argument.
2023-11-29 21:51:35 +01:00