Commit graph

53025 commits

Author SHA1 Message Date
Liav A 8da7d84512 Kernel/VFS: Remove misleading part of debug message when mounting 2023-08-05 18:41:01 +02:00
Bastiaan van der Plaat 220e34b69d LibWeb: Add Canvas Context2D basic text align and text baseline support
Add the CanvasTextDrawingStyles mixin with the textAlign and
textBaseline attributes. Update fill_text in CanvasRenderingContext2D
to move the text rect by the text align and text baseline attributes.
Wrote a simple HTML example to showcase the new features.
2023-08-05 17:17:08 +02:00
Ali Mohammad Pur e689422564 LibRegex: Keep track of instruction positions for backwards tree jumps 2023-08-05 16:40:04 +02:00
Andreas Kling 64c06c345e LibWeb: Parse :host() selector
We were already parsing non-function-syntax :host, so let's also do
the :host(...) variant. Note that we don't have matching for these yet.

This fixes many issues on sites generated by Wix, as they often have
selector lists that include some :host() selector, and we'd reject the
entire rule after failing to parse it.
2023-08-05 13:23:12 +02:00
Aliaksandr Kalenik ac2d9d9273 Ladybird: Do not try to use pixelDelta() to calculate wheel offset
Documentation says that pixelDelta() is not reliable across platforms
so always using angleDelta() should produce more predictable scrolling
behaviour.
2023-08-05 13:22:59 +02:00
Andreas Kling 6f0a93b5df Tests/LibWeb: Rebaseline a block-and-inlines layout test
This test was created before layout test dumps included the paint tree.
2023-08-05 12:09:34 +02:00
Tim Ledbetter eda73af265 Ports/potrace: Add zlib dependency 2023-08-05 12:03:21 +02:00
Zaggy1024 2582b85ab1 LibWeb: Update reactive images according to spec after fetches finish
Reactive images that had an image source selected based on viewport
size would only update when the images were first fetched, meaning the
last valid image source would become stuck in an image element. By
implementing the last step for reacting to environment changes, we can
run the proper updates even when the image does not need to be fetched.
2023-08-05 11:41:41 +02:00
Tim Ledbetter 256084b0b9 top: Disable echo and line buffering on startup
This means we no longer show any characters the user types while top
is running.

Disabling line buffering has the same effect as enabling
non-blocking I/O, but it doesn't crash the terminal when we exit the
program without restoring stdin to its original state. This would
previously happen when a SIGKILL signal was received, for example.
2023-08-05 11:08:16 +02:00
Andreas Kling 41e7c5766e LibWeb: Support more kinds of indefinite widths on flex column items
This stuff is pretty hairy since the specifications don't give any
guidance on which widths to use when calculating the intrinsic height of
flex items in a column layout.

However, our old behavior of "treat anything indefinite as fit-content"
was definitely not good enough, so this patch improves the situation by
considering values like `min-content`, `max-content` and `fit-content`
separately from `auto`, and making the whole flex layout pipeline aware
of them (in the cross axis context).
2023-08-05 10:58:12 +02:00
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