Commit graph

3254 commits

Author SHA1 Message Date
Matthew Olsson 4ae7bbda52 Lagom: Add ClangPlugins to the build system 2024-05-13 16:50:54 -06:00
Matthew Olsson c3ed1a7995 Lagom: Add ClangPlugins
This is a more general and robust replacement of the LibJSGCVerifier.
We want to add more generic static analysis, and this new plugin will
be built in a way that integrates into the rest of the system.
2024-05-13 16:50:54 -06:00
Abuneri 4ea1e26aee LibLocale: Move includes below #pragma once in generated headers 2024-05-13 09:20:22 +02:00
Timothy Flynn 4bf0ddad4c Meta: Remove the generated bindings forwarding header from the GN build
This was removed in commit 22705e3065.
2024-05-12 18:10:05 -04:00
Timothy Flynn 0bd5e94958 Meta: Add missing IDL files to the GN build
Unclear why these being missing did not cause a compilation error.
2024-05-12 15:38:18 -06:00
Timothy Flynn cc84dba7e8 Meta: Port recent changes to the GN build
cea59b6642
2bc51f08d9
e10721f1b5
3a5eabc43b
2024-05-12 15:38:18 -06:00
Xexxa a9269afa05 Base: Add more emoji
🤽 - U+1F93D PERSON PLAYING WATER POLO
🤽‍♂️ - U+1F93D U+200D U+2642 MAN PLAYING WATER POLO
🤽‍♀️ - U+1F93D U+200D U+2640 WOMAN PLAYING WATER POLO
🦨 - U+1F9A8 SKUNK
2024-05-11 17:09:14 -06:00
Nico Weber 3a4e0c2804 LibGfx+Utilities: Add animation utility, make it write animated webps
The high-level design is that we have a static method on WebPWriter that
returns an AnimationWriter object. AnimationWriter has a virtual method
for writing individual frames. This allows streaming animations to disk,
without having to buffer up the entire animation in memory first.
The semantics of this function, add_frame(), are that data is flushed
to disk every time the function is called, so that no explicit `close()`
method is needed.

For some formats that store animation length at the start of the file,
including WebP, this means that this needs to write to a SeekableStream,
so that add_frame() can seek to the start and update the size when a
frame is written.

This design should work for GIF and APNG writing as well. We can move
AnimationWriter to a new header if we add writers for these.

Currently, `animation` can read any animated image format we can read
(apng, gif, webp) and convert it to an animated webp file.

The written animated webp file is not compressed whatsoever, so this
creates large output files at the moment.
2024-05-11 15:43:02 -04:00
Timothy Flynn 5f6495fb29 CI: Remove now-unused Azure pipeline templates 2024-05-10 16:07:23 -04:00
Timothy Flynn fffa4ef250 CI: Move the nightly Android CI to GitHub actions 2024-05-10 16:07:23 -04:00
Timothy Flynn 0887dbfd80 CI: Move the nightly Lagom GCC CI to GitHub actions 2024-05-10 16:07:23 -04:00
Timothy Flynn 7276d52a0e CI: Move the nightly Serenity code coverage CI to GitHub actions 2024-05-10 16:07:23 -04:00
Andreas Kling 76df5ae030 Meta: Update Clang version requirement to 17+ 2024-05-10 19:53:15 +02:00
Dan Klishch 8d3eb937c8 Meta: Remove check-symbols.sh
check-symbols.sh had been dealing with libc.a which we don't provide
anymore.
2024-05-08 09:54:41 -06:00
Dan Klishch 9c707c4205 Tests/LibELF: Run LibELF tests on Lagom using Linux runtime linker
So that we can be sure Serenity's runtime linker performs the same.
2024-05-08 09:21:36 -06:00
Andrew Kaster e10721f1b5 LibWeb: Add stub implementation of FontFaceSet and Document.fonts
This is now enough for duolingo to load and use its fallback fonts.
2024-05-08 10:39:16 +02:00
Andrew Kaster 2c31d7dddc LibWeb: Add stub implementation of CSS FontFace Web API 2024-05-08 10:39:16 +02:00
implicitfield a08d1637e2 Kernel: Add FUSE support
This adds both the fuse device (used for communication between the
kernel and the filesystem) and filesystem implementation itself.
2024-05-07 16:54:27 -06:00
Dan Klishch ce5813d6ab LibC: Remove libssp_nonshared.a
__stack_chk_fail_local, which libssp_nonshared.a provides, is a relic of
i386 times and is not used on modern architectures.
2024-05-07 16:39:17 -06:00
Nico Weber 3435770c23 Meta: Use -std=c++2b on mac hosts in the GN build
Xcode clang doesn't understand the -std=c++23 spelling yet, and this
is what CMake's `set(CMAKE_CXX_STANDARD 23)` translates to too.

