Commit graph

49146 commits

Author SHA1 Message Date
Tom 6f9c5b71fd WindowServer: Use enum class for Effects and ShowGeometry 2023-04-13 20:18:49 +02:00
Luke Wilde 2125464b76 LibWeb: Don't match the root node of HTMLCollection
Every user of HTMLCollection does not expect the root node to be a
potential match, so let's avoid it by using non-inclusive sub-tree
traversal. This avoids matching the element that getElementsByTagName
was called on for example, which is required by Ruffle:
da689b7687/web/packages/core/src/ruffle-object.ts (L321-L329)
2023-04-13 18:24:18 +02:00
Timothy Flynn f80c05424e LibLocale: Update to CLDR version 43.0.0
https://cldr.unicode.org/index/downloads/cldr-43
2023-04-13 18:22:04 +02:00
Timothy Flynn 0b69e9f974 LibLocale: Prepare locale data generator for breaking changes in CLDR 43
In CLDR 42 and earlier, we were able to assume all cldr-localename files
existed for every locale. They now do not exist for locales that don't
provide any localized data. Namely, this is the "und" locale (which is
an alias for the root locale, i.e. the locale we fall back to when a
user provides an unknown locale).

Further, we were previously able to assume that each currencies.json in
cldr-numbers contained all currencies. This file now excludes currencies
whose localized names are the same as the currency key. Therefore, we
now preprocess currencies.json to discover all currencies ahead of time,
much like we already do for languages.json.
2023-04-13 18:22:04 +02:00
Linus Groh 259a84b7b6 Documentation: Document preference for SCREAMING_CASE constants 2023-04-13 15:57:30 +02:00
Andreas Kling 01ca7e0544 LibWeb: Whine instead of dying on unexpected box during line layout
Log a FIXME on the debug log, along with a layout tree dump of the box
that we didn't expect to see. This will be annoying (until fixed),
but far less so than crashing the browser.
2023-04-13 14:30:16 +02:00
Linus Groh 2555d7a36a LibJS: Make well-known symbol getters return NonnullGCPtr
None of these are ever null after the VM has been initialized, as proved
by virtually every caller immediately dereferencing the raw pointer.
2023-04-13 14:29:42 +02:00
Linus Groh b84f8fb55b LibJS: Make intrinsics getters return NonnullGCPtr
Some of these are allocated upon initialization of the intrinsics, and
some lazily, but in neither case the getters actually return a nullptr.

