Commit Graph

45748 Commits

Author SHA1 Message Date
Timothy Flynn
d1881da2be LibJS: Set approximate number range format result's "source" to "shared"
This is a normative change in the Intl.NumberFormat v3 spec. See:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/7510e7f
2023-01-14 19:12:48 +00:00
Aliaksandr Kalenik
9b6fcd8591 LibWeb: Stop using percentage column widths in compute_table_measures 2023-01-14 19:22:08 +01:00
Aliaksandr Kalenik
b44d977bf8 LibWeb: Propagate layout mode of table formatting context to table cells 2023-01-14 19:22:08 +01:00
Aliaksandr Kalenik
80578ead45 LibWeb: Table box width should be relative to wrapper containing block 2023-01-14 19:22:08 +01:00
Aliaksandr Kalenik
709fe01f52 LibWeb: Override width calculation for table wrappers
Introduce `TableWrapper` type so table wrappers could be
distinguished from block containers and override width
calculation for table wrappers (CSS 2.2 spec, section 17.5.2)
 inside BFCs in the way that their width should be equal to
width of table box they wrap.
2023-01-14 19:22:08 +01:00
Tim Schumacher
7526f9a8b7 AK: Remove CircularDuplexStream 2023-01-14 12:05:52 -05:00
nipos
f15aa539be LibSQL: Don't do fchmod on OpenBSD 2023-01-14 16:32:14 +01:00
nipos
b510747e22 LibCore: On OpenBSD, handle anon_create() like on MacOS 2023-01-14 16:31:59 +01:00
MacDue
fc7099b032 LibWeb: Use failable StringBuilder methods in StyleValue
This is quite verbose... but the errors must flow!
2023-01-14 12:37:00 +01:00
MacDue
2366265c53 AK: Add StringBuilder::try_join()
This is a failable version of StringBuilder::join().
2023-01-14 12:37:00 +01:00
MacDue
0c688fa117 LibWeb: Remove some unnecessary .release_value()s in StyleValue
And instead propagate these errors.
Also while here add my copyright (I've touched these files a lot)
2023-01-14 12:37:00 +01:00
Arda Cinar
93c1fb0b76 LibGemini: Disallow cases forbidden in the spec
The gemini spec at <https://gemini.circumlunar.space/docs/specification.gmi>
does not allow status lines and meta messages to start with a byte order
mark. It also forbids meta messages longer than 1024 bytes.
2023-01-14 12:28:02 +01:00
Arda Cinar
ba9fa59355 LibGemini: Do not loop in Gemini::Job in case of error
Previously, the job was shutdown only on a deferred invoke while there
was still data to be read. This meant that the read callback would get
called again and again, and, potentially throw the error again and again

This patch introoduces a failed state for the protocol parser and
returns early from the read callback if it has already failed
2023-01-14 12:28:02 +01:00
Arda Cinar
083802d41a LibGemini: Propagate errors in Job::read_line and Job::receive
This patch removes a FIXME
2023-01-14 12:28:02 +01:00
Arda Cinar
f883dc3eb0 RequestServer: Do not crash on Gemini responses
Starting a gemini request creates a pipe for the output stream for the
response, and a Core::Stream::File object is created from that pipe.
Previously, the length of the response was computed by calling
output_stream.size() which used lseek on the file descriptor. Doing that
returned an error from lseek. Computing the value by counting the
received bytes (via Gemini::Job::response_length) avoids that crash.
2023-01-14 12:28:02 +01:00
Arda Cinar
0245a62f81 LibGemini: Add a response length helper to Gemini::Job
Unlike HTTP responses, Gemini responses do not have a length header or a
delimiter for the end of a response. A response simply continues until
the connection is closed and its length is the number of bytes received.
So, the response length method only returns the result if it has
finished
2023-01-14 12:28:02 +01:00
nipos
5b45b26613 LibSQL: Don't do fchmod on FreeBSD 2023-01-14 12:27:00 +01:00
Liav A
7aebbe52b9 Meta: Fix copyright header in Kernel/Syscalls/jail.cpp file
I wrote that file in 2022, not Andreas in 2018.
2023-01-14 09:57:04 +01:00
Tim Schumacher
87c64834ca LibDNS: Use AllocatingMemoryStream in DNS package construction 2023-01-13 18:41:05 -07:00
Tim Schumacher
202175cf4c LibCore: Add helper functions to read/write trivial values from streams
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2023-01-13 18:41:05 -07:00
Niklas Poslovski
19bae983e4 LibCore: Enable file descriptor passing on FreeBSD
Ladybird currently doesn't render any webpages on FreeBSD and throws
hundreds of errors,beginning with this:
IPC::ConnectionBase (0x0000000805bf2b00) had an error (File descriptor
passing not supported on this platform), disconnecting.
WebContent process crashed!
2023-01-13 17:36:32 -07:00
Tim Schumacher
c4da1be32c LibCompress: Remove all leftover AK::Stream headers 2023-01-13 17:34:45 -07:00
Tim Schumacher
46a53dc6e0 LibCompress: Switch the deflate seekback buffer to CircularBuffer 2023-01-13 17:34:45 -07:00
Tim Schumacher
35548cab75 LibCompress: Remove DuplexMemoryStream from GzipDecompressor 2023-01-13 17:34:45 -07:00
Tim Schumacher
0d69fbd19f LibCompress: Remove DuplexMemoryStream from DeflateDecompressor 2023-01-13 17:34:45 -07:00
Tim Schumacher
100112134d LibCore: Allow zero-sized spans in Stream::*_entire_buffer
There is no particular reason why we shouldn't allow zero-sized reads or
writes here, and this actually might cause issues with our common
stream-to-stream copy pattern if we end up at an unfortunate offset
where the next read would be zero-sized and trigger EOF only after that.
2023-01-13 17:34:45 -07:00
Tim Schumacher
d23f0a7405 LibCompress: Switch DeflateDecompressor to a fallible constructor
We don't have anything fallible in there yet, but we will soon switch
the seekback buffer to the new `CircularBuffer`, which has a fallible
constructor.

We have to do the same for the internal `GzipDecompressor::Member`
class, as it needs to construct a `DeflateCompressor` from its received
stream.
2023-01-13 17:34:45 -07:00
Tim Schumacher
d717a08003 AK: Add CircularBuffer::read_with_seekback 2023-01-13 17:34:45 -07:00
Timothy Flynn
afc0e461e1 AK+Everywhere: Disallow returning a reference from a fallible expression
This will silently make a copy. Rather than masking this behavior, let's
explicitly disallow it.
2023-01-13 18:50:47 -05:00
Timothy Flynn
3de75f6436 LibJS: Explicitly disallow references in ThrowCompletionOr
This will be disallowed by TRY soon, but the compile error produced by
this requirement will pinpoint the errant line more accurately.
2023-01-13 18:50:47 -05:00
Timothy Flynn
a59ebdac2d LibJS+Everywhere: Return strings by value from PrimitiveString
It turns out return a ThrowCompletionOr<T const&> is flawed, as the GCC
expansion trick used with TRY will always make a copy. PrimitiveString
is luckily the only such use case.
2023-01-13 18:50:47 -05:00
MacDue
9a120d7243 AK: Add support for "debug only" formatters
These are formatters that can only be used with debug print
functions, such as dbgln(). Currently this is limited to
Formatter<ErrorOr<T>>. With this you can still debug log ErrorOr
values (good for debugging), but trying to use them in any
String::formatted() call will fail (which prevents .to_string()
errors with the new failable strings being ignored).

You make a formatter debug only by adding a constexpr method like:
static constexpr bool is_debug_only() { return true; }
2023-01-13 21:09:26 +00:00
MacDue
1388375310 strace: Fix ignored errors in formatting 2023-01-13 21:09:26 +00:00
MacDue
09f02d912a FontEditor: Fix more ignored .to_string() errors 2023-01-13 21:09:26 +00:00
MacDue
f428d17a17 LibWeb: Fix more ignored .to_string() errors in StyleValue 2023-01-13 21:09:26 +00:00
MacDue
92cea3216f AK: Don't inherit Formatter<ErrorOr<T>> for Formatter<IPv6Address> 2023-01-13 21:09:26 +00:00
MacDue
d5152c49a1 AK: Don't inherit Formatter<ErrorOr<T>> for Formatter<IPv4Address> 2023-01-13 21:09:26 +00:00
Tim Schumacher
2150e1b3a5 Shell: Use AllocatingMemoryStream to search for the IFS 2023-01-14 00:33:35 +03:30
Tim Schumacher
156b6e83cd LibCore: Add AllocatingMemoryStream::offset_of 2023-01-14 00:33:35 +03:30
Tim Ledbetter
ecc202c59d PixelPaint: Hold shift to constrain polygonal select tool line angle
Holding shift while using the polygonal select tool now constrains the
line angle in 22.5 degree increments. This matches the behavior of the
line tool.
2023-01-13 15:52:57 +01:00
Tim Ledbetter
569ef94228 PixelPaint: Don't allow the move tool to resize to zero pixels
This prevents an error message appearing when we attempt to scale
a layer to zero pixels using the move tool.
2023-01-13 15:45:28 +01:00
Arda Cinar
037744e62a Kernel/Net: Get the correct interface type in SIOCGIFHWADDR ioctl
When calling ioctl on a socket with SIOCGIFHWADDR, return the correct
physical interface type. This value was previously hardcoded to
ARPHRD_ETHER (Ethernet), and now can also return ARPHRD_LOOPBACK for the
loopback adapter.
2023-01-13 15:44:04 +01:00
Liav A
6f9b84a64a Kernel: Remove outdated FIXME in the DeviceManagement code 2023-01-13 15:42:33 +01:00
Arda Cinar
3f99a8734e LibCore: Call the mkstemp function in a slightly prettier way
This removes a FIXME, although the new version isn't less char-pointery.
2023-01-13 09:29:44 -05:00
Timothy Flynn
8ccd6a31dc GamesSettings: Draw one of the previewed cards as "highlighted"
And draw a valid "moving" card over it to indicate that it is
highlighted for a reason.
2023-01-13 12:58:06 +00:00
Timothy Flynn
c0756d8e55 GamesSettings: Paint the card preview frame using a CardGame subclass
We currently paint the 3 previewed cards using ImageWidget. This works
fine, but in order to preview a card hovering over a valid target card,
it will be easier to use the already-existing CardGame paint logic. So
this patch changes GamesSettings to display the preview as-is using a
CardGame.
2023-01-13 12:58:06 +00:00
Timothy Flynn
208653a93c GamesSettings: Move classes into the GamesSettings namespace
This is to allow registering future classes as with GML.
2023-01-13 12:58:06 +00:00
Liav A
e241b47fee Userland: Remove a bunch of unveil calls on /sys/kernel/processes
These are not needed anymore since the introduction of the new
get_root_session_id syscall.
2023-01-13 13:41:30 +01:00
Liav A
16b6e644d7 Kernel: Require "stdio" pledge promise when calling get_root_session_id 2023-01-13 13:41:30 +01:00
Sam Atkins
a5ff6769f5 LibGUI: Make undo work for TextDocument ReplaceAllTextCommand
The undo code here was just replacing the new text with the new text.
Now we actually save the old text and use that instead. :^)
2023-01-13 13:37:19 +01:00