Commit graph

57242 commits

Author SHA1 Message Date
Sönke Holz
4cd1e4d69e Kernel/riscv64: Use ALWAYS_INLINE instead of inline in CSR header
This fixes building the kernel with `-Og` when using GCC.
2023-12-14 09:02:15 -07:00
Sönke Holz
f04a2b81be Meta: Disable -Wcast-align warning on RISC-V
Also explicitly specify `-mstrict-align` (The current default `-mcpu`
on gcc doesn't support unaligned accesses, so aligned memory accesses
are already implicitly required).
The `-Wcast-align` warning seems to oversensitive as it flags code like
this: https://godbolt.org/z/c8481o8aa

This used to be added for aarch64 in a473cfd71b, but was later removed
in 11896868d6.
2023-12-14 09:02:15 -07:00
Sönke Holz
7768f97333 Meta: Force signed char on all architectures 2023-12-14 09:02:15 -07:00
Tim Schumacher
a1cf2708ee LibCompress: Implement the XZ BCJ filter for ARM64 2023-12-14 08:59:23 -07:00
Tim Schumacher
e2d4952f0f AK: Add Array::from_repeated_value() 2023-12-14 08:59:23 -07:00
Tim Schumacher
afea177d41 Ports/qemu: Update to 8.1.3 2023-12-14 16:43:37 +01:00
Tim Schumacher
592c3a8cb4 Ports: Remove termcap
termcap has last been updated in 2002, and is relying on a lot of
deprecated C99 behavior. All two current users are fine without it,
so just remove it completely.
2023-12-14 16:43:37 +01:00
Andrew Kaster
14c724e8e2 Ports: Use valid URL for libopus 2023-12-14 08:36:25 -07:00
Andrew Kaster
db7eff582e Meta: Update cacert.pem to 2023-12-12 2023-12-14 08:36:25 -07:00
Andrew Kaster
ec11743fae LibWeb: Use StructuredSerializeWithTransfer in window.postMessage()
And update tests to transfer message a message port between iframes.
2023-12-14 08:36:11 -07:00
Andrew Kaster
84ac6a454f LibWeb: Use `Vector<Handle<Object>>` in transfer variants of serialize
Also trap the invalid object index inserted for transferred values in
deserialization. In the future we should avoid inserting that
placeholder value in the data stream at all.
2023-12-14 08:36:11 -07:00
Andrew Kaster
73697058b0 LibWeb: Add ports attribute to MessageEvent and MessageEventInit
Still some FIXMEs left though, as the IDL generator doesn't know what
a FrozenArray is, nor how to properly create a sequence of a Platform
Object.
2023-12-14 08:36:11 -07:00
Aliaksandr Kalenik
e464d484c4 LibWeb: Implement getBoundingClientRect() for inline paintables
This fixes the issue that occurred when, after clicking an inline
paintable page would always scroll to the top. The problem was that
`scroll_an_element_into_view()` relies on `get_bounding_client_rect()`
to produce the correct scroll position and for inline paintables we
were always returning zero rect before this change.
2023-12-14 16:25:27 +01:00
Aliaksandr Kalenik
874af6048f LibWeb/Painting: Remove command to paint progress bar
It is no longer used because we started using shadow dom for progress
element.
2023-12-14 16:24:15 +01:00
Andrew Kaster
c145d5410c Userland: Don't leak objects when constructor arguments throw
Similar to d253beb2f7.

Found with Ali's clang-query script in Shell:

```
for $(find AK Userland -type f -name '*.h' -o -name '*.cpp') {
    in_parallel -j 12 -- clang-query -p \
    Build/lagom/compile_commands.json $it -c \
    'm cxxNewExpr(has(cxxConstructExpr(hasAnyArgument(hasDescendant( \
        allOf(isExpandedFromMacro("TRY"), stmtExpr()))))))' \
    } | grep -v 'matches.' | tee results
```
2023-12-13 19:21:03 -07:00
Andrew Kaster
d253beb2f7 LibCore: Don't leak proto-Resources when loading non-existent paths
The construct `adopt_ref(*new Obj(TRY(get_resource())))` is another
manifestation of a classic anti-pattern. In old C++, you would leak the
object's memory if the argument threw an exception, or if a member
initializer threw an exception. In our case, we leak if the MappedFile
returns an Error. This is pretty concerning, and we should avoid this
pattern at all costs, and try to use the "safer" helpers whenever
possible.
2023-12-13 17:28:07 -05:00
Kemal Zebari
771467f92f LibGUI: Fix debug line causing crash when drag event has no mime data
Resolves #10618.
2023-12-13 17:26:41 -05:00
Bastiaan van der Plaat
04b591b2e0 Ladybird/Qt: Listen to DPI changes and update WebContentView accordingly 2023-12-13 22:25:27 +01:00
Aliaksandr Kalenik
51ecfdf71f LibWeb: Add unscaled fallback font in case Font::with_size() failed 2023-12-13 22:25:00 +01:00
Aliaksandr Kalenik
de4b240429 LibWeb: Add missing null check in font_with_point_size() 2023-12-13 22:25:00 +01:00
Andrew Kaster
6e4d5b310f Meta: Port recent changes to gn build
299d35aadc
7d9fe44039
58f08107b0
2cb0039a13
bc70144df1
48a9d0ede8
149e382735
2023-12-13 10:51:27 -07:00
Andrew Kaster
e0f990f1cb CMake: Don't download IDNA files when ENABLE_NETWORK_DOWNLOAD is OFF
Also tweak the debug message for the Emoji test file.
2023-12-13 10:51:27 -07:00
Nicolas Ramz
cd6c7f3fc4 LibGfx/ILBMLoader: Add support for PC DeluxePaint files 2023-12-13 10:39:13 +00:00
Aliaksandr Kalenik
b108d51c5b LibJS: Only consider VM-accessible execution contexts as strong roots
Partially reverts 3dc5f467a8 to fix
GC memory leak that happens because we treated all execution contexts
as strong roots.
2023-12-13 11:19:13 +01:00
Bastiaan van der Plaat
cbb660c756 LibWeb: Make request_select_dropdown more similar to context menu api 2023-12-13 10:30:13 +01:00
Bastiaan van der Plaat
aee8b39c65 Ladybird/Qt: Open context menus at requested position 2023-12-13 10:30:13 +01:00
Bastiaan van der Plaat
8b0abb8ded Ladybird/Qt: Don't use devicePixelRatio() directly 2023-12-13 10:30:13 +01:00
Aliaksandr Kalenik
41a3c19cfe LibWeb: Make HTML::DecodedImageData to be GC-allocated
This change fixes GC-leak caused by following mutual dependency:
- SVGDecodedImageData owns JS::Handle for Page.
- SVGDecodedImageData is owned by visited objects.
by making everything inherited from HTML::DecodedImageData and
ListOfAvailableImages to be GC-allocated.

Generally, if visited object has a handle, very likely we leak
everything visited from object in a handle.
2023-12-12 23:01:08 +01:00
Andrew Kaster
57a04c536c Ladybird: Enable rich debug messages on all processes
Android is excluded from this patch because the Android dbgln routes
messages to the NDK logger, which already includes process and time
information.
2023-12-12 10:11:24 -07:00
Andrew Kaster
4db5e2ba22 AK: Print timestamp, process name, and pid on all platforms
This requires duplicating some logic from Core::Process::get_name()
into AK, which seems unfortunate. But for now, this greatly improves the
log messages for testing Ladybird on Linux.

