Commit graph

35392 commits

Author SHA1 Message Date
Tobias Christiansen
0dd5f5672c PixelPaint: Rename typo'ed BMPWriter in serialize_as_json() 2022-03-09 17:15:17 +01:00
Tobias Christiansen
937785f6c1 PixelPaint: Fix saving project
Some json objects didn't get finished, so it crashed.
2022-03-09 17:15:17 +01:00
Andreas Kling
9c6999ecf2 LibWeb: Implement "NodeIterator pre-removing steps"
These steps run when a node is about to be removed from its parent,
and adjust the position of any live NodeIterators so that they don't
point at a now-removed node.

Note that while this commit implements what's in the DOM specification,
the specification doesn't fully match what other browsers do.

Spec bug: https://github.com/whatwg/dom/issues/907
2022-03-09 16:43:56 +01:00
Andreas Kling
acbdb95b0a LibWeb: Add support for DOM's TreeWalker
This patch adds TreeWalker (created via Document.createTreeWalker())
which allows you to traverse a filtered view of the DOM in all
directions.
2022-03-09 16:43:55 +01:00
Andreas Kling
fabcee016f LibWeb: Add basic support for DOM's NodeIterator and NodeFilter
This patch adds NodeIterator (created via Document.createNodeIterator())
which allows you to iterate through all the nodes in a subtree while
filtering with a provided NodeFilter callback along the way.

This first cut implements the full API, but does not yet handle nodes
being removed from the document while referenced by the iterator. That
will be done in a subsequent patch.
2022-03-09 16:43:00 +01:00
Andreas Kling
ba87f23f22 LibWeb: Allow returning JS::ThrowCompletionOr<T> from wrapped functions
In some cases, we need more nuance than what DOM::ExceptionOr<T> offers.
2022-03-09 16:43:00 +01:00
Andreas Kling
252ed8ad18 LibWeb: Fail resource loads on HTTP 4xx or 5xx error
This fixes an issue on ACID3 where failing image loads with body content
would still get displayed.
2022-03-09 16:43:00 +01:00
Andreas Kling
7b3642d08c Kernel: Mark sys$lseek() as not needing the big lock
This syscall doesn't access any data that was implicitly protected by
the big lock.
2022-03-09 16:43:00 +01:00
Andreas Kling
09e644f0ba Kernel: Mark sys$emuctl() as not needing the big lock
This syscall doesn't do anything at all, and definitely doesn't need the
big lock. :^)
2022-03-09 16:43:00 +01:00
Andreas Kling
b4fefedd1d Kernel: Mark sys$chmod() as not needing the big lock
This syscall doesn't access any data that was implicitly protected by
the big lock.
2022-03-09 16:43:00 +01:00
Andreas Kling
aa381c4a67 Kernel: Mark sys$fchmod() as not needing the big lock
This syscall doesn't access any data that was implicitly protected by
the big lock.
2022-03-09 16:43:00 +01:00
Andreas Kling
d074aae422 Kernel: Mark sys$dup2() as not needing the big lock
This syscall doesn't access any data that was implicitly protected by
the big lock.
2022-03-09 16:43:00 +01:00
Andreas Kling
8aad9e7448 Kernel: Mark sys$ftruncate() as not needing the big lock
This syscall doesn't access any data that was implicitly protected by
the big lock.
2022-03-09 16:43:00 +01:00
Andreas Kling
69a6a4d927 Kernel: Mark sys$fstatvfs() as not needing the big lock
This syscall doesn't access any data that was implicitly protected by
the big lock.
2022-03-09 16:43:00 +01:00
davidot
a61424a62b LibJS: Be more lenient when parsing milliseconds for Date
Other engines don't give NaN if there is at least one digit after the
dot for milliseconds. We were much stricter and required exactly three
digits.
But there is real world usage of different amounts of digits such as
discord having three extra trailing zeros.
2022-03-09 14:18:59 +01:00
Sahan Fernando
fd5eaf6494 Demos: Create demo for VirGL gpu device
This is a simple demo for VirGL, that does the bare minimum required to
create and render a spinning cube (with one color per face).
2022-03-09 14:58:48 +03:30
Sahan Fernando
2939f65753 SystemServer: Create device files for gpus on startup
We are adding a new class of file, a GPU device. These devices have
major number 28, and are bound to files named /dev/gpuN.
2022-03-09 14:58:48 +03:30
Sahan Fernando
a2887dc157 Kernel: Disable GPU fencing for VirtIOGPU operations
These fences should not be needed, since we force the use of
synchronous operations through synchronous_virtio_gpu_command. The use
of these fences also causes severe lag when SERENITY_GL is enabled.
2022-03-09 14:58:48 +03:30
Sahan Fernando
fd6a536c60 Kernel: Implement basic VirGL device
This commit flips VirtIOGPU back to using a Mutex for its operation
lock (instead of a spinlock). This is necessary for avoiding a few
system hangs when queuing actions on the driver from multiple
processes, which becomes much more of an issue when using VirGL from
multiple userspace process.

