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>.)
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
This also changes fetch to use the preferred languages for the
Accept-Language header.
(cherry picked from commit 2ca8fd1832462c05fdec16a1de73494820597140)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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.)