Commit graph

46779 commits

Author SHA1 Message Date
Kenneth Myhra 3bc5fcaccc LibWeb: Add accessor function HTMLFormElement::constructing_entry_list()
Each form element has a constructing entry list boolean, initially
false.
2023-02-12 00:18:09 +00:00
Kenneth Myhra 2363c2a572 LibWeb: Implement HTMLFormElement::get_submittable_elements()
This implements a convenience method on HTMLFormElement to retrieve a
list in tree order of submittable elements associated with the form
element.
2023-02-12 00:18:09 +00:00
Kenneth Myhra a6cdf6374f LibWeb: Introduce the FormDataEvent interface 2023-02-12 00:18:09 +00:00
Kenneth Myhra d5b5b94a35 LibWeb: Introduce the FormData interface from the XHR specification 2023-02-12 00:18:09 +00:00
Kenneth Myhra b74d5a423d LibWeb: Add convert string into scalar value from Infra spec 2023-02-12 00:18:09 +00:00
Linus Groh 2ad9c1fd6c LibWeb: Re-implement checkbox painting using the UA stylesheet
The checkbox provided by ClassicStylePainter is not scaling-aware and
generally unflexible, instead use the UA default stylesheet with a
handful of properties, the same way we already style buttons and text
inputs.

Thanks to Xexxa for the nice checkmark image!

Co-Authored-By: Xexxa <93391300+Xexxa@users.noreply.github.com>
2023-02-12 00:15:52 +00:00
Linus Groh a8bf2f8e4c LibJS: Port Symbol to String
This includes the VM's global_symbol_registry HashMap, which can now
store String keys.
2023-02-11 21:47:57 +00:00
Linus Groh 5e72fde954 LibJS: Unify Symbol::description() and raw_description()
Let callers take care of handling the empty optional case (undefined in
the spec).
2023-02-11 21:47:57 +00:00
Linus Groh fcdabd179a LibJS: Remove unused forwarding getters from SymbolObject 2023-02-11 21:47:57 +00:00
Linus Groh 89700a2101 LibJS: Rename Symbol::to_deprecated_string() to descriptive_string()
This implements the spec's SymbolDescriptiveString AO and should be
named accordingly.
2023-02-11 21:47:57 +00:00
Aliaksandr Kalenik ac440e6c0e LibWeb: Scale font size to device pixels 2023-02-11 20:59:13 +00:00
Aliaksandr Kalenik 1cc8895e4b LibGfx: Introduce with_size method for Font 2023-02-11 20:59:13 +00:00
Tim Ledbetter d910dd345e Assistant: Allow arguments in AppProvider queries 2023-02-11 19:32:24 +00:00
Tim Ledbetter 3b446fba34 LibDesktop: Pass an optional arguments list to AppFile::spawn() 2023-02-11 19:32:24 +00:00
Tim Ledbetter baaf97787b FileManager: Show directory size and file count in PropertiesWindow
When displaying properties for a directory, the PropertiesWindow now
shows: the total number of files, the total number of subdirectories,
and the total size of all files, in bytes.

These numbers are calculated on a background thread, and current
progress is displayed to the user every 100ms.
2023-02-11 19:32:07 +00:00
Tim Ledbetter d2e1f6ff57 FileManager: Propagate errors from PropertiesWindow initialization 2023-02-11 19:32:07 +00:00
Luke Wilde 588dae8aa6 LibJS/Temporal: Allow annotations after YYYY-MM and MM-DD
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/160e836
2023-02-11 18:42:32 +00:00
Karol Kosek 421b1eee49 WindowServer: Restore cursor animation
This regressed in 6edc0cf5ab.
2023-02-11 14:34:56 +00:00
Lucas CHOLLET db80425a65 LibGUI: Remove the Core::File overload of write_to_file()
One less usage of `Core::File`, yay!
2023-02-11 14:20:26 +00:00
Lucas CHOLLET 107e15c5bc LibGUI: Base write_to_file(StringView path) on the stream overload
`write_to_file(StringView path)` was based on the `Core::File` overload.
The return type also changed from `bool` to `ErrorOr<void>` to ease
error propagation.
2023-02-11 14:20:26 +00:00
Lucas CHOLLET be28800e0d FileManager: Factorize code to handle drag-and-drop
The treeview and the breadcrumbbar used to be on one side, sharing
drag-and-drop handling and on the other side the directory view had
its one logic.