This does result in a few code paths where we inevitably have to grab
a mutex from inside a spinlock, the only way to fix both issues is to
move to issuing asynchronous virtio gpu commands.
2022-03-09 14:58:48 +03:30
Sahan Fernando
966989afe8 Kernel: Use AK::to_underlying instead of static_cast in VirtIOGPU 2022-03-09 14:58:48 +03:30
Sahan Fernando
0e57f80460 LibC: Add ioctls for VirGL 2022-03-09 14:58:48 +03:30
Sahan Fernando
04849c9561 Meta: Add SERENITY_GL environment variable to run.sh 2022-03-09 14:58:48 +03:30
Lady Gegga
407b67e72a Base: Add flags and RGI status to emoji.txt 2022-03-09 11:40:03 +01:00
Lady Gegga
d36baaa9ac Base: Add various flags
Add flags for Palestine, Leinster, Munster, Ulster,
South Ostrobothnia, South Savonia, Kainuu, Kanta-Häme,
Central Ostrobothnia, Central Finland, North Karelia,
Northern Savonia, Päijänne Tavastia, Satakunta, Uusimaa
2022-03-09 11:40:03 +01:00
stelar7
125a43e203 LibTLS: Add support for curve x448 2022-03-09 13:04:48 +03:30
stelar7
0df7ad7493 LibCrypto: Add curve X448 2022-03-09 13:04:48 +03:30
u9g
c8803afe3e Spreadsheet: Add CommonRange#unique() 2022-03-09 10:22:20 +03:30
u9g
b9d44eb022 Spreadsheet: Add SplitRange class and CommonRange#filter 2022-03-09 10:22:20 +03:30
Tim Schumacher
1b6a1748f0 Ports: Add ca-certificates as a dependency to curl 2022-03-08 18:21:06 -08:00
Tim Schumacher
813a1f2865 Ports: Add a ca-certificates "port" 2022-03-08 18:21:06 -08:00
Tim Schumacher
5200cdac43 Kernel: Remove an unused fd_set.h import
The project appears to build just fine without it, and the explicit use
of `LibC` causes it to conflict with the system-wide `fd_set.h` when
building inside of Serenity.
2022-03-08 16:18:48 -08:00
Hendiadyoin1
85ba70d86f Kernel: Don't override FramebufferDevice's memory regions on mmap
This additionally refactors FramebufferDevice::try_to_initialize to not
leave the FramebufferDevice in an invalid state on errors.
This also unifies the logic between FramebufferDevice::mmap and
FramebufferDevice::try_to_initialize.
This comes with the drawback of removing the UNMAP_AFTER_INIT attribute
from this function, which wasn't honoured by IntelNativeGraphicsAdapter
anyway.
2022-03-08 15:58:51 -08:00
Hendiadyoin1
790d620b39 Kernel: Use an ArmedScopeGuard to revert changes after failed mmap 2022-03-08 15:58:51 -08:00
kimlintu
a4e3ae0ee9 Help: Remove redundant selection update when opening page
Since the selection already gets updated in AbstractView::keydown_event
and AbstractView::mousedown_event we don't have to update it again in
the MainWidget::open_url function.

