Commit Graph

60926 Commits

Author SHA1 Message Date
Shannon Booth
a83f4216a5 LibWeb: Add stub IDL interface for OscillatorNode
This source node generates a periodic wave form.
2024-05-02 07:49:23 +02: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
Andreas Kling
5cb127819c LibJS: Fix build after merging CallFrame removal and finally fixes 2024-05-02 07:42:09 +02:00
Hendiadyoin1
ada5027163 LibJS: Cleanup unwind state when transferring control out of a finalizer
This does two things:
* Clear exceptions when transferring control out of a finalizer
  Otherwise they would resurface at the end of the next finalizer
  (see test the new test case), or at the end of a function
* Pop one scheduled jump when transferring control out of a finalizer
  This removes one old FIXME
2024-05-02 07:27:45 +02:00
Hendiadyoin1
27b238d9af LibJS: Stop swallowing exceptions in finalizers
This also fixes one of the try-catch-finally tests, and adds a new one.
2024-05-02 07:27:45 +02:00
Hendiadyoin1
b4b9c4b383 LibJS: Restore scheduled jumps in catch blocks without finalizers 2024-05-02 07:27:45 +02:00
Hendiadyoin1
301a1fc763 LibJS: Propagate finalizers into nested try-catch blocks without them 2024-05-02 07:27:45 +02:00
Aliaksandr Kalenik
865e651a7d LibJS: Merge CallFrame into ExecutionContext
Before this change both ExecutionContext and CallFrame were created
before executing function/module/script with a couple exceptions:
- executable created for default function argument evaluation has to
  run in function's execution context.
- `execute_ast_node()` where executable compiled for ASTNode has to be
  executed in running execution context.

This change moves all members previously owned by CallFrame into
ExecutionContext, and makes two exceptions where an executable that does
not have a corresponding execution context saves and restores registers
before running.

Now, all execution state lives in a single entity, which makes it a bit
easier to reason about and opens opportunities for optimizations, such
as moving registers and local variables into a single array.
2024-05-02 07:26:13 +02:00
Timothy Flynn
46b8a3afb7 LibWeb: Move the read bytes into ReadLoopReadRequest's success callback
The callback is already specified to take the bytes by value. No need to
copy the bytes here.
2024-05-01 21:46:45 +02:00
Timothy Flynn
dce05dd273 LibWeb: Revert using a vector to store each chunk in ReadLoopReadRequest
This reverts commit 12cfa08a09.
2024-05-01 21:46:45 +02:00
Timothy Flynn
6a170e7337 LibWeb: Use the ad-hoc read-all-chunks AO in ReadableStreamPipeTo 2024-05-01 21:46:45 +02:00
Timothy Flynn
6c6fb224ec LibWeb: Add an ad-hoc ReadableStreamDefaultReader::read_all_chunks AO
The ReadableStreamPipeTo AO requires reading all chunks from a stream.
There actually isn't an AO defined to do that, so the "read all bytes"
implementation was changed to provide each chunk in a vector in commit
12cfa08a09.

This change makes reading all bytes a bit more uncomfortable in normal
use cases, as we now have to manually join the vector we receive. This
can also cause churn with huge allocations.

So instead, let's just provide an ad-hoc callback to receive each chunk
as they arrive.
2024-05-01 21:46:45 +02:00
Jamie Mansfield
f5799f7d2c LibWeb/Fetch: Append the Fetch metadata headers 2024-05-01 12:57:35 +02:00
Jamie Mansfield
e52f444329 LibWeb/Fetch: Implement the "set the Sec-Fetch-User header" AO 2024-05-01 12:57:35 +02:00
Jamie Mansfield
1ff90aa3e0 LibWeb/Fetch: Implement the "set the Sec-Fetch-Site header" AO 2024-05-01 12:57:35 +02:00
Jamie Mansfield
5eb46a5f01 LibWeb/Fetch: Implement the "set the Sec-Fetch-Mode header" AO 2024-05-01 12:57:35 +02:00
Jamie Mansfield
f4af1833c1 LibWeb/Fetch: Implement the "set the Sec-Fetch-Dest header" AO 2024-05-01 12:57:35 +02:00
Jamie Mansfield
6e3b2ce300 LibWeb/Fetch: Add to_string function for Request::Mode 2024-05-01 12:57:35 +02:00
Jamie Mansfield
3daba8970c LibWeb/Fetch: Add to_string function for Request::Destination 2024-05-01 12:57:35 +02:00
Jamie Mansfield
da8d0d82c0 LibWeb/Fetch: Add "json" destination for JSON modules
This is a change in the Fetch spec.

See:
- https://github.com/whatwg/fetch/commit/49bff76
2024-05-01 12:57:35 +02:00
Andreas Kling
527ad9ac01 LibWeb: Implement XMLHttpRequest.responseURL
This was used on https://twinings.co.uk/ so let's support it :^)
2024-05-01 12:52:03 +02:00
Andreas Kling
34f2cbf202 LibWeb: Honor intrinsic constraints on available space in table widths
When a table's containing block provides min-content or max-content
available space, we now size the table's width accordingly.
2024-05-01 11:13:48 +02:00
Tim Ledbetter
02a8966b61 LibWeb: Serialize empty media rules with a single newline
This deviates from the CSSOM specification but all modern browsers do
this.
2024-05-01 07:21:21 +02:00
Tim Ledbetter
a2cccf9420 LibWeb: Use correct spacing when serializing media features
Previously, there was no space between the media feature name and value.
2024-05-01 07:21:21 +02:00
Timothy Flynn
398ae75f9a Ladybird+LibWebView: Introduce a cache for cookies backed by SQL storage
Now that the chrome process is a singleton on all platforms, we can
safely add a cache to the CookieJar to greatly speed up access. The way
this works is we read all cookies upfront from the database. As cookies
are updated by the web, we store a list of "dirty" cookies that need to
be flushed to the database. We do that synchronization every 30 seconds
and at shutdown.

