Commit graph

23923 commits

Author SHA1 Message Date
Linus Groh
a2f1d79765 LibJS: Start implementing Temporal.Calendar
Just like the previous Temporal.{Instant,TimeZone} commits, this patch
adds the Calendar object itself, its constructor and prototype
(currently empty), and two required abstract operations.
2021-07-14 23:50:03 +01:00
Linus Groh
48b66c7a68 LibJS: Put Temporal.Instant.prototype member definitions in spec order 2021-07-14 23:50:03 +01:00
Linus Groh
6c8f0fbb35 LibJS: Use more specific return types for some Temporal AOs
Instead of returning Object* we should be specific and return Instant*,
TimeZone* etc.
2021-07-14 23:50:03 +01:00
Idan Horowitz
be475cd6a8 Kernel: Handle OOM when adding memory regions to Spaces :^) 2021-07-15 00:49:41 +02:00
Idan Horowitz
e94dfb7355 AK: Expose RedBlackTree allocation failures via try_insert
This should help with using the RedBlackTree in a more OOM-safe way in
the kernel.
2021-07-15 00:49:41 +02:00
Max Wipfli
a9a54914bf Tests: Add comments to the HTMLTokenizer regression test file 2021-07-15 00:48:45 +02:00
Max Wipfli
bb2aed7d76 LibWeb: Correct behavior of Comment* states in HTMLTokenizer
Previously, this would lead to assertion failures when parsing HTML
comments. This fixes #8757.
2021-07-15 00:48:45 +02:00
Max Wipfli
af0b483123 LibWeb: VERIFY an empty builder when emitting tokens in HTMLTokenizer 2021-07-15 00:48:45 +02:00
Timothy Flynn
1a3e1bff7b LibJS: Implement Atomics.isLockFree 2021-07-14 22:13:15 +01:00
Timothy Flynn
d9c2447999 AK: Add free function to wrap around __atomic_is_lock_free built-in
Note: this exact implementation is needed for __atomic_is_lock_free to
link with both GCC (for the SerenityOS build) and Clang (for the Fuzzer
build). The size argument must be a compile-time constant, otherwise it
fails to link with both compilers. Alternatively, the following
definition links with GCC but fails with Clang:

    template<size_t S>
    static inline bool atomic_is_lock_free(volatile void* ptr = nullptr)
    {
        return __atomic_is_lock_free(S, ptr);
    }
2021-07-14 22:13:15 +01:00
Timothy Flynn
33eb830929 LibJS: Implement Atomics.compareExchange 2021-07-14 22:13:15 +01:00
Timothy Flynn
655ffce64d LibJS: Implement Atomics.exchange 2021-07-14 22:13:15 +01:00
Gunnar Beutner
7236584132 Kernel: Make kernel symbols available much earlier in the boot process
This adds a new section .ksyms at the end of the linker map, reserves
5MiB for it (which are after end_of_kernel_image so they get re-used
once MemoryManager is initialized) and then embeds the symbol map into
the kernel binary with objcopy. This also shrinks the .ksyms section to
the real size of the symbol file (around 900KiB at the moment).

By doing this we can make the symbol map available much earlier in the
boot process, i.e. even before VFS is available.
2021-07-14 23:04:34 +02:00
Max Wipfli
5a44a0b9f4 Tests: Add a basic test suite for HTMLTokenizer
The test suite includes a few basic tests and a very crude regression
test, which just concatenates the to_string() of all tokens and checks
the String's hash to be equal. This relies on the format of
HTMLToken::to_string() to stay the same, which is not ideal.
2021-07-14 23:03:36 +02:00
Max Wipfli
045a6a566b LibWeb: Remove unused HTMLTokenizer::m_input member variable 2021-07-14 23:03:36 +02:00
Max Wipfli
35f32ac170 LibWeb: Change HTMLToken.h to east const style 2021-07-14 23:03:36 +02:00
Max Wipfli
125982943a LibWeb: Change HTMLTokenizer.{cpp,h} to east const style 2021-07-14 23:03:36 +02:00
Gunnar Beutner
300823c314 LibWeb: Use move() when enqueuing tokens in HTMLTokenizer
We're not using the current token anymore once it's enqueued so let's
use move() when enqueuing the tokens.
2021-07-14 23:03:36 +02:00
Gunnar Beutner
c3ad8e9a52 LibWeb: Remove StringBuilder from HTMLToken::m_comment_or_character 2021-07-14 23:03:36 +02:00
Gunnar Beutner
3aa202c432 LibWeb: Remove StringBuilder from HTMLToken::m_tag 2021-07-14 23:03:36 +02:00
Gunnar Beutner
901d71148b LibWeb: Remove StringBuilders from HTMLToken::AttributeBuilder 2021-07-14 23:03:36 +02:00
Gunnar Beutner
992964aa7d LibWeb: Remove StringBuilders from HTMLToken::m_doctype 2021-07-14 23:03:36 +02:00
Gunnar Beutner
2150609590 LibWeb: Remove more unused StringBuilders in HTMLToken
These fields aren't read anywhere but I didn't feel like removing
them outright.
2021-07-14 23:03:36 +02:00
Gunnar Beutner
d9e52997e2 LibWeb: Use an Optional<String> to track the last HTML start tag
Using an HTMLToken object here is unnecessary because the only
attribute we're interested in is the tag_name.
2021-07-14 23:03:36 +02:00
Gunnar Beutner
d92548c5b0 AK: Avoid pagefaults when repeatedly enqueing/dequeing items in a Queue
When repeatedly enqueing and dequeing a single item in a Queue we end
up faulting in all the pages for the underlying Vector. This is a
performance issue - especially where the element type is large.
2021-07-14 23:03:36 +02:00
Gunnar Beutner
3ff0a3aa4b AK: Avoid allocations for the Queue class
Previously the Queue class used a SinglyLinkedList to manage its queue
segments. This changes the Queue class to use the IntrusiveList class
instead which saves us one allocation per segment.
2021-07-14 23:03:36 +02:00
Andreas Kling
859e5741ff Kernel: Fix Process use-after-free in Thread finalization
We leak a ref() onto every user process when constructing them,
either via Process::create_user_process(), or via Process::sys$fork().

