Commit Graph

37115 Commits

Author SHA1 Message Date
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
djwisdom
c74711eb10 Base: Update Ataraxia Bold 10 for consistency 2022-04-10 17:39:49 +01:00
djwisdom
6493faf788 Base: Update Csilla12 Latin-1 Supplement with adjustments
CsillaRegular12
Latin-1 Supplement
00A1-00FF
https://www.unicode.org/charts/PDF/U0080.pdf
2022-04-10 17:39:41 +01:00
djwisdom
652fdda8f5 Base: Add Latin-1 Supplement to Csilla Bold 12 font
CsillaBold12
Latin-1 Supplement
00A1-00FF
https://www.unicode.org/charts/PDF/U0080.pdf
2022-04-10 17:39:41 +01:00
Andreas Kling
751b605690 LibWeb: Cache scaled web fonts instead of recreating them every time
Previously, we would create a new Gfx::ScaledFont whenever we needed one
for an element's computed style. This worked fine on Acid3 since the use
of web fonts was extremely limited.

In the wild, web fonts obviously get used a lot more, so let's have a
per-point-size font cache for them.
2022-04-10 12:40:07 +02:00
Andreas Kling
ae6b09f4dc AK: Add hash traits for floating-point primitives
This allows us to use float and double as hash keys.
2022-04-10 12:39:44 +02:00
Anthony Van de Gejuchte
69ca27d3d7 LibWeb: Show correct favicon when default favicon is loaded
Block the replacement of the favicon by the default favicon loader
when a favicon that is loaded through a link tag is already active.

This way, the favicon in the link tags will be prioritized against
the default favicons from `/favicon.ico` or the seranity default icon.
2022-04-10 12:10:59 +02:00
Anthony Van de Gejuchte
06d9853a8b LibWeb: Update displayed favicon when a favicon is loaded
When a favicon has been loaded, trigger a favicon update on
document level. Of all the link tags in the header, the last
favicon that is load should be shown.

When the favicon could not be loaded, load the next icon in reverse tree
order.
2022-04-10 12:10:59 +02:00
Anthony Van de Gejuchte
13847aa7e8 LibWeb: Add icon as possible resource type on the link tag 2022-04-10 12:10:59 +02:00
Jelle Raaijmakers
44d78a8a13 Base: Add a Ladyball .obj :^) 2022-04-10 12:08:31 +02:00
Jelle Raaijmakers
a021a7e240 Applications: Support .obj polygons in 3DFileViewer
Our `WavefrontOBJLoader` only supported faces with 3 vertices, but
`.obj` files can specify arbitrary polygons with 4 or more vertices.
2022-04-10 12:08:31 +02:00
Jelle Raaijmakers
1577a8ba42 AK: Remove KERNEL check from String
Since we no longer use `String` inside of the kernel code, we can drop
this `#ifndef`.
2022-04-10 12:08:31 +02:00
Andreas Kling
9ed5a14af2 LibWeb: Remove unused ResourceLoader::load_sync()
There are no remaining users of this API, everyone has been migrated
to asynchronous resource loading.
2022-04-10 01:37:45 +02:00
Andreas Kling
db2b67dc5e LibHTTP: Don't re-urlencode URL query strings
AK::URL stores the URL query string already encoded. We were sending
double-encoded query strings, which is why the Google cookie consent
page was not working correctly.
2022-04-10 01:37:45 +02:00
Andreas Kling
79c77debb0 AK: Don't destructively re-encode query strings in the URL parser
We were decoding and then re-encoding the query string in URLs.
This round-trip caused us to lose information about plus ('+')
ASCII characters encoded as "%2B".
2022-04-10 01:37:45 +02:00
Andreas Kling
3724ce765e AK+LibWeb: Encode ' ' as '+' in application/x-www-form-urlencoded
This matches what the URL and HTML specifications ask us to do.
2022-04-10 01:37:45 +02:00
Linus Groh
74241527d7 Base: Add the remaining 15 German state flag emojis (DE-XX) 2022-04-10 00:14:39 +01:00
Simon Wanner
4cbbb72ce8 Meta/Lagom: Add a fuzzer for the WOFF parser 2022-04-09 23:48:18 +02:00
Simon Wanner
b19e134999 LibWeb: Invalidate layout after the computed font changes
If the font resource finishes loading we need to make sure the element
using it gets a chance to re-layout, even if the font-family property
didn't change.
2022-04-09 23:48:18 +02:00
Simon Wanner
5ebcb15c92 Base: Add a test page for CSS font-face 2022-04-09 23:48:18 +02:00
Simon Wanner
539adf5b9c LibWeb: Support WOFF in font-face 2022-04-09 23:48:18 +02:00
Simon Wanner
bf6d64c199 LibGfx: Add a loader the Web Open Font Format (WOFF)
This format is 'just' a zlib compressed wrapper for TrueType/OpenType
which makes implementing it rather convenient. :^)
2022-04-09 23:48:18 +02:00
Simon Wanner
f386b0d43c LibWeb: Migrate SC::FontLoader from TTF::Font to Gfx::VectorFont 2022-04-09 23:48:18 +02:00
Simon Wanner
17baf05c5a LibGfx: Migrate Typeface from TTF::Font to Gfx::VectorFont 2022-04-09 23:48:18 +02:00