Unbreaks building with Xcode clang on macOS.
2024-05-07 11:41:40 -04:00
Nico Weber 2f81a3610d Meta: Port recent changes to the GN build
3a73eb99ac
2024-05-07 11:41:40 -04:00
Andrew Kaster 77e890b15e Meta+Documentation+Ports: Move from C++20 to C++23
Now that oss-fuzz is on a clang commit > the 17.x release candidates,
we can start looking at some shiny new features to enable.
2024-05-06 11:46:28 -06:00
Nico Weber d04f9cf3c8 LibGfx+image: Add scaffolding for writing webp files 2024-05-06 17:32:19 +02:00
Andrew Kaster 68ec099b66 Ladybird: Update Android build to work with current LibWebView/LibCore
Also update to the latest gradle plugin versions and other dependencies
as recommended by Android Studio Jellyfish.
2024-05-06 09:31:32 -06:00
Hendiadyoin1 b2377f1f9c Meta/run.py: Bring back SERENITY_EXTRA_QEMU_ARGS 2024-05-02 07:44:13 -06:00
Shannon Booth c9b2c1c747 LibWeb: Add stub IDL interface for AudioScheduledSourceNode
This is a base class of a few different audio nodes, most notably for
our immediate needs - OscillatorNode.
2024-05-02 07:49:23 +02:00
Shannon Booth 6661c68b28 LibWeb: Add stub IDL interface for AudioNode
An AudioNode is the fundamental building block used in 'Audio
Contexts'. In our immediate case, the audio node we are working towards
implementing is an oscillating source node.
2024-05-02 07:49:23 +02:00
Shannon Booth 5ae0ac7b73 LibWeb: Add stub IDL interface for AudioParam
An AudioParam is a fundamental building block in WebAudio as it controls
the value of an individual parameter of an AudioNode, such as volume.
2024-05-02 07:49:23 +02:00
Shannon Booth b1b7e2324a LibWeb: Add stub IDL interface for PeriodicWave
PeriodicWave represents an arbitrary periodic waveform to be used
with an OscillatorNode.
2024-05-02 07:49:23 +02:00
Ali Mohammad Pur 7f39142f0f Meta: Show GML formatting issues after lint 2024-04-30 17:46:41 -06:00
Ali Mohammad Pur f3a4118aee GMLCompiler+LibGUI: Add support for object properties and undo hack
Previously the GML compiler did not support object properties such as
`content_widget: @GUI::Widget{}` for GUI::ScrollableContainerWidget;
this commit adds support for such properties by simply calling
`set_<key>(<TProperty>&)` on the object.
This commit also removes the previous hack where
ScrollableContainerWidget was special-cased to have its singular child
used as the content widget; the only GML file using this behaviour was
also changed to be in line with 'proper' GML as handled by the GML
Playground.
2024-04-30 17:46:41 -06:00
Ali Mohammad Pur 5c17b61378 GMLCompiler: Use synthetic widget definition when original is missing
This makes it possible to use externally defined toplevel widgets that
have no C++ header defining them.
Note that this only allows widget-native properties on the object, as
the actual original definition is not available.
2024-04-30 17:46:41 -06:00
Andrew Kaster 37a0466285 CMake: Resolve FIXMEs related to CMake < 3.20
We already have required this version for quite a while for Lagom,
Ladybird and Serenity. Now that we require it in all of our CMakeLists,
let's scrub for better ways of writing things.
2024-04-30 07:14:17 -06:00
Andrew Kaster 65bfd2ca2d CMake: Bump Superbuild CMake requirement to 3.20
This more closely matches the serenity requirement (3.25), the Lagom
requirement (3.21) and the Ladybird requirement (3.23)
2024-04-30 07:14:17 -06:00
Timothy Flynn 1b859bac64 Meta: Port recent changes to the GN build
cd07249482
acd5369774
7d05fe84bc
2024-04-30 06:02:15 -06:00
Idan Horowitz c96730c984 Meta: Enable networking by default on RISC-V 2024-04-30 06:01:26 -06:00
Andrew Kaster bc976fe7e1 LibWebView: Create plumbing for a single UI process
This allows main UI processes created while there is a currently
running one to request a new tab or a new window with the initial urls
provided on the command line. This matches (almost) the behavior of
Chromium and Firefox.

Add a new IPC protocol between two UI processes. The main UI process
will create an IPC server socket, while secondary UI processes will
connect to that socket and send over the URLs and action it wants the
main process to take.
2024-04-27 20:32:12 -04:00
Shannon Booth 22705e3065 LibWeb: Don't generate Bindings/Forward.h
This is no longer used.
2024-04-27 18:29:35 -04:00
Shannon Booth bad44f8fc9 LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h
This was resulting in a whole lot of rebuilding whenever a new IDL
interface was added.

