Commit graph

53165 commits

Author SHA1 Message Date
Daniel Bertalan 17b363b596 Ports/vim: Override uname output to fix compilation on macOS
`vim` does not use a mechanism like `config.sub` for determining the
canonical system name from the `--target` triple passed to `configure`.
Instead, it directly executes the `uname` executable on the host. This
leads to it trying to build macOS-specific files on Mac hosts even if we
are compiling for a different platform. To make cross-compilation
possible, developers added a way to override `uname`'s output with
environment variables. Let's set these.

See vim/vim#9338
Obsoletes #11426

Co-Authored-By: unixinspace <unixinspace@users.noreply.github.com>
2023-08-05 10:57:27 +02:00
Andi Gallo 7b0b501418 LibWeb: Improve adjustment of automatic table width with percentages
Use the max-width of percentage cells instead of min-width as the
reference to be used to compute the total table width. The specification
only suggests that the UA should try to satisfy percentage constraints
and this behavior is more consistent with other browsers.
2023-08-05 10:32:48 +02:00
Aliaksandr Kalenik d32bf4cd41 LibWeb: Set min-width for inline child boxes after inside layout
min-width for boxes with inline children can only be applied after
inside layout is done and width of box content is known.
2023-08-05 09:25:24 +02:00
Hediadyoin1 50bf303edd LibJS: Capture UnrealizedSourceRanges in ExecutionContext, not ASTNodes
This loosens the connection to the AST interpreter and will allow us to
generate SourceRanges for the Bytecode interpreter in the future as well

Moves UnrealizedSourceRanges from TracebackFrame to the JS namespace for
this
2023-08-05 06:39:06 +02:00
Lucas CHOLLET cd9bb985d4 LibGfx/JPEGXL: Add support for the self-correcting predictor
This predictor is much more complicated than the others. Indeed, to be
computed, it needs its own value but for other pixels. As you can guess,
implementing it involved the introduction of a structure to hold that
data.

Fundamentally, this predictor uses the value of the error between the
predicted value and the true value (aka decoded value) of pixels around.
One of this computed error (namely max_error) is used as a property, so
this patch also solves a FIXME in `get_properties`.

To ease the access to value that are close in the channel and moving
their values around, this patch adds a `Neighborhood` struct which holds
this data. It has been used in `prediction()` and it allowed to simplify
the signature and to remove the explicit retrieval of the underlying
data.

All this work allows us to decode the default image that appears when
loading `https://jxl-art.surma.technology`. However, we still render it
incorrectly due to the lack of support for orientation values different
from 1.
2023-08-05 06:30:59 +02:00
MacDue a01a2f712e LibWeb: Fix calculating the corner radius values for SVG <rect>
Previously, this would treat having both rx and ry set as if just rx
was set. The checks are now updated to match the spec comments above
them :).
2023-08-05 04:50:33 +02:00
Tim Schumacher d95f1deade Meta: Add myself to CODEOWNERS 2023-08-05 04:50:00 +02:00
Aliaksandr Kalenik b549f2d1d9 WebContent: Coalesce multiple sequential MouseWheel events
Same as a58d84407f but for MouseWheel :)
2023-08-05 04:47:46 +02:00
Aliaksandr Kalenik 6631314874 Ladybird: Send mouse wheel events to WebContent process
Rather than directing mouse wheel events to the QAbstractScrollArea,
send them to the WebContent process, allowing it to determine if they
should be consumed by the element or used for page scrolling.
2023-08-05 04:47:46 +02:00
Andrew Kaster 3a82f2d7ec Meta: Port 059857d26f to gn build 2023-08-04 20:02:28 -06:00
Daniel Bertalan a2daed5817 Ports/gettext: Replace manually linking libintl with a libtool patch
The `gettext` port comprises of multiple libraries, however `libintl.so`
is the one most commonly used in external executables/libraries, so
porting the patches to this one is enough.
2023-08-05 01:05:06 +02:00
Daniel Bertalan e9ce317483 Ports: Replace manually linking freetype with a libtool patch 2023-08-05 01:05:06 +02:00
Daniel Bertalan a050d91073 Ports/zlib: Do not manually link zlib into a shared library
Instead, pass our system name to its (non-autotools) configure script.
Tell it to include a SONAME to avoid breaking dependent ports when
updating zlib.
2023-08-05 01:05:06 +02:00
Sebastian Zaha 100714b8ac Meta: Pretty-print strings in gdb as a single object, not by character
This changes the string pretty-printer to show strings as
"full" as opposed to {"f", "u", "l", "l", "\0"}.
2023-08-05 02:16:55 +03:30
Sebastian Zaha e13b89dd20 Meta: Implement support for the new String in the gdb formatter
The pretty-print gdb helpers were not updated since the
DeprecatedString change. This commit introduces a new printer for String
and renames the old one to DeprecatedString.
2023-08-05 02:16:55 +03:30
0GreenClover0 259228d8d2 Spreadsheet: Set Help window mode to Modeless in the constructor
And don't try to do it every time the Help button is clicked.
This fixes a crash when clicking the Help button twice (setting window
mode on an already visible window is not supported).