There's plenty of room for improvement here, some of which is marked
with FIXMEs in the CookieJar.

Before these changes, in a SQL database populated with 300 cookies,
browsing to https://twinings.co.uk/ WebContent spent:

    19,806ms waiting for a get-cookie response
    505ms waiting for a set-cookie response

With these changes, it spends:

    24ms waiting for a get-cookie response
    15ms waiting for a set-cookie response
2024-05-01 07:06:26 +02:00
Kemal Zebari
8893836b60 Run: Don't wait for child process to end when adding it to history
When we try to start a long-running child process (e.g. a GUI app)
using a combination of the POSIX spawn and waitpid API, the Run
process ends up waiting for it to end before making any changes
to the path history. This leads to some confusion when trying to
fire up another Run process only to see that it did not save the
path to this program.

This PR resolves this by saving the path after it was created using
the POSIX spawn API.
2024-05-01 06:42:59 +02:00
Andrew Kaster
05731f93b6 LibCore: Don't use designated initializers for struct cmsghdr
This can cause issues with older versions of glibc warning when not
initializing the flexible array member for CMSG_DATA. Such as glibc
shipped with Ubuntu 20.04.
2024-05-01 06:33:00 +02:00
Ali Mohammad Pur
7f39142f0f Meta: Show GML formatting issues after lint 2024-04-30 17:46:41 -06:00
Ali Mohammad Pur
eaa2d69d73 LibGUI+Everywhere: Rename the 'style' frame property to 'frame_style'
'set_frame_style' is what Frame itself uses to set the value, and a
significant number of GML files use 'frame_style' instead of just
'style', so let's switch to it and use it everywhere consistently.
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
Timothy Flynn
4b51a36044 Browser: Add support for a singleton chrome process
This partially supports the WebView::ChromeProcess mechanics. New
windows aren't totally supported and will just open a new tab for now.

When launched via the Browser's AppFile (either through quick launch or
the desktop shortcut), a new window will be requested.
2024-04-30 17:43:14 -06:00
Timothy Flynn
3990e630f2 FileManager: Launch applications with their AppFile-specified arguments
We should really use Core::Process here, but it does not yet support all
posix_spawn features we are currently using.
2024-04-30 17:43:14 -06:00
Timothy Flynn
7dd961c39f LibDesktop+LaunchServer: Propagate AppFile arguments over IPC
This will allow clients (namely FileManager) to use the arguments
specified in the AppFile.
2024-04-30 17:43:14 -06:00
Timothy Flynn
b5e5354515 LibDesktop: Add an "Arguments" field to AppFile
This allows specifying arguments to be passed to the AppFile executable.
The Arguments string is delimted by ASCII spaces.
2024-04-30 17:43:14 -06:00
Timothy Flynn
ca4891f5b3 Taskbar: Use the AppFile's spawn method to launch applications
A future patch will add argument support to the AppFile. This patch
means one less place that needs to be updated to support that.
2024-04-30 17:43:14 -06:00
Timothy Flynn
dccd1cd348 LibDesktop+TaskBar: Propagate errors from AppFile::spawn and friends
Returning a boolean tells us nothing about why the spawn failed.
2024-04-30 17:43:14 -06:00
Andrew Kaster
416eb74fa5 Tests: Skip flaky unicode-range LibWeb Ref test
This seems related to CSS resources and the load event.
2024-04-30 07:18:40 -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
Andrew Kaster
effd368b5b CMake: Remove redundant configuration options from Ladybird CMakeLists
These options are already specified in common_compile_options.cmake and
lagom_install_options.cmake
2024-04-30 07:14:17 -06:00
Sönke Holz
b363abb082 Kernel/aarch64: Explicitly allow float instrs in {load,store}_fpu_state
LLVM 18 otherwise throws errors, as we use '-mgeneral-regs-only' in the
kernel.
The functions had to be moved into a .S, as there is no
'-mno-general-regs-only' and also no nice way to remove
'-mgeneral-regs-only' for a single .cpp file.
2024-04-30 06:32:58 -06:00
Liav A.
476b3703fd Utilities/mount: Resolve regression on mounting non-storage-backed FSes
Without this patch, we fail on manually mounting RAMFS (which I tested
for) but any filesystem that is not backed by actual storage will fail.
This bug was introduced in 0739b5df11 and
now is resolved by checking if the source fd is negative, to avoid fail
of the fstat call on it.
2024-04-30 06:03:10 -06:00
Timothy Flynn
1a1191cc6e Ladybird/AppKit: Add support for a singleton chrome process 2024-04-30 06:02:15 -06:00
Timothy Flynn
bfb356fd6c Ladybird/AppKit: Track the currently active tab
Will be needed to open new tabs from other Ladybird processes from the
active tab.
2024-04-30 06:02:15 -06:00
Timothy Flynn
7ad7ec3c0c Ladybird/AppKit: Bring newly active windows/tabs to the front
This actually actives the underlying tab if needed. This wasn't an issue
previously, as new tabs were always created in already active windows.
But when new windows/tabs are requested from new Ladybird processes, we
need to actually activate those tabs.
2024-04-30 06:02:15 -06:00
Timothy Flynn
606df46e46 Ladybird/AppKit: Retrieve socket notifiers from the local thread data
For some reason, we occasionally receive a junk `info` pointer from the
CFSocketCallback we create for socket notifiers. Instead of capturing a
pointer to the local Core::Notifier for this `info` member, grab it from
the thread data instance based on the socket FD.

This was mostly seen when spamming new window requests to an existing
Ladybird process.
2024-04-30 06:02:15 -06:00