Instead, just directly include the prototype in every C++ file which
needs it. While we only really need a forward declaration in each cpp
file; including the full prototype header (which itself only includes
LibJS/Object.h, which is already transitively brought in by
PlatformObject) - it seems like a small price to pay compared to what
feels like a full rebuild of LibWeb whenever a new IDL file is added.

Given all of these includes are only needed for the ::initialize
method, there is probably a smart way of avoiding this problem
altogether. I've considered both using some macro trickery or generating
these functions somehow instead.
2024-04-27 18:29:35 -04:00
Shannon Booth de2cad02aa LibWeb: Factor out a function to generate IDL enumerations
The prototype header generation was getting a bit long.

This is also a step towards generating code for IDL files only
containing an enum definition without any interface. In that case we
can't put the enum definitions alongside the prototype - there is no
prototype to speak of.
2024-04-27 07:11:02 +02:00
Shannon Booth 4a62268d73 LibWeb: Do not handle an invalid enum in idl_enum_to_string
We should never hit this case - so don't generate code for it, and
instead put in a VERIFY_NOT_REACHED.

Also improve the formatting of the generated code to closer match the
serenity code style.
2024-04-27 07:11:02 +02:00
Shannon Booth 10add8aa8a LibWeb: Improve error message for IDL generation with missing interface
Instead of a cryptic error that occurs due to an interface with no name,
fail early on by explicitly checking that an interface was parsed with a
name.
2024-04-27 07:11:02 +02:00
Dan Klishch be9ca65179 Meta: Use stripped-down version of LibELF on Lagom 2024-04-26 19:08:13 -06:00
Tim Ledbetter 1127fa1e01 IDLGenerators: Set namespace object prototype to Object.prototype
Previously, namespace objects were constructed with no prototype, so
calling methods like `toString()` on them would unexpectedly throw an
exception.
2024-04-26 20:02:42 +02:00
Tim Ledbetter 3eb07a9b8b IDLGenerators: Don't duplicate include statements for each import
Previously, all `#import` statements generated two identical includes
in the generated C++ source code.
2024-04-26 08:00:32 -04:00
Tim Ledbetter ddd1ac1e36 LibWeb: Add a custom extended attribute for namespace-level finalization
This change adds the `WithFinalizer` extended attribute, which allows
namespaces to call a custom function at the point they are finalized.
2024-04-26 13:56:39 +02:00
Tim Ledbetter 6d4b8bde55 LibWeb: Isolate WebAssembly cache by global object
This change moves WebAssembly related data that was previously globally
accessible into the `WebAssemblyCache` object and creates one of these
per global object. This ensures that WebAssembly data cannot be
accessed across realms.
2024-04-26 13:56:39 +02:00
Tim Ledbetter 5e75afd549 LibWeb: Fix typo in extended WithGCVisitor extended attribute name 2024-04-26 13:56:39 +02:00
Idan Horowitz 8a86218e25 Meta: Support debugging the riscv64 kernel 2024-04-26 09:52:56 +02:00
Idan Horowitz 904ebb74a9 Kernel: Use NVME polling by default on RISC-V
Since we don't support the RISC-V PLIC yet, we can't actually use
interrupt-based NVME handling.
2024-04-26 09:52:56 +02:00
Idan Horowitz 6d255fb92b Meta: Enable graphics by default on RISCV64 2024-04-26 09:52:56 +02:00
Andrew Kaster ce9eed918f ImageDecoder: Schedule decode jobs on the LibThreading background thread
This allows the ImageDecoder service to handle new IPC requests while
decoding in parallel.
2024-04-26 09:41:24 +02:00
Timothy Flynn 1560d6ad62 LibCore: Remove the now-obsolete SingletonProcess helper files 2024-04-24 15:51:58 -06: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
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
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
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
Timothy Flynn f16f89eb32 Ladybird+LibWebView: Move SQLServer launcher to Ladybird
It previously resided in LibWebView to hide the details of launching a
singleton process. That functionality now lives in LibCore. By moving
this to Ladybird, we will be able to register the process with the task
manager.
2024-04-22 14:46:10 -06:00
Timothy Flynn bf50881e61 LibCore+LibSQL+LibWebView: Move launching a singleton process to LibCore
This just moves the code to launch a single process such as SQLServer to
LibCore. This will allow re-using this feature for other processes, and
will allow moving the launching of SQLServer to Ladybird.
2024-04-22 14:46:10 -06:00
Timothy Flynn 5dd3b91f0e LibCore+LibWebView: Move process statistics to LibCore
This will be needed to collect statistics from processes that do not
have anything to do with LibWebView. The ProcessInfo structure must be
virtual to allow callers to add application-specific information.
2024-04-22 14:46:10 -06:00
Timothy Flynn ac594fae5e Meta: Port recent changes to the GN build
376427380e
2024-04-22 14:46:10 -06:00
Daniel Bertalan 2f43b4ff15 Meta: Enable HVF acceleration on x86_64 macOS 2024-04-22 14:04:02 -06:00
Shannon Booth 1ec6399c00 Everywhere: Remove uneeded short option argument where possible 2024-04-22 08:10:08 +02:00
Dan Klishch d8119c4b4a LibLocale: Statically link LibLocaleData into LibLocale 2024-04-21 13:34:04 -06:00
Andreas Kling 1068518bdf LibLocale: Use String::from_utf8_without_validation() in generated code
The unnecessary UTF-8 validation performed here was actually visible
while profiling navigation between pages on GitHub.
2024-04-21 19:32:49 +02:00
Jess f4c8f1a346 Meta: Add ASAN option allocator_may_return_null=1 to CI
This stops ASAN from complaining about massive allocations.
2024-04-20 19:23:46 -04:00
Andrew Kaster 5e1d678bae Ladybird+Userland: Remove use of unnecessary fd passing socket concept
Now that LibIPC is using SCM_RIGHTS properly, we can go back to only
having one socket laying around when needing to transfer fds to peers.
2024-04-19 16:38:55 -04:00
Andrew Kaster cb87725ec8 LibIPC+LibWeb: Transfer IPC::Files using sendmsg/recvmsg directly
This refactor eliminates the need for a second "fd passing socket" on
Lagom, as it uses SCM_RIGHTS in the expected fashion, to send fds along
with the data of our Unix socket message.
2024-04-19 16:38:55 -04:00
Timothy Flynn 5a3efb8842 LibLocale: Update to CLDR version 45.0.0
https://cldr.unicode.org/index/downloads/cldr-45
2024-04-19 11:00:31 +02:00
Timothy Flynn 7e51d6e07d Meta: Port recent changes to the GN build
e487f70bbf
f4f4f7781d
2024-04-19 11:00:31 +02:00
Nico Weber ea441fea95 LibGfx: Move QMArithmeticDecoder to its own file
It will be used by the JPEG2000 decoder as well.

