Commit Graph

50303 Commits

Author SHA1 Message Date
Sam Atkins
02ee93d6c9 ps: Use Optional for column indices, instead of -1 meaning "not present" 2023-05-16 12:54:18 +02:00
Sam Atkins
e6f7b828c3 ps: Ensure columns capacity in advance
Also use unchecked_append() in a couple of other places where we can.
2023-05-16 12:54:18 +02:00
Sam Atkins
2b02c58cd3 ps: Migrate from DeprecatedString to String 2023-05-16 12:54:18 +02:00
Sam Atkins
61552415a3 ps: Use Core::System::fstat() 2023-05-16 12:54:18 +02:00
Tim Ledbetter
46510bbb64 Base: Add man page for pgrep 2023-05-16 12:49:15 +02:00
Tim Ledbetter
5a9a27cea0 pgrep: Add -d option to specify a pid delimiter
This is useful for commands which expect a comma-separated list of
pids.
2023-05-16 12:49:15 +02:00
Timothy Flynn
e30dcc7391 Ladybird: Add a context menu for image elements 2023-05-16 12:48:39 +02:00
Timothy Flynn
0d1b5e7f7a Ladybird: Add a context menu for link elements 2023-05-16 12:48:39 +02:00
Timothy Flynn
1b2394d92e Ladybird: Add a context menu for video elements 2023-05-16 12:48:39 +02:00
Timothy Flynn
a0e31bf1de Ladybird: Move the page context menu from the BrowserWindow to the Tab
This will allow us to show different context menus depending on what
element is clicked, much like we do for Browser on Serenity.
2023-05-16 12:48:39 +02:00
Timothy Flynn
1df0a141af Browser: Add a context menu for video elements
This includes actions such as controlling play state, downloading the
video, and opening the video in a new tab.
2023-05-16 12:48:39 +02:00
Timothy Flynn
c82f678fc6 LibWeb+WebContent: Add APIs to control video playback state
This allows for the browser process to control the play/pause state,
whether we paint user agent controls on the video, and whether the video
loops when it finishes playing.
2023-05-16 12:48:39 +02:00
Timothy Flynn
d8f03dda08 Browser+LibWeb+WebContent: Broadcast video element context menu requests
This just sets up the IPC to notify the browser process of context menu
requests on video elements. The IPC contains a few pieces of information
about the state of the video element.
2023-05-16 12:48:39 +02:00
Timothy Flynn
5f473bcb5f LibWeb: Propagate non-primary mouse button clicks on video elements
Otherwise, returning "no" here will disallow the browser process from
showing a context menu, as the event handler will bail early.
2023-05-16 12:48:39 +02:00
Timothy Flynn
bcfa4a34a1 LibCore: Support the WebM file extension when determining MIME type
This enables, for example, navigating to a file:// URL in Ladybird with
a .webm file extension.
2023-05-16 12:48:39 +02:00
networkException
63d2b26b17 LibVT: Correctly wrap text when the scrollbar is hidden 2023-05-16 12:47:16 +02:00
Luke Wilde
b15128c45b LibJS/Bytecode: Implement initial support for super member expressions 2023-05-16 11:26:31 +02:00
Luke Wilde
00493687f2 LibWeb: Implement location.assign 2023-05-16 11:25:44 +02:00
Andrew Kaster
baeee0effe Kernel: Restore kernel8.img for aarch64 build
This was erroneously deleted in 420952a433
2023-05-16 09:47:37 +02:00
Aliaksandr Kalenik
2d05c63c7c LibWeb: Skip frozen tracks while distributing space in GFC 2023-05-16 07:47:47 +02:00
Aliaksandr Kalenik
a613a0973e LibWeb: Reset item_incurred_increase before distributing space in GFC
item_incurred_increase should be reset before every next distirbution
because otherwise it will accumulate increases from previous
distributions which is not supposed to happen.
2023-05-16 07:47:47 +02:00
Timon Kruiper
55e8ffd122 Kernel/aarch64: Make REGISTER_STATE_SIZE a multiple of 16 bytes
This ensure that the stack pointer also stays 16 byte aligned. This
fixes a baremetal issue when getting an exception.
2023-05-15 17:16:06 -06:00
Timon Kruiper
65ed5419ae Kernel/aarch64: Dump registers when unknown exception occurs
This is useful when debugging baremetal issues.
2023-05-15 17:16:06 -06:00
Andreas Kling
5d4e9a0673 LibWeb: Basic support for CSS text-indent: <length-percentage>
Note that this simple form of text-indent only affects the first line
of formatted content in each block.

