Commit graph

54311 commits

Author SHA1 Message Date
James Williams
6ab11e5f44 Documentation: Correct link to flake.nix in BuildInstructionsOther.md 2023-09-09 08:35:05 -06:00
Sam Atkins
b1a569c1c5 LibWeb: Stop crashing when textarea element is modified before insertion
If an element is created from JS, it might have its contents modified
before it is inserted into the document. In this case, we don't have a
shadow tree yet and so trying to set m_text_node's text content would
cause a null dereference. So let's not do that. :^)

That case also means that by the time we do create the shadow tree, we
have the text content already, so we can set it there.

Added a test to verify that we don't crash, and that the text content
appears in the textarea whether it was inserted by JS or by the HTML
parser.
2023-09-09 13:52:01 +01:00
Zaggy1024
883f44d397 LibWeb: Use CSSPixels only when calculating radial gradient sizes
In order to do this, a function `sqrt(CSSPixels)` was added, which
currently just converts to floating point to run `AK::sqrt()`.
2023-09-09 13:03:11 +02:00
Zaggy1024
d9c842a83f LibWeb: Set radial gradients' ending shape corners correctly
Previously, the corner was always set to the top right, except if the
top left turned out to be closest, in which case it would be left
default-initialized instead.
2023-09-09 13:03:11 +02:00
Zaggy1024
0e78037c68 LibWeb: Use fractions to calculate font absolute size mappings
This also brings us closer to spec by changing the fractional scaling
to use division instead of hard-coded decimal numbers.
2023-09-09 13:03:11 +02:00
Zaggy1024
c9849aeadd LibWeb: Use a switch instead of HashMap to get absolute size mappings
A `HashMap` is unnecessary complexity for such a small set of possible
keys, let's let the optimizer actually understand what's happening.
2023-09-09 13:03:11 +02:00
Zaggy1024
f57c42fad7 LibWeb: Avoid conversion from floating point in CSS position resolution
We can just use division here, since fixed-point division by 2 will
compile down to a shift by 1.
2023-09-09 13:03:11 +02:00
Zaggy1024
99c90e49b6 LibWeb: Calculate viewport-relative lengths in CSSPixels 2023-09-09 13:03:11 +02:00
Zaggy1024
fc05cda8cf LibWeb: Make division of CSSPixels by integers create a fraction
This also adds some additional operators to `CSSPixelsFraction` to
allow this change to build, since some places were using equations like
`(a / b) + (c / d)` or `-(x / y)`.
2023-09-09 13:03:11 +02:00
Zaggy1024
607a398917 LibWeb: Store computed CSS font size as CSSPixels
The value is originally set using a `CSSPixels` value converted to
double, then when it is used it is always converted back to a
`CSSPixels` again. Let's just store it as that instead.
2023-09-09 13:03:11 +02:00
Zaggy1024
d792461714 LibWeb: Use Integral concept for CSSPixels operators
These were previously manually overloaded, which is unnecessary when we
can just use a concept to cover everything!
2023-09-09 13:03:11 +02:00
Sam Atkins
9e227dfc16 LibWeb: Flesh out HTMLTextAreaElement
Give it a shadow tree, similar to HTMLInputElement's, so that we can
actually edit its contents at a basic level. Add some CSS to use the
`rows` and `cols` attributes as the size if they are present.
2023-09-09 07:45:05 +02:00
Sam Atkins
4897643ffb LibWeb: Allow non-HTMLInputElements to have did_edit_text_node() called
HTMLTextAreaElement also needs to be told when its contained text node
has been edited, so let's make this functionality work for anyone who
extends the new EditableTextNodeOwner interface class.
2023-09-09 07:45:05 +02:00
Tim Schumacher
ce556c9566 Ports: Remove the ability to override fetch and patch_internal 2023-09-09 01:06:31 +02:00
Tim Schumacher
d94bffd708 Ports/gn: Switch to using the Git repository directly 2023-09-09 01:06:31 +02:00
Tim Schumacher
e28ff48304 Ports: Introduce support for Git repositories 2023-09-09 01:06:31 +02:00
Tim Schumacher
ce50dbb411 Ports: Pass --no-sign to tagging operations
If the user chose to sign tags by default, not passing this flag will
force a signed and therefore annotated tag, which requires a message.
2023-09-09 01:06:31 +02:00
Tim Schumacher
b80760003e Ports: Use clearer tag names for ./package.sh dev
The old names only made sense in the context of `./package.sh dev` but
that will not be the only context anymore very soon.
2023-09-09 01:06:31 +02:00
Tim Schumacher
9a828a76d2 Ports: Remove ./package.sh dev support for non-Git patches
All of our existing patches have been converted into Git patch format,
and new patches are created through `./package.sh dev` itself.
2023-09-09 01:06:31 +02:00
Tim Schumacher
456fd9f574 Ports: Switch to the new files syntax 2023-09-09 01:06:31 +02:00
Andrew Kaster
920dc1ba53 Ladybird/Android: Move host build into its own shell script
This lets us select a proper host compiler version if cc/cxx are not
suitable for building Lagom.
2023-09-08 09:01:34 -06:00
Andrew Kaster
bd7d01e975 Meta: Move compiler detection functions to their own file
This way we can use them in other scripts that want to build Lagom
and pick a suitable host compiler.
2023-09-08 09:01:34 -06:00
nipos
b258450fa6 LibCore: Implement waiting for the debugger on FreeBSD 2023-09-07 14:30:11 -06:00
Aliaksandr Kalenik
0f75d0611f LibWeb: Implement support for parsing CSS column-count property 2023-09-07 20:16:33 +02:00
Sönke Holz
9bd3c542b4 Kernel/riscv64: Add basic SBI support 2023-09-07 11:56:34 -06:00
Ali Mohammad Pur
84777fbe62 Shell: Allow the user to set the prompt using PROMPT()
This allows the prompt to be dynamically configurable, making it
possible to display various bits of information in the prompt.
2023-09-07 11:52:37 -06:00
Tim Ledbetter
71ddc33fbf find: Print hyperlinks when standard output is attached to a terminal 2023-09-07 11:52:09 -06:00
Liav A
446200d6f3 Kernel+Services: Enable barebones hot-plug handling capabilities
Userspace initially didn't have any sort of mechanism to handle
device hotplug (either removing or inserting a device).
This meant that after a short term of scanning all known devices, by
fetching device events (DeviceEvent packets) from /dev/devctl, we
basically never try to read it again after SystemServer initialization
code.

