Commit graph

64582 commits

Author SHA1 Message Date
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
Sönke Holz
06c3528197 Kernel/aarch64: Implement Processor::read_cycle_count 2024-12-19 12:53:52 -05:00
Sönke Holz
51103b5f35 Kernel: Make Processor::read_cycle_count return an Optional<u64>
Not all processors provide a mechanism to read the cycle count.

Change the `EntropySource::add_random_event` function to fall back to
getting a timestamp from TimeManagement if no cycle count is available.
2024-12-19 12:53:52 -05:00
Sönke Holz
f50852117b Kernel: Rename Processor::{read_cpu_counter => read_cycle_count}
This name better reflects what this function actually does.
2024-12-19 12:53:52 -05:00
Sönke Holz
264a139e78 Kernel/aarch64: Set g_total_processors to a hard-coded value of 1
This value is used by the NVMe driver to determine the number of queues
to create.
2024-12-19 12:53:52 -05:00
Sönke Holz
aa4c286138 Kernel/aarch64: Make RPi::SDHostController a DeviceTree::Driver 2024-12-19 12:53:52 -05:00
Sönke Holz
cae52e39c2 Kernel/aarch64: Only attempt to initialize the MiniUART on Raspberry Pis 2024-12-19 12:53:52 -05:00
djwisdom
05ccc4ccf5 Ports: Update jakt to latest as of 19-Dec-2024 2024-12-18 20:33:41 -05:00
Sönke Holz
e447342550 Kernel/aarch64: Perform an ISB after setting TTBR*_EL1
Changes to ARM system registers are not guaranteed to be visible until
a context synchronization event, like performing an ISB.
2024-12-19 00:29:05 +01:00
Sönke Holz
1d3a255ea1 Kernel: Recognize a stack pointer pointing to the top of stack as valid
This also removes the explicit decrementing of the stack pointer in
`sys$create_thread` before passing it to `validate_user_stack`,
as it's unnecessary now.
2024-12-18 16:09:52 -05:00
Sönke Holz
a6be79d977 WindowServer: Handle shifted submenus during safe submenu navigation
The old calculation was unnecessarily complicated and didn't handle
horizontally or vertically shifted menus correctly.

To determine the two triangle corners at the submenu, we can simply
use the submenu's rect() and subtract the position of the parent menu
to get the correct relative coordinates.
This fixes the case when the menu is shifted vertically.

If the submenu is shifted horizontally, we need to use the opposite
corners of the window rect.
2024-12-17 19:05:49 -05:00
MacDue
df59b54a45 LibGfx: Add "Redmond Glass" window theme
This adds a window theme that aims to imitate the default Windows 7
theme (known as Aero). This initial version mainly focuses on window
frames along with minor taskbar theming.

Currently, the colors for the window frames are hardcoded, but the
actual gradient painting uses the LibGfx gradient support, so it should
be fairly easy to make configurable.
2024-12-17 19:04:58 -05:00
MacDue
0531955673 LibGfx: Add "Redmond Plastic" window theme
This adds a window theme that aims to imitate the default Windows XP
theme (known as Luna). This initial version mainly focuses on window
frames along with minor taskbar theming.

Currently, the colors for the window frames are hardcoded, but the
actual gradient painting uses the LibGfx gradient support, so it should
be fairly easy to make configurable.
2024-12-17 19:04:58 -05:00
MacDue
b34fb8e7f9 LibGfx+Taskbar: Allow having an alpha channel for the taskbar window 2024-12-17 19:04:58 -05:00
MacDue
893f7ed1d6 LibGfx: Avoid overpainting in Painter::draw_line()
These axis-aligned cases can be done with a single fill call too (which
is likely faster).
2024-12-17 19:04:58 -05:00
MacDue
a205b57b20 LibGfx: Avoid overpainting in Painter::draw_rect_with_thickness() 2024-12-17 19:04:58 -05:00
MacDue
47400d5b06 Taskbar: Fill inside of task bar frames (clock and applet area)
This does not change anything for the classic theme but will be needed
to ensure things look okay with more custom taskbar themes.
2024-12-17 19:04:58 -05:00
MacDue
759e29fdae LibGfx+Taskbar: Add paint hooks for the taskbar to WindowTheme
This will allow window themes to apply (basic) customization to the
taskbar.
2024-12-17 19:04:58 -05:00
MacDue
94f06cdd33 LibGfx+WindowServer: Allow specifying a window theme in the palette
Currently, the only available option is "Classic", but in later patches
this will be used to allow selecting custom window themes (e.g. for
Aero or Luna styles).

It is a little weird that this is in the palette, but it already
contains non-color properties, and placing the window themes here makes
them easily accessible when needed.
2024-12-17 19:04:58 -05:00