Commit graph

50352 commits

Author SHA1 Message Date
Karol Kosek bde96640ac Spreadsheet: Don't release the file buffer when importing CSV files
CSVImportDialogPage takes and holds a StringView meaning that the data
was dropped instantly and displayed garbage instead.
2023-05-15 06:55:41 +02:00
Ben Wiederhake 4de99d553e LibCore: Remove DeprecatedFile::read_link 2023-05-15 06:50:43 +02:00
Ben Wiederhake 85c897dc17 LaunchServer: Prefer FileSystem over DeprecatedFile 2023-05-15 06:50:43 +02:00
Ben Wiederhake e77f59b7d3 Shell: Prefer FileSystem over DeprecatedFile 2023-05-15 06:50:43 +02:00
Ben Wiederhake 317cdc32ad readlink: Prefer FileSystem::readlink over DeprecatedFile 2023-05-15 06:50:43 +02:00
Karol Kosek b7558a5ce4 LibGUI+Userland: Store column names in JsonArrayModel as String 2023-05-15 06:42:10 +02:00
Karol Kosek 945f05ed76 Userland: Port Model::column_name() to String 2023-05-15 06:42:10 +02:00
MacDue 741f07dedf LibGUI: Increase the min width of the vertical opacity slider
This prevents the <opacity>% text on the slider being clipped.
2023-05-15 06:40:18 +02:00
MacDue 9685d54291 LibGUI: Ensure final stop of the opacity slider gradient has 255 alpha
Otherwise, if you change the opacity in the color picker, the slider's
opacity changes.
2023-05-15 06:40:18 +02:00
Karol Kosek acf8e19eac LibCore: Use StringView in Object::find_{child,descendant}_of_type_named
It's unnecessary to allocate a string when we only want to compare it
with another string.

This change also adds a helper for string literals, so that we won't
need to add -sv suffix everywhere. :^)
2023-05-15 06:39:22 +02:00
MacDue 631fe129e9 LibGfx: Stop assuming the target format is always BGRA8888
...and instead assume it's BGRx8888 or BGRA8888, for now. Always
treating the target as BGRA8888 leads to the alpha channel being
interpreted incorrectly sometimes (as can be seen with WindowServer
overlays).

Fixes #18749
2023-05-15 06:38:22 +02:00
Ben Wiederhake 173f872cda Meta: Remove unused debug flags, add missing GENERATE_DEBUG
Commands that were helpful while investigating this:
```
grep -P '^set' Meta/CMake/all_the_debug_macros.cmake \
  | sed -Ee 's,set\((.+) ON\)$,\1,' > macros.lst
for i in $(cat macros.lst); do
  echo -n "$i "; git grep -Pn '\b'"$i"'\b' | wc -l
done | tee matches.lst
sort -k2 -n matches.lst
```
2023-05-14 16:01:57 -06:00
Ben Wiederhake c56481e73f Meta: Make *.in files accessible to QtCreator 2023-05-14 16:01:57 -06:00
Caoimhe 8bcf5b72eb VideoPlayer: Use LibFileSystemAccessClient 2023-05-14 15:56:49 -06:00
Caoimhe 465fa3460f LibVideo: Add PlaybackManager::from_mapped_file
This allows us to create a PlaybackManager from a file which has already
been mapped, instead of passing a file name.

This means that anyone who uses `PlaybackManager` can now use LibFSAC :)
2023-05-14 15:56:49 -06:00
Caoimhe 69396d4c4d VideoPlayer: Store video sizing mode in the configuration 2023-05-14 15:56:49 -06:00
Caoimhe 61add64f0f VideoPlayer: Pledge the "VideoPlayer" configuration domain 2023-05-14 15:56:49 -06:00
Ben Wiederhake 17a1e2eed1 ls: Migrate away from DeprecatedFile
Note that since many low-level bare C APIs are used, null-terminated
strings are still necessary in many places, which sadly required the
addition of many DeprecatedStrings.
2023-05-14 15:44:39 -06:00
Ben Wiederhake d5c13a3cbc LibCore: Remove standard I/O from DeprecatedFile 2023-05-14 15:42:57 -06:00
Ben Wiederhake b65d49669a test-imap: Prefer Core::File over DeprecatedFile 2023-05-14 15:42:57 -06:00
Ben Wiederhake b10106fc7d LookupServer: Migrate from DeprecatedFile to File 2023-05-14 15:41:58 -06:00
Ben Wiederhake f890b70eae Tests: Prefer TRY_OR_FAIL() and MUST() over EXPECT(!.is_error())
Note that in some cases (in particular SQL::Result and PDFErrorOr),
there is no Formatter defined for the error type, hence TRY_OR_FAIL
cannot work as-is. Furthermore, this commit leaves untouched the places
where MUST could be replaced by TRY_OR_FAIL.

