Commit graph

64550 commits

Author SHA1 Message Date
Liav A.
1dfc9e2df3 Kernel+Userland: Add immutable mounts
Immutable mounts are mounts that can't be changed in any aspect, if the
VFSRootContext that hold them is used by a process. This includes two
operations on a mount:
1. Trying to remove the mount from the mount table.
2. Trying to change the flags of the mount.

The condition of a VFSRootContext being held by a process or not is
crucial, as the intention is to allow removal of mounts that marked as
immutable if the VFSRootContext is not being used anymore (for example,
if the container that was created with such context stopped).

Marking mounts as immutable on the first VFS root context essentially
ensures they will never be modified because there will be a process
using that context (which is the "main" VFS root context in the system
runtime).

It should be noted that setting a mount as immutable can be done in
creation time of the mount by passing the MS_IMMUTABLE flag, or by doing
a remount with MS_IMMUTABLE flag.
2024-12-23 20:38:38 +01:00
Nico Weber
d6bdb9a3ed AK: Add implementations of exp2() and exp() on non-x86
This is a pretty naive implementation of exp2() that can be improved
a lot, but hey, it beats the sin() and cos() implementation on non-x86.

It also implements exp(x) as exp2(x * log2(e)), with the same
disclaimer.
2024-12-23 08:42:48 -05:00
Nico Weber
1edd0cd8e0 AK: Reorder exp() and exp2() in Math
No behavior change, just moving one function after the other,
to make an upcoming diff easier to read.
2024-12-23 08:42:48 -05:00
MacDue
cd2a614732 Base: Add some missing window icons to Redmond Plastic 2024-12-22 13:11:10 -05:00
MacDue
ed1405a02d Base: Add some missing window icons to Redmond Glass 2024-12-22 13:11:10 -05:00
Nico Weber
25365e2890 Meta: Use response file for linking shared libraries in GN build
Linking liblagom-web.so produces a ~132K long command line. Ninja
passes the whole command line as a single arg to `sh -c <arg>`,
and the limit for single arguments (`MAX_ARG_STRLEN`) on Linux
is `PAGE_SIZE * 32` == 128K.

A response file passes the list of files in a file on disk, which
lets us sidestep this problem. Ninja writes response files before
invoking commands, and deletes them after (unless `-d keeprsp` is
passed to ninja, then it keeps them on disk).
2024-12-21 20:50:35 -05:00
Sam Atkins
fadd346d83 LibWeb/CSS: Don't overwrite active font load when requesting a pt size
start_loading_next_url() is a no-op if there's a pending resource load,
but not if that resource load has successfully loaded already. There is
a delay between the font resource loading, and it being processed into
a vector font. Calling font_with_point_size() in that gap would
previously erase the previously-loaded font, if the font had multiple
URLs to choose from.

This fixes the icon font on mods.factorio.com :^)

(cherry picked from commit 28388f1fd24c0019d2c4be7900584c6c536527ad)
2024-12-21 14:58:20 -05:00
Pavel Shliak
2fccdf6371 LibWeb: Refer a spec issue in Location::internal_get_own_property
(cherry picked from commit 4cd1ef12d7bdddc7cbb235350d50fee65fbd5f34)
2024-12-21 14:58:20 -05:00
Pavel Shliak
2270cd93f4 LibWeb: Update Location initialization according to spec
(cherry picked from commit 361c6f1b64393de645c6728712658a6052e857a1)
2024-12-21 14:58:20 -05:00
Timothy Flynn
026b5e53eb LibCrypto: Protect the SignedBigInteger ctor against integer overflow
In particular, if given a value of -2147483648, we would invoke signed
integer overflow (which is UB).

(cherry picked from commit edd3b14ddf049048e5d6bd952677133237adb652)
2024-12-21 14:58:20 -05:00
Totto16
960b5a4e94 LibWeb: Add test for getComputedStyle with a PseudoElement argument
This test checks the case, where an unknown pseudo element is used as
second argument to getComputedStyle

(cherry picked from commit 540c840755755844c84b0b9f41c50d2e835486fe)
2024-12-21 14:58:20 -05:00
Totto16
db43de0c58 LibWeb: Handle special cases of PseudoElement::Type correctly
There are some special values for CSS::Selector::PseudoElement::Type
which are after `KnownPseudoElementCount` and therefore not present in
various arrays of pseudo elements, this leads to some errors, if a type
after `KnownPseudoElementCount` is used without checking first. This
adds explicit checks to all usages

