Commit graph

52082 commits

Author SHA1 Message Date
Dominika Liberda 484f10132d Ports: Add a Super Tux Kart port
Co-Authored-By: Linus Groh <mail@linusgroh.de>
Co-Authored-By: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-Authored-By: lilylunatic <lily@acab.dev>
Co-Authored-By: io_err <quint@guvernator.net>
2023-07-04 12:26:05 +02:00
Dominika Liberda 815fc034ff Ports: Fix building harfbuzz against freetype 2023-07-04 12:26:05 +02:00
MacDue ff402b1b42 file: Add a description for the image/tinyvg mime type 2023-07-04 12:04:32 +02:00
Linus Groh 8aa579d494 Ports: Update URL of pkgconf release tarball
See: 437c2a3218
2023-07-04 10:43:11 +01:00
Andreas Kling fb727332f9 LibWeb: Decode linked style sheets before parsing them
This fixes an issue where a BOM at the head of a style sheet would be
passed verbatim to the parser, who would then interpret it as an ident
token and (after some confusion) fail to parse the first rule, but then
carry on with the rest of the sheet.
2023-07-04 10:45:20 +02:00
Ali Mohammad Pur 251ea54cc8 Ports: Bump the version of make to 4.4.1 2023-07-04 08:35:02 +02:00
Timothy Flynn 260b0451b0 LibLocale: Update to CLDR version 43.1.0
https://cldr.unicode.org/index/downloads/cldr-43#h.qobmda543waj
2023-07-04 07:26:50 +02:00
Nico Weber efad31dac1 Utilities: Add a pdf utility
This utility will learn tricks such as extracting images from PDFs and
dumping tables from PDFs so that we can create code from specs.

It also allows testing LibPDF things in lagom, and allows testing
reading large amounts of PDFs using a shell script.
2023-07-04 06:50:15 +02:00
Andreas Kling e7e454f1d6 LibWeb: Resolve used insets for grid items 2023-07-04 06:43:53 +02:00
Andreas Kling 03ec17fd37 LibWeb: Resolve used insets for flex items 2023-07-04 06:43:53 +02:00
Andreas Kling c83ae729d2 LibWeb: Resolve used insets for floating elements
This makes the game carousel work on https://null.com/ :^)
2023-07-04 06:43:53 +02:00
Carwyn Nelson a2591bc5fa LibCore: Make ArgParser::Arg::accept_value return ErrorOr<bool>
Much like the previous commit, this commit makes the
ArgParser::Arg::accept_value callback return an ErrorOr<bool> instead of
just a bool.

The aim of this is to make argument parsing more robust, especially
with the newer String api that returns an ErrorOr for many functions.
2023-07-04 04:26:58 +03:30
Carwyn Nelson abbfb00a02 LibCore: Make ArgParser::Option::accept_value return ErrorOr<bool>
This commit makes the `ArgParser::Option::accept_value` property more
error-safe by ensuring it returns an ErrorOr<bool> instead of just a
bool.
2023-07-04 04:26:58 +03:30
Jelle Raaijmakers 0315ee5937 Kernel: Clean up includes for Audio subsystem
Some unused, missing or misplaced includes.
2023-07-04 00:05:34 +02:00
Jelle Raaijmakers 5c64686666 Kernel+AudioServer: Use interrupts for Intel HDA audio buffer completion
We used to not care about stopping an audio output stream for Intel HDA
since AudioServer would continuously send new buffers to play. Since
707f5ac150 however, that has changed.

Intel HDA now uses interrupts to detect when each buffer was completed
by the device, and uses a simple heuristic to detect whether a buffer
underrun has occurred so it can stop the output stream.

This was tested on Qemu's Intel HDA (Linux x86_64) and a bare metal MSI
Starship/Matisse HD Audio Controller.
2023-07-04 00:05:34 +02:00
Lucas CHOLLET 2e474e8c18 image: Add an option to tweak the quality of output JPEG 2023-07-04 00:01:06 +02:00
Lucas CHOLLET f3d15f53c9 LibCore: Add the template instantiation ArgsParser::add_option<u8>() 2023-07-04 00:01:06 +02:00
Lucas CHOLLET 1c1ba6a2bd LibCore: Be explicit about integers size
This concerns all template instantiations of `ArgsParser::add_option()`
for integers.
2023-07-04 00:01:06 +02:00
Lucas CHOLLET a58c7fe322 LibGfx/JPEG: Take the quality as an argument instead of hardcoding it 2023-07-04 00:01:06 +02:00
Lucas CHOLLET 05c8ad4e91 LibGfx/JPEG: Write quantization tables in the zigzag ordering
This is clearly something I missed during the first implementation. The
specification is crystal clear about it: "The quantization elements
shall be specified in zig-zag scan order."