Inspired by:
https://github.com/SerenityOS/serenity/pull/18710#discussion_r1186892445
2023-05-14 15:39:38 -06:00
Aliaksandr Kalenik 87a7299078 LibWeb: Start implementing sizing for tracks with span > 1 items in GFC
Partially implements:
- Increase sizes to accommodate spanning items crossing content-sized
  tracks
- Increase sizes to accommodate spanning items crossing flexible tracks

from https://www.w3.org/TR/css-grid-2/#algo-content
2023-05-14 19:32:34 +02:00
Aliaksandr Kalenik 7a5603052a LibWeb: Separate grid tracks from gaps in GFC
This change is supposed to solve the problem that currenty when grid
tracks are interleaved with gaps it is impossible to iterate tracks
spanned by a specific grid item. There is a pair of functions:
gap_adjusted_row() and gap_adjusted_column() but they won't work
when it comes to items spanning > 1 track.

Separating gaps from tracks is going to make it possible to iterate
just tracks or both tracks and gaps when it is required. And now tracks
spanned by an item can be accessed by just index without doing any
additional math.
2023-05-14 18:18:31 +02:00
Luke Wilde 8bacd569ff LibWeb: Make the dblclick event bubble, cancelable and composed 2023-05-14 13:51:05 +02:00
Luke Wilde 3894a8b995 Ladybird: Send the double click event to WebContent 2023-05-14 13:51:05 +02:00
Daniel Bertalan e2b1f9447c LibELF: Only call IFUNC resolvers after populating the PLT
As IFUNC resolvers may call arbitrary functions though the PLT, they can
only be called after the PLT has been populated. This is true of the
`[[gnu::target_clones]]` attribute, which makes a call to
`__cpu_indicator_init`, which is defined in `libgcc_s.so`, through the
PLT.

`do_plt_relocation` and `do_direct_relocation` are given a parameter
that controls whether IFUNCs are immediately resolved. In the first
pass, relocations pointing to IFUNCs are put on a worklist, while all
other relocations are performed. Only after non-IFUNC relocations are
done and the PLT is set up do we deal with these.
2023-05-14 13:47:53 +02:00
Daniel Bertalan cd45c2d295 LibELF: Split do_relocation into do_{direct,plt}_relocation
No functional changes intended. This is in preparation of a commit that
overhauls how IFUNCs are resolved.

This commit lets us move the implementation of PLT patching from
`DynamicObject` to `DynamicLoader` where all other relocation code
lives. For this, got[2] now stores the loader's address instead of the
object's.
2023-05-14 13:47:53 +02:00
Daniel Bertalan c4e0f5e5ee LibC+LibELF: Handle the R_AARCH64_IRELATIVE relocation type
This is the AArch64 equivalent of `R_X86_64_IRELATIVE`, which specifies
a symbol whose address is determined by calling a local IFUNC resolver
function.
2023-05-14 13:47:53 +02:00
Ben Wiederhake b23a0b409d SystemMonitor: Prefer Core::File, poll ProcessStatisticsReader correctly
The signature of Core::ProcessStatisticsReader::get_all changed, and
instead of requiring a pointer to an open file, it now needs a bool to
indicate whether usernames should be polled or not. `m_proc_all` was
always converted to `false` in `RefPtr::operator bool()`, so we were
missing usernames for a long time.
2023-05-14 13:46:57 +02:00
Aliaksandr Kalenik 07b6fb9104 LibWeb: Remove unused line in calculate_min_content_size() in GFC 2023-05-14 13:45:29 +02:00
Aliaksandr Kalenik 46db51a8c0 LibWeb: Remove excessive spec referencing in GridFormattingContext
Removes unrelated to the code copy paste from spec (sometimes
duplicated).
2023-05-14 13:45:29 +02:00
Aliaksandr Kalenik 6f82079a93 LibWeb: Remove dead code in resolve_intrinsic_track_sizes() in GFC
Removes partially implemented algorithm for distributing extra space
from spanning item:
https://www.w3.org/TR/css-grid-2/#extra-space

