Commit graph

53627 commits

Author SHA1 Message Date
Andrew Kaster 50383d318c Toolchain: Add a script to build GN from source 2023-08-19 21:05:06 -06:00
Andrew Kaster 0acd87954b Meta: Add Serenity Kernel to gn build 2023-08-19 21:05:06 -06:00
Andrew Kaster f4e37c8ad4 Meta: Add serenity toolchain to gn build 2023-08-19 21:05:06 -06:00
Andrew Kaster f8e1544f41 StateMachineGenerator: Pass output file as an argument
This allows us to avoid shell redirection to create output files, and
will help with the GN build.
2023-08-19 21:05:06 -06:00
Andrew Kaster f87a488b22 AK: Silence -Wimplicit-const-int-float-conversion in clamp_to_int 2023-08-19 21:05:06 -06:00
Andrew Kaster 871485cc0d Meta: Port fe672989a9 to gn build 2023-08-19 21:05:06 -06:00
0GreenClover0 f6c3ec3742 LibWeb: Add Base::apply_presentational_hints call to <symbol> element 2023-08-20 05:03:27 +02:00
Andreas Kling d296992fb3 LibWeb: Make StackingContext point to paint tree instead of layout tree
Eventually we should not need the layout tree for anything when painting
and this code will only look at the paint tree. For now, this is just
another step in that direction.
2023-08-20 05:02:59 +02:00
Andreas Kling 1e0ea45fe5 LibWeb: Make sure that SVG use and symbol elements get paintables
I'm about to make StackingContext traverse the paintable tree instead of
actually traversing the layout tree, and it turns out we were not
creating paintables for these SVG elements.

Also switch them to Layout::Box instead of the default InlineNode to
make the trees look a bit less weird. Ultimately, we should do something
specialized for these subtrees, but for now this'll do.
2023-08-20 05:02:59 +02:00
Andreas Kling 3d7c880a42 LibWeb: Give DOM::Node a direct pointer to its Paintable
Instead of going via the layout tree.
2023-08-20 05:02:59 +02:00
Andreas Kling 25375bf1d5 LibWeb: Make Document::paintable() return a ViewportPaintable 2023-08-20 05:02:59 +02:00
Andreas Kling 8bb275f2ea LibWeb: Move painting logic from Layout::Viewport to ViewportPaintable 2023-08-20 05:02:59 +02:00
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