Commit graph

3081 commits

Author SHA1 Message Date
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