(cherry picked from commit d21bfda9001efd1f2303dc86af6c1f0a2d7da182)
2024-12-21 14:58:20 -05:00
Jelle Raaijmakers
36f87b9a56 LibWeb: Resolve performance FIXME in Node::is_equal_node()
(cherry picked from commit f29457b61ecd5b7d4a27414259010eb7e1ae6d2c)
2024-12-21 14:58:20 -05:00
Jelle Raaijmakers
5b85d2a558 LibWeb: Remove unused (Tree)Node::index_of_child()
(cherry picked from commit c357fbf03668c7da18140864b6317387d3d0fc39)
2024-12-21 14:58:20 -05:00
Gustavo Ramirez
63cbda39a7 LibWeb/CSS: Refactor phase() method to reduce redundancy
The function AnimationEffect::phase() contained duplicated condition
checks for the animation phase determination. This refactor eliminates
the redundant checks by simplifying the logic.

(cherry picked from commit 108701c8997e8484890adee8dbf1d4cb81a51c39)
2024-12-21 14:58:20 -05:00
Timothy Flynn
e0a25b5cdd LibJS: Return the allocated dst register from deleting super properties
Even though calling delete on a super property will ultimately throw a
ReferenceError, we must return the allocated register for the result of
the delete operation (which would normally be a boolean). If the delete
operation is used in a return statement, the bytecode generator for the
return statement must be able to assume the statement had some output.

(cherry picked from commit 5947c37637f8ea3d4c323a04e5e5dfe9fad5a4d7)
2024-12-21 14:58:20 -05:00
Pavel Shliak
55f8790da8 LibGC: Preallocate space before dumping GC graph
Speeds up the append_gc_graph function by preallocating space.
This change reduces the time taken to dump the GC graph by 4%
on about:blank.

(cherry picked from commit 03ac6e6e87488fdc638cd3a84b2c59890bdba3cc)
2024-12-21 14:58:20 -05:00
Timothy Flynn
62ced93997 LibJS: Avoid internal assertion accessing detached TA internal slots
This defers accessing TA internal slots until we know we have a valid,
attached TA. Our implementation has assertions that guard against this.

(cherry picked from commit 962441b3cf34c1350877ac7c73351657c10f675b)
2024-12-21 14:58:20 -05:00
Manuel Zahariev
6fcbd25d0d LibWeb: Test layout of standalone SVG document: edge cases
Tests with different combinations of missing width, height
and viewBox.

All tests confirmed to work on Ladybird:
 - exactly the same as Chromium (131.0.6778.85)
 - almost the same as Firefox (129.0.2)
    - only difference: standalone-w.svg: same size, different alignment

(cherry picked from commit 5d85f3a5c8c7fa5631ca5ece3f1ed95c68e480c4)
2024-12-21 14:58:20 -05:00
Manuel Zahariev
89c32a919c LibWeb: Test layout of standalone SVG document: main use case
SVG document with specified width and height attributes is layed out
with this width/height.

(cherry picked from commit 5d77104c2f214f0a78d936c014cea21335083eaf)
2024-12-21 14:58:20 -05:00
Manuel Zahariev
1922f1ff3e LibWeb: Layout standalone SVG document with specified dimensions
Before, standalone SVG documents were stretched to fit the agent
viewport.

(cherry picked from commit f5e01192cce526a61d09d364222852ac1937bce8)
2024-12-21 14:58:20 -05:00
Jelle Raaijmakers
ccfffdd3ff LibWeb: Update spec steps in Selection
Resolves two FIXMEs in `::collapse()` and `::select_all_children()`.

(cherry picked from commit d14fd8a6c88688349b015e5cafa4d7055bc34ad1)
2024-12-21 14:58:20 -05:00
Simek
3daf5b90ea LibWeb/ARIA: Add missing menuitemradio widget role
(cherry picked from commit a64432ec130ba1ea2d0ef97f80af4f0393dd1901)
2024-12-21 14:58:20 -05:00
Luke Wilde
bb16fdf969 LibWeb: Respect subarrays in Crypto#getRandomBytes
It is the responsibility of code that deals with TypedArrays to apply
the byte offset and byte length. Not doing this caused Unity Web to
crash, as they call getRandomValues with views into their full main
memory. Previously, it would fill their entire memory of about 33.5 MB
with random bytes.

(cherry picked from commit 023c3aa5b091605316bf87a9fc516e54d03e5874)
2024-12-21 14:58:20 -05:00
Pavel Shliak
16ab1c09c4 LibWeb: Align mfrac Padding with Updated MathML Core Spec
This aligns with the transition from the MathML Core Working Draft
(27 November 2023) to the Editor's Draft (26 November 2024).