The feature is hidden behind a runtime flag with a global setter in the
same way that totally enabling/disabling dbgln is.
2023-12-12 10:11:24 -07:00
Andrew Kaster
87cbc63334 LibELF: Remove loader reservation after most allocating operations
It's possible for a malloc inside load_program_headers() to steal the
reserved memory space we created for the program headers. Remove the
reservation later in the method.
2023-12-12 17:41:44 +01:00
Aliaksandr Kalenik
57e5abae92 LibJS+LibWebView+WebContent+Ladybird: Output GC-graph into a file
Instead of displaying a massive JSON in stdout, it's more practical
to save the GC-graph to a file.
2023-12-12 15:35:35 +01:00
Andreas Kling
ed1bee222b LibJS: Give Shape::TransitionType an underlying 8-bit type
This shrinks Shape by 8 bytes. :^)
2023-12-12 15:26:46 +01:00
Dan Klishch
8dfca6c464 LibWebView: Do not treat prefix of public suffix as valid public suffix 2023-12-12 06:44:54 -05:00
Liav A
dbae1873ec Base: Add manual page for drain(1) 2023-12-12 06:44:10 -05:00
Liav A
f67b9cb680 Utilities/drain: Add an option to specify different block size
This is useful for a situation when handling a small file than 512 KiB
or being under low system memory pressure.
2023-12-12 06:44:10 -05:00
Andreas Kling
5204020d42 LibWeb: Add missing DOM::Position::visit_edges()
Caught by running the test suite under ASAN.
2023-12-12 01:08:07 +01:00
Andreas Kling
6cbcd521a2 LibJS/JIT: Add fast path for UnaryMinus on Int32
5% speedup on Octane/mandreel.js :^)
2023-12-12 00:10:44 +01:00
Sönke Holz
78419e858d Kernel/Graphics: Don't use [[gnu::packed]] on Bochs VGA structs
The `[[gnu::packed]]` attribute apparently lowered the required
alignment of the structs, which caused the compiler to generate two
1 byte loads/stores on RISC-V. This caused the kernel to read/write
incorrect values, as the device only seems to accept 2 byte operations.
2023-12-11 14:46:06 -07:00
stelar7
dd391d5e8c LibWeb: Add test for week_number_of_the_last_day microsyntax 2023-12-11 14:04:27 -07:00
stelar7
479c48643e LibWeb: Move common date microsyntax to a separate file 2023-12-11 14:04:27 -07:00
stelar7
a72636ad8d LibWeb: Implement week_number_of_the_last_day 2023-12-11 14:04:27 -07:00
Aliaksandr Kalenik
6b79508c08 LibWeb: Use offset of nearest scrollable ancestor for positioned boxes
Because positioned descendants are painted out-of-order we need to
separately apply offset of nearest scrollable box for them.

Fixes https://github.com/SerenityOS/serenity/issues/20554
2023-12-11 20:37:05 +01:00
Aliaksandr Kalenik
2952f01e84 LibWeb: Add pair of methods to apply/reset scroll offset of paintable
Separate scroll application from before_children_paint and
after_children_paint.
2023-12-11 20:37:05 +01:00
Andreas Kling
8eacb81eba LibJS: Skip redundant marking of Shape property table keys
All the keys in a property table are guaranteed to be marked via
Shape::m_property_key in each step of the transition chain that leads
up to the Shape.
2023-12-11 20:36:15 +01:00
Andreas Kling
3d92c26445 LibJS: Stop making shapes unique
We previously had a concept of unique shapes, which meant that they
couldn't be shared between multiple objects.

Object shapes became unique in three situations:

- They were the shape of the global object.
- They had more than 100 properties added to them.
- They had one or more properties deleted from them.

Unfortunately, unique shapes presented an annoying problem for inline
caches, and we added a "unique shape serial number" for being able to
tell that a unique shape had been mutated.

This patch gets rid of the concept of unique shapes, simplifying all
the caching code, since inline caches can now simply perform a shape
check and then we're good.

To make this possible, we now have the concept of delete transitions,
which occur when a property is deleted from a shape.

Note that this patch by itself introduces a performance regression in
some situtations, since we now create a lot more shapes, and marking
their property keys can be very heavy. This will be addressed in a
subsequent patch.
2023-12-11 20:36:15 +01:00
Andreas Kling
ef86cf4646 LibJS: Mark forward shape transition keys
These should really be weakly held by the Shape, but we don't have a
mechanism for weak hashmap keys at the moment, so let's just mark
these for now so they don't go stale.
2023-12-11 20:36:15 +01:00
dependabot[bot]
e5120ab389 CI: Bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 12:07:40 -07:00
Andrew Kaster
0052f9e895 CMake: Don't try to enable install options if no languages are enabled
This removes a CMake dev warning when building serenity via the
Superbuild.
2023-12-11 11:03:32 -07:00
Sam Atkins
9b77fc00ba LibWeb: Add missing FIXME to Navigable::navigate() 2023-12-11 16:33:28 +00:00