Percentages are resolved against the width of the block.
2023-05-15 19:31:09 +02:00
Sam Atkins
9c2d496dbe LibWeb: Make processBodyError take an optional exception
Changed here:
018ac19838
2023-05-15 16:28:16 +02:00
Aliaksandr Kalenik
ae5bb13f1f LibWeb: Do not layout grid items during grid container intrinsic sizing
There is not need to run layout inside grid items for intrinsic sizing
of grid container.
2023-05-15 16:27:53 +02:00
Aliaksandr Kalenik
1ecbbadf3a LibWeb: Fix specified_size_suggestion to use size of dimension
specified_size_suggestion() should use width or height depending on
specified dimension.
2023-05-15 16:20:51 +02:00
Aliaksandr Kalenik
daf86eaabc LibWeb: Fix UBSAN issue caused by invalid TemporaryTrack pointer in GFC
Fixes the issue when if there are enough rows/column to force
m_row_gap_tracks or m_column_gap_tracks be resized during gaps
initialization then pointers stored in m_grid_columns_and_gaps or
m_grid_rows_and_gaps become invalid.
2023-05-15 15:35:34 +02:00
Andreas Kling
4d0d0a99b4 LibGUI: Fix bad title alignment in GroupBox
Make a separate rect for the text and use IntRect::centered_within()
to sidestep any subpixel jitter. This way it looks good with both bitmap
and vector fonts.
2023-05-15 14:15:53 +02:00
Andreas Kling
20e2c9a7dd LibWeb: Cache state of the contenteditable attribute on HTMLElement
Instead of recomputing the state whenever someone asks for it, we now
cache it when the attribute is added/changed/removed.

Before this change, HTMLElement::is_editable() was 6.5% of CPU time
when furiously resizing Hacker News. After, it's less than 0.5%. :^)
2023-05-15 14:08:20 +02:00
Andreas Kling
990e7219d6 LibWeb: Fix iframes flickering on window resize
After finishing layout, iframe layout boxes (FrameBox) get notified
about their new size by LayoutState::commit(). This information is
forwarded to the nested browsing context, where it can be used for
layout of the nested document.

The problem here was that we notified the FrameBox twice. Once when
assigning the used offset to its paintable, and once when assigning its
size. Because the offset was assigned first, we ended up telling the
FrameBox "btw, your size is 0x0". This caused us to throw away all
the layout information we had for the nested document.

We'd then say "actually, your size is 300x200" (or something) but by
then it was already too late, and we had to do a full relayout.
This caused iframes to flicker as every time their containing document
was laid out, we'd nuke the iframe layout and redo it (on a zero timer).

The fix is pleasantly simple: we didn't need to inform the nested
document of its offset in the containing document's layout anyway. Only
its size is relevant. So we can simply remove the first call, which
removes the bogus 0x0 temporary size.

Note that iframes may still flicker if they change size in the
containing document. That's a separate issue that will require more
finesse to solve. However, this fixes a very noticeable common case.
2023-05-15 14:08:08 +02:00
thankyouverycool
44049f5ad5 WindowServer: Catch more Window stealing misbehavior
Previously it was possible for a window to register as a parentless
blocking modal then add itself to a stealable parent's modal chain,
bypassing a mode misbehavior check in create_window()

Also relaxes reciprocity for blockers with the same parent. This
scenario is usually created by simultaneous MessageBoxes. It's not
an ideal UX to cascade these, but there's no need to crash over it.
2023-05-15 12:15:39 +02:00
thankyouverycool
c87c4f6d94 LibGUI: Put a governor on Action activation
Many actions affect Window modality, so let's put a temporary change
governor on activation to stop race conditions.

Fixes being able to spam open/close shortcuts and spawn multiple
FilePickers, among other things.
2023-05-15 12:15:39 +02:00
thankyouverycool
7323a54e59 LibGUI+FileSystemAccessServer: Avoid using dummy windows
Creates two new gatekept helpers for FilePicker and MessageBox to be
used by FSAS to replace the "dummy window" approach to centering
Dialogs. There was a slight delay in creating two windows, one a
transparent intermediary hidden behind the second, to display FSAS
Dialogs. Now we only need to make the window we actually see.
2023-05-15 12:15:39 +02:00
thankyouverycool
f76d24c2ec LibGUI: Simplify Dialog::ScreenPosition and allow Dialogs to opt out
These options were created 2 years ago but the only use cases thus far
are for Center and CenterWithinParent, so let's chuck the rest for now.

Adds a new DoNotPosition option to opt out of automatic centering and
a ScreenPosition setter and getter for configuration before exec()
2023-05-15 12:15:39 +02:00
thankyouverycool
dfe06096c7 LibGUI: Add Window::constrain_to_desktop() helper
And a center_within(IntRect const&) overload
2023-05-15 12:15:39 +02:00
thankyouverycool
2d64147f02 LibGfx: Reverse coordinate subtraction in Rect::constrained_to()
Fixes translating in the wrong direction or not at all in the case of
a constraint at (0,0). This doesn't appear to be used anywhere yet but
is needed in the upcoming patch.
2023-05-15 12:15:39 +02:00
Andreas Kling
85c542ab00 Ladybird+LibWebView: Move backing store management code to LibWebView
This lets us share this code on all platforms, and makes resizing the
window much faster on SerenityOS as well. :^)
2023-05-15 12:13:34 +02:00
Andreas Kling
ec2600f246 Ladybird: Make resizing the window a lot less laggy
While resizing, we now pad the shared bitmap allocations with 256 pixels
extra in both axes. This avoids churning through huge allocations for
every single resize step.

We also don't reallocate at all when making the window smaller.

3 seconds after the user stops resizing, we resize the backing stores
again so they fit the window perfectly.
2023-05-15 10:04:29 +02:00
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