This also fixes a situation where when opening the Help window with an
action, we didn't set its mode to "Modeless".
2023-08-05 02:14:51 +03:30
Bastiaan van der Plaat 059857d26f Ladybird: Add app icon for macOS 2023-08-04 15:36:37 -06:00
Andrew Kaster ef03e73844 Meta: Port ad440f9e9a to gn build 2023-08-04 14:20:00 -06:00
Andrew Kaster 616e61ee23 Meta: Port bc4d4f0f95 to gn build 2023-08-04 14:20:00 -06:00
Andrew Kaster 777fb44bb0 Meta: Port 78e1defbfe to gn build 2023-08-04 14:20:00 -06:00
ronak69 1453028975 Shell: Color bareword yellow if it's a prefix of at least one command
Before, if a bareword wasn't a runnable program's filename it got
colored red and white otherwise. Now, additionally it will be checked if
it is a "prefix" of a possible command and colored yellow if it is and
red if not.

Coloring this way provides another "feedback" to the user: If while
typing out a command name the color changes from yellow to red then a
typo occurred :^)

To check if a bareword is a prefix the `Shell::complete_program_name()`
function is utilized (if pressing tab gives you some suggestions then it
is a prefix).
2023-08-04 23:27:59 +03:30
Zaggy1024 ad440f9e9a LibWeb/Ladybird: Use the abstract audio output in a new audio plugin
The implementation of this plugin is meant to eventually replace all
current audio plugins in Ladybird. The benefits over the current Qt-
based audio playback plugin in Ladybird are:

- Low latency: With direct access to PulseAudio, we can ask for a
specific latency to output to allow minimal delay when pausing or
seeking a stream.
- Accurate timestamps: The Qt audio playback API does not expose audio
time properly. When we have access directly to PulseAudio APIs, we can
enable their timing interpolation to get an accurate monotonically-
increasing timestamp of the playing audio.
- Resiliency: With more control over how the underlying audio API is
called, we have the power to fix most bugs we might encounter. The
PulseAudio wrappers already avoid some bugs that occur with QAudioSink
when running through WSLg.
2023-08-04 13:49:36 -06:00
Zaggy1024 bc4d4f0f95 LibAudio: Create a playback class with a PulseAudio implementation
This adds an abstract `Audio::PlaybackStream` class to allow cross-
platform audio playback to be done in an opaque manner by applications
in both Serenity and Lagom.

Currently, the only supported audio API is PulseAudio, but a Serenity
implementation should be added shortly as well.
2023-08-04 13:49:36 -06:00
Zaggy1024 fe672989a9 LibCore: Add a class for thread-safe promises
Since the existing Promise class is designed with deferred tasks on the
main thread only, we need a new class that will ensure we can handle
promises that are resolved/rejected off the main thread.

This new class ensures that the callbacks are only called on the same
thread that the promise is fulfilled from. If the callbacks are not set
before the thread tries to fulfill the promise, it will spin until they
are so that they will run on that thread.
2023-08-04 13:49:36 -06:00
Zaggy1024 8626404ddb LibCore: Store the event loop stack as a function-scope thread_local
By allocating the event loop stack onto the heap, we were leaking it
when exiting. This way, we should avoid ASAN being unhappy with us.
2023-08-04 13:49:36 -06:00
Zaggy1024 78e1defbfe Ladybird: Allow posting events to the Qt event loop from other threads
Previously, a QTimer was used to start processing of our event queue in
the main Qt event loop. Unfortunately, QTimers are not thread-safe, and
disallow starting of a timer from a different thread than it was
created in.