This ref() is balanced by a corresponding unref() in
Thread::WaitBlockCondition::finalize().

Since kernel processes don't have a leaked ref() on them, this led to
an extra Process::unref() on kernel processes during finalization.
This happened during every boot, with the `init_stage2` process.

Found by turning off kfree() scrubbing. :^)
2021-07-14 22:36:29 +02:00
Timothy Flynn
6211eb0f9a LibJS: Implement Atomics.store 2021-07-14 20:44:42 +01:00
Timothy Flynn
b6364ec899 LibJS: Implement Atomics.xor 2021-07-14 20:44:42 +01:00
Timothy Flynn
d2f6255b91 LibJS: Implement Atomics.sub 2021-07-14 20:44:42 +01:00
Timothy Flynn
f9d8e234b2 LibJS: Implement Atomics.or 2021-07-14 20:44:42 +01:00
Timothy Flynn
2d3af5c1b4 LibJS: Implement Atomics.and 2021-07-14 20:44:42 +01:00
Timothy Flynn
940875c9fd LibJS: Implement Atomics.load 2021-07-14 20:44:42 +01:00
Timothy Flynn
cc3b96743a LibJS: Implement Atomics.add 2021-07-14 20:44:42 +01:00
Timothy Flynn
ba2c3731e9 LibJS: Make ValidateTypeArray abstraction public
Also adds a typed_array_from helper for casting a known value to a
TypedArray.
2021-07-14 20:44:42 +01:00
Timothy Flynn
4f8f79c5ca LibJS: Add some TypedArray abstractions for querying underlying type
IsUnclampedIntegerElementType and IsBigIntElementType.
2021-07-14 20:44:42 +01:00
Timothy Flynn
f4ea6b1824 LibJS: Implement TypedArray GetModifySetValueInBuffer abstract operation 2021-07-14 20:44:42 +01:00
Timothy Flynn
a61723ec59 LibJS: Begin implementing Atomics
This adds the Atomics object to the global object and sets up only its
@@toStringTag property.
2021-07-14 20:44:42 +01:00
Timothy Flynn
df75c35d5b LibJS: Alphabetically sort LibJS's CMakeLists.txt 2021-07-14 20:44:42 +01:00
Sam Atkins
fa7a6fbedd Meta: Fix SPICE detection in run.sh
The previous fix did not work for me, but this does. :^)

Credit goes to @X-yl for actually figuring it out.
2021-07-14 21:17:56 +02:00
Kenneth Myhra
7fa71fb7eb Documentation: Remove '$' character from build instruction commands
This removes the '$' character so that it is easier to copy commands
directly from the build instructions and then executing them without
first having to remove the '$' character.
2021-07-14 19:51:23 +02:00
Karol Kosek
1c30f0a154 Browser: Escape an ampersand in the menu to avoid making a shortcut 2021-07-14 18:25:36 +02:00
Karol Kosek
871c51dfd3 LibGfx: Don't underline escaped ampersand in menus
Double ampersands (&&) marking in menus is meant to provide a way
to show the ampersand, since using just one would turn it
into a modifier that sets the shortcut for the next character.

Unfortunately, while the first character had a special case to avoid
marking this set, the marking was still calculated
for the second character.

The fix is rather simple: just skip then the following character!

This issue applied only to the visual part of the Menu.
The WindowServer calculation for the shortcut character is working
properly, i.e. ignores escaped ampersands.
2021-07-14 18:25:36 +02:00
Tom
c144d358ae ResourceGraph: Handle more than 4 GiB of memory 2021-07-14 18:24:55 +02:00
x-yl
410eb9e9ff Meta: Don't use SPICE if QEMU doesn't support it
I do seem to have a tendency for breaking everyone's builds :/
2021-07-14 17:17:06 +02:00
Timothy Flynn
f7acd6aca5 LibWeb: Handle when the last selected node does not contain text
If the text-for-rendering of the last selected node is empty, the select
all implementation would end up setting the index to -1. This value is
used directly for a substring length in the copy text implementation,
thus would cause a failed assertion.
2021-07-14 17:16:39 +02:00
Timothy Flynn
22ab512f39 LibWeb: Remove now-duplicated actions from IPWV regarding text selection 2021-07-14 17:16:39 +02:00
Timothy Flynn
615a1c7210 Browser: Add context menu item for selecting all text 2021-07-14 17:16:39 +02:00
Timothy Flynn
ae910e4370 LibWeb: Add OOPWV IPC for selecting all text 2021-07-14 17:16:39 +02:00
Timothy Flynn
fea7e84b26 LibWeb: Move select-all implementation to BrowsingContext 2021-07-14 17:16:39 +02:00