Commit graph

50264 commits

Author SHA1 Message Date
Andreas Kling 984630845d Ladybird: Only request repaint for what's in the visible viewport
Before this change, we asked WebContent to fill the whole shared bitmap
with content, even if we couldn't show it all in the viewport.
2023-05-15 10:04:29 +02:00
Andreas Kling def37e65f3 Ladybird+LibWebView: Remember the size of the last paint
This will allow us to change the size of the backing store bitmap
without conflating the size of the bitmap and the size of the paint.
2023-05-15 10:04:29 +02:00
Andreas Kling 68271c4fce Ladybird: Floor the WebContentView viewport offset at 0, 0
This fixes an unpleasant visual glitch when resizing the window.
When the user makes our QAbstractScrollArea larger, the scroll bars can
end up with negative values, which we were happily forwarding to the
WebContent process and asking it to paint the whole page at an offset.
2023-05-15 10:04:29 +02:00
Daniel Bertalan 02fe3feb71 Toolchain: Enable RELRO support for AArch64
The BFD linker requires the `COMMONPAGESIZE` emulation parameter to be
set in order to enable RELRO support for AArch64. As we are adding a
custom `emulparams` file anyways, let's also tell LD that our ELF
interpreter is called `/usr/lib/Loader.so`.

This commit also removes some vestigial references to i686 SerenityOS.
The one in `gas/configure.tgt` is still needed, as it also handles
x86_64.
2023-05-15 07:00:29 +02:00
Daniel Bertalan 07918b79b7 Toolchain+Ports: Update GCC to 13.1.0
This is a mostly straight-forward rebase of our patches on top of
13.1.0. The spec files needed a change, as GCC no longer supports STABS
debug information, but we were building GCC with support for it.

Highlights of this release include static `operator()`, The Equality
Operator You Are Looking For and extended `constexpr` support.
2023-05-15 07:00:29 +02:00
Daniel Bertalan 4809f60e2d Toolchain: Use xz-compressed GCC and Binutils archives
This reduces the downloaded archives' size from 143+46 MB to 81+25 MB.
2023-05-15 07:00:29 +02:00
Daniel Bertalan 8df5bd53da AK: Silence false positive -Warray-bounds warning
This regression has been reported to GCC's Bugzilla:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109727

The formatting change looks like a clang-format 15 bug :(
2023-05-15 07:00:29 +02:00
Daniel Bertalan fc003cd248 Userland: Silence or resolve new GCC 13 warnings
GCC 13 produces the following true positive warnings:
- `-Wredundant-move` when trying to move `result->tooltip()`, which
  is a const reference in `Assistant/main.cpp`
- `-Wuse-after-free` when freeing an environment variable before
  removing it from `s_malloced_environment_variables`
- `-Wdangling-pointer` when storing an AST node's `this` pointer to the
  interpreter's node stack in LibJS. This is not actually an issue, as
  it is popped when the scope ends, but GCC has no way of telling this.
2023-05-15 07:00:29 +02:00
Daniel Bertalan 2123fdd678 Kernel: Remove FIFO::{attach,detach}(Direction)
These functions would have caused a `-Woverloaded-virtual` warning with
GCC 13, as they shadow `File::{attach,detach}(OpenFileDescription&)`.

Both of these functions had a single call site. This commit inlines
`attach` into its only caller, `FIFO::open_direction`.

Instead of explicitly checking `is_fifo()` in `~OpenFileDescription`
before running the `detach(Direction)` overload, let's just override the
regular `detach(OpenFileDescription&)` for `FIFO` to perform this action
instead.
2023-05-15 07:00:29 +02:00
Tim Ledbetter f666989c9e Base: Add man page for pidof 2023-05-15 06:57:44 +02:00
Tim Ledbetter fac6c6c554 pidof: Add -S option to specify a pid separator
This is useful for commands which expect a comma-separated list of
pids.
2023-05-15 06:57:44 +02:00
Tim Ledbetter 8be7b16c42 pidof: Use ArgsParser to validate arguments
The built in functionality of ArgsParser is now used to validate the
options given. All options are now grouped into a struct.
2023-05-15 06:57:44 +02:00
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