Pure code move, no behavior change.
2024-04-19 10:59:11 +02:00
Dan Klishch b8c3e75573 Meta+Userland: Fix more instances of bad lambda-Variant interaction
These don't cause compilation to fail but they still crash crashd.
2024-04-18 13:14:33 -06:00
Andrew Kaster c87e32154a Ladybird+headless-browser: Make RequestServer single instance on Lagom
Co-Authored-By: Timothy Flynn <trflynn89@pm.me>
2024-04-17 10:09:49 -04:00
Andrew Kaster 336b661835 Ladybird: Move QApplication class to its own file
We'll attach some global data to it in an upcoming commit, so it needs
to be accessible outside of main.cpp.
2024-04-17 10:09:49 -04:00
Jamie Mansfield 2d90317c20 LibWeb: Implement <desc> SVG element 2024-04-17 07:17:27 +02:00
Andreas Kling f4f4f7781d Ladybird+LibWeb: Add optional IDL call tracing
When launched with the new --enable-idl-tracing option, we now log
every call to web platform APIs declared via IDL, along with the
arguments passed.

This can be very helpful when trying to figure out what a site is
doing, especially if it's not doing what you'd expect.
2024-04-16 16:57:06 +02:00
Space Meyer 5d89d3090e Kernel: Add KCOV recursion debugging 2024-04-15 21:16:22 -06:00
Space Meyer 8050ef24a6 Meta: Correct kaddr2line example in serenity.sh 2024-04-15 21:16:22 -06:00
Aryan Baburajan d6ca054935 GMLCompiler: GML compile compatibility for ScrollableContainerWidget 2024-04-15 14:01:13 +02:00
Aliaksandr Kalenik ccb363c443 LibWeb: Add hashchange event support 2024-04-15 01:02:51 -07:00
Timothy Flynn 6eb2052d40 LibWebView: Remove now-unused history object 2024-04-14 18:53:58 -07:00
Nico Weber 3b89a187ac Meta/gn: Port #23933 2024-04-13 19:30:53 -06:00
Timothy Flynn 3ab5ecb671 Ladybird/AppKit: Implement a simple TaskManager window
Unlike the Inspector window, this is owned by the ApplicationDelegate as
there should be only a single task manager for the entire application.
2024-04-12 09:08:16 +02:00
Timothy Flynn 058dd225dd Meta: Port recent changes to the GN build
f3d3454976
8fa636d8d5
2024-04-11 18:41:57 +02:00
Timothy Flynn b5ebbe6159 Meta: Port recent changes to the GN build
676fc5e8c6
b873e5bc1d
2024-04-10 07:46:42 +02:00
Andrew Kaster 8c5e64e686 Ladybird+LibWebView: Add mechanism to get Mach task port for helpers
On macOS, it's not trivial to get a Mach task port for your children.
This implementation registers the chrome process as a well-known
service with launchd based on its pid, and lets each child process
send over a reference to its mach_task_self() back to the chrome.