To accommodate hotplug needs, we change SystemServer by ensuring it will
generate a known set of device nodes at their location during the its
main initialization code. This includes devices like /dev/mem, /dev/zero
and /dev/full, etc.

The actual responsible userspace program to handle hotplug events is a
new userspace program called DeviceMapper, with following key points:
- Its current task is to to constantly read the /dev/devctl device node.
  Because we already created generic devices, we only handle devices
  that are dynamically-generated in nature, like storage devices, audio
  channels, etc.

- Since dynamically-generated device nodes could have an infinite minor
  numbers, but major numbers are decoded to a device type, we create an
  internal registry based on two structures - DeviceNodeFamily, and
  RegisteredDeviceNode. DeviceNodeFamily objects are attached in the
  main logic code, when handling a DeviceEvent device insertion packet.
  A DeviceNodeFamily object has an internal HashTable to hold objects of
  RegisteredDeviceNode class.

- Because some device nodes could still share the same major number (TTY
  and serial TTY devices), we have two modes of allocation - limited
  allocation (so a range is defined for a major number), or infinite
  range. Therefore, two (or more) separate DeviceNodeFamily objects can
  can exist albeit sharing the same major number, but they are required
  to allocate from a different minor numbers' range to ensure there are
  no collisions.

- As for KCOV, we handle this device differently. In case the user
  compiled the kernel with such support - this happens to be a singular
  device node that we usually don't need, so it's dynamically-generated
  too, and because it has only one instance, we don't register it in our
  internal registry to not make it complicated needlessly.

The Kernel code is modified to allow proper blocking in case of no
events in the DeviceControlDevice class, because otherwise we will need
to poll periodically the device to check if a new event is available,
which would waste CPU time for no good reason.
2023-09-07 11:50:50 -06:00
Liav A
9dbd22b555 SystemServer: Make decision on whether to enable a service more readable
This change ensures that code in the Service class doesn't try to check
the g_system_mode variable, but instead is asked on whether it supports
a given system mode string value.

Also, don't assume that we should create sockets for any new Service
instance, but instead do that only if the Service should run in the
current system mode.
2023-09-07 11:50:50 -06:00
Liav A
41db527369 LibCore: Add helpers to create block and character device files 2023-09-07 11:50:50 -06:00
Liav A
39c93f63c8 Kernel: Move FileSystem/DeviceFileTypes.h => API/DeviceFileTypes.h
This file will be used by userspace code later on, so let's move to the
API directory.
2023-09-07 11:50:50 -06:00
Liav A
0c14a2aba7 SystemServer: Organize initialization sequence into logical units
Just a small cleanup to ensure we can get these pieces of code out to
other files and still have the main.cpp file organized.