This algorithm should not be part of resolving track sizing on its own
but instead be a subfunction of step 3:
https://www.w3.org/TR/css-grid-2/#track-size-max-content-min

There are changes in layout tests but those are not regressions.
2023-05-14 13:45:29 +02:00
Rimvydas Naktinis 42bfe5db5f LibWeb: Change implicit background-size height to auto
The spec says: "The first value gives the width of the corresponding
image, the second value its height. If only one value is given the
second is assumed to be auto."

Fixes #18782
2023-05-14 13:02:32 +02:00
Andreas Kling 719f1db6c9 LibWeb: Protect against dereferencing a null pending image request
The spec seems to neglect the potential nullity of an image's pending
request in various cases.

Let's protect against crashing and mark these cases with a FIXME about
figuring out whether they are really spec bugs or not.
2023-05-14 10:25:25 +02:00
MacDue 7f3b98093e Meta: Enable DWARF 5 debug information
For our use case DWARF 5 seems to work fine now (see previous commit)
2023-05-14 09:21:08 +02:00
MacDue cf79df0edb LibDebug: Stub out LocListX and remove stub expression evaluator
The expression evaluator is dead code that does nothing but crash on
all paths, as no opcodes are implemented.

Stubbing out the LocListX form fixes a crash while reading DWARF 5
debug data that contains location lists. These are just a new way
to store location expressions, and since we never implemented
expressions, we can just ignore these too.

As far as I can tell this is enough for DWARF 5 to work for us (since
we mainly just use the line tables).
2023-05-14 09:21:08 +02:00
Andreas Kling ce634957c1 LibJS/Bytecode: Restore old environments when an exception is caught
Unwind contexts now remember the lexical and variable environments in
effect when they were created. If an exception is caught, we revert
to those environments in the running execution context.
2023-05-14 06:18:28 +02:00
Andreas Kling 81a62f4f59 LibJS/Bytecode: Fix bogus program termination after try with catch
For `try` statements with a `catch` clause, we were generating *two*
"next" blocks. This meant that not throwing an exception would cause
execution to stop.

Fix this by using the "next" block pointer for the try "entry" and
"handler" blocks.
2023-05-14 06:18:28 +02:00
Fabian Dellwing b01fcccbbd Userland+Base: Don't run NetworkSettings in elevated mode 2023-05-13 17:59:37 -06:00
Fabian Dellwing 24b1bdca27 NetworkSettings: Use helper script to write config
This change allows us to not run the app with elevated privileges.

It uses the Escalator to call a helper and passes the settings as
JsonObject to it.
2023-05-13 17:59:37 -06:00
Fabian Dellwing 27297d2817 Escalator: Major rework and enable forwarding of stdin/stdout
- Escalator now uses `posix_spawn` instead of `exec`
- Escalator is now able to forward stdin and stdout
- A few general changes to improve code quality
2023-05-13 17:59:37 -06:00
Fabian Dellwing 059904371f Userland: Allow our access check to pass flags to faccessat syscall 2023-05-13 17:59:37 -06:00
Fabian Dellwing 639aee037f Userland+Meta: Add new helper program for network settings
This little program allows us to take the NetworkSettings app away
from being an elevated GUI app.

It receives a JsonObject on STDIN and writes it to the global
Network configuration file.

If the write was successfull it will apply the changes.
2023-05-13 17:59:37 -06:00
Mike Swanson 041e29e585 Ports: Add chocolate-doom 3.0.1 2023-05-13 17:52:58 -06:00
Mike Swanson f947c4f4fc Ports: Add libsamplerate 0.2.2 2023-05-13 17:52:58 -06:00
Aliaksandr Kalenik dbafb11a7e LibWeb: Flesh out basic support of min-width/height for grid items
This change brings calculate_minimum_contribution() for grid items and
supporting functions.
2023-05-13 18:43:34 +02:00
Ben Wiederhake 32a777347f AK: Fix typo in instructions for adopt_nonnull_REF_or_enomem 2023-05-13 18:35:02 +02:00
Ben Wiederhake 77f021f5f1 pledge: Prefer FileSystem over DeprecatedFile 2023-05-13 17:06:42 +02:00
Ben Wiederhake 8c2cdb7bc7 which: Prefer FileSystem over DeprecatedFile 2023-05-13 17:06:42 +02:00