We'll need this Mach task port right to get process statistics.
2024-04-09 16:43:27 -06:00
Andrew Kaster 77f18cf062 LibCore: Add a rough abstraction class around Mach port rights 2024-04-09 16:43:27 -06:00
Matthew Olsson abb4b6d117 LibJSGCVerifier: Detect missing JS_CELL() calls 2024-04-09 09:13:06 +02:00
Matthew Olsson 312bc94ac9 LibJSGCVerifier: Detect missing JS_DECLARE_ALLOCATOR() calls
C++ classes that inherit from JS::Cell and are leaf classes should have
their own type-specific allocator. We also do this for non-leaf classes
that are constructable from JS.

To do this, JSON messages are passed to communicate information about
each class the Clang tool comes across. This is the only message we have
to worry about for now, but in the future if we want to transmit
different kinds of information, we can make this message format more
generic.
2024-04-09 09:13:06 +02:00
Matthew Olsson dfce95ab0f LibJSGCVerifier: Support message passing between Clang processes
This allows each Clang process to send JSON messages to the
orchestrating Python process, which aggregates the message and can do
something with them all at the end. This is required because we run
Clang multithreaded to speed up the tool execution.

I did try to add a second frontend tool that accepts all the files at
once, but it was _extremely_ slow, so this is the next best thing.
2024-04-09 09:13:06 +02:00
Matthew Olsson 76fa127cbf LibJSGCVerifier: Detect stack-allocated ref captures in lambdas
For example, consider the following code snippet:

    Vector<Function<void()>> m_callbacks;
    void add_callback(Function<void()> callback)
    {
    	m_callbacks.append(move(callback));
    }

    // Somewhere else...
    void do_something()
    {
    	int a = 10;
    	add_callback([&a] {
            dbgln("a is {}", a);
    	});
    } // Oops, "a" is now destroyed, but the callback in m_callbacks
      // has a reference to it!

We now statically detect the capture of "a" in the lambda above and flag
it as incorrect. Note that capturing the value implicitly with a capture
list of `[&]` would also be detected.

Of course, many functions that accept Function<...> don't store them
anywhere, instead immediately invoking them inside of the function. To
avoid a warning in this case, the parameter can be annotated with
NOESCAPE to indicate that capturing stack variables is fine:

    void do_something_now(NOESCAPE Function<...> callback)
    {
    	callback(...)
    }

Lastly, there are situations where the callback does generally escape,
but where the caller knows that it won't escape long enough to cause any
issues. For example, consider this fake example from LibWeb:

    void do_something()
    {
    	bool is_done = false;
    	HTML::queue_global_task([&] {
            do_some_work();
            is_done = true;
        });
    	HTML::main_thread_event_loop().spin_until([&] {
            return is_done;
        });
    }

In this case, we know that the lambda passed to queue_global_task will
be executed before the function returns, and will not persist
afterwards. To avoid this warning, annotate the type of the capture
with IGNORE_USE_IN_ESCAPING_LAMBDA:

    void do_something()
    {
   	IGNORE_USE_IN_ESCAPING_LAMBDA bool is_done = false;
    	// ...
    }
2024-04-09 09:10:44 +02:00
Andrew Kaster e5415f6d86 Documentation: Add more specific instructions on how to use the GN build 2024-04-08 18:49:41 -06:00
Lucas CHOLLET 94128fe027 LibWeb: Make CanvasImageSource also be an ImageBitmap 2024-04-08 14:25:36 +02:00
Shannon Booth b873e5bc1d LibWeb: Implement the PointerEvent interface
As defined in: https://w3c.github.io/pointerevents

With the exception of the getCoalescedEvents and getPredictedEvents
APIs.