This saves us a whole bunch of pointer dereferences (as NonnullGCPtr has
an `operator T&()`), and also has the interesting side effect of forcing
us to explicitly use the FunctionObject& overload of call(), as passing
a NonnullGCPtr is ambigous - it could implicitly be turned into a Value
_or_ a FunctionObject& (so we have to dereference manually).
2023-04-13 14:29:42 +02:00
Linus Groh ed9e2366da LibJS: Add spec comments to WeakSetPrototype 2023-04-13 13:04:44 +02:00
Linus Groh bccffed7e9 LibJS: Add spec comments to WeakSetConstructor 2023-04-13 13:04:44 +02:00
Linus Groh 77fc05afd6 LibJS: Add spec comments to WeakRefPrototype 2023-04-13 13:04:44 +02:00
Linus Groh 7c9f1dcced LibJS: Add spec comments to WeakRefConstructor 2023-04-13 13:04:44 +02:00
Linus Groh 7bf92b5c3b LibJS: Add spec comments to WeakMapPrototype 2023-04-13 13:04:44 +02:00
Linus Groh 627dc1b88b LibJS: Add spec comments to WeakMapConstructor 2023-04-13 13:04:44 +02:00
Linus Groh 89bcc05a0d LibJS: Add spec comments to TypedArrayPrototype 2023-04-13 13:04:44 +02:00
Linus Groh aefa053473 LibJS: Add spec comments to TypedArrayConstructor 2023-04-13 13:04:44 +02:00
Linus Groh 81c6ad047a LibJS: Add spec comments to SymbolPrototype 2023-04-13 13:04:44 +02:00
Linus Groh 0ae511edae LibJS: Add spec comments to SymbolConstructor 2023-04-13 13:04:44 +02:00
Linus Groh 066133d97b LibJS: Add spec comments to StringConstructor 2023-04-13 13:04:44 +02:00
Linus Groh 1b3c3f9777 LibJS: Add spec comments to SetPrototype 2023-04-13 13:04:44 +02:00
Linus Groh 58566d2a3f LibJS: Add spec comments to SetConstructor 2023-04-13 13:04:44 +02:00
Sam Atkins d0f80b40b2 LibWeb: Reimplement CalculatedStyleValue as a calculation node tree
VALUES-4 defines the internal representation of `calc()` as a tree of
calculation nodes. ( https://www.w3.org/TR/css-values-4/#calc-internal )

VALUES-3 lacked any definition here, so we had our own ad-hoc
implementation based around the spec grammar. This commit replaces that
with CalculationNodes representing each possible node in the tree.

There are no intended functional changes, though we do now support
nested calc() which previously did not work. For example:
    `width: calc( 42 * calc(3 + 7) );`

I have added an example of this to our test page.

A couple of the layout tests that used `calc()` now return values that
are 0.5px different from before. There's no visual difference, so I
have updated the tests to use the new results.
2023-04-13 09:53:47 +02:00
Sam Atkins 5f2f780662 LibWeb: Expose type and raw values of basic CSS types
This makes it possible to do arithmetic on them without having to
resolve to their canonical unit, which often requires context
information that is not available until the last minute. For example, a
Length cannot be resolved to px without knowing the font size, parent
element's size, etc.

Only Length currently requires such context, but treating all these
types the same means that code that manipulates them does not need to
know or care if a new unit gets added that does require contextual
information.
2023-04-13 09:53:47 +02:00
Sam Atkins 89e55c5297 AK+Tests: Add Vector::find_first_index_if() 2023-04-13 09:53:47 +02:00
Sam Atkins 1352f8820b LibWeb: Simplify CalculatedStyleValue types to match CSS-VALUES-4 :^)
Level 4 drops the limitations of what types can be a denominator, which
means `<calc-number-sum>`, `<calc-number-product>` and
`<calc-number-value>` all go away.
2023-04-13 09:53:47 +02:00
Sam Atkins bab968867d LibWeb: Move StyleValue::absolutized() back where it belongs
I accidentally moved this when moving the CalculatedStyleValue methods,
and didn't notice because it was hidden in the middle. Oops!
2023-04-13 09:53:47 +02:00
iyush cc301f9861 HackStudio: Set_cursor even if the file is already open
Upon opening already opened file, the cursor was previously not
set to the correct line and column. With this patch, it should
be correctly set.

Fixes a bug where ctrl+clicking a function declaration would not
jump to the line if the file containing the function is already
open.
2023-04-13 09:52:33 +02:00
Linus Groh 742f6f7e26 LibWeb/Streams: Fix inconsistent uses of realm() and vm()
This is not documented yet, but the preferred style is getting both
upfront instead of inlining various kinds of calls in places that use
the realm and vm.
2023-04-13 09:51:48 +02:00
Linus Groh 0a556ae26d LibWeb/URL: Make URL::search_params() return a NonnullGCPtr 2023-04-13 09:51:48 +02:00
Linus Groh 28cf8ba92e LibWeb/URL: Add spec links and comments 2023-04-13 09:51:48 +02:00
Cubic Love 6e14dde97d Base: Add 32px icon for CertificateSettings
Before, the 32px icon was just the 16px icon upscaled.
Now TreuKS has tailor-made a 32px version :)

