Commit graph

60731 commits

Author SHA1 Message Date
Timothy Flynn fecd08ce64 Everywhere: Remove 'clang-format off' comments that are no longer needed 2024-04-24 16:50:01 -04:00
Timothy Flynn ec492a1a08 Everywhere: Run clang-format
The following command was used to clang-format these files:

    clang-format-18 -i $(find . \
        -not \( -path "./\.*" -prune \) \
        -not \( -path "./Base/*" -prune \) \
        -not \( -path "./Build/*" -prune \) \
        -not \( -path "./Toolchain/*" -prune \) \
        -not \( -path "./Ports/*" -prune \) \
        -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")

There are a couple of weird cases where clang-format now thinks that a
pointer access in an initializer list, e.g. `m_member(ptr->foo)`, is a
lambda return statement, and it puts spaces around the `->`.
2024-04-24 16:50:01 -04:00
Timothy Flynn 823fdb83db Meta: Switch to clang-format-18 as the standard formatter 2024-04-24 16:50:01 -04:00
Timothy Flynn 891c4ac68e CI: Bust the toolchain ccache when the toolchain's major version changes
The build will be entirely clean anyways, so no need to preserve the
previous version's ccache.
2024-04-24 16:49:50 -04:00
Timothy Flynn 4cc8266727 CI: Do not prune the toolchain ccache
Currently, if the prebuilt toolchain cache gets used, we will not try to
build the toolchain. Thus, the toolchain's ccache does not get used, and
is then pruned entirely at the end of the run.

So for now, let's just not prune the toolchain ccache. After a few years
it only reached 0.8 GB in size. And now that we are starting from empty
again, it would likely be a few more years before we reach 0.8 GB again.
2024-04-24 16:49:50 -04:00
Cnidarias 1a1e5aaf54 LibWeb: Add null check for get_client_rects() on non paintable elements 2024-04-24 18:04:28 +02:00
Andreas Kling c186ab96ac LibWeb: Explicitly ignore PageClient::m_console_clients
This map is managed entirely by manual insertion/removal when a document
is created/destroyed, so we should just ignore it in visit_edges().
2024-04-24 17:04:43 +02:00
Andreas Kling f60d82eb85 LibWeb: Make HTML::Environment a GC-allocated type
The only subclass was already GC-allocated, so let's hoist the JS::Cell
inheritance up one level. This ends up simplifying a bit of rather
dubious looking code where we were previously slicing ESOs.
2024-04-24 17:04:43 +02:00
Bastiaan van der Plaat 7fa45c5fdf LibWeb: Add map element areas property 2024-04-24 15:23:45 +02:00
Bastiaan van der Plaat 3e507102ea LibWeb: Add datalist element options property 2024-04-24 15:23:45 +02:00
Timothy Flynn 90fcfca6f6 CI: Configure ccache before modifying its contents (if any)
If there is a cache miss while downloading the ccache from GitHub/Azure,
the .ccache directory won't exist when we try to update the modification
time of its contents. Configure the ccache size first, which will create
the .ccache directory if it doesn't exist.
2024-04-24 09:16:41 -04:00
Aliaksandr Kalenik 1072d9f15d LibJS: Save min and max block addresses in CellAllocator
This allows to skip iterating through all allocated blocks in
`find_min_and_max_block_addresses()`.

With this change `collect_garbage()` in profiles of Discord goes down
from 17% to 8%.
2024-04-24 11:42:15 +02:00
Aliaksandr Kalenik 55154b6c68 LibWeb: Use SafeFunction for completion steps in "populate SHE"
...to visit GC-allocated objects captured by this callback.
2024-04-24 10:22:29 +02:00
Aliaksandr Kalenik 64ad536dbb LibWeb: Create HeapFunction for after_document_populated
...to make it visited by SafeFunction callback of deferred_invoke().

Fixes use-after-free ASAN error that happens if you try to reload the
page.
2024-04-24 10:22:29 +02:00
ronak69 b25d220a2c headless-browser: Call platform_init() for path of resources folder
For `AK_OS_SERENITY`, the root path of the resources folder is "/res";
but otherwise it should be the `s_serenity_resource_root` variable set
in `platform_init()`.

However, a path provided on the command line, will override the default
path in both of those cases.

This change also makes sure that `RequestServer` can find the
certificates file `serenity/Build/lagom/share/Lagom/ladybird/cacert.pem`
2024-04-24 10:21:20 +02:00
Dan Klishch 49e09507d7 LibELF: Perform weak relocations in much more straight-forward manner
There is no need to defer unresolved weak relocations until stage 3 --
it is not like we will magically find new symbols in the same objects.
2024-04-23 23:26:00 -06:00
Andrew Kaster 7b06417ccf CI: Test using Clang for ASAN+UBSAN on Linux, add nightly GCC job
Clang builds of ASAN+UBSAN on Linux take significantly less time on the
Azure CI runners. Measured times were 82 minutes for Clang 18 and
112 minutes for GCC 13, with no cache.

To keep our coverage of Ladybird builds + testing with GCC, add a
nightly job to run through the full test cycle on GCC 13.
2024-04-23 21:16:53 -06:00
Tim Schumacher 5f088f3233 Meta: Trim the CI ccache down to files used in the current build 2024-04-23 22:00:07 -04:00
kleines Filmröllchen e74b34b69e LibC: Fix extended floating point software rounding
Contrary to IEEE formats, x86's 80-bit extended floats need the topmost
mantissa bit to be 1 or else a special kind of NaN is produced. We fix
this by reinserting the special bit if necessary.
2024-04-23 19:18:09 -06:00
kleines Filmröllchen 0c1ad05f50 LibC: Add rounding specializations for RISC-V
Whenever the floating-point values are in integer range, we can use the
various FCVT functions with static rounding mode to perform fast
rounding. I took this opportunity to clean up the architecture
differentiation for these functions, which allows us to use the software
rounding implementation for all extreme and unimplemented cases,
including AArch64.

Also adds more round & trunc tests.
2024-04-23 19:18:09 -06:00
kleines Filmröllchen 334f5e319c LibC: Prevent undefined shift in internal_to_integer
New tests will hit a dead bit count of 64, leading to an undefined
shift.
2024-04-23 19:18:09 -06:00
kleines Filmröllchen 8443d0a74d AK: Use common ComponentType integer type for float bitfields
This allows us to easily use an appropriate integer type when performing
float bitfield operations.

This change also adds a comment about the technically-incorrect 80-bit
extended float mantissa field.
2024-04-23 19:18:09 -06:00
kleines Filmröllchen 997828c31a LibC: Add some fenv tests
Co-Authored-By: Dan Klishch <danilklishch@gmail.com>
2024-04-23 19:18:09 -06:00
kleines Filmröllchen 24af4f1882 LibC: Start on fenv support for RISC-V
Co-Authored-By: Sönke Holz <sholz8530@gmail.com>
2024-04-23 19:18:09 -06:00
Dan Klishch a4a8dd29ba LibC: Read correct FP register in fegetround on x86-64 :^) 2024-04-23 19:18:09 -06:00
Andrew Kaster 751ddae7a2 DevContainer: Recommend clang-18, and bump feature version 2024-04-23 15:37:07 -06:00
Andrew Kaster c5cd1ad737 CI: Use macOS 14 Apple Silicon runner to create js package for esvu 2024-04-23 15:37:07 -06:00
Andrew Kaster 0555650387 CI: Use macOS 13 x86_64 runner in Azure DevOps
Sadly the Apple Silicon runners GitHub Actions has now are not yet
available in ADO. However, we can still bump the version to Ventura.
2024-04-23 15:37:07 -06:00
Andrew Kaster 2e385e4c12 CI: Bump Lagom CI builds to gcc-13 and clang-18
This includes Lagom Tools for Serenity builds, and the Lagom builds on
Azure.
2024-04-23 15:37:07 -06:00
Andrew Kaster 913cffe928 AK: Add workaround for faulty Sanitizer warning on gcc 13+ in Atomic
gcc can't seem to figure out that the address of a member variable of
AK::Atomic<u32> in AtomicRefCounted cannot be null when fetch_sub-ing.
Add a bogus condition to convince the compiler that it can't be null.
2024-04-23 15:37:07 -06:00
Andrew Kaster 1c3f11a5a6 Userland: Remove remaining callers of synchronous ImageDecoder API
Most of these now just await the image decoding, equivalent (ish) to
the old behavior. A more async-aware refactor should happen some time
in the future.
2024-04-23 12:32:04 -06:00
Andrew Kaster 651e78fedb LibWeb: Convert callers of ImageCodecPlugin to the async API
The HTMLLinkElement caller is a bit hairy, so we shove an await() in
there temporarily. This is sure to cause fun times for anyone debugging
task/microtask execution order.
2024-04-23 12:32:04 -06:00
Andrew Kaster 39dfb659cf LibWeb+WebContent: Convert ImageCodecPlugin to use the promise-based API 2024-04-23 12:32:04 -06:00
Andrew Kaster b871bc082c ImageDecoder: Handle decoding of images in an asynchronous manner
ImageDecoder now queues up image decoding requests and returns the
images back to the caller later. ImageDecoderClient has a new
promise-based API that allows callers to attach their own resolve/reject
handlers to the responses from ImageDecoder.
2024-04-23 12:32:04 -06:00
Idan Horowitz 0d8064fafc DynamicLoader: Resolve missing weak absolute symbols to null
Weak symbols can be left unresolved, and code is supposed to check if
they're null at runtime before using them. Handle them appropriately
instead of refusing to load.
2024-04-23 20:27:51 +02:00
Andrew Kaster 28fcf64835 Documentation: Update Ladybird README with more descriptive information 2024-04-23 11:24:14 -06:00
dependabot[bot] 4eee9ee132 CI: Bump JamesIves/github-pages-deploy-action from 4.5.0 to 4.6.0
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.5.0...v4.6.0)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-23 10:32:46 -06:00
Tim Ledbetter 4611a58f8c PixelPaint: Avoid infinite loop when updating zoom level ComboBox text
After 8b4e2e20, `Combobox::set_text()` invokes the `on_change` event by
default. This led to an infinite loop at program startup which caused a
crash.
2024-04-23 16:26:39 +02:00
Michal Grich 7a6d84d036 LibTextCodec: Add Windows-1250 text decoder
This commit is adding Windows-1250 decoding based on unicode.org
mapping table.
2024-04-23 16:26:16 +02:00
Jamie Mansfield b7bd3fd920 Ladybird: Calculate the 'physical pixels' for screens
Previously the 'device independent pixels' (which consider scaling)
were used, and then scaling would be applied again when calculating the
screen width for CSS.
2024-04-23 16:25:20 +02:00
Aliaksandr Kalenik d4f08fb0a1 LibWeb: Fix division by zero in solve_replaced_size_constraint()
Happened when input_width > 0 but input_height == 0.