(cherry picked from commit 10311fba87e3d2ef7029c10dc72524bcc45ada2d)
2024-12-21 14:58:20 -05:00
Pavel Shliak
2433f1a54e LibWasm: Respect instance.types() bounds
(cherry picked from commit e08f6a69b2e7cfcc363098555b5d90a0aab7e73c)
2024-12-21 14:58:20 -05:00
R-Goc
df5cd5d593 LibCrypto: DER.cpp use uz literals
(cherry picked from commit e2b6ab4a699a01981f7c369d845173263e7e2801)
2024-12-21 14:58:20 -05:00
R-Goc
d279123747 LibCrypto: Use size_t integer literal
(cherry picked from commit 3e69794c7d78e30591d62b4455a32e8a7ec0f052)
2024-12-21 14:58:20 -05:00
Pavel Shliak
7ac2e83da4 LibCore: Do not include math.h in ArgsParser
(cherry picked from commit 6ec06a01a2e3bd8397716fcfac6d301ab09c63bc)
2024-12-21 14:58:20 -05:00
Felipe Muñoz Mazur
ab385f8321 LibWeb: Handle abort signal in CloseWatcher
(cherry picked from commit e27c59047a0deebf132ab0822db32cfe064c14ad)
2024-12-21 14:58:20 -05:00
Luke Warlow
513cac67d9 LibWeb: Remove :closed pseudo class
This was removed from the spec.

(cherry picked from commit 7c9a162f994caeeeaf8ca3bfcc4a75bee1609b91)
2024-12-21 14:58:20 -05:00
Psychpsyo
b2cc8582db Tests: Make test less flaky
This increases the animation length on this test
as it has been failing for me locally.

(cherry picked from commit 366f15b441abb2c3c3b244188edaa86e10712dcd)
2024-12-21 14:58:20 -05:00
Sidicer
4a36ae5a70 UI/Qt: Fix hover_label hiding URLs
m_hover_label did not have checks if the mouse is in the same location.
This caused clickable URLs to be hidden.
Also shortened the label text to not be longer than half of the window.

(cherry picked from commit edf29857f8f8b669c45d673b088d9c0236659d73)
2024-12-21 14:58:20 -05:00
Jonne Ransijn
c93382fa23 LibWeb: Do not normalize border radii containing their initial values
Most computed border-radii contain their initial values, and since the
normalized initial border radii are always zero, there is no need to do
expensive floating point math to normalize them.

(cherry picked from commit acaf01bf7b6bd2d952dda8d5375be8c09bd84294)
2024-12-21 14:58:20 -05:00
Milo van der Tier
2ab078d79b LibWeb/CSS: Do not ignore self-start/self-end alignment in flex layout
This makes these values the same as `start` and `end`. While this is not
entirely correct, it is better than centering which is what we did
previously.

This fixes misaligned images on https://nos.nl

(cherry picked from commit 2ee7e555f24f04ed370630836c556a7dee6dd23a)
2024-12-21 14:58:20 -05:00
Jonne Ransijn
8b68800a8d LibJS: Cache source code positions more often
The source code position cache was moved from a line based approach
to a "chunk"-based approach to improve performance on large, minified
JavaScript files with few lines, but this has had an adverse effect
on _multi-line_ source files.

Reintroduce some of the old behaviour by caching lines again, with
some added sanity limits to avoid caching empty/overly small lines.

Source code positions in files with few lines will still be cached
less often, since minified JavaScript files can be assumed to be
unusually large, and since stack traces for minified JavaScript
are less useful as well.

On WPT tests with large JavaScript dependencies like
`css/css-masking/animations/clip-interpolation.html` this reduces the
amount of time spent in `SourceCode::range_from_offsets` by as much as
99.98%, for the small small price of 80KB extra memory usage.

(cherry picked from commit 1b3f8e1e9ad14f0777188bd6eba06e42ffd98961)
2024-12-21 14:58:20 -05:00
Jonne Ransijn
8f05403660 LibWeb: Stop allocating Tokens and ComponentValues unnecessarily
When the "Consume a component value from input, and do nothing."
step in `Parser::consume_the_remnants_of_a_bad_declaration` was
executed, it would allocate a `ComponentValue` that was then
immediately discarded.

Add explicitly `{}_and_do_nothing` functions for this case that never
allocate a `ComponentValue` in the first place.

Also remove a `(Token)` cast, which was unnecessarily copying a `Token`
as well.