There are still many other parts of that spec (such as the event
handlers) left to implement, but this does get us at least some of the
way.
2024-04-08 14:25:08 +02:00
Andreas Kling e67f6343f7 LibJSGCVerifier: Warn on missing visit of JS::Value members
A JS::Value can refer to a GC-allocated object, so let's ensure they
are visited when necessary.
2024-04-07 18:01:50 +02:00
Shannon Booth 80658743d3 LibWeb: Generate Optional<NonnullGCPtr<T>> as GCPtr<T>
This is the general pattern which has been adopted in LibWeb, so let's
generate our IDL like this too.
2024-04-07 18:01:05 +02:00
Tim Ledbetter 8324a82409 IPCCompiler: Give a useful error if parameter is unnamed
Previously, parsing would continue if a parameter wasn't given a name
and malformed code would be generated, leading to hard to diagnose
compiler errors.
2024-04-07 07:17:31 +02:00
Tim Ledbetter 076904a59b IPCCompiler: Allow generic parameter types to contain spaces
Previously, a parameter type containing any spaces would cause parsing
to fail.
2024-04-07 07:17:31 +02:00
Matthew Olsson aac873fcec LibWeb: Fix a few "missing visit_edges" warnings from the GC verifier 2024-04-07 07:03:13 +02:00
Matthew Olsson 164db73bdc IDLGenerators: Fix a GCVerifier warning 2024-04-07 07:03:13 +02:00
Matthew Olsson f3096bd4a1 LibJSGCVerifier: Define the NULL constant
Not sure why this throws warnings, but its a simple fix
2024-04-07 07:03:13 +02:00
Idan Horowitz 945c58c7c1 LibUnicode: Generate and use code point composition mappings
These allow us to binary search the code point compositions based on
the first code point being combined, which makes the search close to
O(log N) instead of O(N).
2024-04-06 14:21:04 -04:00
Torben Virtmann 6207405f3d Base: Add and Rework Emoji
- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB

Base: Add and Rework Emoji

- 🛳 - U+1F6F3 PASSENGER SHIP

- 🕷️ - U+1F577 SPIDER
- 🕸️ - U+1F578 SPIDER WEB
2024-04-06 13:40:45 -04:00
Idan Horowitz 9f31a83c2e LibJSGCVerifier: Assume MarkedVector wrapped members are valid
These are effectively heap roots, so they don't need to be visited.
2024-04-06 06:59:36 +02:00
Idan Horowitz f921952cc3 LibJSGCVerifier: Warn about missing visit_edges impls with GC members
Previously we would only warn about missing calls to visit inside
visit_edges implementations, now we warn as well when there's no
visit_edges implementation at all.
2024-04-06 06:59:36 +02:00
Idan Horowitz c84cd1d668 LibJSGCVerifier: Support marking GCPtr members as raw references
This lets us avoid false positives when a GCPtr-wrapped member is only
a weak reference which is automatically updated by the GC when the
member's gc state is updated.
2024-04-06 06:59:36 +02:00
Shannon Booth 0090b916dd LibJS: Make ParserError::to_string infallible 2024-04-05 20:01:37 -04:00
Idan Horowitz 1fd6673f87 LibJSGCVerifier: Support building & running with the Lagom build 2024-04-05 21:49:13 +02:00
Timothy Flynn 683c08744a Userland: Avoid some conversions from rvalue strings to StringView
These are all actually fine, there is no UAF here. But once e.g.
`ByteString::view() &&` is deleted, these instances won't compile.
2024-04-04 11:23:21 +02:00
Timothy Flynn b5f22b6e90 AK+Userland: Remove some needlessly explicit conversions to StringView 2024-04-04 11:23:21 +02:00
Andrew Kaster 6d38d55fc8 LibWebView: Collect memory and cpu usage for helpers on Linux 2024-04-04 09:41:01 +02:00
0x4261756D f489c3d9c2 LibJSGCVerifier: Fix false positives in HeapFunction::visit_edges()
clang doesn't make all `Base::visit_edges()` calls CXXMemberCallExprs
This would lead to false positives like in HeapFunction,
where the matcher would fail to match and report a warning.
Also previously the matcher would succeed
if the visited class is missing the call to `Base::visit_edges()`
but an included class has a correct method.

