Commit graph

27833 commits

Author SHA1 Message Date
Karol Kosek aa06012249 Meta: Add my new serenityos.org email to .mailmap :^) 2021-09-18 23:58:23 +02:00
Idan Horowitz e00ca10283 LibJS: Convert ListFormat AOs to ThrowCompletionOr 2021-09-18 22:59:15 +03:00
Idan Horowitz e65aeee67d LibJS: Convert DisplayNames AOs to ThrowCompletionOr 2021-09-18 22:59:15 +03:00
Idan Horowitz 768009e005 LibJS: Convert NumberFormat AOs to ThrowCompletionOr 2021-09-18 22:59:15 +03:00
Przemysław R. Kusiak c6e23e45c5 Kernel: Let MouseDevice and KeyboardDevice write method return EINVAL
Currently, writing anything to `/dev/mouse0` or `/dev/keyboard0` causes
the Kernel to panic. The reason for this is that
`[Mouse,Keyboard]Device::write` always returns 0, which is explicitly
prohibited by `VERIFY` macro in `Process::sys$write`.  The fix seems
trivial; `write` should return EINVAL instead (as is the case with, for
example, `KCOVDevice`).
2021-09-18 22:57:42 +03:00
Tobias Christiansen 6e1f6bd684 LibWeb: Add transform: translateY() support
This is very naive.
2021-09-18 21:53:37 +02:00
Tobias Christiansen 9ebfafafbe LibWeb: Add transform property to the system
This patch adds parsing support as well as all the needed stuctures all
over LibWeb to pass Transformations around.
2021-09-18 21:53:37 +02:00
Andreas Kling 74b88a8156 LibWeb: Implement window.location.port
This returns the port of the current document's URL. :^)
2021-09-18 21:48:44 +02:00
Idan Horowitz 407cf04884 LibJS: Convert get_number_option() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz 6d3de03549 LibJS: Convert default_number_option() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz b9c7a629f8 LibJS: Convert coerce_options_to_object() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz d0e5fc4576 LibJS: Convert supported_locales() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz de9785b71b LibJS: Convert Intl::get_option() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz 3758e65293 LibJS: Convert canonicalize_locale_list() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Linus Groh 5426901521 Ports: Update Python to 3.10.0rc2
Released on 2021-09-07.
https://www.python.org/downloads/release/python-3100rc2/
2021-09-18 21:20:18 +02:00
Brian Gianforcaro c5cdb6eb4c LibDebug: Dont copy an AbbreviationEntry every time we retrieve a value
These API's are used in a variety of ways when building the die cache.
Each AbbreviationEntry has vector and other members, so avoid copying
it at all costs.
2021-09-18 21:05:13 +02:00
Brian Gianforcaro 952441943f LibDebug: Avoid short lived allocations in DIE::for_each_child
This algorithm is both iterative and recursive, so allocating on every
recursion, or when iterating each child is extremely costly.

Instead allow the on stack DIE to be re-initialized so it can be reused.
2021-09-18 21:05:13 +02:00
Andreas Kling 19c492e976 LibWeb: Avoid unnecessary padded_rect() call in Box::paint()
We were computing the padded rect of the box during every paint phase,
despite only needing it in the Overlay phase.

Since this is an expensive call, let's take care not to make it
unnecessarily.
2021-09-18 20:07:38 +02:00
Andreas Kling 76bafe5542 LibJS: Always inline two hot (and trivial) functions in JS::Lexer
This improves parsing time on a large chunk of JS by ~5%.
2021-09-18 19:54:24 +02:00
Andreas Kling 33f038ba7a LibJS: Add fast failure path to try_parse_labelled_statement()
If the next token isn't a TokenType::Colon (:), this can't possibly be a
labelled statement, so we can fail before having to save_state().

This improves parsing time on a large chunk of JS by ~12.5%.
2021-09-18 19:54:24 +02:00
Andreas Kling 8bde4e94d8 LibJS: Make Lexer::s_keywords store keywords as FlyString
This allows O(1) comparison against lexed keywords, since we lex to
FlyString.
2021-09-18 19:54:24 +02:00
Andreas Kling bf46845819 LibJS: Avoid a temporary AK::String when lexing already-seen identifiers
By using the FlyString(StringView) constructor instead of the
FlyString(String) one, we can dodge a temporary String construction.

This improves parsing time on a large chunk of JS by ~1.6%.
2021-09-18 19:54:24 +02:00
Andreas Kling 391352c112 AK: Inline all the trivial Utf8View functions
This improves parsing time on a large chunk of JS by ~3%.
2021-09-18 19:54:24 +02:00
Andreas Kling 1be4cbd639 AK: Make Utf8View constructors inline and remove C string constructor
Using StringView instead of C strings is basically always preferable.
The only reason to use a C string is because you are calling a C API.
2021-09-18 19:54:24 +02:00
Andreas Kling 291dbff2e1 LibWeb: Remove the unused LayoutTreeModel
If we want to bring back this functionality, we'll have to rewrite it
for multi-process mode anyway.
2021-09-18 19:54:24 +02:00
Brian Gianforcaro aa118642aa Lagom/Fuzzers: Add fuzzer for the LibCrypto PEM parser 2021-09-18 17:15:08 +00:00
Brian Gianforcaro 4f5d71b4e8 Lagom/Fuzzers: Add fuzzer for the LibTLS ASN1 parser 2021-09-18 17:15:08 +00:00
Liav A 3f5a6be69f Documentation: Add the new supported RTL8168 variants to the list 2021-09-18 17:49:24 +03:00
Liav A 23ef46f4f7 Kernel/Net: Enable usage of RTL8168E and RTL8168H in RTL8168 driver
I tested both (version 15 and 30 of the RTL8168 chipset) with PCI-
passthrough of these cards, and they seem to work just fine with the
driver.
2021-09-18 17:49:24 +03:00
Liav A 86fa5d71c0 Kernel/Memory: Add more super pages to satisfy contiguous allocations
When testing the RTL8168 driver, it seems we can't allocate super pages
anymore. Either we expand the super pages range, or find a solution to
dynamically expand the range (or let drivers utilize other ranges).
2021-09-18 17:49:24 +03:00
Itamar a27716846f HackStudio: Make sure Window is destroyed before Application object
We previously stored the Window object in a global RefPtr (for no
apparent reason).

