Commit graph

49513 commits

Author SHA1 Message Date
thankyouverycool
683c8284cf Meta: Fix a typo in CONTRIBUTING.md 2023-04-24 16:48:37 +01:00
Jelle Raaijmakers
99451b14b2 Aplay: Determine absolute path before first unveil
`Core::DeprecatedFile::absolute_path` uses `stat` to determine whether a
file exists, which will always fail after the first `unveil` call
`aplay` does. Reorder things so we don't get a stack trace thrown at us
for each file being played.
2023-04-24 14:50:11 +02:00
Timothy Flynn
f08499b4cf WebContent: Add the 'thread' pledge for video playback
This is required after 036eb82aca.
2023-04-24 14:49:42 +02:00
Timothy Flynn
8fe846eb7f Ladybird: Define AK_DONT_REPLACE_STD via CMake rather than in every file 2023-04-24 14:49:04 +02:00
Aliaksandr Kalenik
269c25e1d2 LibWeb/Fetch: Pass recursive=false to manual navigation redirect
Implement ca10f49748

Fixes the issue I found while working on navigation:
https://github.com/whatwg/fetch/issues/1629
2023-04-24 13:38:37 +01:00
Liav A
7b6cea9ef4 Kernel: Improve context state keeping in the VirtIOGPU3DDevice class
This is done mainly by implementing safe locking on the data structure
keeping the pointers to the PerContextState objects. Therefore, this now
eliminates the need for using LockRefPtr, as SpinlockProtected is enough
for the whole list.

The usage of HashMap in this class was questionable, and according to
Sahan Fernando (the original contributor to the VirGL work also known as
ccapitalK) there was no deep research on which data structure to use for
keeping all pointers to PerContextState objects.
Therefore, this structure is changed to IntrusiveList as the main reason
and advantage to use it is that handling OOM conditions is much more
simple, because if we succeeded to create a PerContextState object, we
can be sure now that inserting it to the list will not cause OOM error
condition.
2023-04-24 13:09:22 +02:00
Liav A
8289759f1d Kernel: Allow configuring a Jail to not impose PID isolation restriction
This is quite useful for userspace applications that can't cope with the
restriction, but it's still useful to impose other non-configurable
restrictions by using jails.
2023-04-24 12:15:29 +02:00
Jonah
cf8875426d Browser: Support selections from the accessibility tab
You can now select elements and see their attributes in the bottom
panel like when navigating from the DOM tab.
2023-04-24 10:39:34 +02:00
Jonah
837a8dc213 LibWeb: Serialize element's IDs when serializing a11y tree 2023-04-24 10:39:34 +02:00
Cameron Youell
8df04f37e4 LibGUI: Convert JsonArrayModel to use Core::File
While we're here lets also convert all the `{set/store/add/remove}`
functions to use `ErrorOr`
2023-04-24 09:21:51 +02:00
Cameron Youell
da305017de Shell: Use JsonArray::append in save_to
We can convert it into a failable function here easily
2023-04-24 09:21:51 +02:00
Cameron Youell
ba38984a60 SQLStudio: Convert MainWidget to a failable constructor 2023-04-24 09:21:51 +02:00
Cameron Youell
e9ad7b8eed BrowserSettings: Convert BrowserSettingsWidget to a failable factory 2023-04-24 09:21:51 +02:00
Cameron Youell
2df0eeaa20 Browser: Convert BookmarksBarWidget to use failable functions 2023-04-24 09:21:51 +02:00
Cameron Youell
bedb370dec Services/WebContent: Use JsonArray::append
We can use the failable function here easily
2023-04-24 09:21:51 +02:00
Cameron Youell
ada6dbf636 AK: Use JsonArray::append when parsing array 2023-04-24 09:21:51 +02:00
Cameron Youell
8134dccdc7 AK: Add new failable JsonArray::{append/set} functions
Move all old usages to the more explicit `JsonArray:must_{append/set}`
2023-04-24 09:21:51 +02:00
Aliaksandr Kalenik
3b00636288 LibWeb: Implement "create a new browsing context and document"
Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-04-24 07:57:15 +02:00
Andreas Kling
6871fbce9f LibWeb: Implement the "top-level traversable" of a browsing context 2023-04-24 07:57:15 +02:00
Andreas Kling
65467021e2 LibWeb: Add updated version of "determine the origin" AO from HTML spec
The old version is still around since it has many users, so we can't
remove it until everything has been updated to use the new version.
2023-04-24 07:57:15 +02:00
Aliaksandr Kalenik
3225c39191 LibWeb: Implement Document::make_active()
Implementation of "make active" algorithm from the spec for Document.

Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-04-24 07:57:15 +02:00
Timothy Flynn
32e2207b55 LibWeb: Implement the HTMLMediaElement fastSeek method 2023-04-24 07:55:54 +02:00
martinfalisse
c987c934d0 LibWeb: Fix grid size when intrinsically sized
This fixes a bug that was seen when a combination of the grid having
been floated with `float: left` and a `minmax()` column size were used.

