Commit Graph

33845 Commits

Author SHA1 Message Date
Andreas Kling
28d4e326f8 LibGfx: Use the woff2 library to decode WOFF2 font files
This saves us the trouble of maintaining our own implementation,
and instantly brings us to full WOFF2 feature parity with others.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-06-07 18:42:12 +02:00
Aliaksandr Kalenik
9be5867eb2 LibWeb: Implement rejection by bounding box for PaintInnerBoxShadow
Before this change we were painting inner shadows lying outside of
viewport.

Improves painting performance on Github and Twitter where this command
is used a lot.
2024-06-07 18:41:57 +02:00
Aliaksandr Kalenik
1c8d37d528 LibWeb: Rename PaintOuterBoxShadowParams to PaintBoxShadowParams
Drop "outer" from the name because this struct is used for both inner
and outer shadows.
2024-06-07 18:41:57 +02:00
Aliaksandr Kalenik
22bb476b6f LibWeb: Use ints instead of DevicePixels in PaintOuterBoxShadowParams
DevicePixels concept should not leak from painting recording phase.
2024-06-07 15:42:38 +02:00
Aliaksandr Kalenik
2dd3b6fcff LibWeb: Remove unused members in PaintOuterBoxShadowParams
This struct had all members in CSSPixels and DevicePixels, but only the
latter are needed for painting.

Shrinks PaintOuterBoxShadowParams from 144 bytes to 72 bytes.
2024-06-07 15:42:38 +02:00
Jamie Mansfield
ab6b687d4c LibWeb: Implement "Set request’s referrer policy on redirect" AO 2024-06-07 09:54:19 +02:00
Jamie Mansfield
5a40a00d9e LibWeb/ReferrerPolicy: Add spec link for strip URL AO 2024-06-07 09:54:19 +02:00
Jamie Mansfield
8542a8b458 LibWeb/Fetch: Update "HTTP-redirect fetch" algorithm to latest spec
The spec and implementation's comments had diverged a little, this
brings them in line :)
2024-06-07 09:54:19 +02:00
Jamie Mansfield
8f2cb6755b LibWeb: Implement HTMLAreaElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
64eadab181 LibWeb: Implement HTMLIFrameElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
1aa58b6d8c LibWeb: Implement HTMLImageElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
f82c727071 LibWeb: Implement HTMLLinkElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
469cbe78de LibWeb: Use Reflect for HTMLAnchorElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
53d7aa53a2 LibWeb: Use Enumerated for HTMLScriptElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
7ce35b75aa LibWeb: Implement should block mixed content response to request 2024-06-07 09:50:30 +02:00
Jamie Mansfield
2159377296 LibWeb: Upgrade mixed requests to potentially trustworthy URLs
(if appropriate)
2024-06-07 09:50:30 +02:00
Jamie Mansfield
8f0d035145 LibWeb: Implement should block mixed content request 2024-06-07 09:50:30 +02:00
Andrew Kaster
d90a9ab70c LibWeb: Add Web::UIEvents::KeyCode and KeyModifier enums, drop Kernel
This was the last Kernel header we had. Move the definitions we need
into a UIEvents header similar to MouseButton.
2024-06-07 09:44:41 +02:00
Andrew Kaster
f98e28912a LibCore: Only include BeepInstruction in System.cpp on Serenity
It remains to be seen whether we actually need this on serenity either..
2024-06-06 12:51:14 -06:00
Andrew Kaster
2770b7eecd LibCore: Null-check struct addrinfo to avoid freeaddrinfo(NULL)
On some C libraries, like NetBSD and musl-libc, this under-specified
edge case results in a crash rather than silently ignoring the null
pointer.
2024-06-06 12:48:58 -06:00
Andrew Kaster
405ce6e5f5 LibCore: Be more BSD-friendly in Core::Environment
FreeBSD and NetBSD don't have secure_getenv(3), same as macOS.
FreeBSD 13 and lower also don't allow setting environ pointers to null.

Co-Authored-By: Robert Clausecker <fuz@FreeBSD.org>
2024-06-06 12:48:58 -06:00
Andrew Kaster
89092e98a4 LibJS: Pass -1 as fd when using MAP_ANONYMOUS with mmap
NetBSD and FreeBSD get upset when we don't set the fd to an invalid
value when using a non-shared mapping.

Reported-By: Thomas Klausner <wiz@gatalith.at>
2024-06-06 12:48:58 -06:00
easrng
43b8f82e94 LibGfx: Ignore nonexistent font directories 2024-06-06 10:42:55 -06:00
easrng
f058939f1b LibCore: Get font directories from XDG_DATA_DIRS 2024-06-06 10:42:55 -06:00
Andrew Kaster
aef6ece9e6 Meta: Remove shred utility 2024-06-06 09:43:51 -06:00
Timothy Flynn
d61770c457 LibCore: Remove now-unused singleton process utilities 2024-06-06 11:27:03 -04:00
Timothy Flynn
8362c073f3 Everywhere: Remove LibSQL, SQLServer, and the sql REPL :^)
It is now entirely unused and replaced by sqlite3.
2024-06-06 11:27:03 -04:00
Timothy Flynn
30e745ffa7 LibWebView: Replace usage of LibSQL with sqlite3
This makes WebView::Database wrap around sqlite3 instead of LibSQL. The
effect on outside callers is pretty minimal. The main consequences are:

1. We must ensure the Cookie table exists before preparing any SQL
   statements involving that table.
2. We can use an INSERT OR REPLACE statement instead of separate INSERT
   and UPDATE statements.
2024-06-06 11:27:03 -04:00
Timothy Flynn
65ddd0553b Meta+LibWebView: Install and link sqlite3 with vcpkg
We will use sqlite3 as a replacement for LibSQL. Using a tried-and-true
database will allow us to avoid maintaining our an incomplete, non-ACID,
and less performant implementation. It also means we do not have to
launch and manage the singleton SQLServer process.
2024-06-06 11:27:03 -04:00
Timothy Flynn
d1ec32e28f LibProtocol: Exit fatally if the connection to RequestServer disappears
The default implementation of die() causes the client process to simply
exit cleanly. This prevents any tests from recognizing that something
went wrong, as the process exits with a code of 0. With this patch, we
still just exit when the connection dies, but with a fatal signal. In
the future, we will want to launch a new RequestServer process and
re-establish client connections.
2024-06-06 13:55:10 +02:00
Enver Balalic
862fc91b2c LibWeb: Implement HTMLImageElement::decode with a few FIXMEs
Implements enough of HTMLImageElement::decode for it to not break
websites and actually load an image :)
2024-06-06 08:20:02 +02:00
Andrew Kaster
7b67fa706f DOM: Check for navigable destruction in declarative refresh timer
If the Document's navigable has been destroyed since we started this
timer, or it's no longer the active document of its navigable, we
shouldn't navigate to it.
2024-06-06 08:13:34 +02:00
Nathan E. Egge
b040e5c12b LibTimeZone: Remove AK_OS_SERENITY ifdef
Remove special case for SerenityOS as fallback will still work.
2024-06-05 22:23:15 -04:00
Nathan E. Egge
d83ab035ee LibTimeZone: Read /etc/timezone for current TZ
Fallback to reading /etc/timezone by calling system_time_zone() when
unable determine time zone from /etc/localtime.
This works on systems where /etc/localtime is a file and not a symlink.

Fixes #65
2024-06-05 22:23:15 -04:00
Tim Ledbetter
c79041344d LibWeb: Ensure anchor node is not null when extending selection
Previously, clicking while holding shift without having previously made
any text selection would cause a crash.
2024-06-05 13:57:01 -04:00
Andrew Kaster
90af26e309 Meta+CMake: Remove unused CMake functions and features
Goodbye, serenity_components and Jakt.
2024-06-05 12:23:54 -04:00
Tim Ledbetter
f721230456 LibWeb: Extend text selection when left clicking and holding shift 2024-06-05 11:51:41 -04:00
Andreas Kling
f42c18bc4c LibGfx: Make Painter::target() return a Bitmap&
Painter always has a target bitmap, so let's return a reference.
2024-06-05 15:37:05 +02:00
Andreas Kling
a1a59ec3ab LibGfx: Remove unused Painter::draw_text() overloads 2024-06-05 15:37:05 +02:00
Andreas Kling
2f23912a55 LibGfx: Remove unused cruft from Painter.h 2024-06-05 15:37:05 +02:00
Andreas Kling
fe4cc32380 Everywhere: Include <LibGfx/Painter.h> in fewer places
Touching Painter.h now rebuilds ~40 files instead of ~300.
2024-06-05 15:37:05 +02:00
Andreas Kling
0e47e5e265 LibGfx: Move Gfx::Painter::LineStyle => Gfx::LineStyle 2024-06-05 15:37:05 +02:00
Andreas Kling
57906a4e1b LibGfx: Move Gfx::Painter::WindingRule => Gfx::WindingRule 2024-06-05 15:37:05 +02:00
Andreas Kling
254d040ff4 LibGfx: Move Gfx::Painter::ScalingMode => Gfx::ScalingMode
This will allow users to avoid including Painter.h
2024-06-05 15:37:05 +02:00
Andreas Kling
5e059c80cd LibGfx: Remove unused TabPosition.h 2024-06-05 15:37:05 +02:00
Andreas Kling
6a96920dbc LibGfx: Remove Bitmap and Painter "scale" concept
We don't need intrinsic scale factors for Gfx::Bitmap in Ladybird,
as everything flows through the CSS / device pixel ratio mechanism.

This patch also removes various unused functions instead of adapting
them to the change.
2024-06-05 15:37:05 +02:00
Andreas Kling
fce4739d3e LibTLS: Put debug spam about loaded certificates behind TLS_DEBUG 2024-06-05 07:11:34 +02:00
Andreas Kling
a0874dc870 LibWebView: Remove ProcessManager debug spam 2024-06-05 07:10:42 +02:00
Aliaksandr Kalenik
881e970846 LibWeb: Implement scrollbars dragging 2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
94eacf6da7 LibWeb: Remove did_request_scroll_to IPC call
No longer used after moving scrollbar painting into WebContent.
2024-06-05 07:03:42 +02:00