This patch factorizes both versions, in the meantime upgrading the
version used by the treeview/breadcrumbbar that was left behind. It now
uses the copy dialog :^).
2023-02-11 14:18:13 +00:00
Nico Weber 0c4bbf5be3 AK: Move try_make_ref_counted() to NonnullRefPtr.h 2023-02-11 08:53:00 -05:00
Nico Weber 3c842d9d76 AK: Move try_make() to NonnullOwnPtr.h 2023-02-11 08:53:00 -05:00
Linus Groh 6bc6085219 Meta: Mark myself as a CODEOWNER of a few more things
Browser, Ladybird, the neofetch & python3 ports I added.
2023-02-11 13:26:47 +00:00
Linus Groh ee68eba0ac LibWeb: Implement Headers.getSetCookie()
This is a normative change in the Fetch spec.
See: https://github.com/whatwg/fetch/commit/e4d3480

This also implements the changes to the 'sort and combine' algorithm,
which now treats "set-cookie" headers differently, and is exposed to JS
via the Headers' iterator.

Passes all 21 WPT tests :^)
http://wpt.live/fetch/api/headers/header-setcookie.any.html
2023-02-11 13:14:26 +00:00
Linus Groh 6bce48e99b LibWeb: Fix UAF in convert_header_names_to_a_sorted_lowercase_set()
We can't keep a span (ReadonlyBytes) to a move()'d ByteBuffer
in the header_names_seen HashTable - copy the original name span instead
which works the same thanks to CaseInsensitiveBytesTraits.

This would sporadically fail the contains() check due to garbage data,
later leading to a VERIFY() crash in the OrderedHashTable append loop.
2023-02-11 13:14:26 +00:00
Aliaksandr Kalenik 92cb32b905 LibWeb: Add tests for flex formatting context 2023-02-11 10:42:52 +01:00
Julian Offenhäuser 9be9bf3379 Ports: Add GemRB
GemRB is an open-source implementation of the Infinity engine by
Bioware, used in some of their classic role-playing games.
2023-02-11 10:41:59 +01:00
Julian Offenhäuser b789debe07 Ports: Build python3 port with shared libraries 2023-02-11 10:41:59 +01:00
Nico Weber ed198ee6ae AK: Move adopt_nonnull_ref_or_enomem() to NonnullRefPtr.h
Rewrite the implementation to not depend on OwnPtr.h.

No intended behavior change.
2023-02-11 10:36:48 +01:00
Nico Weber ca6090889a AK: Move adopt_nonnull_own_or_enomem() to NonnullOwnPtr.h
Rewrite the implementation to not depend on OwnPtr.h.

No intended behavior change.
2023-02-11 10:36:48 +01:00
Nico Weber cf73e15dc1 LibGfx: Make ICC code handle out-of-memory situations better
...by using adopt_nonnull_ref_or_enomem() via the try_make_ref_counted()
wrapper, instead of adopt_ref().
2023-02-11 10:02:24 +01:00
Luke Wilde f09d2ae395 LibJS: Add missing assignment to offset_string in ZDT conversion 2023-02-11 00:57:59 +00:00
Nico Weber 4b2e18f34f LibGfx: Add scaffolding for curves in lutAToBType and lutBToAType 2023-02-10 23:25:51 +00:00
Baitinq 743f494a9c Toolchain: Add fuse2fs to serenity.nix
This previously missing package was needed for root-less image building
:)
2023-02-11 00:06:55 +01:00
MacDue 654950eaf7 Tests: Add a few tests to verify vectors are using inline storage 2023-02-11 00:03:14 +01:00
MacDue c0b7ff3c4c AK: Always initialize vector capacity to inline_capacity
This ensures constructors that take a span or an initializer_list
don't allocate when there's already enough inline storage.
(Previously these constructors always allocated)
2023-02-11 00:03:14 +01:00
Victor Panisa e1b15b9a44 Keymaps: Stop pt-br's r-shift printing "?"
Currently when trying to use the right-shift on the pt-br layout
it prints a "?" on key-down on top of applying the shift modifier.
This patch removes the unwanted "?".
2023-02-10 23:35:10 +01:00
Zaggy1024 e6c3b0e495 LibVideo/VP9: Rename round_2() to rounded_right_shift() for clarity 2023-02-10 23:34:37 +01:00
Zaggy1024 33ff3427eb LibVideo/VP9: Drop the decoder intermediate bounds checks
Checking the bounds of the intermediate values was only implemented to
help debug the decoder. However, it is non-fatal to have the values
exceed the spec-defined bounds, and causes a measurable performance
reduction.

