Commit graph

49180 commits

Author SHA1 Message Date
Matthew Olsson f9d6a161e8 LibWeb: Add ByteStreamController to ReadableStreamController type 2023-04-14 13:03:34 +02:00
Matthew Olsson bd7809cc18 LibWeb: Mostly implement ReadableByteStreamController.[[ReleaseSteps]] 2023-04-14 13:03:34 +02:00
Matthew Olsson 51abecc8bc LibWeb: Mostly implement ReadableByteStreamController.[[PullSteps]] 2023-04-14 13:03:34 +02:00
Matthew Olsson c97f6b7701 LibWeb: Implement ReadableByteStreamController.[[CancelSteps]] 2023-04-14 13:03:34 +02:00
Matthew Olsson 8274906301 LibWeb: Expose ReadableStream::m_state and use in AOs
This allows us to be a bit closer to the spec phrasing and matches
what we do with WritableStream
2023-04-14 13:03:34 +02:00
Ali Mohammad Pur eba466b8e7 LibRegex: Avoid calling GenericLexer::consume() past EOF
The consume(size_t) overload consumes "at most" as many bytes as
requested, but consume() consumes exactly one byte.
This commit makes sure to avoid consuming past EOF.

Fixes #18324.
Fixes #18325.
2023-04-14 12:33:54 +02:00
Luke Wilde 821702fadd LibWeb: Set Comment's prototype
This makes YouTube's thumbnails start appearing on the homepage.
Yes,seriously.

Simply put, this is because this check failed when Comment had the
incorrect prototype:
90cb97f847/packages/shadycss/src/style-util.js (L397)

This causes it to try and reconvert style sheets that are already in
Shady format, which would cause it to spuriously add things such as
class selectors on the end of tag selectors. This caused nothing to
match the selectors.

When YouTube is generating the thumbnails, it checks if the thumbnail
grid container has a non-zero clientWidth. If it's zero, it simply
bails generating thumbnails. Since the selectors for this container did
not apply, we would not properly create a paint box for it, causing
clientWidth to return zero.
2023-04-14 12:30:43 +02:00
Tim Schumacher 18565dd286 Ports/llvm: Increase the default stack size for LLVM executables 2023-04-14 10:05:05 +02:00
Tim Schumacher b1136ba357 AK: Efficiently resize CircularBuffer seekback copy distance
Previously, if we copied the last byte for a length of 100, we'd
recalculate the read span 100 times and memmove one byte 100 times,
which resulted in a lot of overhead.

Now, if we know that we have two consecutive copies of the data, we just
extend the distance to cover both copies, which halves the number of
times that we recalculate the span and actually call memmove.

This takes the running time of the attached benchmark case from 150ms
down to 15ms.
2023-04-14 10:03:42 +02:00
Matteo Benetti 3e1626acdc Spreadsheet+LibSyntax: Never insert spans directly
Function `CellSyntaxHighlighter::rehighlight()` direct inserted spans
to TextDocument `m_span` vector missing out important reordering and
merging operation carried out by `TextDocument::set_spans()`.

This caused overlapping spans for a cell with only a `=` symbol
(one for the actual token and one for the highlighting) to
miscalculate `start` and `end` value and a `length` value (of
`size_t` type) with a `0-1` substraction (result: 18446744073709551615)
causing `Utf32View::substring_view()` to fail the
`!Checked<size_t>::addition_would_overflow(offset, length)` assertion

This remove the possibility to directly alter `TextDocument`'s spans
thus forcing the utilization of `HighlighterClient::do_set_spans()`
interface function.

