Commit graph

53615 commits

Author SHA1 Message Date
Andreas Kling
c01c4b41e2 LibWeb: Add ViewportPaintable to represent viewports in the paint tree
This patch just adds the new root paintable and updates the tests
expectations. The next patch will move painting logic from the layout
viewport to the paint viewport.
2023-08-20 05:02:59 +02:00
Andreas Kling
136ac1a6a5 LibWeb: Add virtuals to check if Paintable is PBox or PWithLines
Instead of inferring the type of paintables by looking at the type of
their origin in the layout tree, let's ask them directly.
2023-08-20 05:02:59 +02:00
Andreas Kling
6b3af92262 LibWeb: Give paintables their own pointer to the BrowsingContext 2023-08-20 05:02:59 +02:00
Andreas Kling
e67ac16862 LibWeb: Give Paintable its own pointer to the corresponding DOM node
Instead of going through the layout node's DOM pointer.
2023-08-20 05:02:59 +02:00
Andreas Kling
216bd513fa LibWeb: Make the paint tree a proper standalone tree
Until now, paint trees have been piggybacking on the layout tree for
traversal, and paintables didn't actually have their own parent/child
pointers.

This patch changes that by making Paintable inherit from TreeNode, and
adding a new pass to LayoutState::commit() where we recursively build
the new paint tree.
2023-08-20 05:02:59 +02:00
Andreas Kling
4d4dbacfc3 LibWeb: Remove all the unused functions from TreeNode 2023-08-20 05:02:59 +02:00
Andreas Kling
2f3e7187ca LibWeb: Remove unused TreeNode::is_child_allowed()
This is not used by any of the TreeNode template users.
2023-08-20 05:02:59 +02:00
Sebastian Zaha
a0fb1478bf Meta: Add options for lldb and gdb output to gn
This makes it possible to specify (instead of is_debug) a more
specialized is_debug_lldb or is_debug_gdb, so that clang outputs the
proper symbols. (For lldb this fixes issues with formatting by
setting -fstandalone-debug)
2023-08-19 20:09:26 -06:00
Sebastian Zaha
1b395a3df9 Meta: Port GCC compile option from cmake to gn
The clang build is very noisy without
-Wno-implicit-const-int-float-conversion
2023-08-19 20:09:26 -06:00
Sebastian Zaha
b4df4d66dc Meta: Port recent build changes to gn build
This ports the following commits:

f76c614a84
ddbe6bd7b4
2eaa528a0e
1b40bf9783
9f6ceff7cf
52d6df5ee5
9e22f01eba
bf4e2f3e9c
da2cd73bcf
2023-08-19 20:09:26 -06:00
Andrew Kaster
4c26b0b047 Tests: Convert WebDriver patch to a git patch and clean up assumptions
Instead of assuming that the WebDriver binary is in PATH or the two
most common build directories for our scripts, add a command line
argument to the script to pass a WebDriver binary.
2023-08-20 03:20:54 +02:00
Niklas Poslovski
9c3b0b367a Ladybird: Link libnsl and libsocket to RequestServer on Solaris 2023-08-19 18:25:56 -06:00
Andrew Kaster
326e8a0a33 LibWeb: Only update /etc/hosts for WPT if required lines are not present 2023-08-19 17:49:04 -06:00
Andrew Kaster
99499a6fae Ladybird+Meta: Add ctest to run WPT in the Integration configuration
By running ctest -C Integration -R WPT, you can run WPT. Adding just
-C Integration will run all other tests *and* the WPT test.

Also add support for ./Meta/serenity.sh test lagom WPT to serenity.sh
2023-08-19 23:50:29 +02:00
Andrew Kaster
8e605fb0f9 Meta+LibWeb: Make WPT run script runnable anywhere, remove apt installs
We should be documenting required pacakges elsewhere and installing them
in the setup step of CI.

