Commit Graph

46032 Commits

Author SHA1 Message Date
Timothy Flynn
d50724956e AK: Add a method to find the byte offset of a code point 2023-01-24 16:23:50 -05:00
Timothy Flynn
5e44b93af2 AK: Remove [[nodiscard]] attribute from String methods returning ErrorOr 2023-01-24 16:23:50 -05:00
Timothy Flynn
bc9a440f31 LibJS: Use correct type for NumberFormat's UseGrouping internal slot
This was converted to an enumeration for Intl.NumberFormat V3 in commit
33698b9615, but the default value was not
updated (and it's a bit surprising it compiled at all, given that this
is an 'enum class').
2023-01-24 16:23:50 -05:00
Timothy Flynn
4548906e7b LibJS: Propagate OOM errors from all Intl.Locale *OfLocale AOs 2023-01-24 16:23:50 -05:00
Timothy Flynn
f2527c8c81 LibJS: Add a fallible variant of Array::create_from 2023-01-24 16:23:50 -05:00
Timothy Flynn
879a590882 LibJS: Propagate OOM errors from ApplyUnicodeExtensionToTag
These were missed in bff0e25ebe.
2023-01-24 16:23:50 -05:00
Timothy Flynn
d2ec31cbdb LibJS: Remove DeprecatedString usage from Intl.PluralRules
This can make due with a StringView.
2023-01-24 16:23:50 -05:00
Karol Kosek
e45434c0c7 FileManager+HackStudio+SpaceAnalyzer: Use File::can_delete_or_move 2023-01-24 20:13:30 +00:00
Karol Kosek
b810f7f88a LibCore: Implement File::can_delete_or_move()
Besides from a general check if a file's directory has write
permissions, this also checks if the directory has set a sticky bit,
meaning that only file owners and the directory owner can remove or move
files in such directory. It's being used in /tmp for example.
2023-01-24 20:13:30 +00:00
Karol Kosek
8cfd445c23 Kernel: Allow to remove files from sticky directory if user owns it
It's what the Linux chmod(1) manpage says (in the 'Restricted Deletion
Flag or Sticky Bit' section), and it just makes sense to me. :^)
2023-01-24 20:13:30 +00:00
Karol Kosek
798154fbbc FileManager: Calculate file action permissions for subsequent columns
Previously, the permission for the action was always calculated
according to the first column.
2023-01-24 20:13:30 +00:00
kleines Filmröllchen
4d9b4e1381 Documentation: Add a link list
The link list tries to collect all links from the website, BenW's link
list <https://benwiederhake.github.io/serenity-fixmes/index.html#links>
and the unofficial wiki <https://wiki.serenityos.net/links.html> into
one sorted and expanded list, so that hopefully noone has difficulty
searching for serenity pages in the future :^)
2023-01-24 19:51:13 +00:00
Aliaksandr Kalenik
025b496616 LibWeb: Improve column width distribution 2023-01-24 20:47:11 +01:00
Aliaksandr Kalenik
5966f181f5 LibWeb: Avoid division by zero in distribute_width_to_columns 2023-01-24 20:47:11 +01:00
Aliaksandr Kalenik
d331cbba41 LibWeb: Use table wrapper box width to resolve cells width 2023-01-24 20:47:11 +01:00
Aliaksandr Kalenik
2b0ae71172 LibWeb: Use percentage column widths in compute_table_measures
This reverts commit 9b6fcd8591 because not
resolving percentage column widths breaks table width calculation.
2023-01-24 20:47:11 +01:00
davidot
bb483c8308 LibJS: Add missing MUST in DisposableStack.prototype.use
Although the spec has a TRY here I believe this is a spec issue
together with the missing TRY just above this change.
2023-01-24 15:50:39 +00:00
Zaggy1024
42606c87e3 LibVideo/VP9: Move TreeSelection class to TreeParser.cpp
The class no longer needs to be defined in the header, as it is only
used in static functions.
2023-01-24 14:55:51 +00:00
Timon Kruiper
c4a3af12fc Kernel/aarch64: Change base address of the kernel to 0x2000000000
This is the same address that the x86_64 kernel runs at, and allows us
to run the kernel at a high virtual memory address. Since we now run
completely in high virtual memory, we can also unmap the identity
mapping. Additionally some changes in MMU.cpp are required to
successfully boot.
2023-01-24 14:54:44 +00:00
Timon Kruiper
3bc122fcef Kernel/aarch64: Ensure global variable accesses work without MMU enabled
Since we link the kernel at a high virtual memory address, the addresses
of global variables are also at virtual addresses. To be able to access
them without the MMU enabled, we have to subtract the
KERNEL_MAPPING_BASE.
2023-01-24 14:54:44 +00:00
Timon Kruiper
fdc687a911 Kernel/aarch64: Disable stack protector + sanitizers for MMU-less files
Compile source files that run early in the boot process without the MMU
enabled, without stack protector and sanitizers. Enabling them will
cause the compiler to insert accesses to global variables, such as
__stack_chk_guard, which cause the CPU to crash, because these variables
are linked at high virtual addresses, which the CPU cannot access
without the MMU enabled.
2023-01-24 14:54:44 +00:00
Timon Kruiper
ebdb899d3d Kernel/aarch64: Add pre_init function for that sets up the CPU and MMU
This is a separate file that behaves similar to the Prekernel for
x86_64, and makes sure the CPU is dropped to EL1, the MMU is enabled,
and makes sure the CPU is running in high virtual memory. This code then
jumps to the usual init function of the kernel.
2023-01-24 14:54:44 +00:00
Timon Kruiper
5e00bb0b9f Kernel/aarch64: Change MMU::kernel_virtual_range to high virtual memory
This was previously hardcoded this to be the physical memory range,
since we identity mapped the memory, however we now run the kernel at
a high virtual memory address.