This led to a use-after-free bug in the Window's destructor when
HackStudio was exited via the Quit action (Exiting by closing the
window did not trigger this bug).
2021-09-18 16:45:50 +02:00
Tobias Christiansen d104885757 LibWeb: Flexbox: Assume Block when finding max main size of flex-column
This is a hack, but it seems to do quite okay.

What we should do is to find the largest size the Box could want in its
main axis. To do that we have to layout the Box according to the needed
LayoutMode. For flex-rows we do as requested and try to make the Box as
wide as we want.
However, for flex-columns we simply assume the Box is a Block and we
calculate their height according to this.
2021-09-18 15:50:47 +02:00
Tobias Christiansen ddb7402649 LibWeb: Also avoid setting definite size for height
This patch patches ef22a1b to also check for is_auto() on the height
property when setting definite_height.
2021-09-18 15:50:47 +02:00
Andrew Kaster aed56b46d4 Documentation: Update Lagom ReadMe with new fuzzer build instructions 2021-09-18 16:38:59 +03:00
Liav A d19bd59e28 Kernel/Storage: Tidy up RamdiskDevice class 2021-09-18 15:05:51 +03:00
Linus Groh f90d98aef0 LibJS: Update step order in the InterpretTemporalDateTimeFields AO
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/be88667
2021-09-18 13:38:48 +02:00
Andreas Kling 99f9667e5d LibWeb: Simplify ComputedCSSStyleDeclaration property lookup
Factor out the per-property StyleValue generation to a separate function
so we don't have to repeat ourselves so much in property(). :^)
2021-09-18 13:14:40 +02:00
Andreas Kling 1735d978ed LibWebSocket: Use deferred_invoke() when discarding a connection
We don't want to destroy the WebSocketImpl while we're still using it
higher up the stack. By using deferred_invoke(), we allow the stack
to unwind before actually destroying any objects.

This fixes an issue with the WebSocket service crashing on immediate
connection failure.
2021-09-18 12:57:58 +02:00
Andreas Kling f82c4c4137 LibWebSocket: Fix confusion about sizeof(size_t) on 64-bit platforms
sizeof(size_t) is 8 on 64-bit platforms, not 64.
2021-09-18 12:51:31 +02:00
Andreas Kling 00895a5789 LibWebSocket: Fix a handful of clang-tidy warnings in WebSocket.{cpp,h} 2021-09-18 12:48:34 +02:00
Andreas Kling 4e47e6d578 LibWeb: Use floating-point math for border-radius rendering
We're still limited by Gfx::Painter here, but we can at least do most
of the LibWeb things in floating-point math.
2021-09-18 12:21:42 +02:00
Andreas Kling f6a2d6af0b LibGfx: Add Point<T>::to_rounded<U>() 2021-09-18 12:21:42 +02:00
Mustafa Quraish 441e601689 ClipboardHistory: Listen for configuration changes
Resize the clipboard history size dynamically by listening for config
changes. This is currently not ideal since we don't have the callbacks
for `Config::Listener::config_i32_did_change`, so for now we are just
taking the string and attempting to convert it to an int.
2021-09-18 03:33:25 +00:00
Mustafa Quraish b1a3bb638b ClipboardHistory: Use config file to set number of history items
The number of items in history was hardcoded to 20 earlier, now
we try to load this value from a config file. The default if none
is available is still 20.
2021-09-18 03:33:25 +00:00
Tim Schumacher b9979e9a59 LibC: Implement most langinfo values mentioned in POSIX 2021-09-18 03:12:58 +00:00
Tim Schumacher b8c756a53a LibC: Primitively implement wcscoll
At the moment, sorting like LC_COLLATE=C would do is better than
nothing.
2021-09-18 02:57:56 +00:00
Jean-Baptiste Boric 8043fcd466 LibC: Don't format strings when asserting with an unstable heap
If we hit an assertion while the heap isn't in a stable state, we can't
rely on dynamic memory allocation because the malloc mutex is already
held and the heap is most likely corrupted. Instead, we need to bail
out fast before we make the situation even worse.
2021-09-18 01:35:11 +00:00
Andreas Kling e215580147 LibWeb: Don't attempt to run unparsed scripts 2021-09-18 01:39:59 +02:00
Andreas Kling 0bb680bacd LibWeb: Remove bogus offset when painting an SVG <path> box 2021-09-18 01:39:59 +02:00
Andreas Kling 684f7cca9f LibWeb: Implement very naive layout of <path> within <svg> 2021-09-18 01:39:59 +02:00