This patch fixes the weird behavior we had when using the quantization
table.
2023-07-04 00:01:06 +02:00
MacDue c63d66e32f Base: Add high-quality vectorized Buggie .tvg file
I could not find a vector graphic of Buggie, so I've now made one
and am adding it exclusively as a .tvg :^)

Should be easy to convert to an SVG too :)
2023-07-03 23:54:51 +02:00
MacDue c04e0494df Tests: Add simple .tvg decoding test
yak.tvg is the Twemoji bison we all know and love.
2023-07-03 23:54:51 +02:00
MacDue dfcd7b3ca5 Ladybird: Replace forward/back/reload SVGs with TVGs
Doing this removes the qt6-svg dependency and allows our rasterizer to
be used for these little icons (and happens to be a fair bit smaller
than the old SVGs).
2023-07-03 23:54:51 +02:00
MacDue bb5db0835d LibGfx: Allow loading a Bitmap (from bytes) with an ideal size 2023-07-03 23:54:51 +02:00
MacDue 7a0e3474d6 Base: Setup file associations for .tvg 2023-07-03 23:54:51 +02:00
MacDue ee09ecaf42 Userland: Register MIME type/extension for .tvg
These both come from the specification.
2023-07-03 23:54:51 +02:00
MacDue ae18186905 LibGfx: Implement image decoder for TinyVG (.tvg)
This adds a decoder for the TinyVG vector format (https://tinyvg.tech/).
TinyVG is a very simple binary vector format, but it is good enough to
represent a lot of SVGs, without needing the full web engine.

The main use case for Serenity is for scalable icons (which .tvg easily
handles).
2023-07-03 23:54:51 +02:00
MacDue e7cddda7e1 LibGfx: Allow passing an ideal size to image decoders
The ideal size is the size the user will display the image. Raster
formats should ignore this parameter, but vector formats can use
it to generate a bitmap of the ideal size.
2023-07-03 23:54:51 +02:00
Lucas CHOLLET ff47223301 LibCore: Make NetworkJob::start() take a Stream::BufferedSocketBase&
It used to take a plain `Socket` and cast it to a `BufferedSocketBase`,
which can lead to unpleasant result when used with a non-buffered
`Socket`.
2023-07-03 23:29:28 +02:00
Lucas CHOLLET 5fc873f53b LibCore: Don't implement pure virtual methods in NetworkJob 2023-07-03 23:29:28 +02:00
Lucas CHOLLET 9581fe1d7d LibTLS: Remove unused methods
Affected methods are:
 - can_read_line
 - can_read
 - read_line
2023-07-03 23:29:28 +02:00
Lucas CHOLLET b46667639f LibHTTP: Make HttpRequest return its method name as a StringView 2023-07-03 23:29:28 +02:00
Timothy Flynn 163ddf1d73 LibWeb: Display the media volume in a tooltip while it is changing 2023-07-03 19:07:26 +02:00
Timothy Flynn 720d8889ad LibWeb: Allow changing media volume with keyboard controls
This allows increasing and decreasing the media volume by 10% with the
up and down arrow keys, respectively. This also allows toggling the mute
state with the M key.
2023-07-03 19:07:26 +02:00
Timothy Flynn 6a5229c2cb LibWeb: Allow seeking media elements with keyboard controls
This allows seeking backwards and forwards by 5 seconds with the left
and right arrow keys, respectively. This also allows seeking to the
beginning and end of the media track with the home and end keys.
2023-07-03 19:07:26 +02:00
Timothy Flynn a4070b1452 LibWeb: Allow toggling playback of media elements with keyboard controls
This allows pausing/playing media elements with the space bar.
2023-07-03 19:07:26 +02:00
Timothy Flynn 2c5c815f44 LibWeb: Toggle media playback when clicking anywhere on the control box
Feels nicer to click anywhere on the control box to toggle playback,
rather than needing to accurately click the playback button. Note this
does not affect other behavior-specific buttons; i.e. if the mute button
is pressed, we won't reach the playback toggle..
2023-07-03 19:07:26 +02:00
Timothy Flynn c2357a059e LibWeb: Mark media elements as focusable
This allows focusing media elements for keyboard control.
2023-07-03 19:07:26 +02:00
Timothy Flynn 3793b7c6bd LibWeb: Move helper to toggle a media element's playback to the element
This will be needed elsewhere.
2023-07-03 19:07:26 +02:00
Timothy Flynn 435ced70b8 LibWeb: Update the media element's display in a couple situations
Mostly seen on macOS, but when we toggle playing a media element, we
need to update its layout node's display to ensure the change is
reflected on the playback button. Further, when setting the element's
display time, we need to update the display to ensure the change is
refelected on the media timeline.
2023-07-03 19:07:26 +02:00
Timothy Flynn b57199ccb9 Ladybird: Propagate "empty" key events to the WebContent process
We currently drop events which do not have text associated with them.
This prevents e.g. arrow keys from being able to be handled by web
elements. We now match Browser's behavior on Serenity, where these key
events are already propagated.
2023-07-03 19:07:26 +02:00
Timothy Flynn 27ca90646d WebContent: Clear Serenity's audio buffers when seeking
Without this, the already-buffered audio may continue playing after a
seek. The SoundPlayer application does the same operation here.
2023-07-03 19:07:26 +02:00
Andreas Kling 21260ea2ef LibWeb: Merge did_remove_attribute() into attribute_changed()
Instead of having two virtuals for attribute change notifications,
there is now only one. When the attribute is removed, the value is null.
2023-07-03 19:04:45 +02:00
Andreas Kling 5a74486b59 LibWeb: Rename DOM::Element::parse_attribute() => attribute_changed()
This is a first step towards merging attribute change and removal
notifications into a single function.
2023-07-03 19:04:45 +02:00
Ali Mohammad Pur e1e04884b9 LibLine: Handle any errors propagated through refresh_display()
This can only realistically happen when the terminal no longer exists,
so quitting with an error here is the better solution as the application
will soon be killed anyway.
Fixes #19742.
Fixes #19017.
2023-07-03 19:07:33 +03:30
Hendiadyoin1 b26dad3d62 LibJS: Handle Calls argument range during EliminateLoads pass
Otherwise we could forget to emit stores those registers, thinking that
they are only directly accessed.
2023-07-03 16:55:13 +02:00
Lucas CHOLLET f52e3e540f LibGfx/JPEG: Add a fast path for sequential JPEGs
Decoding progressive JPEGs involves a much more complicated logic than
sequential JPEGs. Thanks to template specialization, this patch allow us
to skip the additional cost of progressive images when it's not needed.

It gives a nice 10% improvements on sequential JPEGs :^)
2023-07-03 14:26:15 +02:00
Andreas Kling 510dfbb7e6 LibWeb: Update anonymous wrappers when applying style changes
Anonymous wrapper boxes inherit style from their layout tree parent,
and since style data is per-layout-node, we have to manually sync them
from parent to anonymous children when something changes.

