Commit graph

42021 commits

Author SHA1 Message Date
Andreas Kling 4ddfc3a6db LibWeb: Mark content: "string" text nodes as generated
This will allow us to give them special treatment, particularly when
they are an empty string.
2022-10-14 19:50:15 +02:00
Andreas Kling 063d6cab8b LibWeb: Remove unused Layout::TextNode::ChunkIterator::m_layout_mode 2022-10-14 19:50:15 +02:00
Andreas Kling 42538b5375 LibWeb: Fix bogus inline-block check in line box layout
When checking if a line box fragment "isn't just dumb inline content",
we were checking "is replaced or inline-block". What we really need to
be checking is "is replaced or inline-outside-but-not-flow-inside".
So now we check that.

This fixes an issue where inline-flex boxes were given incorrect extra
height due to being treated as regular text for purposes of line height
calculation.
2022-10-14 19:50:14 +02:00
Andreas Kling 20711c76b7 LibWeb: Apply min/max constraints to sizes that are initially definite
Also add a comment explaining how we determine initial definite sizes.
2022-10-14 19:50:14 +02:00
Andreas Kling 7f6ba8b910 LibWeb: Clamp flex item's automatic cross sizes to min/max sizes
This takes care of an old FIXME.
2022-10-14 19:50:14 +02:00
Andreas Kling 13792e572c LibWeb: Mark percentage heights as initially definite when appropriate
Percentage heights are now considered definite when their containing
block has a definite height. This makes profile pictures have geometry
on Twitter. (We still don't load the images themselves though.)
2022-10-14 19:50:14 +02:00
Luke Wilde d5d1146cc3 LibJS/Temporal: Fix inconsistency in order of observable operations
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/a3a8237
2022-10-14 18:55:12 +02:00
Mart G 7394316818 HexEditor: Render selection background without gaps between rows
The selected region in HexEditor is indicated by rendering a different
background color for the selected bytes.

Previously this background was rendered so that the background
rectangles were not contigous between different rows. This caused a high
contrast pattern that interfered with the readability of the hexadecimal
digits.

Now the background is rendered as a single contiguous block.
2022-10-14 16:24:51 +01:00
kleines Filmröllchen e6ea49d10b LibAudio: Fix 24-bit PCM rescaling
This code was so totally wrong I can't even explain it.
2022-10-14 09:20:38 -06:00
kleines Filmröllchen 5f71c81e1b LibAudio: Correctly rescale 8-bit PCM samples
8-bit PCM samples are unsigned, at least in WAV, so after rescaling them
to the correct range we also need to center them around 0. This fix
should make 8-bit WAVs have the correct volume of double of what it was
before, and also future-proof for all other unsigned PCM sample formats
we may encounter.
2022-10-14 09:20:38 -06:00
Timothy Flynn 1524288127 LibSQL: Rewrite the SQL::Value type to be contained within one class
Currently, the Value class is essentially a "pImpl" wrapper around the
ValueImpl hierarchy of classes. This is a bit difficult to follow and
reason about, as methods jump between the Value class and its impl
classes.

This changes the Variant held by Value to instead store the specified
types (String, int, etc.) directly. In doing so, the ValueImpl classes
are removed, and all methods are now just concise Variant visitors.

As part of this rewrite, support for the "array" type is dropped (or
rather, just not re-implemented) as it was unused. If it's needed in the
future, support can be re-added.

This does retain the ability for non-NULL types to store NULL values
(i.e. an empty Optional). I tried dropping this support as well, but it
is depended upon by the on-disk storage classes in non-trivial ways.
2022-10-14 17:47:44 +03:30
Timothy Flynn 7d41b46a7d LibSQL: Remove infallible type conversions from SQL::Value
Force the callers to either know that the type is convertible, or to
handle the conversion failure.
2022-10-14 17:47:44 +03:30
Timothy Flynn af3980384b LibSQL: Return StringView from enum-to-string converters
No need to allocate here. Also mark these methods as constexpr rather
than inline static.
2022-10-14 17:47:44 +03:30
Timothy Flynn c0b54f18b5 LibSQL: Copy SQL::Value instances less frequently (which may be vectors) 2022-10-14 17:47:44 +03:30
Timothy Flynn 5f549fe5d9 LibSQL: Add missing header includes
These are explicitly needed, and will cause compile errors as headers
moved around in subsequent commits.
2022-10-14 17:47:44 +03:30
leeight 2029c98fa7 LibWeb: Add missing property and methods for history object
We provide `length` property and `go` / `back` / `forward` methods
implementation here.
2022-10-14 16:01:35 +02:00
snooze6214 2b9cf5a7b4 PixelPaint: Unveil clipboard using the right path
Commit #3197c17 introduced a session based clipboard portal.
This made pixel-paint fail to launch, because it had an unveil that
used the old path to the clipboard. This commit fixes that and now
unveils the new session based clipboard portal.
2022-10-14 15:42:07 +02:00
Liav A 7520acd4eb Kernel: Move Scheduler current time method to the TimeManagement code 2022-10-14 14:13:51 +02:00
Liav A 3651d9701e Kernel: Abstract platform-specific current time methods from Scheduler
This change ensures that the scheduler doesn't depend on a platform
specific or arch-specific code when it initializes itself, but rather we
ensure that in compile-time we will generate the appropriate code to
find the correct arch-specific current time methods.
2022-10-14 14:13:51 +02:00
kleines Filmröllchen c439a34ff7 Meta: Get rid of /res/version.ini
There are no more users of this legacy version API. :yakgone:
2022-10-14 13:45:33 +02:00
kleines Filmröllchen cb0b82ec46 Userland+LibCore: Remove legacy SERENITY_VERSION from Core::Version
This was being used as a default version argument in a couple of APIs,
so those need to change signature and the caller always needs to provide
a version.
2022-10-14 13:45:33 +02:00
kleines Filmröllchen 38bb189772 LibCore: Read version information from uname() instead of /res/version 2022-10-14 13:45:33 +02:00
kleines Filmröllchen 83da2be8f3 uname: Report system revision version aka git commit hash
This can be done with -v and makes uname fully POSIX compliant as far as
I can tell.
2022-10-14 13:45:33 +02:00
kleines Filmröllchen 4c7eef874d Kernel: Read version and git commit hash from baked-in version info
... instead of hard-coding it in the uname syscall.
2022-10-14 13:45:33 +02:00
kleines Filmröllchen 7e11b9a276 Kernel: Move sys$uname to use TypedTransfer
This should equate to roughly the same code but improve typechecking.
2022-10-14 13:45:33 +02:00
kleines Filmröllchen 7c05eed487 Kernel: Bake version information into the Kernel
This is done by generating a Kernel/Version.h header with major version,
minor version, and git hash.
2022-10-14 13:45:33 +02:00
Timothy Slater 92c203bba2 PixelPaint: Change BucketTool and WandTool to use new Bitmap flood fill
This updates the Bucket and Wand tools to leverage the new flood fill
algorithm added to Gfx::Bitmap instead of implementing it in each tool.
2022-10-14 13:39:33 +02:00
Timothy Slater eec881ea34 LibGfx: Implement flood fill algorithm in Bitmap class
This change implements a flood fill algorithm for the Bitmap class. This
will be leveraged by various Tools in PixelPaint. Moving the code into
Bitmap reduces the duplication of the algorithm throughout the
PixelPaint Tools (currently Bucket Tool and Wand Select).

The flood fill function requires you to pass in a threshold value (0 -
100) as well as a lambda for what to do when a pixel gets reached. The
lambda is provided an IntPoint representing the coordinates of the pixel
that was just reached.

The genericized lambda approach allows for a variety of things to be
done as the flood algorithm progresses. For example, the Bucket Tool
will paint each pixel that gets reached with the fill_color. The Wand
Select tool wont actually alter the bitmap itself, instead it uses the
reached pixels to alter a selection mask.
2022-10-14 13:39:33 +02:00
demostanis 6933644b2e Base: Add more glyphs
This patch adds U+2504, U+256D, U+256E, U+256F and U+2570
to Csilla Regular, as well as U+2022 to Csilla Bold.
They are used by the Kakoune port.
2022-10-14 13:37:29 +02:00
demostanis fe94636ac3 Ports: Add a kakoune port 2022-10-14 13:37:29 +02:00
demostanis 6880359064 LibVT: Make Terminal::clear_in_line() keep line attributes 2022-10-14 13:37:29 +02:00
demostanis 09a2db89c9 LibC: Add ffs{,l,ll}
Those are wrappers around AK::bit_scan_forward().
2022-10-14 13:37:29 +02:00
demostanis aa788581f2 AK: Make StringUtils::matches() handle escaping 2022-10-14 13:37:29 +02:00
Gunnar Beutner 70f4d943be Kernel+LibC: Add registers for AARCH64 in __mcontext 2022-10-14 13:01:13 +02:00
Gunnar Beutner b7555419f1 Kernel: Remove -nodefaultlibs compiler options
This was necessary until a few months ago because of b0rked toolchain
options.
2022-10-14 13:01:13 +02:00
Gunnar Beutner 3065577b54 Everywhere: Enable building userspace and test binaries on AARCH64
Surely this will just work once the kernel boots, right?
2022-10-14 13:01:13 +02:00
Gunnar Beutner a7a71be113 LibC: Fix some compiler errors
__x86_64__ isn't defined at all on AARCH64.
2022-10-14 13:01:13 +02:00
Gunnar Beutner 808c43312d Tests+Userland: Implement AARCH64 support for some inline assembly blobs 2022-10-14 13:01:13 +02:00
Gunnar Beutner dadf656dc9 Tests+Userland: Prefer using __builtin_trap() instead of UD2
This way we don't have to hard-code per-architecture instructions.
2022-10-14 13:01:13 +02:00
Gunnar Beutner 7a8206197e AK: Stub out the NAKED macro on AARCH64
This is almost certainly incorrect but we'll see about that once
the kernel actually gets to userspace init.
2022-10-14 13:01:13 +02:00
Gunnar Beutner 5921df75b6 Kernel: Implement userspace support for syscalls on AARCH64
There are no guarantees that the final syscall API will look like this
but at least for now this lets us compile the userland binaries.
2022-10-14 13:01:13 +02:00
Gunnar Beutner a650c74b27 AK+Toolchain: Make char and wchar_t behave on AARCH64
By default char and wchar_t are unsigned on AARCH64. This fixes a
bunch of related compiler errors.
2022-10-14 13:01:13 +02:00
Gunnar Beutner 31bd5b1a02 AK+Userland: Stub out code that isn't currently implemented on AARCH64
Even though this almost certainly wouldn't run properly even if we had
a working kernel for AARCH64 this at least lets us build all the
userland binaries.
2022-10-14 13:01:13 +02:00
Gunnar Beutner c18c84dbfd Toolchain: Fix building libgcc for AARCH64
There was a typo in one of the spec files which resulted in us not
building softfp support for libgcc. Additionally we were missing flags
to build libgcc_s. This patch also makes sure we're not trying to
link against crtbeginS.o and crtendS.o. This is part of a larger effort
to at least get the userland to build at all.
2022-10-14 13:01:13 +02:00
Tim Schumacher 24987e2b1f Toolchain: Add SerenityOS to the LLVM config.guess 2022-10-14 12:57:55 +02:00
leeight bb39f70efc WindowServer: Avoid window nullptr exception
If `window` is nullptr, we should return as soon as possible to
avoid segment fault runtime error.
2022-10-14 11:42:36 +02:00
cflip 30be638fb2 Ports/zlib: Update to 1.2.13 2022-10-14 11:37:25 +02:00
Lucas CHOLLET 99cd6f66cf Base: Launch CrashDaemon at session start-up 2022-10-14 11:37:11 +02:00
Lucas CHOLLET 3197c1793a Base: Launch Clipboard at session start-up
The clipboard service hasn't been ported to user-based portals with
others services as it is needed at `GUI::Application` creation and thus
before the first login, as the `LoginServer` needs one.

This problem as been solved thanks to session-based portals, a clipboard
portal is now created at boot for the "login" session and another for
each "user" session.

With a user-based portal, the "login" portal would have needed to be
created for the `root` user, exposing us to security issues. It now, can
be owned by the `window` user.
2022-10-14 11:37:11 +02:00
davidot 1be337353b LibJS: Make sure to exactly add nanoseconds in add_duration
If the given nanoseconds values add to something above 2**53 - 1 we are
potentially rounding the double to some near integer value.
2022-10-14 11:23:50 +02:00