Commit graph

63369 commits

Author SHA1 Message Date
Sönke Holz
7c710805ec Kernel: VERIFY that the SafeMem sections are not empty on all arches 2024-11-07 09:32:54 -05:00
Sönke Holz
9e9148dead Kernel/aarch64: Add .{ro,unmap}_after_init sections to linker script 2024-11-07 09:32:54 -05:00
Sönke Holz
859fceeb07 Kernel/aarch64: Correctly set {start,end}_of_kernel_{data,text}
MemoryManager::protect_kernel_image uses these symbols.
2024-11-07 09:32:54 -05:00
Sönke Holz
93cc7d213f Kernel/x86: Fix indentation in linker script 2024-11-07 09:32:54 -05:00
Sönke Holz
3f3f7a4440 Kernel/aarch64: Fix indentation in linker script
Also remove some trailing whitespace.
2024-11-07 09:32:54 -05:00
Sönke Holz
1d9301d845 Kernel/aarch64: Don't use the memory before .text as the initial stack
This new stack has the same size as the initial stack on riscv64 and
x86_64.
2024-11-07 09:32:54 -05:00
Nico Weber
e56b7bb17b LibPDF: Hook up dash pattern drawing 2024-11-07 09:12:13 -05:00
Nico Weber
ebf67def77 LibPDF: Let LineDashPattern store data as floats
We used to store them as ints, which threw away information.
In practice, files do use fractional values for these.
2024-11-07 09:12:13 -05:00
Nico Weber
d569238896 LibGfx: Add support for stroke dash patterns
This adds support for dash patterns to Path::stroke_to_fill().
This is used in PDFs, <canvas>, and <svg>.

The implementation is based on the <canvas> spec. It seems to do
the right thing for PDF files too.

(This commit only adds the feature to LibGfx. Future commits will
hook this up for PDF, <canvas>, and <svg>.)
2024-11-07 09:12:13 -05:00
Nico Weber
0ccacc1d89 Tests: Add some dashed paths to paths.pdf 2024-11-07 09:12:13 -05:00
Sönke Holz
b07b589dad Meta: Add a virtio-serial device to the RISC-V machine
This unbreaks `Meta/serenity.sh run riscv64`, since 36a2826 enabled
SPICE by default (which requires a virtio-serial device).
2024-11-07 07:57:01 -05:00
Ninad Sachania
c6002dc861 Services/EchoServer: Print a helpful error message instead of crashing 2024-11-07 07:25:10 -05:00
Ninad Sachania
277604b692 Services/EchoServer: Make it clear that the server is waiting 2024-11-07 07:25:10 -05:00
Ninad Sachania
b9e387ed6d LibShell/Builtin: Add a blank line before the timing report 2024-11-07 07:24:24 -05:00
Ninad Sachania
7d1d5450a4 LibShell/Builtin: Add spaces to make the output more consistent 2024-11-07 07:24:24 -05:00
Ninad Sachania
6a96e1c23f Ports/stb: Bump version to 2e2bef4 2024-11-06 19:30:43 -05:00
Ninad Sachania
a34248f1b2 Documentation: Remove reference to closed bug bounty program 2024-11-06 19:28:30 -05:00
implicitfield
2f6573a591 LibFileSystem: Make copy_file() read in MiB-sized chunks
This prevents us from running out of memory when copying large files.
2024-11-05 20:14:21 +01:00
implicitfield
54bfc3d294 Kernel/Ext2FS: Cache blocks less aggressively
With this patch, we now only cache at most 2^14 blocks, which greatly
relieves memory pressure when working with large files.
2024-11-05 20:14:21 +01:00
implicitfield
54b8fe1fa4 Kernel/Ext2FS: Add a helper to free every block an inode holds 2024-11-05 20:14:21 +01:00
implicitfield
a32b9c903b Kernel/Ext2FS: Make block allocation properly fallible
For some context, write_bytes_locked used to simply bail out before
writing any data if there weren't enough blocks to cover the entire size
of an inode before 1bf7f99a.

We're not actually restoring that behavior here, since computing the
amount of blocks to be allocated would get exceedingly complex,
considering that there could always be holes in between already
allocated blocks.

Instead, this simply makes allocate_blocks() bail out properly if there
aren't any free blocks left.

Fixes #24980
2024-11-05 20:14:21 +01:00
Jamie Mansfield
c7e4d1b575 LibWeb: Use "en" as a fallback when setting preferred languages
This will set the preferred languages to [ "en" ] if an empty list is
provided.

(cherry picked from commit b7f0241ab5c06c945553acdefbd7daf7569d2b8b)
2024-11-05 11:41:15 -05:00
Jamie Mansfield
58f96312a2 LibWeb: Add a default for the navigator's languages
This will mean that non-Qt frontends don't return an empty array.

(cherry picked from commit 7b105e1ecfe23d6954c8abae6735cf655ff57204)
2024-11-05 11:41:15 -05:00
Jamie Mansfield
a225b9ca51 Ladybird/Qt: Add setting for preferred languages
(cherry picked from commit 132ab775d8bf712c2f461e40e4e20c431fcadc90)
2024-11-05 11:41:15 -05:00
Jamie Mansfield
a49db64dac LibWeb: Make preferred languages configurable
This also changes fetch to use the preferred languages for the
Accept-Language header.