Also changes PageDirectory.h to store up-to 512 pages, as the code now
needs access to more than 4 pages.
2023-01-24 14:54:44 +00:00
Timon Kruiper
5db32ecbe1 Kernel/aarch64: Access MMIO using mapping in high virtual memory
This ensures that we can unmap the identity mapping of the kernel in
physical memory.
2023-01-24 14:54:44 +00:00
Timon Kruiper
91d0451999 Kernel/aarch64: Use relative addressing in boot.S
As the kernel is now linked at high address in virtual memory, we cannot
use absolute addresses as they refer to high addresses in virtual
memory. At this point in the boot process we are still running with the
MMU off, so we have to make sure the accesses are using physical memory
addresses.
2023-01-24 14:54:44 +00:00
Timon Kruiper
a581cae4d4 Kernel/aarch64: Add function to MMU.cpp to unmap identity mapping
This function will be used once the kernel runs in high virtual memory
to unmap the identity mapping as userspace will later on use this memory
range instead.
2023-01-24 14:54:44 +00:00
Timon Kruiper
150c52e420 Kernel/aarch64: Add {panic,dbgln}_without_mmu
And use it the code that will be part of the early boot process.

The PANIC macro and dbgln functions cannot be used as it accesses global
variables, which in the early boot process do not work, since the MMU is
not yet enabled.
2023-01-24 14:54:44 +00:00
Timon Kruiper
69c49b3d00 Kernel/aarch64: Map kernel and MMIO in high virtual memory
In the upcoming commits, we'll change the kernel to run at a virtual
address in high memory. This commit prepares for that by making sure the
kernel and mmio are mapped into high virtual memory.
2023-01-24 14:54:44 +00:00
Timon Kruiper
33581d5c44 Kernel: Add KERNEL_MAPPING_BASE to Sections.h and use it in Prekernel 2023-01-24 14:54:44 +00:00
Nico Weber
95992a255e icc: Print every TagData object only once
When several tags refer to the same TagData object, we now only print
it the first time, and print "(see 'foob' above)" the following times,
where `foob` is the tag identifier where we printed it the first time.
2023-01-24 14:45:27 +00:00
Nico Weber
81cc64f29c LibGfx: Dedupe ICC TagData objects
Several tags can refer to the same TagData. In particular, the
rTRC, gTRC, bTRC tags usually all three refer to the same curve.
Curve objects can be large, so allocate only a single TagData
object in that case and make all tags point to it.