This is not very elegant or efficient, so I've left a FIXME about
solving it in a nicer way.

This fixes horizontal dog alignment on https://waffles.dog/ :^)
2023-07-03 13:37:14 +02:00
Andreas Kling b918ce4022 LibWeb: Make Layout::TextNode::text_for_rendering() lazily computed
As it turns out, Layout::TreeBuilder never managed to wrap text within
table boxes in anonymous wrapper boxes, since it relied on checking
text_for_rendering(), and that was never initialized during that early
stage of tree building.

This patch fixes the issue by making text_for_rendering() compute the
(potentially collapsed) text lazily when called.

Note that the test included with this patch is still totally wrong,
but that is now a TFC problem rather than a TreeBuilder problem. :^)
2023-07-03 11:50:58 +02:00
Andreas Kling 5cdb394400 LibWeb: Make HTML parser flush all pending tokens in "in table text"
There were multiple bugs in the parsing algorithm for handling text
occurring inside a `table` element:

- When there was pending non-whitespace text inside a table, we only
  flushed one token instead of all pending tokens.

- Also, we didn't even flush one of the right tokens, but instead the
  token that caused the flush to happen.

- Once we started flushing the right tokens, it turned out we had not
  yet implemented character insertion points expressed as "before X".

- Finally, we were not exiting the "in table text" mode after flushing
  pending tokens, effectively getting us stuck in that mode until EOF.
2023-07-03 11:50:58 +02:00