This also fixes a problem where the run script would fail if you already
had a cloned wpt directory.
2023-08-19 23:50:29 +02:00
Sam Atkins
81b9f3ec15 LibWeb: Make ResolvedCSSStyleDeclaration method infallible
Specifically, `style_value_for_property()` and some supporting helper
functions.
2023-08-19 17:34:22 +02:00
Sam Atkins
eca144a75e LibWeb: Make absolutizing StyleValues infallible 2023-08-19 17:34:22 +02:00
Sam Atkins
e177cef8ff LibWeb: Make parse_css_value_for_properties() return Optional
Signalling failure with a null `PropertyAndValue::style_value` is weird.
2023-08-19 17:34:22 +02:00
Sam Atkins
2038cb3c81 LibWeb: Make CSS math function parsing infallible 2023-08-19 17:34:22 +02:00
Sam Atkins
28c2836c24 LibWeb: Make external StyleValue-parsing methods infallible 2023-08-19 17:34:22 +02:00
Sam Atkins
9e1bbfbd37 LibWeb: Make internal StyleValue-parsing methods infallible 2023-08-19 17:34:22 +02:00
Sam Atkins
8a8cc18cf4 LibWeb: Make StyleValue constructors infallible 2023-08-19 17:34:22 +02:00
Aliaksandr Kalenik
b2b99aba95 LibWeb: Use Core::Timer for cursor blink timer in BrowsingContext
Using `Core::Timer` that doesn't implicitly convert callback to
`JS::SafeFunction` fixes the bug when `BrowsingContext` is never
destroyed because of cyclic dependency between callback and
`BrowsingContext`.
2023-08-19 16:41:53 +02:00
Sam Atkins
dfb5ba0e2c LibCore: Prevent duplicate ArgsParser option names
Inspired by #20641, detect when adding an option that its long and short
names are both unique. If they are not, print a warning and crash.
2023-08-19 16:27:53 +02:00
Hans Joachim Desserud
2d31903e07 Ports: Add flare-game
Add a playable campagin to flare-engine
2023-08-19 15:51:50 +02:00
Hans Joachim Desserud
54ea999373 Ports: Add flare-engine
Action RPG engine
2023-08-19 15:51:50 +02:00
Fabian Dellwing
a6dd0e6339 Ports: Don't set previously unset environment variables
Co-authored-by: Tim Schumacher <timschumi@gmx.de>
Co-authored-by: Jelle Raaijmakers <jelle@gmta.nl>
2023-08-19 15:48:50 +02:00
Aliaksandr Kalenik
bdd3a16b16 LibWeb: Make Fetch::Infrastructure::Body be GC allocated
Making the body GC-allocated allows us to avoid using `JS::Handle`
for `m_stream` in its members.
2023-08-19 15:12:00 +02:00
Aliaksandr Kalenik
953c19bdb7 LibWeb: Clear callbacks in SharedImageRequest after request is done
Callbacks registered within the SharedImageRequest can be removed after
the request has been completed. This resolves the GC memory leak issue
that occurs due to a cyclic dependency, where the callback captures the
image request while being owned by the image request at the same time.
2023-08-19 15:10:20 +02:00
Daniel Bertalan
075ce53d14 AK: Fix Clang 18 -Wdeprecated-literal-operator warning
The proper syntax for defining user-defined literals does not require a
space between the `operator""` token and the operator name:

> error: identifier 'sv' preceded by whitespace in a literal operator
>        declaration is deprecated
2023-08-19 11:07:12 +02:00
Timothy Flynn
6d331389ad WebDriver: Coerce window handles to strings when activating a tab
This allows the session to reject the request with "no such window",
instead of crashing by assuming the JSON value was already a string.
2023-08-19 05:15:51 +02:00
Timothy Flynn
9608bfb576 LibWebView+Ladybird: Remove duplicate WebContent callback
We have on_navigate_back + on_back_button and on_navigate_forward +
on_forward_button. Remove the *_button variants.
2023-08-19 05:15:35 +02:00
Daniel Bertalan
1adf06c9f0 LibELF: Cache consecutive lookups for the same symbol
This reduces the startup time of LibWeb by 10%, and eliminates 156'000
of the total 481'000 global symbol lookups during a self-test run.
2023-08-19 05:15:08 +02:00
Aliaksandr Kalenik
9a07ac0b6a LibWeb/Fetch: Use JS::HeapFunction for callback in FetchAlgorithms
In FetchAlgorithms, it is common for callbacks to capture realms. This
can indirectly keep objects alive that hold FetchController with these
callbacks. This creates a cyclic dependency. However, when
JS::HeapFunction is used, this is not a problem, as captured by
callbacks values do not create new roots.
2023-08-19 05:03:17 +02:00
Aliaksandr Kalenik
469aea5a5b AK+LibJS: Introduce JS::HeapFunction
This change introduces HeapFunction, which is intended to be used as a
replacement for SafeFunction. The new type behaves like a regular
GC-allocated object, which means it needs to be visited from
visit_edges, and unlike SafeFunction, it does not create new roots for
captured parameters.

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-08-19 05:03:17 +02:00
Danik2343
a1ccc4b0cf Ports/zlib: Update to version 1.3 2023-08-18 23:56:41 +02:00
Tim Ledbetter
ca9785cf81 Ports/binutils: Build with support for zstd compression 2023-08-18 23:05:49 +02:00
Tim Ledbetter
5b23ec46b8 Ports/backward-cpp: Link against zstd if present
Previously, the build would fail when the `zstd` port was already
installed.
2023-08-18 23:05:49 +02:00
Tim Ledbetter
917de46589 Ports/mgba: Update to version 0.10.2 2023-08-18 22:43:07 +02:00
Tim Ledbetter
1a9c507093 Ports/mgba: Remove unnecessary futimens patch 2023-08-18 22:43:07 +02:00
Tim Ledbetter
0023bc0327 Ports/quake2: Add a launcher icon 2023-08-18 22:14:43 +02:00
Timothy Flynn
60a468d50b sql: Change the short-name flag for the SQLServer path
The short-name 's' is duplicated by another option.
2023-08-18 16:10:17 -04:00
Hendiadyoin1
b342b4dfb8 LibWeb: Fix a rounding issue on CSSPixels multiplication
Co-Authored-By: ronak69 <ronak69@danwin1210.de>
2023-08-18 17:58:44 +02:00
kleines Filmröllchen
096cecb95e Everywhere: Add RISC-V 64 target to the build system
This is a minimal set of changes to allow `serenity.sh build riscv64` to
successfully generate the build environment and start building. This
includes some, but not all, assembly stubs that will be needed later on;
they are currently empty.
2023-08-18 08:37:43 -06:00
Daniel Bertalan
c63fe0e1f1 Tests/LibELF: Test loading libraries with dynamic TLS
The setup is a bit peculiar: both the definition and the use site of
these TLS variables have to be in a shared library, otherwise the linker
might relax the global-dynamic access mode to something that doesn't
require a `__tls_get_addr` call.
2023-08-18 16:20:13 +02:00
Daniel Bertalan
ad9e674fa0 LibC+LibELF: Support loading shared libraries compiled with dynamic TLS
This is a prerequisite for upstreaming our LLVM patches, as our current
hack forcing `-ftls-model=initial-exec` in the Clang driver is not
acceptable upstream.

Currently, our kernel-managed TLS implementation limits us to only
having a single block of storage for all thread-local variables that's
initialized at load time. This PR merely implements the dynamic TLS
interface (`__tls_get_addr` and TLSDESC) on top of our static TLS
infrastructure. The current model's limitations still stand:
- a single static TLS block is reserved at load time, `dlopen()`-ing
  shared libraries that define thread-local variables might cause us to
  run out of space.
- the initial TLS image is not changeable post-load, so `dlopen()`-ing
  libraries with non-zero-initialized TLS variables is not supported.

The way we repurpose `ti_module` to mean "offset within static TLS
block" instead of "module index" is not ABI-compliant.
2023-08-18 16:20:13 +02:00
Daniel Bertalan
192ee4594c AK: Fix volatile qualifier in Atomic<T*>::ptr()
It's the pointer that should be volatile, not the pointed-to object.
2023-08-18 16:20:13 +02:00
Daniel Bertalan
182bb97479 CMake: Always build LibC with -ftls-model=initial-exec
LibC is always guaranteed to be loaded at program start, so its
thread-local variables live in the static TLS block. This permits us to
use the more optimal initial-exec TLS access model.
2023-08-18 16:20:13 +02:00
Daniel Bertalan
70fcbcf54b LibELF+readelf: Add missing constants for dynamic relocations
These should cover all relocation types we can possibly see in an x86_64
or AArch64 final linked ELF image.
2023-08-18 16:20:13 +02:00
Federico Zotti
d250f8fc3e Documentation: Add dependencies for alpine linux
- Add qemu-audio-pa for the audio driver
- Change qemu i386 with x86_64
- Mention fuse2fs for building.
2023-08-18 15:54:39 +02:00