Commit graph

51325 commits

Author SHA1 Message Date
Ben Wiederhake
85f822381f LibWeb: Avoid copies while computing ARIA name/description
This also makes the cycle-detection work as intended.
2023-06-15 08:09:16 +02:00
Ben Wiederhake
a9b3aaa887 LibJS: Fix redundancy-detection when printing raw values
Note that this does not change cycle-detection.

This is also was an unnecessary copy, since there is an easier, less
memory-intense way to do cycle detection than copying the entire
visited_set all the time.
2023-06-15 08:09:16 +02:00
Ben Wiederhake
72756f09f4 LibIDL: Avoid unnecessary copies of imported paths 2023-06-15 08:09:16 +02:00
Ben Wiederhake
fe9e09fa3a LibGUI: Avoid unnecessary copies of MenuItem pointer sets 2023-06-15 08:09:16 +02:00
Ben Wiederhake
c4a9afe31a LibLine: Avoid unnecessary copies of style spans 2023-06-15 08:07:17 +02:00
Ben Wiederhake
d3a6512643 WindowServer: Properly handle OOM on drag-and-drop metadata copy 2023-06-15 08:07:17 +02:00
Ben Wiederhake
efbf6b7e5f LibWeb: Make HashMap copy of inline CSS declarations fallible 2023-06-15 08:07:17 +02:00
Ben Wiederhake
592e6c89a5 LibGUI: Avoid unnecessary copies of clipboard metadata 2023-06-15 08:07:17 +02:00
Ben Wiederhake
342e1c6eab Browser: Avoid unnecessary copies of temporary Storages 2023-06-15 08:07:17 +02:00
MacDue
a8b9130ceb LibWeb: Support SVG vertical/horizontal lineto with multiple parameters
This now allows v 1 2 3 or h 1 2 3, which are treated like v 1 v 2 v 3
and h 1 h 2 h 3 respectively. This fixes the freeCodeCamp SVG logo.
2023-06-15 00:10:53 +02:00
Aliaksandr Kalenik
c48f60a98d Tests/LibWeb: Add a flag to update expectation metadata in WPT runner
Adds `--update-expectations-metadata` that allows to automatically
rebuild metadata.txt file with test expectations.
2023-06-14 20:50:32 +02:00
Aliaksandr Kalenik
67de71d302 Tests/LibWeb: Do not fail WPT tests on unexpected results
Since both the WebDriver and Browser API are currently unstable during
WPT tests, it's a good idea to make sure that WPT passes even if there
are unexpected results. This will help avoid having failures marked as
red in the CI system caused by flaky WPT tests.
2023-06-14 20:50:32 +02:00
Andreas Kling
3a11b55286 LibWeb: Treat % max-width as none when containing block size indefinite
This is technically "undefined behavior" per CSS 2.2, but it seems
sensible to mirror the behavior of max-height in the same situation.
It also appears to match how other engines behave.

Fixes #19242
2023-06-14 20:12:02 +02:00
Timothy Flynn
ff1606ffaf LibWeb: Implement seeking for audio tracks 2023-06-14 17:54:40 +02:00
Timothy Flynn
0c4b28faf3 LibWeb: Dispatch an addtrack event for newly created audio tracks 2023-06-14 17:54:40 +02:00
Timothy Flynn
6520a9a849 LibWeb: Support TrackEvent instances with an AudioTrack track type 2023-06-14 17:54:40 +02:00
Sam Atkins
11af5119b6 FileManager: Save the DirectoryView's visible columns
Since these are stored as numbers, and "1,2,3,5,6" is a bit meaningless
to anyone who looks at this code, the default set of visible columns is
provided as it was before, by them all being visible except a couple
that are specifically hidden.

