Commit Graph

50366 Commits

Author SHA1 Message Date
thankyouverycool
e4ab9a799d LibGfx: Convert FontStyleMappings to Arrays
This will let us neatly ensure capacities, do unchecked appends, and
iterate by size() on FontEditor's models.
2023-05-13 12:53:49 +02:00
thankyouverycool
8dda4e4ab5 LibGUI: Add fallible factories to ItemListModel 2023-05-13 12:53:49 +02:00
thankyouverycool
023c1dffab LibGUI: Ignore Alt+{Left,Right} key events in GlyphMapWidget
Fixes seek actions not activating by keyboard shortcut when
GlyphMapWidget has focus.
2023-05-13 12:53:49 +02:00
Aliaksandr Kalenik
d187862f76 LibWeb: Return grid container width from automatic_content_width in GFC
automatic_content_width() should return grid container width that is
supposed to be set by determine_intrinsic_size_of_grid_container().
2023-05-13 12:53:25 +02:00
Aliaksandr Kalenik
644e4f4c99 LibWeb: Implement grid container intrinsic sizes calculation
When a width/height constraint is applied to GFC it should set its own
width/height to the sum of track sizes according to the spec.

Changes in layout tests are improvement over what we had before.
2023-05-13 12:53:25 +02:00
Aliaksandr Kalenik
d0ce61bf13 LibWeb: Fix condition to determine auto tracks while sizing in GFC
This solves the issue when track with "fixed" min sizing function were
treated like "auto" during sizing.
2023-05-13 12:53:25 +02:00
Daniel Bertalan
2626136749 SpiceAgent: Gracefully handle the host clearing the clipboard
When the host clears the clipboard (e.g. by running `pbcopy </dev/null`)
the Spice server sends an empty string to us. Previously, we would crash
as `AnonymousBuffer::create_with_size` doesn't accept a size of 0. Fix
this by passing `{}` to `async_set_clipboard_data` in this case.
2023-05-13 10:19:28 +02:00
Andreas Kling
9d78619b59 LibWeb: Let HTMLImageElement delay the document load event again 2023-05-13 09:08:42 +02:00
Andreas Kling
c648e24cff LibWeb: Don't force HTMLImageElement to have a legacy ImageLoader
We achieve this by adding a new Layout::ImageProvider class and having
both HTMLImageElement and HTMLObjectElement inherit from it.

The HTML spec is vague on how object image loading should work, which
is why this first pass is focusing on image elements.
2023-05-13 09:08:42 +02:00
Andreas Kling
3cf73ca0b3 LibWeb: Implement enough of "update the image data" to load images
This first pass is enough to get us:
- Image loading via fetch
- Source selection via srcset and sizes attributes
2023-05-13 09:08:42 +02:00
Andreas Kling
6fe4fcb74b LibWeb: Add a class to represent the "source set" concept from HTML
Also comes with a little extra CSS parser helper for parsing "sizes"
attributes in images.
2023-05-13 09:08:42 +02:00
Andreas Kling
9281bf7a01 LibWeb: Add class to represent "list of available images" from HTML spec 2023-05-13 09:08:42 +02:00
Andreas Kling
596eabe9e6 LibWeb: Start fleshing out HTML "image requests" and "image data"
This patch adds HTML::ImageRequest and HTML::DecodedImageData.

The latter had to use a different name than "ImageData", as there is
already an IDL-exposed ImageData class in HTML.
2023-05-13 09:08:42 +02:00
Liav A
420952a433 Kernel/aarch64: Remove drawing of logo on the framebuffer during init
This logo was actually used as a first sign of life in the very early
days of the aarch64 port.
Now that we boot into the graphical mode of the system just fine there's
no need to keep this.
2023-05-13 07:56:00 +02:00
Ben Wiederhake
c5d3de3f7d LibDebug: Propagate errors around LineProgram
Found while playing Fixme-Roulette.
2023-05-13 07:54:34 +02:00
Fabian Dellwing
4093952a6e Ports: Update and fix nethack
This update fixes the broken build on newer (Ubuntu) systems.

