Commit graph

15171 commits

Author SHA1 Message Date
Tim Schumacher 2470dd3bb5 AK: Move bit streams from LibCore 2023-01-29 19:16:44 -07:00
Tim Schumacher 94f139c111 AK: Move buffered streams from LibCore 2023-01-29 19:16:44 -07:00
Tim Schumacher 8464da1439 AK: Move Stream and SeekableStream from LibCore
`Stream` will be qualified as `AK::Stream` until we remove the
`Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is
defined by `SeekableStream`, since defining its own would require us to
qualify it with `AK::SeekMode` everywhere.
2023-01-29 19:16:44 -07:00
Tim Schumacher 5f2ea31816 AK: Move Handle from LibCore and name it MaybeOwned
The new name should make it abundantly clear what it does.
2023-01-29 19:16:44 -07:00
Tim Schumacher ae64b68717 AK: Deprecate the old AK::Stream
This also removes a few cases where the respective header wasn't
actually required to be included.
2023-01-29 19:16:44 -07:00
Nico Weber fef15becb2 LibGfx: Support ICCs in JPEGs that are split across several tags
Most jpegs that use multi-tag ICCs are in CMYK format, so running
`icc` on them still produces

    Runtime error: Unsupported number of components in SOF

but it no longer prints several

    jpg: Ignoring ICC profile spanning several chunks (1/9)

lines before that.

(And if I manually comment out that error message, the profile
is printed fine. But we can't decode the actual pixel data yet.)
2023-01-29 19:17:35 +00:00
Timothy Flynn 78def34c5e LibSQL: Use kill to exit forked SQLServer processes to avoid Qt issues
In order to daemonize the SQLServer process for Ladybird, we double-fork
and exit the first child process to ensure the grandchild process is in
a detached state to become SQLServer. After commit c05fcd5, this happens
after Ladybird's QApplication is created. QApplication seems to hook up
some `exit` handling that makes the call to `exit(0)` here not actually
exit the child process.

Instead, using `kill` with SIGTERM will actually terminate the child
process.
2023-01-29 18:32:21 +00:00
thankyouverycool 08456be9dc LibGUI+LibGfx: Add Tray ColorRole helpers to Palette 2023-01-29 18:27:34 +00:00
Tim Schumacher 89a4a9c7a7 LibDebug: Correct a (un-)signed mixup in the DWARF abbreviations map
I accidentally replaced this with `read_unsigned` in
908b88db34, now it's correct again.
2023-01-29 18:21:11 +00:00
MacDue d11baf48ae LibGfx: Fix constructor initialisation style in GradientPainting 2023-01-29 13:49:35 +00:00
MacDue 285bd7a37a LibGfx: Stop passing color stop spans by const reference
No idea why I did this, possibly because these were once vectors?
Anyway, the const reference is pointless here.
2023-01-29 13:49:35 +00:00
Nico Weber e9dcc49f9c LibGfx: Validate tag types of AToBNTag, BToANTag, gamutTag, previewNTag
Also rewrite a few of the existing tag type checks using a new helper.
2023-01-29 11:40:14 +00:00
Nico Weber bd4078ad45 LibGfx: Make ICC EMatrix3x3::operator[] a bit less silly 2023-01-29 11:35:37 +00:00
Nico Weber 1329799d20 LibGfx: Rename EMatrix to EMatrix3x3 in ICC code
There will be an EMatrix3x4 in a future change.
2023-01-29 11:35:37 +00:00
Nico Weber f63ec8de68 LibGfx: Use auto more in ICC code 2023-01-29 11:35:37 +00:00
MacDue 489fe49321 LibWeb: Fix parsing/to_string for "switch" ARIA role
I accidentally regressed this in 890b4d7, this role needs to be
handled specially due to the clash with the C++ 'switch' keyword.
2023-01-29 00:57:41 +00:00
Linus Groh 476d4b4963 LibWeb: Remove no longer needed DeprecatedFlyString.h includes
ARIA roles no longer use DeprecatedFlyString, replace them with the
forwarding header, and StringView.h in one case, for other things from
AK used in those headers.
2023-01-29 00:02:55 +00:00
Linus Groh 8556d47240 LibWeb: Move ARIA-related code into the Web::ARIA namespace
ARIA has its own spec and is not part of the DOM spec, which is what the
Web::DOM namespace is for (https://www.w3.org/TR/wai-aria-1.2/).

This allows us to stay closer to the spec with function names and don't
have to add the word "ARIA" to identifiers constantly - the namespace
now provides that clarity.
2023-01-29 00:02:55 +00:00
Timothy Flynn 8414734a2d LibJS: Propagate the OOM error from setting the String length property 2023-01-29 00:02:45 +00:00
Timothy Flynn b75b7f0c0d LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocate
Callers that are already in a fallible context will now TRY to allocate
cells. Callers in infallible contexts get a FIXME.
2023-01-29 00:02:45 +00:00
Timothy Flynn 109b190a19 LibJS: Fully qualify the use of AK::is in MUST_OR_THROW_OOM
This is to allow using this macro in contexts that have defined `is`
already. For example, in ObjectConstructor, there is a native function
`is` which would trip up the compiler without this change.
2023-01-29 00:02:45 +00:00
Timothy Flynn 2b5054c903 LibJS: Add a method to ThrowCompletionOr to drop allocation errors
This should solely be used to ignore completions from Heap::allocate in
currently-infallible contexts. It's mostly meant to let us both ignore
these errors and mark them with a FIXME in one go.
2023-01-29 00:02:45 +00:00
Timothy Flynn 2692db8699 LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errors
Note that as of this commit, there aren't any such throwers, and the
call site in Heap::allocate will drop exceptions on the floor. This
commit only serves to change the declaration of the overrides, make sure
they return an empty value, and to propagate OOM errors frm their base
initialize invocations.
2023-01-29 00:02:45 +00:00
Timothy Flynn 1c1b902a6a LibJS+LibWeb: Move headers around to allow including Value from Cell
The goal here is to allow Cell::initialize to return a ThrowCompletion,
to handle OOM for example. Cell.h will then need to include Completion.h
which must include Value.h. This currently can't happen because Value.h
includes BigInt.h, which in turn includes Cell.h. So we would have an
include cycle.

This removes BigInt.h from Value.h, as it is forward-declarable (it is
only referred to with a reference or pointer). Then the Value overload
for Cell::Visitor::visit is moved to Cell.h, and missing BigInt.h
includes as peppered as needed.
2023-01-29 00:02:45 +00:00
Timothy Flynn b0a4df76de LibJS: Define Date constants such that translation units don't copy them
Variables that are constexpr must be delcared inline in the global
namespace to prevent copying them.

The static keyword is meaningless on variables in headers in the global
namespace. Declare the static bigint as extern and define it out-of-line
instead.
2023-01-29 00:02:45 +00:00
Linus Groh e4158d8555 LibJS: Replace some deprecated_string() with utf8_string() in Temporal
The remaining ones are needed for PropertyKey, which is not yet String
compatible.
2023-01-28 22:58:03 +00:00
Linus Groh b41e7b7e86 LibJS: Replace to_deprecated_string() with to_string() in Temporal
Turns out all of these can already be replaced with no further changes!
2023-01-28 22:54:44 +00:00
MacDue 890b4d7980 LibWeb: Replace ARIA role static FlyStrings with an enum
This replaces the FlyStrings for ARIA roles that were constructed in
a [[gnu::constructor]] with a single enum. I came across this as the
DOM inspector was crashing due to a null FlyString for an ARIA role.

After fixing that, I was confused as to why these roles were not an
enum. Looking at the spec there's a fixed list of roles and switching
from references to static strings to an enum was pretty much an
exercise in find and replace :).

No functional changes (outside of fixing the mentioned crash).
2023-01-28 22:09:18 +00:00
Linus Groh 3a9225608a LibAudio: Remove try_ prefix from fallible LoaderPlugin methods 2023-01-28 22:41:36 +01:00
Linus Groh ee0297d9ec LibAudio: Remove try_ prefix from fallible LoaderPlugin methods 2023-01-28 22:41:36 +01:00
Linus Groh 108ea2b921 LibCore: Remove try_ prefix from fallible SharedCircularQueue methods 2023-01-28 22:41:36 +01:00
Linus Groh 9c08bb9555 AK: Remove try_ prefix from FixedArray creation functions 2023-01-28 22:41:36 +01:00
Nico Weber 909c2a73c4 LibGfx+icc: Read and display lut16Type and lut8Type ICC tag types 2023-01-28 21:40:45 +00:00
Nico Weber a0513a360a LibGfx: Use AssertSize<> in ICC/Profile.cpp 2023-01-28 21:40:45 +00:00
Sam Atkins 53ebe607f8 LibWasm: Implement data.drop instruction 2023-01-28 22:57:25 +03:30
Sam Atkins a2f42512c2 LibWasm: Move memory.init code together with other memory.foo impls
And add a spec link while I'm at it.
2023-01-28 22:57:25 +03:30
Sam Atkins 330911a274 LibWasm: Implement memory.copy instruction 2023-01-28 22:57:25 +03:30
Sam Atkins 42adba5ad4 LibWasm: Implement memory.fill instruction 2023-01-28 22:57:25 +03:30
Nico Weber 6c79201f43 LibGfx: Make PNGImageDecoderPlugin::icc_data() return data if present 2023-01-28 12:42:19 +01:00
Nico Weber 53f485c5f0 LibGfx: Process colorspace-related chunks in PNGLoader
This stores the data from all these chunks on PNGLoadingContext
but doesn't do anything with it yet.
2023-01-28 12:42:19 +01:00
Linus Groh 0f4bbfdfb7 LibJS: Add spec comments to FunctionPrototype 2023-01-28 00:41:18 +00:00
Linus Groh 6d6ea1fffe LibJS: Add spec comments to FinalizationRegistryPrototype 2023-01-28 00:41:18 +00:00
Linus Groh 2473940526 LibJS: Add spec comments to FinalizationRegistryConstructor 2023-01-28 00:41:18 +00:00
Linus Groh 39301cce70 LibJS: Add spec comments to DataViewPrototype 2023-01-28 00:41:18 +00:00
Linus Groh 814e7260f3 LibJS: Add spec comments to DataViewConstructor 2023-01-28 00:41:18 +00:00
Linus Groh 0f3899b24a LibJS: Add spec comments to Completion 2023-01-28 00:41:18 +00:00
Linus Groh e32265c896 LibJS: Add spec comments to BooleanConstructor 2023-01-28 00:41:18 +00:00
Linus Groh 02808948ec LibJS: Add spec comments to BigIntPrototype 2023-01-28 00:41:18 +00:00
Linus Groh 7b139c6982 LibJS: Add spec comments to ArrayConstructor 2023-01-28 00:41:18 +00:00
Linus Groh eefb73add2 LibJS: Add spec comments to ArrayBufferConstructor 2023-01-28 00:41:18 +00:00