The issue was that a grid track size should be considered intrinsically
sized if both the min and max sizes are intrinsic, not just one of them.
2023-04-24 07:55:40 +02:00
Aliaksandr Kalenik
9f691b7fe4 LibWeb: Convert navigationId from DeprecatedString to String 2023-04-24 07:55:20 +02:00
Jelle Raaijmakers
71c98546b8 LibSQL: Add a note to Serializer about m_heap 2023-04-23 18:08:17 -04:00
Jelle Raaijmakers
fdac8331cc LibSQL: Use Block::Index everywhere; rename pointer to block_index
No functional changes.
2023-04-23 18:08:17 -04:00
Jelle Raaijmakers
6601ff9d65 LibSQL: Redesign heap storage to support arbitrary amounts of data
Previously, `Heap` would store serialized data in blocks of 1024 bytes
regardless of the actual length. Data longer than 1024 bytes was
silently truncated causing database corruption.

This changes the heap storage to prefix every block with two new fields:
the total data size in bytes, and the next block to retrieve if the data
is longer than what can be stored inside a single block. By chaining
blocks together, we can store arbitrary amounts of data without needing
to change anything of the logic in the rest of LibSQL.

As part of these changes, the "free list" is also removed from the heap
awaiting an actual implementation: it was never used.

Note that this bumps the database version from 3 to 4, and as such
invalidates (deletes) any database opened with LibSQL that is not
version 4.
2023-04-23 18:08:17 -04:00
Jelle Raaijmakers
194f846f12 LibSQL: Rename Heap constants to match our code style
No functional changes. The constants are moved to constexpr variables
inside `Heap`.
2023-04-23 18:08:17 -04:00
Jelle Raaijmakers
fcd35e824c LibSQL: Remove unused Tuple::is_compatible 2023-04-23 18:08:17 -04:00
Jelle Raaijmakers
a99c1297e0 LibSQL: Clean up code style and remove unused includes
No functional changes.
2023-04-23 18:08:17 -04:00
Jelle Raaijmakers
8992ff5aeb LibSQL: Remove and update VERIFYs
We are performing a lot of checks on pointers that are performed again
immediately afterwards because of a dereference. This removes the
redundant `VERIFY`s and simplifies a couple others.
2023-04-23 18:08:17 -04:00
Zaggy1024
036eb82aca LibVideo/VP9: Implement threaded tile column decoding
This adds a new WorkerThread class to run one task asynchronously,
and allow waiting for that thread to finish its work.

TileContexts are placed into multiple tile column vectors with their
streams to read from pre-created. Once those are ready, the threads can
start their work on each vector separately. The main thread waits for
those tasks to finish, then sums up the syntax element counts for each
tile that was decoded.
2023-04-23 23:14:30 +02:00
Zaggy1024
ba5bf412e5 LibThreading: Create WorkerThread class run a single task concurrently
This class can be used to run a task in another thread, and allows the
caller to wait for the task to complete to retrieve any error that may
have occurred.