It also contains a security fix.
2023-05-13 07:53:58 +02:00
Ben Wiederhake
960822ef74 LibCore: Remove unused API from DeprecatedFile
It looks like this migration it taking a while, so let's make sure noone
accidentally introduces new usages of this currently-unused API.
2023-05-13 07:53:13 +02:00
Ben Wiederhake
bc2a517ade Userland: Merge DEFAULT_PATH into LibFileSystem/FileSystem.h 2023-05-13 07:53:13 +02:00
Andreas Kling
0db94daf5e Ladybird: Disable SQL database by default (until we can trust it)
The asynchronous query execution keeps causing bugs with document.cookie
so let's make the SQL database backend default off until we can trust it
to do what we need.
2023-05-13 07:52:22 +02:00
Andreas Kling
c8cf599c44 LibWeb: Make PercentageOr<T> equality comparison work for calc() values
This makes hovering around on GitHub fast again, as it no longer
believes that the grid-template-areas property keeps changing
when it didn't :^)

Also made to_string() work for calc() values as well, since I stumbled
upon that while debugging this.
2023-05-13 07:38:08 +02:00
Aliaksandr Kalenik
d7ca52afaf LibWeb: Fix typo in containing_block_size_for_item in GFC 2023-05-13 06:48:55 +02:00
Aliaksandr Kalenik
4ef997c47c LibWeb: Align calculate_min/max_content_contribution with the spec
This change brings more spec compliant implementation of functions to
calculate min/max contributions of grid items in containing block size.
2023-05-13 06:29:42 +02:00
Ben Wiederhake
d2cc8baf41 SystemServer: Migrate from DeprecatedFile to File
Note that previously, the only check was that at least one byte was read
from /dev/devctl. This is incorrect, as potentially not the entire
struct was read. In practice, this probably never happened, but the new
code at least detects this case and aborts.
2023-05-12 19:46:54 +01:00
Ben Wiederhake
97e60f2c7d LibKeyboard: Read keymap through File, not DeprecatedFile
This results in a new OOM prevention. Hooray!
2023-05-12 19:46:54 +01:00
Ben Wiederhake
37b5bfa068 AudioServer: Migrate from DeprecatedFile to File
Advances #17129.
2023-05-12 19:46:54 +01:00
Caoimhe
d7b067e8f7 Base: Run SpiceAgent as a user service
This allows it to read/write to the user's clipboard properly. Prior to
this, it would be writing to the Clipboard server running under the
window user, which doesn't impact other users (like anon).