Co-authored-by: TreuKS <ks2225@protonmail.com>
2023-04-13 07:52:16 +01:00
Tim Schumacher ad60a0b522 Fuzzers: Stop loading audio frames once the end is reached
Previously, the condition was reversed, so we would stop immediately on
a file that has at least one working chunk, and we would infinitely loop
on a file with no chunks.
2023-04-12 14:03:20 -04:00
Tim Schumacher 708387b850 LibAudio: Use read_until_filled to fill a buffer from a Stream
This has the advantage of recognizing when the Stream reaches EOF and
avoids an endless loop.
2023-04-12 14:02:56 -04:00
Tim Schumacher 4098335600 LibCompress: Error on truncated uncompressed DEFLATE blocks 2023-04-12 14:02:13 -04:00
Nico Weber f56b897622 Everywhere: Fix a few typos
Some even user-visible!
2023-04-12 19:37:35 +02:00
Cubic Love 3d10132021 Starfield: Rename starfield_window to starfield_widget
Linus says it should be a widget and not a window!
2023-04-12 19:34:27 +02:00
Cubic Love c3a5618dab Base: Add icons for the Gradient screensaver
Add 32px and 16px application icons for the Gradient screensaver
2023-04-12 19:34:27 +02:00
Cubic Love c6af248909 Demos: Rename GradientScreensaver to Gradient
This brings the name in-line with the naming convention used by the
other screensavers 'Starfield' and 'Tubes'.
2023-04-12 19:34:27 +02:00
Nico Weber 97dc2d1dd5 LibGfx/WebP: Don't assert when size in header is smaller than header
read_webp_first_chunk() sensibly assumes that if decode_webp_header()
succeeds, there are at least sizeof(WebPFileHeader) bytes available.

But if the file size in the header was less than the size of the header,
decode_webp_header() would truncate the data to less than that and
happily report success. Now it no longer does that.

Found by clusterfuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57843&sort=-opened&can=1&q=proj%3Aserenity
2023-04-12 17:32:00 +02:00
Nico Weber 93f5a6f217 LibGfx/ICC: Use mix() in CurveTagData::evaluate()
No behavior change.

(Well, technically mix() uses the other simple implementation of lerp
and the two have slightly different behavior if the arguments are of
very different magnitude and in various corner cases. But in practice,
for ICC profiles, it shouldn't matter. For a few profiles I tested, it
didn't have a measurable effect.)
2023-04-12 15:23:51 +02:00
Nico Weber 077164ae15 AK: Make grepping for "lerp" find mix() 2023-04-12 15:23:51 +02:00
Liav A 7ca71959e1 Documentation: Remove unnecessary answer to non-asked question in FAQ
By this point of time, we already have x86-64 support and have removed
i686 support too.

Since we are not the only OS project to remove 32-bit support entirely
and 64-bit computing is the norm for modern personal computers, there's
no need to explain this as it's obvious "why we are 64-bit only".
2023-04-12 14:48:49 +02:00
Tim Schumacher adfda6a271 AK: Remove the Endian bytes accessor
This is a remnant from when we didn't have a `read_value` and
`write_value` implementation for `AK::Endian` and instead used the
generic functions for reading a span of bytes. Now that we have a more
ergonomic alternative, remove the helper that is no longer needed.
2023-04-12 07:33:15 -04:00
Tim Schumacher 547a08670e LibWasm: Replace usages of the Endian bytes accessor 2023-04-12 07:33:15 -04:00
Tim Schumacher e11e7309dd LibCompress: Replace usages of the Endian bytes accessor 2023-04-12 07:33:15 -04:00
Tim Schumacher 8370377832 Shell: Add map_fixed to the pledges for command autocompletion 2023-04-12 07:06:54 -04:00
Fabian Dellwing e78db6417a LibTLS: Remove outdated comment about ECC
PR #18166 introduced the ability to parse ECC certificates. If we
now fail here the reason is mostlikely something new and we should
prevent this rabbit hole from happening.
2023-04-12 11:40:06 +03:30
Fabian Dellwing 93232d4e6d LibTLS: Streamline certificate loading
Some refactoring of our root ca loading process:

- Remove duplicate code
- Remove duplicate calls to `parse_root_ca`
- Load user imported certificates in Browser/RequestServer
2023-04-12 11:40:06 +03:30
stelar7 e4481baef9 LibTLS: Dont also include the OID when printing the RDN short name 2023-04-12 11:36:54 +03:30
Tim Ledbetter 0829101eb8 Applications: Use thousands separator for numbers shown in status bar
TextEditor, HackStudio and SQLStudio now print the current line and
column number, as well as the number of currently selected words, with
thousands separators.

TextEditor also uses thousands seperators for the current word and
character count.
2023-04-12 09:03:01 +02:00