(cherry picked from commit 3f5e32ee8464a3bc92bc52f12d90914fa74a5f52)
2024-12-21 14:58:20 -05:00
joshua stein
40ebff3962 LibWeb: Remove a misleading duplicate comment in HTMLParser
(cherry picked from commit 12442ca4308267b82e7ef81e6db1f326ee19f495)
2024-12-21 14:58:20 -05:00
Luke Wilde
cc45fa48cd LibWeb: Remove LegacyOverrideBuiltIns flag from Storage
This was preventing https://ubereats.com/ from fully loading, because
they are attempting to overwrite setItem. They seem to be trying to add
error logging to setItem if it throws, as all they do is add a
try/catch block that emits an error log to their monitoring service if
it throws.

However, because Storage is a legacy platform object with a named
property setter (setItem), it will call setItem with the stringified
version of the function. This is actually expected as per the spec,
Firefox (Gecko) and Epiphany (WebKit) does this too, but Chromium does
not as it actually overwrites the function with the new function and
does not store the stringified function.

The problem is that we had the LegacyOverrideBuiltIns flag accidentally
set, so it would return the stored string instead of the built-in
function (hence the name), then it would try and call it and throw a
"not a function" error. This prevented their JS from going any further.

This fix allows their UI to fully load and be fully interactive, though
it is quite slow at the moment!

(cherry picked from commit faf6fd11894ac1c1d8aeeb35cb3723c66f900f1a)
2024-12-21 14:58:20 -05:00
Jonne Ransijn
5968435f6f LibWeb: Fix infinite loop in Storage::internal_own_property_keys
Since `Storage::item_value` never returns an empty Optional,
and since `PlatformObject::is_supported_property_index` only
returns false when `item_value` returns an empty Optional,
the loop in `PlatformObject::internal_own_property_keys` will
never terminate when executed on a `Storage` instance.

This fix allows youtube.com to load successfully :^)

(cherry picked from commit cc0fce3983932b27b46eb783adbed10842837852)
2024-12-21 14:58:20 -05:00
Jim Broadbent
31d66c2050 LibWeb/Storage: Return undefined for non-existent key/index access
All tests at now pass: http://wpt.live/webstorage/defineProperty.window.html

(cherry picked from commit 7a663162975a7193f1d77abf9cb0e574e4017d8e)
2024-12-21 14:58:20 -05:00
Nico Weber
5222f0e4c7 Meta: Update GN files after #25537 2024-12-21 14:58:20 -05:00
Nico Weber
e4c36876d2 AK: Make Function a little bit constexpr
Just enough to make it possible to pass a lambda to a constexpr function
taking an AK::Function parameter and have that constexpr function call
the passed-in AK::Function.

The main thing is that bit_cast<>s of pointers aren't ok in constexpr
functions, and neither is placement new. So add a union with stronger
typing for the constexpr case.

The body of the `if (is_constexpr_evaluated())` in
`init_with_callable()` is identical to the `if constexpr` right
after it. But `if constexpr (is_constexpr_evaluated())` always
evaluates `is_constexpr_evaluated()` in a constexpr context, so
this can't just add ` || is_constexpr_evaluated()` to that
`if constexpr`.
2024-12-20 12:05:06 -05:00
Nico Weber
761320c4d2 AK: Make parts of Atomic constexpr
These new constexpr functions are for the most part identical to
the same non-constexpr functions, except they drop the `volatile`
qualifier on `this`.

`fetch_add()`, `fetch_sub()`, `load()` have explicit
`is_constant_evaluated()` branches that don't call (non-constexpr)
atomic built-ins. Off the constexpr path, they forward to the
volatile functions.
2024-12-20 12:05:06 -05:00
Serge Croisé
e3826bf791 Documentation: Fix typos in SmartPointers.md 2024-12-19 19:14:47 -05:00
djwisdom
7eab5956ff Ports: Update vim to 8.2.5056 2024-12-19 15:58:17 -05:00
djwisdom
b50252ac4c Ports: Update vim to use version huge from normal 2024-12-19 15:58:17 -05:00
Linus Groh
315ad73b32 Ports: Update Python to 3.13.1
Released on 2024-12-03.
https://www.python.org/downloads/release/python-3131/
2024-12-19 20:09:02 +01:00
Linus Groh
ac3427342b Revert "Ports/python3: Backport gh-126688: Reinit import lock after fork"
This reverts commit a47e63b589.

(It's not a complete revert as I added back two newlines in the
generated ReadMe.md so it matches output for the current patch files.)
2024-12-19 20:09:02 +01:00
Nico Weber
c73ab635cd Meta: Add serenity sed to lagom
Useful for testing.
2024-12-19 20:07:02 +01:00