Instead, use a dummy QObject to post a custom QEvent to the main loop
from whatever thread we like, and process our event queue when it is
received by our dummy object.
2023-08-04 13:49:36 -06:00
Zaggy1024 6131d879f7 Ladybird: Process Qt event queue when polling the event loop
The logic for `EventLoopImplementationQt::pump()` caused calls to
`EventLoop::pump(PumpMode::DontWaitForEvents)` to not consume events
posted to the Qt event queue. This caused the window to be unresponsive
even when polling the event loop, if waiting was not desired.
2023-08-04 13:49:36 -06:00
Tim Schumacher a8f5cf9da7 Ports/sqlite: Replace the stub libtool patch with the full version 2023-08-04 20:51:19 +02:00
Andrew Kaster a0869159cd Meta: Add Alexander Kalenik to the contributors list :^)
With a moderate historical delay, in what seems to be the correct order
2023-08-04 12:04:01 -06:00
Aliaksandr Kalenik 2bd7d1426b LibWeb: Remove unused CSSPixels::epsilon() 2023-08-04 19:00:02 +02:00
Aliaksandr Kalenik 79cbbfc67f LibWeb: Fix infinite spinning while distributing extra space in GFC
Fixes infinite spinning in the cases when CSSPixels does not have
enough precision to represent increase per track which happens when
very small extra_space got divided by affected tracks number.
2023-08-04 19:00:02 +02:00
Andrew Kaster de1726caee BindingsGenerator: Only truncate generated files if they have changed
Rework the write_if_changed logic to properly truncate the output file.
The original logic would not truncate the file, leading to extra junk
at the end of files if the IDL files shrunk between builds.
2023-08-04 10:06:41 -06:00
Fabian Dellwing 0003381a71 sed: Keep correct owner and permissions with sed -i 2023-08-04 09:02:31 -06:00
Karol Kosek d94a0623d0 Meta: Truncate generated IDL source files
3dd3120a8a changed open mode from Write to
ReadWrite, which stopped truncating files.

This could be noticed by building a slightly older branch, as compiling
it gave compile errors.
2023-08-04 15:59:16 +02:00
Karol Kosek 49df2e1e3a Ladybird+Browser: Update zoom text on menu after clicking zoom button 2023-08-04 15:16:48 +02:00
Andreas Kling cc9885c0c6 Meta: Add Steffen T. Larssen to the contributors list :^) 2023-08-04 15:16:33 +02:00
Andreas Kling 48af6a7325 Meta: Remove .github/FUNDING.yml
Only the top 4 entries from this file actually show up on the GitHub
interface, so instead of cutting some people off, let's just not have
the list.

There are already sponsorship links in README.md anyway :^)
2023-08-04 15:16:33 +02:00
Sam Atkins 7c9b9520ce Meta: Add myself to CODEOWNERS 2023-08-04 14:08:31 +01:00
Tim Ledbetter 539a33dc28 Ports/glm: Create /usr/local/include if it doesn't exist
Previously, the glm port would not build from a clean state, as this
directory does not exist by default.
2023-08-04 13:40:52 +02:00
Andi Gallo 3e70c1b6a3 LibWeb: Improve precision when computing size of replaced elements
Change associativity in computing of replaced element size to improve
precision of division.

Fixes vertically squashed image from Mozilla splash page MDN example.
2023-08-04 13:36:29 +02:00
Andi Gallo e9ad8d5e4f LibWeb: Use i64 for intermediate value in CSSPixels multiplication
Reduce the chance of overflow due to fixed point denominator being
squared when multiplying the raw values, before adjusting the final
value back.
2023-08-04 13:36:29 +02:00
ronak69 bed5a752df LibMarkdown: Preserve blank lines in CodeBlocks
Specifically, `CodeBlock::render_lines_for_terminal()` eats up blank
lines because it uses `DeprecatedString::split()` without the
`SplitBehavior::KeepEmpty` enum. Easy fix: use the enum.
2023-08-04 13:16:32 +02:00
ronak69 e0e027c17c Meta: Remove .gitignore from Base/
Base/.gitignore leaks into serenity's file-system. It can be safely
removed by adding equivalent un-ignore pattern in top-level .gitignore.
2023-08-04 13:15:24 +02:00
Fabian Neundorf 413e212ea8 Piano: Cache buffers in Track and WaveWidget
The Track itself caches the Samples after each processing step which
allows it to be queried without the need to process it every time.

This result is queried by the WaveWidget which then caches the result to
prevent unnecessary heap allocations every paint event.
2023-08-04 12:56:27 +02:00
Fabian Neundorf 885e35e92c Piano: Use Sample struct from LibDSP
Removes the Sample struct inside Piano and replaces it with the struct
from LibDSP.

It automatically scales the height of the wave depending on the maximum
amplitude, as the Samples now contain floats and not integers.
2023-08-04 12:56:27 +02:00
Aliaksandr Kalenik 0019b901a0 LibWeb: Remove hardcoded span = 2 while sizing spanning items in GFC 2023-08-04 12:41:11 +02:00
Andreas Kling a6e08e85d2 Meta: Update maintainer section in CONTRIBUTING.md 2023-08-04 12:37:44 +02:00
Andreas Kling 67c60aa009 Meta: Prune CODEOWNERS file 2023-08-04 12:32:13 +02:00
Torstennator 5e6f5a524a PixelPaint: New submenu for masking actions
This patch moves the mask related menu actions into a submenu in order
to keep the menu more clear.
2023-08-04 12:11:13 +02:00
Torstennator d8320d0a14 WindowServer: Fix menu height when invisible items are involved
This patch checks for visible items to determine the menu height. Now
the last visible item is used to determine the height of the menu.
Before this patch that menu height could be wrong e.g. if the last item
was not visible.
2023-08-04 12:11:13 +02:00