Currently, it doesn't support functions returning a value on success,
but with some template magic that should be possible. :^)
2023-04-23 23:14:30 +02:00
Zaggy1024
1fcac52e77 LibVideo/VP9: Count syntax elements in TileContext, and sum at the end
Syntax element counters were previously accessed across tiles, which
would cause a race condition updating the counts in a tile-threaded
mode.
2023-04-23 23:14:30 +02:00
Zaggy1024
a8604d9356 LibVideo/VP9: Fallibly allocate the probability tables 2023-04-23 23:14:30 +02:00
Zaggy1024
8ce4245214 LibVideo/VP9: Return Corrupted error when tile range decoder init fails
Previously, we were incorrectly wrapping an error from `BooleanDecoder`
initialization in a `DecoderErrorCategory::Memory` error. This caused
an incorrect error message in VideoPlayer. Now it will instead return
`DecoderErrorCategory::Corrupted`.
2023-04-23 23:14:30 +02:00
Peter Brottveit Bock
b6deb8fd42 LibJS: Replace DeprecatedString with String in strip_ansi 2023-04-23 16:56:06 +02:00
Peter Brottveit Bock
fac7045a44 LibJS: Use Stream::format instead of manually formating and printing 2023-04-23 16:56:06 +02:00
Peter Brottveit Bock
6f6d6c654d AK: Implement Stream::format(fmtstr, args...)
Based on `out()` and `vout()` from AK/Format.h. As opposed to those,
this propagates errors.

As `Core::File` extends `AK::Stream`, this allows formatted
printing directly on `Core::File`s.
2023-04-23 16:56:06 +02:00
Timothy Flynn
ab1244a160 LibWeb: Paint video timestamps using CSS/device pixel-aware scaled fonts
The timestamp text was very tiny on a HiDPI display.
2023-04-23 16:22:45 +02:00
Timothy Flynn
848078aedd LibWeb: Propagate LibVideo decoder errors to the HTMLMediaElement 2023-04-23 16:22:45 +02:00
Timothy Flynn
9c940608fd LibWeb: Implement the HTMLMediaElement error attribute 2023-04-23 16:22:45 +02:00
Timothy Flynn
73a80b7047 LibWeb: Implement the MediaError IDL interface 2023-04-23 16:22:45 +02:00
Aliaksandr Kalenik
22572c39e0 LibWeb: Implement Node::navigable()
https://html.spec.whatwg.org/multipage/document-sequences.html#node-navigable
2023-04-23 15:41:05 +02:00
Andreas Kling
6e416284b9 LibWeb: Add API for finding Navigable with a given active document
This will be used to look up a document's node navigable. It might be
nice to have a direct pointer from Document to its Navigable, but at
the moment I don't understand the algorithms well enough to maintain
that linkage.
2023-04-23 15:41:05 +02:00
Nico Weber
f09aaf826f LibGfx: Decrease indent in ImageDecoder::try_create_for_raw_bytes() some
No behavior change.
2023-04-23 14:35:20 +02:00
Daniel Bertalan
f18e7659a6 DynamicLoader: Ensure that backtrace computation stops at _start
If we don't set FP and LR to 0, the Kernel might not stop generating
backtraces when it reaches `_start`'s stack frame, and might continue by
reading garbage memory instead. This leads to a kernel panic, as SafeMem
access faults aren't handled properly in the AArch64 kernel yet.

We might want to ensure that the kernel zeroes out all registers when a
new process is created.
2023-04-23 14:30:59 +02:00
Daniel Bertalan
ff2fa72e28 LibCoredump+CrashReporter: Make CrashReporter work on AArch64
This commit implements printing out the AArch64 register file and
generating backtraces. Tested to work on the sshd port.
2023-04-23 14:30:59 +02:00
Daniel Bertalan
ed13b7beb6 LibDebug: Support DW_FORM_ref_udata
This is used alongside/instead of the fixed-length DW_FORM_ref4 form
when compiling for AArch64.
2023-04-23 14:30:59 +02:00
Daniel Bertalan
d205814da6 Kernel+LibC: Implement pthread_create for AArch64
Instead of storing x86_64 register names in `SC_create_thread_params`,
let the Kernel figure out how to pass the parameters to
`pthread_create_helper`.
2023-04-23 14:30:59 +02:00