Commit graph

29072 commits

Author SHA1 Message Date
Linus Groh 3f311ec0ac LoginServer: Fix typo in --auto-login option value name 2021-10-19 17:58:04 +01:00
Nícolas F. R. A. Prado 72f1e23e6b ImageViewer: Use scaled image size when resizing window to fit it
When the image is flipped or rotated, the window is resized to ensure
that the image still fits in the frame. However, currently the original
bitmap rect is used, which doesn't take into account the scaling
factor. Fix this by using the scaled rect instead.
2021-10-19 18:24:20 +02:00
Timothy Flynn 05d7ac1193 LoginServer: Log in when the user presses the enter key 2021-10-19 18:19:33 +02:00
Timothy Flynn 204a091765 LibCore: Avoid buffer overrun when invoking crypt() with a SecretString
For example, consider the following SecretString construction:

    String foo = "foo";
    auto ss = SecretString::take_ownership(foo.to_byte_buffer());

The ByteBuffer created by to_byte_buffer() will not contain the NUL
terminator. Therefore, the value returned by SecretString::characters
will not be NUL-terminated either.

Currently, the only use of SecretString is to pass its character data to
crypt(), which requires a NUL-terminated string. To ensure this cannot
result in a buffer overrun, make SecretString append a NUL terminator to
its buffer if there isn't one already.
2021-10-19 18:19:33 +02:00
Timothy Flynn 4739982c66 LibCore: Change Account::set_password to take a SecretString
This matches the API of Account::authenticate. The only caller to this
API is the passwd utility, which already has the new password stored as
a SecretString.
2021-10-19 18:19:33 +02:00
Andreas Kling fcff6b7160 LibWeb: Don't assume we hit a layout node when handling mousedown events
Regression from the introduction of CSS pointer-events in
ec43f7a2b0.
2021-10-19 12:53:22 +02:00
Luke Wilde defe4d50ff LibWeb: Add Event.eventPhase constants 2021-10-19 10:00:26 +02:00
Idan Horowitz 545d403f6b LibJS: Convert Value operator AOs to ThrowCompletionOr 2021-10-18 23:06:11 +01:00
Idan Horowitz 48ac15758e LibJS: Convert is_loosely_equal() to ThrowCompletionOr 2021-10-18 23:06:11 +01:00
Idan Horowitz b5e28410c5 LibJS: Convert is_less_than() to ThrowCompletionOr 2021-10-18 23:06:11 +01:00
Idan Horowitz c15a3b0576 LibJS: Convert Value::get() to ThrowCompletionOr 2021-10-18 23:06:11 +01:00
Timothy Flynn 72b409a2f7 Base: Add a test page for the various element classList APIs 2021-10-18 23:33:56 +02:00
Timothy Flynn 14349f058a LibWeb: Implement the Element classList attribute
And ensure it is updated (if it exists) when the 'class' attribute is
changed.
2021-10-18 23:33:56 +02:00
Timothy Flynn d24ae8063b LibWeb: Implement DOMTokenList for managing space-separated tokens lists
DOMTokenList is used as the return type of, e.g., the Element.classList
property.
2021-10-18 23:33:56 +02:00
Timothy Flynn 4d8320a49a LibWeb: Add initial support for IDL methods with variadic parameters
Adds support for methods whose last parameter is a variadic DOMString.
We constructor a Vector<String> of the remaining arguments to pass to
the C++ implementation.
2021-10-18 23:33:56 +02:00
Linus Groh 2fa9422b3b LibJS: Convert PrototypeObject::typed_this_value() to ThrowCompletionOr 2021-10-18 21:24:30 +01:00
Linus Groh 4b7c1f703e LibJS: Convert PrototypeObject::typed_this_object() to ThrowCompletionOr 2021-10-18 21:24:30 +01:00
Linus Groh 7c29979e30 LibJS: Convert PrototypeObject::this_object() to ThrowCompletionOr 2021-10-18 21:24:30 +01:00
Linus Groh 08db3b9f66 LibJS: Convert this_symbol_value() to ThrowCompletionOr 2021-10-18 21:24:30 +01:00
Linus Groh 60366ae032 LibJS: Convert this_string_value() to ThrowCompletionOr 2021-10-18 21:24:30 +01:00
Linus Groh 233bb89929 LibJS: Convert this_number_value() to ThrowCompletionOr 2021-10-18 21:24:30 +01:00
Linus Groh f6cf44c3db LibJS: Convert this_bigint_value() to ThrowCompletionOr 2021-10-18 21:24:30 +01:00
Linus Groh be28a6142b LibJS: Convert to_integer_or_infinity() to ThrowCompletionOr 2021-10-18 21:24:30 +01:00
Linus Groh ffee3890a7 LibJS: Remove a bunch of forgotten exception checks after TRY_OR_DISCARD
Not quite sure how that happened :^)
2021-10-18 21:24:30 +01:00
Liav A 64aaf263a2 Kernel/Net: Generate interface name near construction point
This change allows the Kernel to actually construct other interfaces
besides the E1000 type.
This solves a breakage that was introduced recently because of move
semantics.