Additionally, the checks were implemented as an assertion, which is
easily broken by bad input files.

I see about a 4-5% decrease in decoding times in the `webm_in_vp9` test
in TestVP9Decode.
2023-02-10 23:34:37 +01:00
Andreas Kling 7c607462a4 LibGfx+LibWeb: Store radii as FloatSize rather than FloatPoint
Radii are sizes, not points. This becomes important when mapping them
through a 2D transform.
2023-02-10 23:33:16 +01:00
Andreas Kling e9078e216d LibGfx: Make sure the Painter clip rect is never larger than the target
The new Painter::set_clip_rect(IntRect) API was able to make the clip
rect larger than the underlying target bitmap. This was not good, as it
could make it possible to draw outside the bitmap memory.

Fixes a crash when viewing https://twinings.co.uk/ in the browser. :^)
2023-02-10 23:33:16 +01:00
Liav A b4596b48f5 LibCore: Fix wrong call to stat on the Core::System::lstat method
We should call lstat and not stat, because lstat gives information on
the symbolic link itself (if the path is about a symbolic link).
2023-02-10 23:23:12 +01:00
Luke Wilde 349c126d8d LibWeb/Fetch: Implement CORS preflight
The main things missing is the CORS preflight cache and making
extract_header_list_values properly parse, validate and return split
values for the Access-Control headers.
2023-02-10 22:18:19 +00:00
Luke Wilde d9d556fbab AK: Allow Vector<ByteBuffer>::contains_slow to accept (Readonly)Bytes
This is done by providing Traits<ByteBuffer>::equals functions for
(Readonly)Bytes, as the base GenericTraits<T>::equals is unable to
convert the ByteBuffer to (Readonly)Bytes to then use Span::operator==

This allows us to check if a Vector<ByteBuffer> contains a
(Readonly)Bytes without having to making a copy of it into a ByteBuffer
first. The initial use of this is in LibWeb with CORS-preflight, where
we check the split contents of the Access-Control headers with
Fetch::Infrastructure::Request::method() and static StringViews
such as "*"sv.bytes().
2023-02-10 22:18:19 +00:00
Luke Wilde 237df9df5c LibWeb: Make extract_header_list_values differentiate parsing failures
Previously, parsing failures and the header not existing made
extract_header_list_values return an empty Optional, making it
impossible to differentiate between the two.

Required for implementing CORS-preflight, where parsing failures for
the headers makes it fail, but not having them doesn't make it fail in
all cases.
2023-02-10 22:18:19 +00:00
Luke Wilde bf2895365b LibWeb/Fetch: Don't add cookies when creating ResourceLoader request
Using LoadRequest::create_for_url_on_page will unconditionally add
cookies as long as there's a page available. However, it is up to
http_network_or_cache_fetch to determine if cookies should be added to
the request.

This was noticed when implementing CORS-preflight requests, where we
sent cookies in OPTIONS requests.
2023-02-10 22:18:19 +00:00
Luke Wilde c51026a855 Ladybird: Teach RequestManagerQt how to handle every valid HTTP method 2023-02-10 22:18:19 +00:00
Aliaksandr Kalenik 2ed5415750 LibWeb: Fix clearance to update y offset within current block
If a box has clearance and margin bottom of preceding box is greater
than static y of the box then it should also affect y offset in current
block container so subsequent boxes will get correct y position too.
2023-02-10 20:55:33 +01:00
Aliaksandr Kalenik 0cd63f851e LibWeb: Store y offset of current block container in BFC member
This change should make it possible to access y offset of current block
container in BFC without explicitly passing it using method parameters.
2023-02-10 20:55:33 +01:00