Fixes crashing on Discord that happens after clicking on direct
messages conversation.
2024-04-23 16:21:48 +02:00
circl 3c58126771 Base: Adjust transparent border of the question icon
While this makes little visual difference, it is now pixel-perfectly
equal to the information icon.
2024-04-23 15:45:09 +02:00
circl c872fdd46d Base: Remove white pixels from warning icon
This is cleaner, and was likely the intended appearance.
2024-04-23 15:45:09 +02:00
Andreas Kling 184368285c LibWeb: Fix GC leaks in Fetch::Infrastructure::Body::fully_read()
By making this function accept the success and error steps as
HeapFunction rather than SafeFunction, we break a bunch of strong
GC cycles.
2024-04-23 12:50:40 +02:00
Andreas Kling 0c84508f87 LibJS: Fix GC leaks in promise reaction job setup
There's no need to capture things as Handle when using HeapFunction.
In this case, it was even creating a strong reference cycle, which ended
up leaking.
2024-04-23 12:50:40 +02:00
Aliaksandr Kalenik a044e9cf4f LibWeb: Add background-clip: text support for InlinePaintable
Moves background mask calculation into `paint_background()` that is
shared between PaintableBox and InlinePaintable.
2024-04-23 12:50:07 +02:00
Tim Ledbetter 3aea14093f LibWeb: Don't crash if the document element is not visible
Previously, setting the `hidden` property on the `<html>` element would
cause a crash.
2024-04-23 11:17:54 +02:00
Aliaksandr Kalenik dd73cccf8f LibWeb: Fire "scroll" events on DOM elements
Before this change "scroll" events were only fired on document but now
it happens for all elements with scrollable overflow.
2024-04-23 11:00:35 +02:00
Timothy Flynn 771054bff7 Ladybird: Slightly increase the size of the Task Manager window
This adds a bit more room to see most titles on one line.
2024-04-22 14:46:10 -06:00
Timothy Flynn 2851c05dee LibWebView: Display each tab's title in the Task Manager
This allows us to more easily differentiate between WebContent processes
in the Task Manager at a glance.
2024-04-22 14:46:10 -06:00