The new matcher checks the current class for `visit_edges`-overrides
and matches all `visit_edges`-memberExprs inside,
checking those for starting with `Base::`.
This seems to get rid of the false positives
and should be more correct detecting missing calls.
2024-04-04 07:50:13 +02:00
0x4261756D 7743dcf4a9 LibJSGCVerifier: Fix dangling-reference errors
When building, clang would throw errors about dangling references.
Extracting `template_args` to a variable before the loop and
indexing into that seems to fix the errors.
2024-04-04 07:50:13 +02:00
Andrew Kaster d1fdfead54 LibWebView+Browser: Collect memory and cpu usage for helpers on Serenity 2024-04-03 20:56:33 +02:00
Timothy Flynn 1fc995d4aa Ladybird/Qt: Add a hover effect to the audio play state button
By default, a flat QPushButton does not have a hover effect. Add a small
subclass to provide such an effect to make it clearer it is a button.
2024-04-03 20:56:04 +02:00
Timothy Flynn 22ab12e4a1 Meta: Port recent changes to the GN build
ccebc7a905
2024-04-03 20:56:04 +02:00
Luke Wilde 316814988f LibIDL+LibWeb: Add support for static readonly attributes
Support for settable attributes is a FIXME.
2024-04-03 07:55:51 +02:00
Nico Weber 7fc4ea5495 Meta/jbig2_to_pdf.py: Read jbig2 dimensions from file
Since we're parsing segment headers for random-access jbig2 inputs
already, just always do that and get the image dimensions from the
PageInformation segment data. Not all that much more code, and it
makes this script much more pleasant to use.
2024-04-02 15:00:23 -04:00
Nico Weber 05844141bf Meta/jbig2_to_pdf.py: Write correct page contents stream length
The previoulsy hardcoded `25` worked only if the image had width and
height with three digits each (e.g. 399x400).
2024-04-02 15:00:23 -04:00
Nico Weber 2872c37993 Meta/jbig2_to_pdf.py: Allow jbig2 files with random-access organization
jbig2 data in PDFs is in the embedded organization, which is like the
sequential organization with the file header removed.

That means jbig2 files using the random-access organization need to
be transformed to be supported. A random-access jbig2 has all segment
headers at the start, followed by the data of all segments. Decode
all headers and rewrite them to the sequential organization, where
each segment header is followed by that segment's data.

The motivation is that almost all of the jbig2 files in
ghostpdl/test/jbig2 use the random-access organization.
2024-04-02 15:00:23 -04:00
Timothy Flynn de97497d26 Meta: Port recent changes to the GN build
31c0d00ab1
2024-04-02 15:00:15 -04:00
Andrew Kaster fa8b64d59a LibWebView+WebContent: Notify UI process about WebContent PID explicitly
On Serenity, it's not trivial to extract the peer pid from a socket that
is created by SystemServer and then passed to a forked service process.
This patch adds an API to let the WebContent process notify the UI
directly, which makes the WebContent process show up in the Serenity
port's TaskManagerWidget. It seems that we will need to do something of
this sort in order to properly gather metrics on macOS as well, due to
the way that self mach ports work.
2024-04-02 09:52:34 -06:00
Andrew Kaster 096feaaeb8 Ladybird+LibWebView: Add ProcessManager to track live processes
This model will be used to add a Processes tab to the inspector.
2024-04-02 09:52:34 -06:00
Timothy Flynn 51f5fa1437 Meta: Port recent changes to the GN build
3bab4fbae9
a6a40a5bc6
6d72f40d8d
1f59e21829
2024-04-02 07:50:17 +02:00
MacDue 59cd086199 LibWeb: Stub (and implement) SVGSVGElement methods and attributes
This implements trivial functions and stubs out the rest.

Implemented:

```
[SameObject] readonly attribute SVGAnimatedLength x;
[SameObject] readonly attribute SVGAnimatedLength y;
[SameObject] readonly attribute SVGAnimatedLength width;
[SameObject] readonly attribute SVGAnimatedLength height;

undefined deselectAll();

SVGLength createSVGLength();
DOMPoint createSVGPoint();
DOMMatrix createSVGMatrix();
DOMRect createSVGRect();
SVGTransform createSVGTransform();

Element getElementById(DOMString elementId);

unsigned long suspendRedraw(unsigned long maxWaitMilliseconds);
undefined unsuspendRedraw(unsigned long suspendHandleID);
undefined unsuspendRedrawAll();
undefined forceRedraw();
```

Stubbed:

```
attribute float currentScale;
[SameObject] readonly attribute DOMPointReadOnly currentTranslate;

NodeList getIntersectionList(
  DOMRectReadOnly rect, SVGElement? referenceElement);
NodeList getEnclosureList(
  DOMRectReadOnly rect, SVGElement? referenceElement);
boolean checkIntersection(SVGElement element, DOMRectReadOnly rect);
boolean checkEnclosure(SVGElement element, DOMRectReadOnly rect);
```
2024-04-01 21:10:35 +02:00
MacDue a6a40a5bc6 LibWeb: Stub out SVGTransform 2024-04-01 21:10:35 +02:00
Shannon Booth e590e92399 LibWeb: Add HTMLCollection as a platform object
It is returned by the IDL of HTMLAllCollection.
2024-04-01 14:41:00 +02:00
Shannon Booth a09849072e LibWeb: Pass through [EnforceRange] and [Clamp] extended attributes
To the 'convert to int' AO. Nothing actually makes use of the [Clamp]
attribute yet in our implementation, but we may as well add support for
it now since it is trivial to do do.
2024-03-30 21:21:23 +01:00
Idan Horowitz 56b0066485 Meta: Remove explicit default library type for lagom libraries
This partially reverts d1e2d2a4, which made us explicitly specify the
library type for lagom libraries. This broke the fuzzer build, which
relies on the BUILD_SHARED_LIBS cmake variable to enable static builds.
2024-03-30 14:42:15 -04:00
Kenneth Myhra 900a889eb1 LibWeb+LibIDL: Add support for overloading constructors 2024-03-30 19:29:14 +01:00
Kenneth Myhra 09779ab4a6 LibWeb: Add Uint8ClampedArray as supported parameter type
Adds Uint8ClampedArray as supported parameter type to our
BindingsGenerator.
2024-03-30 19:29:14 +01:00
Timothy Flynn 0df7f5bcfc Meta: Port recent changes to the GN build
5dce559ed8
c1b5fe61d1
2024-03-30 07:35:30 +01:00
Timothy Flynn f6ea4bbff8 LibCore: Turn LibCoreMinimal into a normal shared library
We were able to keep LibCoreMinimal a bit smaller as an object library,
but that is causing ODR violations in the fuzzer build (realistically,
should be an issue in all builds, but only the fuzzer actively complains
for some reason).

To make it a shared library, we have to add a couple more symbols to it,
and make LibCore publicly depend on it.
2024-03-29 16:23:34 -04:00
Timothy Flynn 8b1ad5c496 LibWeb+LibWebView+WebContent: Add a new IPC for modifying history state
Let's not re-invoke the "page did start loading" IPC when the history
state is pushed/replaced. It's a bit misleading (the change does not
actually load the new URL), but also the chromes may do more work than
we want when we change the URL.

Instead, add a new IPC for the history object to invoke.
2024-03-29 08:52:01 -04:00
Timothy Flynn cd73878d8c Meta: Port recent changes to the GN build
a1f4d1875e
2024-03-29 08:52:01 -04:00
Timothy Flynn 40c0dd81d2 LibWeb+LibWebView+WebContent: Inform chromes when audio is played/paused
Most browsers have some indicator when audio is playing in a tab, which
makes it easier to find that tab and mute unwanted audio. This adds an
IPC to allow the Ladybird chromes to do something similar.
2024-03-28 21:08:23 +01:00
Timothy Flynn 21a223845f Meta: Add the "paste" icon to the GN build 2024-03-28 21:08:23 +01:00
Timothy Flynn d74059580c LibWeb: Return the correct substring when parsing an HTTP quoted string
We were off-by-one when returning the result of parsing a quoted string
in Web::Fetch::Infrastructure::collect_an_http_quoted_string. Instead of
backtracking the lexer and consuming the backtracked string, do a simple
substring operation.
2024-03-26 19:19:13 +00:00
Timothy Flynn 576c2f4f4d LibURL+LibUnicode+LibWebView: Handle punycode directly in LibURL
We had defined punycode handling in LibUnicode when LibURL (AK at the
time) was unable to depend on LibUnicode. This is no longer the case.
2024-03-26 12:25:21 -04:00
Timothy Flynn 5ddfcfd07e LibCore+LibTimeZone: Move TZDB utilities from LibTimeZone to LibCore
We had weakly defined a couple utilities needed by Core::DateTime when
LibCore was unable to depend on LibTimeZone. This is no longer the case.
2024-03-26 12:25:21 -04:00
Timothy Flynn 9b1b91f98a LibFileSystem: Depend on the minimal LibCore source set 2024-03-26 12:25:21 -04:00
Timothy Flynn 6f65e188f0 Meta/Tools: Depend on the minimal LibCore source set 2024-03-26 12:25:21 -04:00
Timothy Flynn f7ddcb1f98 LibCore: Separate some LibCore sources into a minimal object library
We have been dancing around circular dependencies between LibCore and
generated sources. For example, LibURL currently cannot depend on
LibUnicode because the LibUnicode generators depend on LibCore, and
LibCore depends on LibURL. LibTimeZone is in a similar situation.

To alleviate this, we can define the minimal sources that the code
generators need as an object library. This will allow the generators to
depend on this library, rather than the full LibCore.
2024-03-26 12:25:21 -04:00
Timothy Flynn 4c08a1e0c0 Meta: Remove serenity_lib_static() CMake helper function
Its one user (LibMain) can now just specify a STATIC library type in an
invocation of serenity_lib().
2024-03-26 12:25:21 -04:00
Timothy Flynn d1e2d2a4df Meta: Allow specifying the library type when invoking serenity_lib()
This will allow creating object libraries with this function.
2024-03-26 12:25:21 -04:00