Commit graph

37338 commits

Author SHA1 Message Date
Sam Atkins 3e5b1b1dbc LibCore: Add ArgsParser::add_positional_argument(Vector<String>&, ...) 2022-04-11 21:09:42 +02:00
Sam Atkins b81a3a6f0e profile: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins eb857e45dc HackStudio: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins 88800e8f32 FileManager: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins d2b32924d6 pls: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins 3971f71235 Terminal: Use Core::System::exec() 2022-04-11 21:09:42 +02:00
Sam Atkins 5a47b74227 paste: Use Core::System::{exec,setenv} 2022-04-11 21:09:42 +02:00
Sam Atkins 32ab09a930 LibCore: Add a wrapper for execvpe() and friends
This is a single function, which behaves like the various LibC exec()
functions depending on the passed parameters. No direct equivalent is
made for execl() - you have to wrap your arguments in a Span of some
kind.

On Serenity, this calls the syscall directly, whereas Lagom forwards to
the appropriate LibC function.
2022-04-11 21:09:42 +02:00
Linus Groh b4c6fd51be LibJS: Use single page spec link for BoundFunctionCreate 2022-04-11 19:44:56 +01:00
Linus Groh 231acda7f8 LibJS: Fix two bogus spec links 2022-04-11 19:44:33 +01:00
Simon Danner bd90498332 LibWeb: Add SVGDefsElement
* Similarly to clipPath, this doesn't need to get rendered, so return no
  LayoutNode.
2022-04-11 20:19:10 +02:00
stelar7 55e9192886 HackStudio: Fix inverted condition when trying to create directories 2022-04-11 16:44:36 +02:00
Julen Ruiz Aizpuru 23ea5c6721 BrowserSettings: Validate homepage URL 2022-04-11 08:19:29 -04:00
Florian Stellbrink af3174c9ce LibGFX: Transform vertices when drawing antialiased lines
Previously we transformed each rasterized point when drawing a line.
Now we transform the lines' endpoints instead.

That means running two transforms per line instead of transforms for
each pixel. It is not clear that the overhead for the fast path is
still worth it. If we still want to optimize identity and translations,
it is probably better to do that inside AffineTransform.

In addition this will behave nicer if the transform includes scaling.
Previously this would rasterize lines before scaling. Which means
drawing too many points when scaling down, and not drawing enough
points when scaling up.
With the new approach we will automatically rasterize at pixel scale.

This is essentially the same as OpenGL, where vertices are transformed
and rasterization happens in screen space.
2022-04-11 03:16:37 +02:00
Andreas Kling b4a8be5dc9 LibWeb: Reset canvas elements when their width/height attribute are set 2022-04-11 03:05:19 +02:00
Andreas Kling 88ef1bff38 LibWeb: Add fast path for CRC2D.drawImage() with simple transform
If the transform is a simple translation, we don't need to run the big
and slow transform rasterizer.
2022-04-11 02:29:37 +02:00
Andreas Kling 57feb0f3ec LibWeb: Add missing null check of independent formatting context in FFC
When calling layout_inside() on a flex item that can't have children of
its own, layout_inside() will not return an independent formatting
context, so we need to handle that case here.
2022-04-11 01:20:24 +02:00
Andreas Kling fc8c4ea23f LibWeb: Let BFC compute width for block-level replaced elements
We never really hit this code path before, but now that IMG elements can
be block-level, we need to get them hooked up with box model metrics.
2022-04-11 01:04:09 +02:00
Andreas Kling edfa4508a5 LibWeb: Create a no-op formatting context for childless replaced boxes
This is a hack that allows block-level replaced elements to be flex
items. Flexbox layout currently assumes (in many places) that it's
always possible to create an independent formatting context for each of
its items.
2022-04-11 01:03:47 +02:00
Andreas Kling b1a6a8600a LibWeb: Honor "display:block" on IMG elements
Previously we forced all image elements to be inline-level. Now they can
participate in block layout if they prefer. :^)
2022-04-11 01:03:47 +02:00
Tim Schumacher 1bdaee475b DHCPClient: Close outgoing sockets after use 2022-04-11 00:15:06 +02:00
Andreas Kling ede818cbf9 AK: Disable the HashTable<double> test until UB issue is fixed 2022-04-11 00:11:53 +02:00
Andreas Kling ca2807ba42 AK: Honor box's own intrinsic size in calculate_intrinsic_sizes()
If a layout box claims to have both intrinsic width and height, we can
simply return those instead of performing any kind of layout.
2022-04-11 00:11:53 +02:00
kleines Filmröllchen 5319e3a03f LibCore+Userland: Remove File::ensure_parent_directories
We have a much safer and more powerful alternative now, so let's move
the few users over.
2022-04-11 00:08:48 +02:00
kleines Filmröllchen 0fd09b2381 LibCore: Automatically create config directories if necessary
If the .config directory (or its children, like lib) was deleted,
ConfigFile would crash because it would try to open or create a file in
a directory that didn't exist. Therefore, for user and library configs
(but not system configs), ensure that the parent directories exist. This
allows the user to delete the entire .config folder and all apps still
work. (Except those which can't handle missing config. That's a separate
issue though.)

Fixes #13555