Proper refactor have been applied to
`CellSyntaxHighlighter::rehighlight()` function
2023-04-14 10:00:52 +02:00
Cubic Love fb47b988ca Base: Add US English Apple Macintosh keymap
Add the full alt + shift-alt keymap for the EN-US Apple Keyboard Layout
2023-04-14 10:00:06 +02:00
Linus Groh 89503a0cfe LibJS: Port PrototypeObject::typed_this_value() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh a23dd88f61 LibJS: Port PrototypeObject::typed_this_object() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh 15360e50d3 LibJS: Port PrototypeObject::this_object() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh b33b0d60e6 LibJS: Port Value::get_method() to GCPtr 2023-04-14 09:59:29 +02:00
Linus Groh 9279b0780d LibJS: Port Value::to_bigint() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh f345f72b55 LibJS: Port Value::to_object() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh e79f5b6e85 LibJS: Port Value::to_primitive_string() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Srikavin Ramkumar 04198a29a8 Base: Fix typo in cursor test page 2023-04-14 09:57:49 +02:00
Srikavin Ramkumar 627d68acdf Ladybird: Display Qt cursors corresponding to missing CSS cursors 2023-04-14 09:57:49 +02:00
Srikavin Ramkumar 33686c8a63 LibWeb: Support NotAllowed CSS cursor 2023-04-14 09:57:49 +02:00
Timon Kruiper 957f89ce4a AK: Add very naive implementation of {sin,cos,tan} for aarch64
The {sin,cos,tan} functions in AK are used as the implementation of the
same function in libm. We cannot use the __builtin_foo functions as
these would just call the libc functions. This was causing an infinite
loop. Fix this by adding a very naive implementation of
AK::{sin, cos,tan}, that is only valid for small inputs. For the other
functions in this file, I added a TODO() such that we'll crash, instead
of infinite looping.
2023-04-13 20:24:25 +02:00
Timon Kruiper 9ed04bdb33 Kernel/aarch64: Add implementation of Processor::for_each 2023-04-13 20:24:25 +02:00
Timon Kruiper 4927eb5396 Kernel/aarch64: Change RPi::Framebuffer::PixelOrder to BGR
This is what the WindowServer expects. Confusingly the pixel format for
MULTIBOOT_FRAMEBUFFER_TYPE_RGB is actually BGRx8888.
2023-04-13 20:22:08 +02:00
Timon Kruiper baa5cb9e30 Kernel/aarch64: Add volatile modifier to various asm statements
This prevents the optimizer from reordering them, which hopefully
prevents future bugs.
2023-04-13 20:22:08 +02:00
Timon Kruiper 10030038e9 Kernel/aarch64: Make sure no reordering of DAIF::read is possible
We were crashing on the VERIFY_INTERRUPTS_DISABLED() in
RecursiveSpinlock::unlock, which was caused by the compiler reordering
instructions in `sys$get_root_session_id`. In this function, a SpinLock
is locked and quickly unlocked again, and since the lock and unlock
functions were inlined into `sys$get_root_session_id` and the DAIF::read
was missing the `volatile` keyword, the compiler was free to reorder the
reads from the DAIF register to the top of this function. This caused
the CPU to read the interrupts state at the beginning of the function,
and storing the result on the stack, which in turn caused the
VERIFY_INTERRUPTS_DISABLED() assertion to fail. By adding the `volatile`
modifier to the inline assembly, the compiler will not reorder the
instructions.

In aa40cef2b7, I mistakenly assumed that the crash was related to the
initial interrupts state of the kernel threads, but it turns out that
the missing `volatile` keyword was the actual problem. This commit also
removes that code again.
2023-04-13 20:22:08 +02:00
Tom 7795b7bc17 WindowServer: Refactor window geometry overlay rect calculation logic
This moves the ideal overlay rect calculation into its own function.
2023-04-13 20:18:49 +02:00
Tom e1077ebbad WindowServer: Prevent some overdraw by the window geometry overlay
While the window geometry overlay is centered inside the tile overlay
neither the text nor the location change, so there is no need to
re-render and update it every time the window moves.
2023-04-13 20:18:49 +02:00
Tom 5a73691fe9 WindowServer: Move window geometry label into the tile overlay area
This moves the window geometry overlay into the center of the
tile window overlay when it's visible or when it moves.
2023-04-13 20:18:49 +02:00
Tom fe54a0ca27 WindowServer: Implement tile window overlay
This adds a tiling mode that will show a tile window overlay rather
than immediately tiling a window, triggering window resizes.
2023-04-13 20:18:49 +02:00
Tom 035b0f9df6 LibGfx: Add Rect::interpolated_to function
This function interpolates the edges between the rectangle and another
rectangle based on a percentage value.
2023-04-13 20:18:49 +02:00
Tom 9ff1fa1cf3 WindowServer: Fix some gliches when overlays are moved or removed
Keep track of areas that overlays were rendered to when we recompute
occlusions. This allows us to then easily figure out areas where
overlays were moved from or removed from.
2023-04-13 20:18:49 +02:00
Tom 426d1b7410 WindowServer: Only register animations when they're running
This allows us to keep Animation objects around, and the compositor
will only use them when the animation is actually running.
2023-04-13 20:18:49 +02:00
Tom fa7f9b0f35 WindowServer: Fix calculating tile rect on secondary screens
The screen rectangle's origin is only {0, 0} on the main screen, so
we need to move the tile rectangle relative to its location.
2023-04-13 20:18:49 +02:00
Tom 6f9c5b71fd WindowServer: Use enum class for Effects and ShowGeometry 2023-04-13 20:18:49 +02:00
Luke Wilde 2125464b76 LibWeb: Don't match the root node of HTMLCollection
Every user of HTMLCollection does not expect the root node to be a
potential match, so let's avoid it by using non-inclusive sub-tree
traversal. This avoids matching the element that getElementsByTagName
was called on for example, which is required by Ruffle:
da689b7687/web/packages/core/src/ruffle-object.ts (L321-L329)
2023-04-13 18:24:18 +02:00
Timothy Flynn f80c05424e LibLocale: Update to CLDR version 43.0.0
https://cldr.unicode.org/index/downloads/cldr-43
2023-04-13 18:22:04 +02:00
Timothy Flynn 0b69e9f974 LibLocale: Prepare locale data generator for breaking changes in CLDR 43
In CLDR 42 and earlier, we were able to assume all cldr-localename files
existed for every locale. They now do not exist for locales that don't
provide any localized data. Namely, this is the "und" locale (which is
an alias for the root locale, i.e. the locale we fall back to when a
user provides an unknown locale).

