Commit graph

56953 commits

Author SHA1 Message Date
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
Kenneth Myhra
eb6a7ccc59 Tests/LibWeb: Verify XHR.open() throws on illegal token in method arg
This verifies that XHR.open() throws a Syntax Error if an illegal token
is passed to the method argument.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
ff05f19c84 Tests/LibWeb: Verify XHR.send() throws when called twice
This verifies that XHR.send() throws an Invalid State Error when called
twice.
2023-11-29 21:51:35 +01:00
Kenneth Myhra
ac82585ae7 Tests/LibWeb: Verify XHR.send() throws when XHR.readyState is UNSENT
This verifies that an Invalid State Error is being thrown when
XHR.open() has not been called before calling XHR::send().
2023-11-29 21:51:35 +01:00
Aliaksandr Kalenik
7a0191cbe9 LibWeb: Clear texture allocated for stacking context painting
In OpenGL newly allocated texture has undefined initial state so we
need to clear it before stacking context painting.
2023-11-29 21:49:23 +01:00
Aliaksandr Kalenik
24da32c884 LibAccelGfx+LibWeb: Store state of all stacking contexts in GPU painter
This change ensures that the GPU painting executor follows the pattern
of the CPU executor, where the state is stored for each stacking
context, but a painter is created only for those with opacity.

Fixes crashing on apple.com because now save() and restore() are called
on correct painters.
2023-11-29 21:48:47 +01:00
Aliaksandr Kalenik
9a66f31b64 LibAccelGfx: Deallocate VAO and VBOs in fill_rect_with_linear_gradient
Fixes memory leak in fill_rect_with_linear_gradient()
2023-11-29 21:47:43 +01:00
Michiel Visser
495b0f2bcc LibTLS: Improve message when root certificate is invalid
Currently there is one root certificate which has expired, but it does
not have a common name, so we are simply printing "Certificate for  by
is invalid, ...", which is less than useful. Instead we just print the
complete subject now, and remove printing the issuer, as root
certificates are always self-signed.
2023-11-29 18:17:14 +03:30
Michiel Visser
000f0274e2 LibCrypto: Fix SECP384r1 verification when hash is SHA256
Some websites actually provide a SECP384 certificate which is signed
using a SHA256 hash. We assumed that SECP384 always used a SHA384 hash,
but this is not the case.
2023-11-29 18:17:14 +03:30
Timothy Flynn
6eadf4a778 LibWebView: Remove now-unused PropertyTableModel 2023-11-29 13:56:35 +01:00
Timothy Flynn
5fcb3dfb2c LibWebView: Remove now-unused callback to override property tables 2023-11-29 13:56:35 +01:00
Timothy Flynn
cd0f5087a7 Ladybird/AppKit: Port the Inspector to the WebView property tables 2023-11-29 13:56:35 +01:00
Timothy Flynn
b5d5e48ffc Ladybird/Qt: Port the Inspector to the WebView property tables 2023-11-29 13:56:35 +01:00
Timothy Flynn
0037fdaf11 Browser: Port the Inspector to the WebView property tables 2023-11-29 13:56:35 +01:00
Timothy Flynn
ad9dfffda7 LibWebView: Support generating property tables in the Inspector
Since all chromes currently show their own tables, this is opt-out until
they are updated to use the WebView tables.
2023-11-29 13:56:35 +01:00
Timothy Flynn
6fc189ea4a LibWebView: Generalize the generated Inspector for another tab container
The Inspector will have a split view, where the top view is that of the
exisiting DOM and accessibility trees, and the bottom view is that of
the currently inspected node's style properties. This patch generalizes
some of the generated code to support having these 2 views.
2023-11-29 13:56:35 +01:00
Timothy Flynn
2891633877 Meta: Port recent changes to the GN build
9836a9ad0e
bc9cdd4394
28723d8be1
f4a5c136c3
2023-11-29 13:56:35 +01:00
Aliaksandr Kalenik
707added91 LibAccelGfx: Premultiply linear gradient colors by alpha
With this change color blending for gradients matches CPU painter.
2023-11-29 13:53:23 +01:00
Andreas Kling
be8952b89d LibJS: Remove pointless Vector copy in FDI 2023-11-29 09:48:18 +01:00
Andreas Kling
aaa7b50f06 LibJS: Skip lexical declaration traversal in FDI if there are none 2023-11-29 09:48:18 +01:00
Andreas Kling
3b6785245f LibJS: Don't call shrink_to_fit() on same environment twice in FDI 2023-11-29 09:48:18 +01:00
Andreas Kling
3fc0333ee6 LibJS: Put Bytecode::CallFrame + register slots in a single allocation
The number of registers in a call frame never changes, so we can
allocate it at the end of the CallFrame object and save ourselves the
cost of allocating separate Vector storage for every call frame.
2023-11-29 09:48:18 +01:00