(cherry picked from commit 2ca8fd1832462c05fdec16a1de73494820597140)
2024-11-05 11:41:15 -05:00
Andreas Kling
09a3dcb9c9 LibWeb: Implement very basic in-memory HTTP caching
This patch adds a simple in-memory HTTP cache to each WebContent
process.

It's currently off by default (turn it on with --enable-http-cache)
since the validation logic is lacking and incomplete.

(cherry picked from commit a3c8e60710451c1325f6718b253e8d1ee2029a30)
2024-11-05 11:22:07 -05:00
Andreas Kling
197076ed7b LibWeb: Make HTTP response directive parsing more robust
(cherry picked from commit 47169db4529d1310d8802b3b60bb97cf926374a7)
2024-11-05 11:22:07 -05:00
Andreas Kling
1c8375f5df LibWeb: Don't extrapolate transition properties for unknown properties
If we don't recognize a given transition-property value as a known CSS
property (one that we know about, not necessarily an invalid one),
we should not extrapolate the other transition-foo values for it.

Fixes #1480

(cherry picked from commit 9765a733d0bc297815fc1a7fce562e3d8f69cd84)
2024-11-05 10:48:01 -05:00
Tim Ledbetter
fb2a030762 UI/Qt: Don't hide the location bar URL when creating a tab from a URL
The location bar URL is no longer hidden when creating a new tab or
opening a new window that has an associated URL. Conversely, the
location bar is now always focused and the URL hidden when creating a
window or tab without an associated URL.

The location bar is focused when:
* Opening the browser from the command line with no URL arguments
* Opening a new tab (Ctrl+T)
* Opening a new window (Ctrl+N)

The location bar is not focused when:
* Opening the browser from the command line with one or more URLs
* Opening hyperlinks in a new tab
* Clicking a hyperlink with `target="_blank"`

This matches the behavior of other major browsers.

(cherry picked from commit efce3d967183f7071d47f27ce93310662217ef5e)
2024-11-05 10:47:18 -05:00
Ninad Sachania
56e2dd15cf Utilities/yes: Remove unnecessary headers 2024-11-05 09:31:54 -05:00
Nico Weber
71ade49580 Meta: Add a script that prints potential Ladybird cherry-picks 2024-11-05 09:08:41 -05:00
Ninad Sachania
9b67345a82 Utilities/basename: Add help message for command usage 2024-11-05 09:06:42 -05:00
Ninad Sachania
68c40377cd Utilities/dirname: Improve help message 2024-11-05 09:06:42 -05:00
sideshowbarker
271559bd80 Meta: Make check-debug-flags.sh runnable in Bash 3.2
This change updates the Meta/check-debug-flags.sh script to avoid an
apparent Bach 3.2 parser bug. Specifically, it takes a comment and some
code of a process substitution and moves it into a separate function.

Otherwise, without this change, trying to run the check-debug-flags.sh
script with Bash 3.2 fails with the following error:

line 39: bad substitution: no closing `)' in <(

...apparently because Bash 3.2 chokes on the comment (and doesn’t choke
if the comment is completely removed).

Relates to https://github.com/LadybirdBrowser/ladybird/issues/283

(cherry picked from commit 15d67f0da2083c0a39964f8fc6bdcbbd4907b2ed)
2024-11-05 06:05:19 -05:00
Tim Ledbetter
370ab9dc16 UI/Qt: Set a minimum size policy for the navigation control toolbar
This prevents the user being able to shrink the window to the point
that the location bar and other controls are no longer visible.

(cherry picked from commit 4ed46adeeec4860b55d455da49aa93aff26bf1a3)
2024-11-05 06:03:32 -05:00
Jamie Mansfield
196a70b3bc Ladybird/Qt: Only update navigation buttons for current tab
This resolves a bug where if you opened a link in a new tab and quickly
went back to the original, the navigation buttons would update for the
new page shortly after.

(cherry picked from commit 7abf47f4bf5039869a8f38c12f1be62bba97e463)
2024-11-05 06:02:54 -05:00
Nico Weber
5bad39d71f Tests: Remove unused Kernel/ include
This include was unused when it was added in #6993, probably
copy-pasta from Tests/LibC/TestLibCInodeWatcher.cpp where it is
used.

No behavior change.
2024-11-04 21:47:15 -05:00
Andreas Kling
fbe99575e0 LibWeb: Resolve flex item % main size to 0 during min-content sizing
When the flex container is sized under a min-content constraint in the
main axis, any flex items with a percentage main size should collapse
to zero width, not take up their own intrinsic min-content size.

This is not in the spec, but matches how other browsers behave.

Fixes an issue where the cartoons on https://basecamp.com/ were way
too large. :^)

(cherry picked from commit 59ed823724331d6457e81f8674aef392ca4dc174)
2024-11-04 21:46:05 -05:00
BenJilks
84617a7202 LibWeb: Add support for flex-wrap: wrap-reverse
Reverse the order of flex lines, when the `flex-wrap` property is set to
`wrap-reverse`. This will also swap the cross-start and cross-end
directions.

(cherry picked from commit 46649fbe1b015a7f4bfad4e059ecaf3c513f3a26)
2024-11-04 21:46:05 -05:00
BenJilks
91d454e252 LibWeb: Only reverse each line of a reverse flex-direction
When a flex container with a reverse `flex-direction` is wrapped. Only
each line should be reversed, not all items.

(cherry picked from commit e2c1fe7255c84ad1ee172765ef9f107949117098)
2024-11-04 21:46:05 -05:00
Andreas Kling
213f86d781 LibWeb: Adjust flex item intrinsic contributions through aspect ratio
When determining the intrinsic cross size contribution of a flex item
with a preferred aspect ratio, we have to account for any min/max
constraints in the main axis.

(cherry picked from commit bde2d3dc7b359cd4f56ad9975c44d22e43ef82fe)
2024-11-04 21:46:05 -05:00
Jelle Raaijmakers
94a64acb2e LibWeb: Account for intrinsic width or height in flex base size
In calculating the base size of a flex item, we have a piece of ad-hoc
code that deals with an item that does have an instrinsic aspect ratio,
but not a cross size to resolve that ratio against. In determining the
actual flex item size however, we also take into account the minimum
content width and height, which assumes the box' intrinsic width or
height when available. This would break having an image as a flex item,
which gets stretched to its maximum size within the flex container
instead of the flex item being shrunk to the instrinsic size of the
image.

Fix this by only stretching flex items that do not have an instrinsic
width nor height set.

(cherry picked from commit 7a783d3a89aec0caaa63a483c855fe921b6d0984)
2024-11-04 21:46:05 -05:00
Jelle Raaijmakers
7c9cafc8f9 LibWeb: Update two spec URIs
No functional changes.

(cherry picked from commit d82f8a4b16097ad2b5d0d61787c8f72c0f43830f)
2024-11-04 21:46:05 -05:00
Jelle Raaijmakers
97e91ab12d LibWeb: Remove unused includes
No functional changes.

(cherry picked from commit 89d21335a127dc385d91aeedac36e78aa662ee83)
2024-11-04 21:46:05 -05:00
simonkrauter
0ab04f92a3 Ladybird/Qt: Apply selected color scheme for new tabs
Previously, new tabs always had the `auto` color scheme, regardless of
what the user has selected before.
Replace the 3 individual slots with a `set_preferred_color_scheme`
method.

(cherry picked from commit 82915e1914bd9a8d4a6dcbec53982b3ba2caa68d)
2024-11-04 20:56:17 -05:00
Ninad Sachania
d6d538acf7 Utilities/yes: Add help message for command usage 2024-11-04 20:33:29 -05:00
Ninad Sachania
c4e20d253d Utilities/yes: Change the default output string to "y" 2024-11-04 20:33:29 -05:00
Sam Atkins
32406976d7 LibWeb: Ensure Elements don't need style update after computing style
Previously, we set the "needs style update" flag to false at the
beginning of recomputing the style. This meant that if any code within
the cascade set this flag to true, then we would end style computation
thinking the element still needed its style updating. This could occur
when starting a transition, and would make TreeBuilder crash.

By ensuring that we always set the flag to false at the very end of
style computation, this is avoided, along with any similar issues - I
noticed a comment in `Animation::cancel()` which sounds like a
workaround was needed for a similar problem previously.

(cherry picked from commit 8c79edac085ee164aca5ca7cf287e68e93e03217)
2024-11-04 19:29:49 -05:00
Zachary Huang
f341138c70 ImageDecoder+LibGfx: Collate decoded bitmaps before sending over IPC
There is an issue where gifs with many frames cannot be loaded, as each
bitmap is sent over IPC using a separate file descriptor, and there is
limit on the maximum number of descriptors per IPC message. Thus, trying
to load gifs with more than 64 frames (the current limit) causes the
image decoder process to die.

This commit introduces the BitmapSequence class, which is a thin wrapper
around the type Vector<Optional<NonnullRefPtr<Gfx::Bitmap>>> and
provides an IPC encode/decode routine that collates all bitmap data into
a single buffer so that only a single file descriptor is required per
IPC transfer, even if multiple frames are being sent.

(cherry picked from commit e0bd42be9590b967d0b5788ce7537a861a35ba74;
amended to fix conflict on build files since we still BitmapMixer.cpp
that upstream removed in LadybirdBrowser/ladybird#41, and
BitmapSequence.cpp conflicted with that. Also amended to not have
AlphaType in BitmapMetadata since we don't have that, and to have
scale instead, which we still do have. Also updated encode() and
decode() to send things in the order they're in in the struct.)
2024-11-04 19:29:13 -05:00
Tim Ledbetter
01324df21e LibWeb: Implement setRangeText for input and textarea elements
This method replaces range of text in its respective element with a new
string

(cherry picked from commit 2f5b0707163db5df5ff2d25dc329e70d8f54a7f1)
2024-11-04 19:28:16 -05:00