Commit Graph

49453 Commits

Author SHA1 Message Date
Timothy Flynn
229cc67fee LibWeb: Implement HTMLMediaElement's autoplay attribute 2023-04-18 16:30:02 +02:00
Timothy Flynn
1ffd533ea2 Ladybird: Propagate autoplay settings to the WebContent process 2023-04-18 16:30:02 +02:00
Timothy Flynn
fed2606591 Browser: Propagate autoplay settings to the WebContent process 2023-04-18 16:30:02 +02:00
Timothy Flynn
65283d6879 BrowserSettings: Add a tab to control the Browser's autoplay settings
This adds a checkbox to enable autoplay on all websites (disabled by
default) and a website list to enable autoplay on individual websites
(set to file:// URLs only by default).
2023-04-18 16:30:02 +02:00
Timothy Flynn
7966fc4780 LibWeb+LibWebView+WebContent: Add APIs to manage an autoplay allowlist
The spec defines a Permissions Policy to control some browser behaviors
on a per-origin basis. Management of these permissions live in their own
spec: https://w3c.github.io/webappsec-permissions-policy/

This implements a somewhat ad-hoc Permissions Policy for autoplaying
media elements. We will need to implement the entire policy spec for
this to be more general.
2023-04-18 16:30:02 +02:00
Timothy Flynn
6131e621d6 LibWeb: Render HTMLVideoElement controls when scripting is disabled
The spec recommends exposing the user agent interface when scripting is
disabled on the media element.
2023-04-18 16:30:02 +02:00
Timothy Flynn
19cc1327af LibWeb: Organize LibWeb forwarding header
Alphabetically sort everything (namespaces and forward declarations
within namespaces), and de-duplicate repeated namespaces (namely the
Web namespace appeared twice).
2023-04-18 16:30:02 +02:00
Andreas Kling
0d5e0d27aa LibWeb: Treat unresolvable percentage flex-basis values as 'content'
Per CSS-FLEXBOX-1, we should treat percentage values of flex-basis as
'content' if they resolve against an indefinite size of the flex
container.
2023-04-18 10:06:02 +02:00
Nico Weber
8f988b7bae Meta: Move more common flags to common_compile_options.cmake
For the most part no behavior change, except that we now pass
-Wno-implicit-const-int-float-conversion and -Wno-literal-suffix
only to clang and gcc each in both lagom and serenity builds,
while we previously passed them to both in lagom builds (and
passed them to one each in serenity builds). The former is
a clang flag, the latter a gcc flag, but since we also use
-Wno-unknown-warning-option it doesn't really matter.
2023-04-18 10:05:49 +02:00
thankyouverycool
5872fe6536 SpreadSheet: Use new InputBox features
Rename now uses a compact box and populates the editor with the
old name, and "Add new" now has a comfy icon. Both prevent empty
names.
2023-04-18 10:05:21 +02:00
thankyouverycool
bc8b409a3c FontEditor: Use compact InputBox for Go to Glyph action 2023-04-18 10:05:21 +02:00
thankyouverycool
8d86f2e69f Calculator: Use numeric InputBox for digit rounding and shrinking
Calc was using a bespoke SpinBox dialog which is no longer necessary.
2023-04-18 10:05:21 +02:00
thankyouverycool
a55d2be147 MasterWord: Use numeric InputBox for settings
And use proper ellipses and capitalization in related action text.
2023-04-18 10:05:21 +02:00
thankyouverycool
14072ce8f0 FileManager: Use InputBox icons for file and directory creation
And set a window icon in desktop mode.
2023-04-18 10:05:21 +02:00
thankyouverycool
ca8918f310 LibGUI: Add a numeric input type to InputBox
This should be a more convenient API and a better UX for apps that
want simple integer input from the user.
2023-04-18 10:05:21 +02:00
thankyouverycool
33ccbc9415 LibGUI: Implement calculated_min_size() for SpinBox 2023-04-18 10:05:21 +02:00
thankyouverycool
b66a76f73b LibGUI: Allow SpinBox to set its value with return key
Previously SpinBox did not update on return or changes to the editor.
The widget had to lose focus or be manually incremented. This lets
the editor update on return and now always displays the most recent
clamped value. set_value_from_current_text() will also be useful to
programmatically set SpinBox within layouts whose default buttons
consume return key presses.
2023-04-18 10:05:21 +02:00
thankyouverycool
7c314f3855 LibGUI: Let InputBox display an ImageWidget
InputBox can now be given a bitmap to display alongside its
prompt and editor. Prompts are now optional to allow for
compact dialogs.
2023-04-18 10:05:21 +02:00
thankyouverycool
02a9e5d3f6 LibGUI+Userland: Improve error and font handling for InputBox
Adds fallible factories, ports DeprecatedString, and rebuilds the
layout to accomodate system font changes.
2023-04-18 10:05:21 +02:00
thankyouverycool
9c2bcffe83 LibGUI: Improve calculated_min_size() for single-line TextEditor
TextBox now shrinks to fit the current font based on preferred line
height, maintaining its historical minimum size of 40x22
2023-04-18 10:05:21 +02:00
thankyouverycool
7304556ff2 LibGUI: Add Window::on_font_change() hook 2023-04-18 10:05:21 +02:00
thankyouverycool
b7cac829ae WindowServer: Show complete title when Window is not resizable
Saves Dialogs the trouble of accounting for variable width titles and
makes all unresizable windows more responsive to font changes.
2023-04-18 10:05:21 +02:00
Romain Chardiny
eef07d2f57 ldd: Pledge map_fixed 2023-04-17 19:29:20 -04:00
thankyouverycool
5bb9af8297 Minesweeper: Simplify resizing game window
Instead of propagating field size changes to main and manually
calculating window size, use auto shrink to automatically
resize the window after changes to the board.
2023-04-17 20:31:12 +02:00
thankyouverycool
76d17e6a8e MasterWord: Rectify resizing game window
Previously resizing the window did not take into account the
height of the status bar. The board now fixes its size on reset
and allows the Window to auto shrink to the perfect dimensions.
2023-04-17 20:31:12 +02:00
thankyouverycool
b8d88f33cf MasterWord: Set icon before showing window 2023-04-17 20:31:12 +02:00
thankyouverycool
7b05bf1c20 LibGUI: Always paint Statusbar's vertical lines when not maximized
Fixes MasterWord's single Statusbar::Segment not painting vertical
lines despite its window being unmaximized. This was only an issue
for non-resizable windows as the Statusbar resizing corner otherwise
negates spans_entire_window_horizontally() when not maximized.
2023-04-17 20:31:12 +02:00
Tim Schumacher
aefd6e9ee1 Kernel: Don't get rbp from internal context switch structures
This has been broken on x86_64 since its introduction, as it features
more registers to be saved, and we never held up the "rbp has to be the
last pushed register" there.

Instead, just copy rbp from the thread structure, which is now properly
updated since the last commit.
2023-04-17 20:30:17 +02:00
Tim Schumacher
0ee476948b Kernel: Properly update the stored thread rbp when switching contexts 2023-04-17 20:30:17 +02:00
Tim Schumacher
50b7183bd1 Kernel: Mark the idle thread as active before switching it in
Otherwise, our code for dumping all thread stacks gets confused if it
finds a thread that is in a 'running' state, but that isn't marked
active.
2023-04-17 20:30:17 +02:00
Linus Groh
20f2389e2a Meta: Remove my CODEOWNERS entries 2023-04-17 19:22:10 +01:00
Andreas Kling
c710575f88 LibWeb: Honor box-sizing in flex item "specified size suggestion"
Although the spec doesn't mention it, if a flex item has box-sizing:
border-box, and the specified size suggestion is a definite size, we
have to subtract the borders and padding from the size before using it.

This fixes an issue seen in "This Week in Ladybird #4" where the
screenshots ended up in one long vertical stack instead of paired up
2 by 2.
2023-04-17 18:22:53 +02:00
Andreas Kling
7f79208759 LibWeb: Support implicit lineto commands after moveto in SVG paths
Per SVG2, any coordinate pairs following a moveto command should be
treated as implicit lineto commands with the same absoluteness as the
moveto command.
2023-04-17 14:18:45 +02:00
Brendan Kelly
8d0985ef01 SoundPlayer: Pledge "FileManager" config domain
This stops SoundPlayer from crashing when attempting to open a sound
file from inside the GUI
2023-04-17 10:34:40 +02:00
Tom
e758545b91 FileManager+LibGUI: Cache the FileSystem::can_delete_or_move value
Add the function FileSystemModel::Node::can_delete_or_move which will
cache the result of FileSystem::can_delete_or_move for a node. This
prevents having to make system calls repeatedly to obtain this
information.

Fixes #18399
2023-04-17 10:34:20 +02:00
Matthew Olsson
d824d07784 LibWeb: Fix inverted condition in WritableStream's constructor 2023-04-17 10:27:40 +02:00
Matthew Olsson
bb9d51fd84 LibWeb: Make StartAlgorithm return a Value instead of a Promise 2023-04-17 10:27:40 +02:00
Matthew Olsson
bad541a0d4 LibWeb: Remove outdated FIXMEs around WebIDL::invoke_callback usages 2023-04-17 10:27:40 +02:00
Matthew Olsson
c40109628d LibWeb: Properly reject abrupt completion in clean_up_on_return 2023-04-17 10:27:40 +02:00
Kenneth Myhra
4ed71d5b40 Ports: Add depends 'libslirp' and configopt '--enable-slirp' to QEMU
This adds the dependency 'libslirp' and forces QEMU to pick up the
dependency or fail compilation by adding the config option
'enable-slirp'.
2023-04-17 10:19:28 +02:00
Kenneth Myhra
ae075b3dff Ports: Reformat QEMU's package.sh script
Use single quotes for non-interpolated strings in the 'configopts' and
'depends' sections.
Let each dependency of the 'depends' section be on a separate line.
2023-04-17 10:19:28 +02:00
Kenneth Myhra
4e661a400b Ports: Add libslirp version 4.7.0
The slirp submodule was removed from QEMU in version 7.2, running
Serenity in QEMU on a Serenity host could fail without this one if
running with network enabled.

For more information on the removal of the slirp submodule see the
following link: https://wiki.qemu.org/ChangeLog/7.2#Removal_of_the_%22slirp%22_submodule_(affects_%22-netdev_user%22)
2023-04-17 10:19:28 +02:00
MacDue
f0dde6236d Tests: Add layout test for SVG preserveAspectRatio
This is a cut down version of the example, but it's nice to add a
test to ensure this keeps working.
2023-04-17 07:32:31 +02:00
MacDue
71ed1e3e50 Base: Add SVG preserveAspectRatio demo page 2023-04-17 07:32:31 +02:00
MacDue
5df4e64eb7 LibWeb: Implement SVG preserveAspectRatio attribute
This attribute is used to define how the viewBox should be scaled.
Previously the behaviour implemented was that of "xMidYMid meet", now
all of them work (expect none :P).

With this the Discord login backend is now correctly scaled/positioned.

This also brings our SVG code a little closer to the spec! With spec
comments and all :^)

(Minor non-visible update to layout tests)
2023-04-17 07:32:31 +02:00
MacDue
5a12e9f222 LibWeb: Clip SVG content to parent <svg> element bounding box 2023-04-17 07:32:31 +02:00
Tim Schumacher
d4e114a31e Kernel: Remove unused functions related to reading full inodes 2023-04-17 01:20:23 +02:00
Tim Schumacher
f5010f7263 Kernel: Use purpose-sized buffers for holding readlink results 2023-04-17 01:20:23 +02:00
Tim Schumacher
6f524e35a7 Kernel: Use purpose-sized buffers when resolving inodes as links 2023-04-17 01:20:23 +02:00
Tim Schumacher
acd8c8dba4 Kernel: Add Inode::read_until_filled_or_end
The existing `read_entire` is quite slow due to allocating and copying
multiple times, but it is simultaneously quite hard to get rid of in a
single step. As a replacement, add a new function that reads as much as
possible directly into a user-provided buffer.
2023-04-17 01:20:23 +02:00