Further, we were previously able to assume that each currencies.json in
cldr-numbers contained all currencies. This file now excludes currencies
whose localized names are the same as the currency key. Therefore, we
now preprocess currencies.json to discover all currencies ahead of time,
much like we already do for languages.json.
2023-04-13 18:22:04 +02:00
Linus Groh 259a84b7b6 Documentation: Document preference for SCREAMING_CASE constants 2023-04-13 15:57:30 +02:00
Andreas Kling 01ca7e0544 LibWeb: Whine instead of dying on unexpected box during line layout
Log a FIXME on the debug log, along with a layout tree dump of the box
that we didn't expect to see. This will be annoying (until fixed),
but far less so than crashing the browser.
2023-04-13 14:30:16 +02:00
Linus Groh 2555d7a36a LibJS: Make well-known symbol getters return NonnullGCPtr
None of these are ever null after the VM has been initialized, as proved
by virtually every caller immediately dereferencing the raw pointer.
2023-04-13 14:29:42 +02:00
Linus Groh b84f8fb55b LibJS: Make intrinsics getters return NonnullGCPtr
Some of these are allocated upon initialization of the intrinsics, and
some lazily, but in neither case the getters actually return a nullptr.

This saves us a whole bunch of pointer dereferences (as NonnullGCPtr has
an `operator T&()`), and also has the interesting side effect of forcing
us to explicitly use the FunctionObject& overload of call(), as passing
a NonnullGCPtr is ambigous - it could implicitly be turned into a Value
_or_ a FunctionObject& (so we have to dereference manually).
2023-04-13 14:29:42 +02:00
Linus Groh ed9e2366da LibJS: Add spec comments to WeakSetPrototype 2023-04-13 13:04:44 +02:00
Linus Groh bccffed7e9 LibJS: Add spec comments to WeakSetConstructor 2023-04-13 13:04:44 +02:00
Linus Groh 77fc05afd6 LibJS: Add spec comments to WeakRefPrototype 2023-04-13 13:04:44 +02:00
Linus Groh 7c9f1dcced LibJS: Add spec comments to WeakRefConstructor 2023-04-13 13:04:44 +02:00
Linus Groh 7bf92b5c3b LibJS: Add spec comments to WeakMapPrototype 2023-04-13 13:04:44 +02:00
Linus Groh 627dc1b88b LibJS: Add spec comments to WeakMapConstructor 2023-04-13 13:04:44 +02:00
Linus Groh 89bcc05a0d LibJS: Add spec comments to TypedArrayPrototype 2023-04-13 13:04:44 +02:00
Linus Groh aefa053473 LibJS: Add spec comments to TypedArrayConstructor 2023-04-13 13:04:44 +02:00