Note: Some changes to pledges and unveils are necessary for this to
work. The only one who can recreate .config at the moment is
ConfigServer, as others probably don't pledge the user home directory.
2022-04-11 00:08:48 +02:00
kleines Filmröllchen 46b76f2f55 LibCore: Introduce Directory
Core::Directory represents an existing directory on the system, and it
holds an actual file descriptor so that the user can be sure the
directory stays in existence.
2022-04-11 00:08:48 +02:00
kleines Filmröllchen ceba27c3fe LibCore: Add openat() syscall wrapper and improve open's implementation
We don't need va_args in open(), we can just use a default parameter.
2022-04-11 00:08:48 +02:00
kleines Filmröllchen 1b67e19bd6 LibCore: Extract Stream::OpenMode conversion helper into static function 2022-04-11 00:08:48 +02:00
Andreas Kling f1d44da422 LibGfx: Simplify draw_anti_aliased_line() by avoiding transform callback
Instead of taking a callback that performs the coordinate transformation
we now just take a bool template parameter.

Thanks to Idan for suggesting this! :^)
2022-04-10 22:06:46 +02:00
Idan Horowitz 2f4ab64e8c Kernel: Use kernel_mapping_base as the minimum kernel stack address
Since KASLR was added kernel_load_base only signifies the address at
which the kernel image start, not the start of kernel memory, meaning
that a valid kernel stack can be allocated before it in memory.

We use kernel_mapping_base, the lowest address covered by the kernel
page directory, as the minimal address when performing safety checks
during backtrace generation.
2022-04-10 21:57:19 +02:00
Andreas Kling 07a3002d39 LibWeb: Bring Element.client{Left,Top} closer to spec
These are supposed to return values based on the computed border size
of the element. Not the X/Y position values of the principal box.
2022-04-10 21:35:55 +02:00
Andreas Kling e81594d9a1 LibWeb: Sketch out a very basic SVG <clipPath> element
This element doesn't actually support anything at the moment, but it
still massively speeds up painting performance on Wikipedia! :^)

How? Because we no longer paint SVG <path> elements found inside
<clipPath> elements. SVGClipPathElement::create_layout_node() returns
nullptr which stops the layout tree builder from recursing further into
the subtree, and so the <path> element never gets a layout or paint box.

Mousing over Wikipedia now barely break 50% CPU usage on my machine :^)
2022-04-10 21:35:55 +02:00
Andreas Kling c6e79124c7 LibGfx: Slap an -O3 optimization #pragma on Gfx::AntiAliasingPainter
We're already doing this for Gfx::Painter, so let's do it here as well.
2022-04-10 21:35:55 +02:00
Andreas Kling 908d42d0ba LibGfx: Add fast path to AA line drawing with simple 2D transform
If the effective 2D transform is just a basic translation, we now simply
translate the underlying painter before & after drawing AA lines.

This avoids all the extra math that otherwise has to happen when mapping
points through an affine transform.

This noticeably increase "mousing around" performance on Wikipedia. :^)
2022-04-10 21:35:55 +02:00
Andreas Kling b4c3882d9c LibGfx: Add AffineTransform::is_identity_or_translation()
This will allow us to implement fast paths in cases where a simple
translation can be handled faster than a full affine transform.
2022-04-10 21:35:55 +02:00
Martin Bříza adc92beed1 Ports: Update Qt to 6.2.3 2022-04-10 21:28:41 +02:00
Andreas Kling 25f6d2e2ab LibWeb: Update layout in Element.getBoundingClientRect() 2022-04-10 20:44:29 +02:00
Andreas Kling 60ec006265 LibWeb: Update layout in HTMLElement.offset{Width,Height}
If we don't do this, we may be returning stale values.
2022-04-10 20:38:16 +02:00
Andreas Kling bb17f74fb1 LibWeb: Bring Element.client{Width,Height} closer to spec
There were two main issues with these functions:

1. They were not updating layout before inspecting metrics.
2. They were not returning viewport metrics for the root and body
   elements when appropriate.
2022-04-10 20:30:19 +02:00
Andreas Kling b5faeb7840 LibWeb: Resolve SVG "scaled viewport size" without triggering layout
Percentage stroke widths are resolved against the scaled viewport size
which we were retrieving by calling client_width() and client_height()
on the element. Now that those accessors may trigger layout, this means
that we can't use them from the stroke_width() getter, which is itself
used *from within* layout.
2022-04-10 20:18:38 +02:00
Andreas Kling 5e35167e05 LibWeb: Don't mark non-painted images as being inside the viewport 2022-04-10 20:16:09 +02:00
Andreas Kling 20c65e4298 LibWeb: Don't include children of overflow:hidden in scrollable overflow
This fixes an issue where Google Maps was getting page scrollbars
when it shouldn't have.
2022-04-10 20:02:53 +02:00
Luke Wilde 89c4e011e4 LibWeb: Stub CanvasRenderingContext2D.clip
This is primarily required by Google Maps Street View, but the map view
works without this.
2022-04-10 19:59:14 +02:00
Luke Wilde 27cc8742ce LibWeb: Implement CanvasRenderingContext2D.resetTransform 2022-04-10 19:59:14 +02:00
Luke Wilde 329e740c85 LibWeb: Implement CanvasRenderingContext2D.setTransform 2022-04-10 19:59:14 +02:00
Luke Wilde df7a83ac0e LibWeb: Implement CanvasRenderingContext2D.transform 2022-04-10 19:59:14 +02:00
Andreas Kling 40f584a2bb AK: Add missing include to Traits.h 2022-04-10 19:18:16 +02:00
djwisdom a687186039 Base: Update Ataraxia Light 8 for consistency 2022-04-10 17:39:49 +01:00
djwisdom 788a716816 Base: Update Ataraxia Light 10 for consistency 2022-04-10 17:39:49 +01:00
djwisdom 265b153461 Base: Update Ataraxia Bold 8 for consistency 2022-04-10 17:39:49 +01:00