This fixes a bug that causes the selection to "spaz out" when
scrolling too fast between pages.
2022-03-08 23:34:45 +01:00
Jonathan Marler
97c0a8c063 Toolchain: Move nix script from Documentation into Toolchain
Moves the nix script to setup the build environment from Documentation
into the Toolchain as a callable script.  I also modified the script
to accept a "pkgs" argument to make it easy to override the nixpkgs
version from the command-line when calling the script.
2022-03-08 23:31:45 +01:00
Daniel Bertalan
70ccdb300b Kernel: Panic if the init process dies
If init crashes, all other userspace processes exit too, thus rendering
the system unusable. Previously, the kernel would still keep running
even without a userland, showing just a black screen without any
indication of the issue.

We now panic the kernel, which shows a message on the console. In the
case of the CI runners, it shuts down the virtual machine, so we don't
have to wait for the 1 hour timeout if an issue arises with
SystemServer.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
a25cc9619d Base+Meta: Make /usr/local read-write
This directory has to be writable if we want to install ports that have
been built inside Serenity. It's owned by root anyway, so having it be
read-only does not provide many security benefits.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
4f89f47acb Ports: Download fresh config.guess if needed
The config.guess file needs to know about the SerenityOS `uname -m`
system name if we want to build ports inside Serenity. Support was only
added in January 2022, so most ports don't have a new enough version
yet.

This commit adds facilities for fetching a fresh config.guess file that
supports SerenityOS, similarly to what we do for config.sub. As its
first user, we make the bash port buildable inside the system.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
aed2e214b6 Ports: Use sed -i for run_replace_in_file on Serenity hosts
We don't have a perl port, so let's use GNU sed's in-place option for
doing substitutions when running inside Serenity.

Note that we can't do this unconditionally, as `sed -i` is not portable
and works differently on BSD systems.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
ea52ba9fdc LibC: Set saved_str to null in strtok_r if no tokens were found
If we do not do this, the next call to strtok_r will start tokenizing
(and possibly modifying!) the memory pointed to by `saved_ptr`.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
4b4177f39c LibDiff: Generate hunks for new/deleted files
Previously we would fail to generate any hunks if the old or the new
file was empty. We now do, with the original/target line index set to 0,
as specified by POSIX.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
7bd68c86d3 date: Allow using a custom format string
This commit adds an optional string positional argument which is used a
custom format string for the date.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
01dc718f07 LibCore: Do not skip dotfiles when copying directories recursively 2022-03-08 23:30:47 +01:00
Daniel Bertalan
a285e651f1 LibArchive: Accept space characters as terminators of tar numeric fields
POSIX specifies that each numeric field is terminated with one or more
space or NUL characters.
2022-03-08 23:30:47 +01:00
Tim Schumacher
35e5024b7d DynamicLinker: Replace $ORIGIN with the executable path 2022-03-08 23:21:35 +01:00
Tim Schumacher
e7f861f34c DynamicLinker: Implement support for RPATH and RUNPATH 2022-03-08 23:21:35 +01:00
Tim Schumacher
7bd0a3e9ba DynamicLoader: Make the cached DynamicObject publicly accessible 2022-03-08 23:21:35 +01:00
Linus Groh
03c46a261f LibWeb: Implement the WindowProxy exotic object
A couple steps requiring working relationships between browsing contexts
are currently FIXME'd - see #12917.
2022-03-08 23:13:54 +01:00
Linus Groh
6f941433d6 LibWeb: Stub out 'check if access between two BCs should be reported'
I put this is a CrossOrigin/ subdirectory in anticipation of a lot more
cross-origin related ground to cover. :^)
2022-03-08 23:13:54 +01:00
Linus Groh
ae96eae4f9 LibWeb: Implement 'cross-origin accessible window property name' concept 2022-03-08 23:13:54 +01:00