Co-authored-by: Daniel Bertalan <dani@danielbertalan.dev>
2023-05-12 17:47:16 +01:00
Timothy Flynn
aece6555e7 ClipboardHistory: Use titlecasing in the applet's window title 2023-05-12 13:05:03 +02:00
Ben Wiederhake
da394abe04 LibGfx+Fuzz: Convert ImageDecoder::initialize to ErrorOr
This prevents callers from accidentally discarding the result of
initialize(), which was the root cause of this OSS Fuzz bug:

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55896&q=label%3AProj-serenity&sort=summary
2023-05-12 09:40:24 +01:00
Timothy Flynn
a84e64ed22 LibWeb: Implement fetching classic scripts using Fetch infrastructure 2023-05-12 05:47:36 +02:00
Timothy Flynn
12976b74ca LibWeb: Implement the fetch a classic script AO
Note that this unfortunately requires the same workaround as <link>
elements to handle CORS cross-origin responses.
2023-05-12 05:47:36 +02:00
Timothy Flynn
00fa23237a LibTextCodec: Change UTF-8's decoder to replace invalid code points
The UTF-8 decoder will currently crash if it is provided invalid UTF-8
input. Instead, change its behavior to match that of all other decoders
to replace invalid code points with U+FFFD. This is required by the web.
2023-05-12 05:47:36 +02:00
Timothy Flynn
cb32bb3502 LibWeb: Add an alias for FetchAlgorithm's consume-body callback argument
This will make it more convenient in places where the Variant would need
to be re-typed outside of this class.
2023-05-12 05:47:36 +02:00
Timothy Flynn
567b8da1e0 LibWeb: Change the script fetch completion callback to accept any script
The completion callback currently only accepts a JavaScriptModuleScript.
The same callback will need to be used for ClassicScript scripts as well
so allow the callback to accept any Script type. The single existing
outside caller already stores the result as a Script.
2023-05-12 05:47:36 +02:00
Timothy Flynn
dff0e8a0dc LibWeb: Implement the fetch response's unsafe response AO 2023-05-12 05:47:36 +02:00
Timothy Flynn
e4cb27050a LibWeb: Implement the fetch response is CORS-cross-origin AO 2023-05-12 05:47:36 +02:00
Timothy Flynn
29d90ccf3b LibWeb: Implement the legacy extracting an encoding AO 2023-05-12 05:47:36 +02:00
Timothy Flynn
9701128145 LibWeb: Implement the CORS settings attribute credentials mode AO 2023-05-12 05:47:36 +02:00
MacDue
9070aaebee LibGfx: VERIFY() error is finite when splitting bezier curves
If this value somehow becomes nan/inf the painter will keep splitting
the path till the process OOMs, a simple crash would be preferable.
2023-05-12 05:37:44 +02:00
MacDue
1012947a30 LibWeb: Use .to_px_or_zero() in tentative_height_for_replaced_element()
If just .to_px() is used the height can end up as the float `inf` or
`nan`. This caused an OOM when loading Polygon as this `inf` would
become a `nan` and propagate to the SVG painting, which then attempts
to draw a path with nan control points, which would make the
Gfx::Painter infinitely split the path till it OOM'd.
2023-05-12 05:37:44 +02:00
Mike Swanson
eb76329ad8 Ports: Add deutex 5.2.2 2023-05-12 05:36:47 +02:00
Mike Swanson
5a1c0c6836 Ports: Support extracting *.tar.zst source archives 2023-05-12 05:36:47 +02:00
Caoimhe
99de0b2c14 HexEditor: Add list of recently opened files 2023-05-11 20:20:40 +01:00
Aliaksandr Kalenik
de970c2dce LibWeb: Resolve grid items preferred width in GFC
Previously, the width and height of grid items were set to match the
size of the grid area they belonged to. With this change, if a grid
item has preferred width or height specified to not "auto" value it
will be resolved using grid area as containing block and used instead.
2023-05-11 18:37:06 +02:00
Aliaksandr Kalenik
c2f6ba8f5f LibWeb: Parse calc() function in grid sizes
Adds missing part of grid size parsing function to handle calc().
2023-05-11 18:36:56 +02:00
Aliaksandr Kalenik
7fee05e18c LibWeb: Use LengthPercentage in CSS::GridSize
Using LengthPercentage instead of Length and Percentage separately
is going to allow GridSize to store calc() values. It also allows
to simplify some parts of layout code.
2023-05-11 18:36:56 +02:00
Sam Atkins
6a21bbb5b2 errno: Remove usage of DeprecatedString 2023-05-11 16:33:18 +02:00
Sam Atkins
23dd16febe errno: Look up errors by name as well as number
eg, `errno enotsup` now shows the description and number for ENOTSUP.
2023-05-11 16:33:18 +02:00
Sam Atkins
a22a6c371e errno: Include error code names in output
And align the output nicely while we're at it. :^)
2023-05-11 16:33:18 +02:00
Andreas Kling
b98252728e LibWeb: Fix percentage min/max sizes on flex items with intrinsic ratio
We were resolving percentage values against the containing block size in
the wrong axis.
2023-05-10 18:46:04 +02:00
Andreas Kling
89ba7246dd LibWeb: Don't resolve CSS property values for unconnected elements
While it's possible to getComputedStyle() on an unconnected element,
the resulting object is not supposed to have any values, since we can't
resolve style without a document root anyway.

This fixes a crash on https://bandcamp.com
2023-05-10 17:27:07 +02:00