Commit graph

51336 commits

Author SHA1 Message Date
wertzuz f8527e1cad AK: Rename fixme to match other FIXMEs 2023-06-15 15:38:50 +01:00
Om Prakaash 7c66c5f12d LibJS: Replace a DeprecatedString with String
Refactors Date class to use String instead of DeprecatedString.

Changes use of the Date class in DatePrototype accordingly.
2023-06-15 14:03:51 +01:00
Karol Kosek 65a927d16e Help: Clear statusbar when leaving link 2023-06-15 13:53:22 +01:00
Karol Kosek bd8e16b704 CharacterMap: Override statusbar text on action hover
We have quite a lot of nicely described action status tips here that we
have never shown. Let's change that!
2023-06-15 13:53:22 +01:00
Karol Kosek 92ff12a0d0 LibGUI+Userland: Port StatusBar::set_override_text() to String 2023-06-15 13:53:22 +01:00
Karol Kosek 5234a30731 LibGUI+Userland: Port Action status tips to String 2023-06-15 13:53:22 +01:00
Karol Kosek 4b169cf25f LibGUI+Userland: Use action text as a fallback in Action::status_tip()
Many applications already do this in their code. This change will simply
move the logic to a single function to stop repeating ourselves!
2023-06-15 13:53:22 +01:00
Karol Kosek 2029750519 LibGUI+Userland: Port StatusBar::text() and set_text functions to String 2023-06-15 13:53:22 +01:00
Karol Kosek 2064f544c6 LibGUI: Store Statusbar text as String 2023-06-15 13:53:22 +01:00
stelar7 e1e382152c LibWeb: Implement CSS sign() 2023-06-15 12:26:34 +01:00
stelar7 79fc4c8a82 LibWeb: Implement CSS abs() 2023-06-15 12:26:34 +01:00
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