The callback is wrapped in a debounce() so that if set_visible_columns
() is called, we'll just save the value once instead of doing so for
each column changed.
2023-06-14 17:53:59 +02:00
Sam Atkins
08edc872aa LibCore+Applications: Put timeout parameter first in debounce()
This matches the parameter order for Core::Timer's factory methods,
stops clang-format freaking out so much, and just seems nicer to
me. :^)
2023-06-14 17:53:59 +02:00
Sam Atkins
4c349165f2 LibGUI: Add a callback when the visible columns of a TableView change 2023-06-14 17:53:59 +02:00
Sam Atkins
8eff3b1910 LibGUI: Add functions to get/set all a TableView's visible columns
Specifically, this is to make it easier to save and restore this state
to a config file. I had hoped to use the column names instead of their
IDs, but some columns have an empty string as their name so we wouldn't
be able to distinguish between those.
2023-06-14 17:53:59 +02:00
Sam Atkins
f33824d2e9 LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
Valtteri Koskivuori
94bcb5bea8 Userland: Propagate errors from file detail providers in file utility
They already return ErrorOr<T>, so we can just use TRY() instead of
manually checking for errors.
2023-06-14 11:18:22 -04:00
Valtteri Koskivuori
e56098f734 LibCore+Userland: Remove uses of DeprecatedString in file utility
Mainly replacing DeprecatedString with StringView, since the actual mime
type and description texts are just static strings anyway.
2023-06-14 11:18:22 -04:00
Andreas Kling
43e1343abf LibWeb: Treat % max-height as none when containing block size indefinite
Fixes #19371
2023-06-14 17:08:15 +02:00
Andreas Kling
b6f3369b66 LibWeb: Fix spelling of non_anonymous_containing_block() 2023-06-14 17:08:15 +02:00
Andreas Kling
34591ff3d9 LibWeb: Use a separate class for shared image requests
As it turns out, making everyone piggyback on HTML::ImageRequest had
some major flaws, as HTMLImageElement may decide to abort an ongoing
fetch or wipe out image data, even when someone else is using the same
image request.

To avoid this issue, this patch introduces SharedImageRequest, and then
implements ImageRequest on top of that.

Other clients of the ImageRequest API are moved to SharedImageRequest
as well, and ImageRequest is now only used by HTMLImageElement.

This fixes an issue with image data disappearing and leading to asserts
and/or visually absent images.
2023-06-14 14:23:17 +02:00
Ali Mohammad Pur
cdec23a68c LibRegex: Treat \<ORD_CHAR> as unescaped in POSIX BRE/ERE
This is undefined according to the spec, but glibc ignores the backslash
and some applications seem to prefer this behaviour (e.g. sed).
2023-06-14 12:38:10 +02:00
Andi Gallo
ce186dca70 LibWeb: Fix the x coordinate of a block after a float
The margin from the containing blocks shouldn't be included in the
amount by which we increment x after a float was places. That coordinate
should be relative to the containing block.

Fixes the comments layout on https://lobste.rs.
2023-06-14 08:30:22 +02:00
Nico Weber
0db8ac7465 image: Add a --move-alpha-to-rgb flag
I didn't put this as a method on Bitmap since it doesn't seem generally
useful.  Easy to move the impl over to Bitmap in the future if we want
to use it elsewhere.
2023-06-14 08:30:06 +02:00
Nico Weber
ca35b5d767 image: Add a --strip-alpha flag
It can be used to look at an input image without its alpha channel.
2023-06-14 08:30:06 +02:00
Nico Weber
d70ddc8961 LibGfx: Add Bitmap::strip_alpha_channel()
Sets all alpha values to 0xff and sets the bitmap's format to BGRx8888.

Currently only implemented for BGRA8888 and BGRx8888.
2023-06-14 08:30:06 +02:00
Nico Weber
6e0fc5e221 LibGfx: Remove a static on a method in a .h file
Methods defined in header files should generally be `inline`,
not `static`.

`static` means that each translation unit will have its own local copy
of the function when the function isn't inlined and it's up to the
linker's identical code folding to hopefully merge the potentially many
copies in the program. `inline` means that the linker can put the
identical copies in a comdat and merge them by name, without having to
compare contents.

No behavior change.
2023-06-14 08:30:06 +02:00
Aliaksandr Kalenik
edf11b3809 Meta: Exclude cloned WPT repo from linting by check-markdown.sh 2023-06-14 06:45:04 +02:00
Aliaksandr Kalenik
0677270a3e Meta: Add WPT in Azure CI 2023-06-14 06:45:04 +02:00
Aliaksandr Kalenik
a414ddcbf3 LibWeb: Add a script to run Web Platform Tests
Introduce very initial and basic support for running Web Platform Tests
for Ladybird. This change includes simple bash script that currently
works only on Debian and could run tests with patched runner.

