Commit graph

64566 commits

Author SHA1 Message Date
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
MacDue
23385968ca WindowServer: Clear format when resetting MultiScaleBitmaps 2024-12-17 19:04:58 -05:00
implicitfield
8ed7225810 Kernel/VFS: Don't explicitly remove "." and ".." entries
No behavior change intended.
2024-12-17 19:02:15 -05:00
implicitfield
0e94887b2c Kernel/VFS: Make filesystem implementations responsible for renames
Previously, the VFS layer would try to handle renames more-or-less by
itself, which really only worked for ext2, and even that was only due to
the replace_child kludge existing specifically for this purpose. This
never worked properly for FATFS, since the VFS layer effectively
depended on filesystems having some kind of reference-counting for
inodes, which is something that simply doesn't exist on any FAT variant
we support.

To resolve various issues with the existing scheme, this commit makes
filesystem implementations themselves responsible for the actual rename
operation, while keeping all the existing validation inside the VFS
layer. The only intended behavior change here is that rename operations
should actually properly work on FATFS.
2024-12-17 19:02:15 -05:00
implicitfield
666ba3b970 Kernel/Ext2FS: Make to_ext2_file_type a static member of Ext2FSInode 2024-12-17 19:02:15 -05:00
implicitfield
14d216e819 mv: Prefer FileSystem::remove over unlink when moving across filesystems
unlink doesn't handle directories, while FileSystem::remove does.
2024-12-17 19:02:15 -05:00
implicitfield
4148716671 LibFileSystem: Ignore ENOTSUP from chmod and chown in copy_directory
This was missed in 5e87b789.
2024-12-17 19:02:15 -05:00
implicitfield
8db6dd47c7 Kernel/FATFS: Allocate new entries properly in allocate_entries
There were two separate issues at play which made this work incorrectly.
The first was that the newly allocated block was incorrectly computed,
because it was assumed that the cached block list was updated when a new
cluster was allocated. The second issue was that there was an off-by-one
in the loop that collected the newly allocated entries, which meant that
the resulting list had an entry less than what was requested.
2024-12-17 19:02:15 -05:00
implicitfield
1a4036e8ed Kernel/FATFS: Don't shadow lfn_entries in add_child 2024-12-17 19:02:15 -05:00
implicitfield
c6e483d65e Kernel/FATFS: Make (an overload of) first_cluster actually freestanding
The old overload still depended on m_entry being initialized, which
meant that (due to where this method is used) all inodes ended up
getting the same index.
2024-12-17 19:02:15 -05:00
Zaki
1a82f0f422 Ports: Update readline to version 8.2.13 2024-12-17 19:01:43 -05:00
Sönke Holz
070534c3ee LibC: Don't push a fake return address in create_thread on non-x86
The AArch64 and RISC-V ABI use a caller-saved register to store the
return address instead of (always) storing it on the stack.
All non-special registers of newly created threads are zero by default,
so we don't need to anything special for those architectures here.

This change also causes the stack pointer to no longer be misaligned for
secondary threads on those architectures.
2024-12-17 19:01:05 -05:00
Linus Groh
5db1ddc677 Meta: Ignore title length of revert commits
Even if a commit message title previously fit into the 72 character
limit it may go over that with 'Revert ""' added - asking the author to
tweak the commit message is not appropriate in that case.

Since additional context can be added to the commit message body the
usual length restriction applies to the remaining lines.

Also restructure the code to group checks based on the line number we're
currently looking at.
2024-12-16 22:08:51 +01:00
Sönke Holz
7bcf97c8e8 Kernel/aarch64: Implement microseconds_delay
This simple delay loop uses the EL1 virtual timer to wait for the given
amount of time.
2024-12-15 15:26:40 +01:00
Sönke Holz
6517eabb5f Kernel/aarch64: Rename AUX.{h,cpp} to AUXPeripherals.{h,cpp}
The file name "AUX" is reserved on Windows.
2024-12-15 02:06:23 +01:00
Sönke Holz
b88cd185a0 Kernel/aarch64: Use the EL1 virtual timer for ARMv8Timer
The physical timer might not be accessible to us if we are running in a
hypervisor.
2024-12-14 19:40:02 +01:00
Sönke Holz
4cc9bea86d Kernel/aarch64: Reject ARMv8Timers with the "interrupt-names" property
Our current check `interrupts.size() != 4` doesn't always work because
timers with the "interrupt-names" property can define 4 timers at the
same indices mapping to different interrupts.

The old devicetree binding only allowed 4 interrupts, so keep the old
check as well.
2024-12-14 19:40:02 +01:00