A couple of points on this patch:
1. In current situation, we can waste time to create a KString and throw
it for nothing. This patch ensures we only create it near construction
point so we know we actually need it.
2. It's very likely to assume that non-x86 machines will expose network
device with a device tree (or with ACPI). The raspberry pi machine is a
good example of that. Therefore, each driver should explicitly ask the
correct interface name generation method, and this patch simplifies this
pattern greatly, especially in a case where the same network device can
appear as a PCI device or as device in another bus type on the same
platform target. For example, the (in)famous ne2000 device can be used
either as a PCI device or as an ISA device, depending on the model.
3. In my opinion, it seems much more readable to construct the name near
calling point of the object constructor than to just pass it with move
semantics.
2021-10-18 12:25:56 -07:00
Dana Burkart 4f9aefadef LibWeb: Ensure parent is not null in DOMTreeModel::index_for_node()
Fix a crash when inspecting empty pages or areas of the page with no
elements.
2021-10-18 18:14:06 +01:00
Sam Atkins fd8c94c094 LibWeb: Make 'auto' LengthStyleValues return 'auto' identifier
I think I broke this in my previous StyleValue clean-up. This prevented
properties like `foo: auto;` from parsing, if they did not accept
Lengths.
2021-10-18 19:01:41 +02:00
Sam Atkins 58a0ca41a7 LibWeb: Use east const in StyleValue.{h,cpp} 2021-10-18 19:01:41 +02:00
thankyouverycool 5d09f4abce Welcome: Save startup preference to user's SystemServer session
Off by default.
2021-10-18 15:55:11 +02:00
thankyouverycool 586a936fac Base: Update tips.txt 2021-10-18 15:55:11 +02:00
Brian Gianforcaro 8c2a88e492 Meta: Add a gdb pretty printer for AK::Array 2021-10-18 03:27:27 -07:00
Timothy Flynn b11a34330a CI: Build the Clang toolchain a single time for both onboard pipelines
As of the Clang 13 upgrade, we only need to build the toolchain once and
can use that toolchain for both x86_64 and i686. To do this, this breaks
the main Azure configuration into 3 "stages" (Lagom, Toolchain, and
Serenity), where the Serenity stage depends on the Toolchain stage.

This has the added benefit of uploading a new prebuilt toolchain cache
sooner than before, which should help alleviate pressure from PRs.
2021-10-18 03:25:26 -07:00
Andreas Kling 957f98805a LibWeb: Update <object> style on resource load/failure 2021-10-18 10:40:30 +02:00
Andreas Kling 177320ee9c LibWeb: Update <img> style on resource load/failure 2021-10-18 10:40:30 +02:00
Andreas Kling f72a37b9d4 LibWeb: Coalesce nested repaint requests instead of swallowing them
Previously we would ignore repaint requests that came in via OOPWV while
the WebContent process was busy with a previous paint request.

This caused some easy-to-trigger bugs where the painted content would be
"one paint behind", especially noticeable when scrolling.
2021-10-18 10:40:30 +02:00
Andreas Kling f9e814826f LibWeb: Only update layout if actually needed when scrolling to anchor 2021-10-18 10:40:30 +02:00
Timothy Flynn b67f6daf05 LibWeb: Weakly store NamedNodeMap's & Attribute's associated Element
This is similar to how Gecko avoids a reference cycle, where both the
NamedNodeMap and Attribute would otherwise store a strong reference to
their associated Element. Gecko manually clears stored raw references
when an Element is destroyed, whereas we use weak references to do so
automatically.

Attribute's ownerElement getter and setter are moved out of line to
avoid an #include cycle between Element and Attribute.
2021-10-18 09:58:52 +02:00
Rodrigo Tobar 356d5821e7 SystemMonitor: Request symbolication wihout source positions
The Stack tab doesn't display this information anyway, so there's no
need to have it calculated and returned to us.
2021-10-17 22:07:10 -07:00
Rodrigo Tobar 08428aadad LibSymbolication: Skip source position calculation if requested
Calculating source code positions can be expensive, and some
applications (like SystemMonitor's Stack tab) don't even show this
information, making these calculations wasteful.

This commit adds a new enumerated flag to the `symbolicate` functions
for callers to specify whether source positions should be included in
the results; it defaults to "Yes" to preserve old behavior for existing
applications.
2021-10-17 22:07:10 -07:00
Idan Horowitz 85a28a6555 LibJS: Convert to_index() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz aad12b050b LibJS: Convert to_length() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz 750da61c0f LibJS: Convert to_u8_clamp() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz 99287afc99 LibJS: Convert to_u8() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz 1b7dbb6b3b LibJS: Convert to_i8() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz 7bbb92dfe9 LibJS: Convert to_u16() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz 627b1205ce LibJS: Convert to_i16() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz cc94bba5c0 LibJS: Convert to_u32() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz f6a5ff7b00 LibJS: Convert to_i32() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz 20d990563c LibJS: Convert to_number() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Jelle Raaijmakers a36ee213b9 LibGL: Implement glIsEnabled() 2021-10-17 21:01:52 -07:00