For now script to run WPT is not integrated in CI.

There is also a bunch of metadata required to run WPT. To avoid
introducing thousands of files in the initial commit for now it is
limited to run only css/CSS2/floats tests subdirectory.
2023-06-14 06:45:04 +02:00
Ali Mohammad Pur
fb262de7cb LibRegex: Make append_alternation() actually skip the common blocks
Previously we started with 'left_skip' set to zero, which made it so
that no blocks were selected to be skipped.
2023-06-14 06:41:17 +02:00
Ali Mohammad Pur
b1ca2e5e39 LibRegex: Do not treat repeats followed by fallthroughs as atomic 2023-06-14 06:41:17 +02:00
Nico Weber
31c9fe5c32 Base: Rename Cupertino window-close-modified-hover.jpg to .png
It's a png file, not a jpeg file, so give it the correct name.
If I read WindowFrame.cpp right, the hover bitmap only works if
the file is named .png, too.

(Noticed by running `find Base/res/icons -name '*.jpg'`.)
2023-06-14 06:40:44 +02:00
Shannon Booth
bd26d022ac LibWeb: Implement FileAPI::Blob::stream() 2023-06-14 06:27:04 +02:00
Shannon Booth
9f39be6e23 LibWeb: Implement FileAPI::Blob::get_stream()
This is used internally in many Blob algorithms, such as Blob::stream(),
Blob::text() and Blob::array_buffer().
2023-06-14 06:27:04 +02:00
Shannon Booth
94883866f5 LibWeb: Implement Web::Streams::readable_stream_enqueue AO
This AO will be used in the Web::FileAPI::Blob::get_stream()
implementation to enqueue all data in the blob to the stream.

There are still plenty of cases to handle, but this appears to be enough
for the basic case of reading all chunks from a readable stream until it
is done.
2023-06-14 06:27:04 +02:00
Shannon Booth
b7b5b5763e LibWeb: Add support to set up stream with byte reading support
This is used by Blobs to set up their stream in their get stream
algorithm.
2023-06-14 06:27:04 +02:00
Shannon Booth
666e413cd2 LibWeb: Add missing forward of Web::Streams::PullIntoDescriptor 2023-06-14 06:27:04 +02:00
Shannon Booth
79fc7d7c7c LibWeb: Add HTML::Task::Source::FileReading 2023-06-14 06:27:04 +02:00
Jelle Raaijmakers
70ca295404 LibSQL+SQLServer: Do not re-open databases
Both `Database` and `Heap` were allowed to be opened twice. Prevent
this, and change SQLServer to only open databases that are not already
opened.

This fixes a Ladybird crash where opening the application twice would
erroneously duplicate free heap block indices.
2023-06-13 16:33:42 -04:00
Jelle Raaijmakers
c05e08decb LibSQL: Prevent writing to free heap blocks
Each block index should have been requested before a write happens to
it. If this is not the case, return an error.
2023-06-13 16:33:42 -04:00
Jelle Raaijmakers
d3335d6ef8 LibSQL: Standardize some debugging statements in Heap 2023-06-13 16:33:42 -04:00
Andreas Kling
41da9a4231 LibWeb: Resolve auto margins on abspos elements in more cases
Specifically, we now handle cases where all three of `left`, `width`
and `right` are non-`auto`.
2023-06-13 17:47:50 +02:00
Andreas Kling
f7dc2742a9 CI: Don't run brew update on macOS CI 2023-06-13 17:25:39 +02:00
Emily Trau
fcef663869 Ports/nhlohmann-json: Fix pkgconf install path
CMAKE_INSTALL_DATADIR is used to define the install base dir for
pkgconf files. In this case it defaulted to /usr/local/share/pkgconf
which is not a location searched by default.

See a0c1318830/CMakeLists.txt (L69)
2023-06-13 16:44:13 +02:00