(If we end up storing some cache in the curve object later on,
this will also increase the effectiveness of that cache.)
2023-01-24 14:45:27 +00:00
Nico Weber
44de4d163b AK: Make HashMap::try_ensure work with a fallible construction callback
Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2023-01-24 14:45:27 +00:00
Nico Weber
2f4a83215c LibGfx: Move TagTableEntry into read_tag_table
It's now used only there.
2023-01-24 14:45:27 +00:00
Nico Weber
f7f592f5d3 LibGfx: Pass offset and size instead of full TagTableEntry to read_tag
read_tag() has no business knowing the tag signature.
2023-01-24 14:45:27 +00:00
Sam Atkins
a19e54c1db WindowServer: Reuse existing WindowManager::desktop_rect() method 2023-01-24 14:41:16 +00:00
Tim Schumacher
1cb306cbe3 LibGfx: Use Core::Stream to decode QOI images 2023-01-24 14:40:02 +00:00
Tim Schumacher
e6f5a208a0 LibGfx: Pass the first QOI chunk byte to the operation implementation
This reduces reliance on the peek operation, which the generic stream
implementation does not support.

This also corrects the naming, since "tag" wasn't entirely correct for
some of the operations, where the tag takes up only part of a byte, with
the rest being reserved for data.
2023-01-24 14:40:02 +00:00
Nico Weber
55e45856ae LibGfx: Use x-mac-roman TextCodec for decoding MacRoman text 2023-01-24 14:37:20 +00:00
Nico Weber
eac2b2382c LibTextCodec: Add a MacRoman decoder
Allows displaying `<meta charset="x-mac-roman">` html files.
(`:set fenc=macroman`, `:w` in vim to save in that encoding.)
2023-01-24 14:37:20 +00:00
Nico Weber
b14b5a4d06 LibTextCodec: Simplify Latin1Decoder::process() a tiny bit 2023-01-24 14:37:20 +00:00
Andreas Kling
850b4a03e6 LibGfx: Cache font pixel metrics in ScaledFont
Instead of recomputing the pixel metrics over and over, we can just
cache them with the font and avoid a bunch of expensive computation.
2023-01-24 14:13:59 +01:00
Jelle Raaijmakers
83488cd102 WindowServer: Double click a window's frame to latch to screen's edge 2023-01-24 12:53:26 +00:00
Jelle Raaijmakers
3e70d41c57 WindowServer: Always process double clicks for mouse events
This used to be optional and was disabled in two cases:

  - On a mouse move event during dragging; because double clicks are
    only possible on mouse up events, this had no effect.
  - On a mouse event for automatic cursor tracking; this has now gained
    support for double click events.

Since it's always enabled now, we can remove the `bool` argument.
2023-01-24 12:53:26 +00:00
Tim Schumacher
448b187782 LibDebug: Pass read_from_stream calls through read_value instead 2023-01-24 12:47:39 +00:00
Tim Schumacher
6972e98efa LibDNS: Pass write_to_stream calls through write_value instead 2023-01-24 12:47:39 +00:00
Tim Schumacher
6ccda76a71 LibCore: Add support for non-trivial types to Stream::*_value
At the moment, there is no immediate advantage compared to just calling
the underlying functions directly, but having a common interface feels
more ergonomic (users don't have to care about how a type serializes)
and maybe we'll find a way to hide the actual implementation from direct
access some time in the future.
2023-01-24 12:47:39 +00:00
Nico Weber
8b5b767465 AK: Print leading zeroes after the dot for FixedPoint numbers
As a nearby comment says, "This is a terrible approximation".
This doesn't make things less terrible, but it does make things
more correct in the given framework of terribleness.

Fixes #17156.
2023-01-24 13:24:21 +01:00
Andreas Kling
4e06e86438 LibWeb: Make min-content height equivalent to max-content as appropriate
Per CSS-SIZING-3, the min-content block size should be equivalent to the
max-content block size for some boxes.

Honoring this gives more correct results, and avoids unnecessary work in
many cases since the cached max-content size can be reused.
2023-01-24 11:44:03 +01:00
Andreas Kling
aa19c4a340 LibWeb: Add Layout::Node::is_table() and make is<TableBox>() fast 2023-01-24 11:44:03 +01:00
Andreas Kling
3dd006f719 LibWeb: Move scroll state from Layout::BlockContainer to Layout::Box
Let's allow any box to be scrollable, not just block containers.
2023-01-24 11:44:03 +01:00