The populate_devtmpfs_char_devices_based_on_sysfs() method is removed
because we can simply create the /dev/devctl device node without looking
at the SysFS. This assumed-to-exist device node will be used later on in
an event loop to handle hotplug events.
2023-09-07 11:50:50 -06:00
Liav A
2a995cffc5 Ports: Add giflib 2023-09-07 19:35:54 +02:00
kamp
74d15195a4 HexEditor: Replace DeprecatedString in HexEditor.cpp 2023-09-07 09:58:00 -06:00
kamp
7a2ad83c07 HexEditor: Replace DeprecatedString in ValueInspectorModel 2023-09-07 09:58:00 -06:00
kamp
4b87714700 HexEditor: Replace DeprecatedString in SearchResultsModel
Except one instance where it is required for interfacing with LibGUI

Also changed an instance of west const to east because the clang-format
commit hook required it.
2023-09-07 09:58:00 -06:00
kamp
81afa029ac HexEditor: Replace DeprecatedString in FindDialog 2023-09-07 09:58:00 -06:00
kamp
f38cf0ca18 HexEditor: Replace DeprecatedString in GoToOffsetDialog 2023-09-07 09:58:00 -06:00
Aliaksandr Kalenik
b4fe118dff LibWeb+WebContent: Set ConsoleClient for nested browsing contexts
Before page_did_create_main_document() only initialized ConsoleClient
for top-level browsing context which means that nested browsing context
could not print into the console.

With this change, ConsoleClient is initialized for documents created
for nested browsing context too. One ConsoleClient is shared between
all browsing contexts within the same page.
2023-09-07 09:06:00 -06:00
Tim Ledbetter
490949c6a8 Ports/devilutionX: Update to version 1.5.1 2023-09-07 07:36:02 +02:00
falkdavid
4a83771a75 Documentation: Fix ladybird executable path 2023-09-06 21:09:13 +02:00
Sergey Bugaev
6d18ec7546 LibTest: Don't attempt to use SA_NOCLDWAIT for SIGABRT
SA_NOCLDWAIT is only meaningful for SIGCHLD.

Fixes building on the Hurd, which lacks SA_NOCLDWAIT.
2023-09-06 11:41:16 -06:00
Sergey Bugaev
976d93d910 LibDNS: Fix compilation with signed time_t
With signed 32-bit time_t, the type of time_t + m_ttl is unsigned int,
which results in -Werror=sign-compare. Fix this by explicitly casting
it back to time_t.
2023-09-06 11:41:16 -06:00
Sergey Bugaev
fcced97509 LookupServer: Fix building on GNU Hurd
The Hurd has sin_len, just like the BSDs.

This happened to hit a clang-format bug, and we have been advised
to disable clang-format for this block of code for now.
2023-09-06 11:41:16 -06:00
Sergey Bugaev
29da1d7c23 LibCore: Implement readlink() and current_executable_path() on GNU/Hurd
Without using PATH_MAX :^)

To read a symlink, we can just open its file with O_NOLINK and read its
contents. To get the executable path, we could read the /proc/self/exe
link like the Linux version does; but that relies on procfs being
mounted. Instead, we could do what procfs itself does to get the path:
ask the proc server about it.
2023-09-06 11:41:16 -06:00
Sergey Bugaev
cee38cf1e5 LibCore: Use SHM_ANON for anon_create() when available
On FreeBSD and GNU/Hurd, SHM_ANON is a nice way to create anonymous
files using the usual shm_open() API. This is a lot like the fallback
shm_open() branch that follows, except we don't have to fool around
with choosing a unique name (with retrying) and unlinking the file
afterwards; it just does the right thing. Isn't this nice?
2023-09-06 11:41:16 -06:00
Sergey Bugaev
ec68979483 LibCore: Implement Process::is_being_debugged() on GNU/Hurd
This checks for the PI_TRACED bit being set in the info returned by
proc_getprocinfo().
2023-09-06 11:41:16 -06:00
Sergey Bugaev
bba193d6a0 Tests, LibTest: Implement disabling core dumps on GNU Hurd 2023-09-06 11:41:16 -06:00
Sergey Bugaev
f31df017f9 LibCore: Port Socket to GNU Hurd
The Hurd supports sending file descriptors over local sockets using
the SCM_RIGHTS / cmsg mechanism just like the other systems. It doesn't
have anything like ucred/PEERCRED, though.
2023-09-06 11:41:16 -06:00
Sergey Bugaev
79431b32b2 AK: Add AK_OS_GNU_HURD :^)
This is defined when building on GNU/Hurd, the GNU operating system with
the Hurd as its kernel (as it was designed originally, before Linux and
GNU/Linux came to be).

Also, define the corresponding part of User-Agent.
2023-09-06 11:41:16 -06:00