Commit Graph

29866 Commits

Author SHA1 Message Date
Tim Schumacher
d350d2dfce Emulator: Restrict library name check when querying symbols
Libraries in /usr/lib currently only end in .so, so no contains() is
needed for now.
2021-11-10 14:42:49 +01:00
Tim Schumacher
6c6381408f Emulator: Use existing queried library name in load check
We already asked the region about what its library name is, and we also
use that value when maybe constructing a path, so let's make the check
use that as well.
2021-11-10 14:42:49 +01:00
Tim Schumacher
fc6f265155 Profiler: Use existing path split when mmapping libraries
We already extracted the `path` part of the segment name, so use that
for checking if the filename looks like a shared library.
2021-11-10 14:42:49 +01:00
Ben Wiederhake
b7e6118098 AK: Properly declare inheritance of Bitmap from BitmapView
All the read-only methods of Bitmap simply defer to BitmapView. Let's
make this relationship official by using class inheritance. This might
even shave off a few instructions, although any sufficiently optimizing
compiler probably already optimized them away.
2021-11-10 14:39:42 +01:00
Ben Wiederhake
bf7a2ff941 AK+Kernel: Make BitmapView read-only 2021-11-10 14:39:42 +01:00
Ben Wiederhake
850db15d66 Everywhere: Remove unused AK/Bitmap includes 2021-11-10 14:39:42 +01:00
Sam Atkins
96936d04d6 LibWeb: Parse background-size as part of background shorthand 2021-11-10 14:38:49 +01:00
Sam Atkins
67214e0b61 LibWeb: Parse background-size property 2021-11-10 14:38:49 +01:00
Sam Atkins
ae2a3bf185 LibWeb: Add BackgroundSizeStyleValue
There's nothing really background-size-specific about this, but since
there is no `<size>` value type defined in the CSS spec at this time,
and background-size is the only user of it, I think this name makes more
sense. But I'm not 100% convinced.
2021-11-10 14:38:49 +01:00
Sam Atkins
891dd46a17 LibWeb: Store Repeat values directly in BackgroundRepeatStyleValue
...as opposed to storing StyleValues, which we have to later check are
IdentifierStyleValues, which store identifiers that we can convert to
Repeat values later. It's fewer allocations, and we can't end up with
invalid values by mistake. :^)
2021-11-10 14:38:49 +01:00
Sam Atkins
901a990b1b LibWeb: Remove concept of CSS pseudo-properties
We don't need them any more, so they're gone. :^)
2021-11-10 14:38:49 +01:00
Sam Atkins
1e53768f1b LibWeb: Combine background-repeat-x/y pseudo-properties
While right now this doesn't save much complexity, it will do once we
care about multiple background layers per node. Then, having a single
repeat value per layer will simplify things.

It also means we can remove the pseudo-property concept entirely! :^)
2021-11-10 14:38:49 +01:00
Sam Atkins
5d0acb63ae LibWeb: Use BackgroundRepeatStyleValue in background shorthand
This is step 1 in removing the two `background-repeat-x/y`
pseudo-properties. Since adding the concept of compound StyleValues, we
don't need `background-repeat` to be split in two any more.
2021-11-10 14:38:49 +01:00
Sam Atkins
368595d850 Base: Add CSS background test page
Also organized the welcome page list slightly.
2021-11-10 14:38:49 +01:00
Sam Atkins
532f1e859d LibWeb: Parse background-clip and background-origin
Including as part of the `background` shorthand. :^)
2021-11-10 14:38:49 +01:00
Sam Atkins
018a4aa85c LibWeb: Parse background-attachment as part of background property 2021-11-10 14:38:49 +01:00
Sam Atkins
116a5fe5d0 LibWeb: Add background-position to background property
This required modifying the background-parsing code to use a
TokenStream, but that turned out to be pretty simple.
2021-11-10 14:38:49 +01:00
Sam Atkins
988a8ed3d8 LibWeb: Parse CSS background-position property
This is done a bit differently from other properties: using a
TokenStream instead of just a Vector of ComponentValues. The reason for
this is, we can then use call the same function when parsing the
`background` shorthand. Otherwise, we would have to know in advance how
many values to pass down, which basically would involve duplicating the
`background-position` parsing code inside `background`.

The StyleValue is PositionStyleValue, since it represents a
`<position>`: https://www.w3.org/TR/css-values-4/#typedef-position
Unfortunately, background-position's parsing is a bit different from
`<position>`'s, (background-position allows 3-value syntax and
`<position>` doesn't) so we'll need to come back and write a different
parsing function for that later.
2021-11-10 14:38:49 +01:00
Luke Wilde
5594a492f0 LibJS: Implement Temporal.ZonedDateTime.prototype.toJSON 2021-11-10 12:56:56 +00:00
Luke Wilde
6856b6168a LibJS: Implement Temporal.ZonedDateTime.prototype.toLocaleString 2021-11-10 12:56:56 +00:00
Luke Wilde
a9ad993e78 LibJS: Implement Temporal.ZonedDateTime.prototype.toString 2021-11-10 12:56:56 +00:00
Luke Wilde
dc72d416b2 LibJS: Implement the required AOs for ZonedDateTime stringifiers 2021-11-10 12:56:56 +00:00
Idan Horowitz
04253c3254 LibJS: Add tests for async functions and await expressions 2021-11-10 08:48:27 +00:00
Idan Horowitz
46dabf02ec LibJS: Add support for await expressions 2021-11-10 08:48:27 +00:00
Idan Horowitz
681787de76 LibJS: Add support for async functions
This commit adds support for the most bare bones version of async
functions, support for async generator functions, async arrow functions
and await expressions are TODO.
2021-11-10 08:48:27 +00:00
Luke Wilde
05c3320da3 LibJS: Mark RoundTemporalInstant as infallible
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/0b4141c

This also allows us to get rid of two old exception checks.
2021-11-09 23:42:34 +02:00
Linus Groh
e9f66d1c2a LibJS: Mark DaysUntil as infallible
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/30a8939
2021-11-09 20:37:17 +00:00
Timothy Flynn
03c023d7e9 LibUnicode: Upgrade to CLDR version 40.0.0
Release notes:
https://github.com/unicode-org/cldr-json/releases/tag/40.0.0
2021-11-09 20:44:52 +01:00
Timothy Flynn
357c97dfa8 LibUnicode: Parse the CLDR's defaultContent.json locale list
This file contains the list of locales which default to their parent
locale's values. In the core CLDR dataset, these locales have their own
files, but they are empty (except for identity data). For example:

https://github.com/unicode-org/cldr/blob/main/common/main/en_US.xml

In the JSON export, these files are excluded, so we currently are not
recognizing these locales just by iterating the locale files.

This is a prerequisite for upgrading to CLDR version 40. One of these
default-content locales is the popular "en-US" locale, which defaults to
"en" values. We were previously inferring the existence of this locale
from the "en-US-POSIX" locale (many implementations, including ours,
strip variants such as POSIX). However, v40 removes the "en-US-POSIX"
locale entirely, meaning that without this change, we wouldn't know that
"en-US" exists (we would default to "en").

For more detail on this and other v40 changes, see:
https://cldr.unicode.org/index/downloads/cldr-40#h.nssoo2lq3cba
2021-11-09 20:44:52 +01:00
Idan Horowitz
91881be4b0 LibJS: Convert GeneratorObject to ThrowCompletionOr 2021-11-09 20:32:51 +02:00
Idan Horowitz
11a90700df LibJS: Convert the IntegerIndexedElementSet AO to ThrowCompletionOr 2021-11-09 20:32:51 +02:00
Idan Horowitz
ba55d77665 LibJS: Remove leftover exception check in OrdinaryHasProperty 2021-11-09 20:32:51 +02:00
faxe1008
100e25d1d3 pape: Add set-random option 2021-11-08 16:36:02 -08:00
Simon Woertz
1476f02f99 SoundPlayer: Fix stack-use-after-scope when playing file in loop mode
The path returned by GUI:FilePicker is stored on the stack when the
callback is executed. The player only stored a StringView to the path
however it should take ownership of the path instead since the path is
accessed even after the file menu open action has returned.
2021-11-08 16:34:03 -08:00
Brendan Coles
1e48cd35a1 UserspaceEmulator: Add support for SC_uname and SC_sysconf syscalls 2021-11-08 16:30:32 -08:00
kleines Filmröllchen
61d9082da6 LibAudio: Replace log_pan with a constant power panning algoritm
This little functional change uses the most common algorithm for panning
audio, known as constant power panning. It makes it so that the total
output power (not directly the sample value, i.e. the peak) stays the
same no matter how the audio is panned.
2021-11-08 16:29:25 -08:00
kleines Filmröllchen
8945cc8358 LibAudio: Improve local variable names
This makes the code easier to read.
2021-11-08 16:29:25 -08:00
David Isaksson
b6d075bb01 LibAudio: Rename Audio::Frame -> Audio::Sample
"Frame" is an MPEG term, which is not only unintuitive but also
overloaded with different meaning by other codecs (e.g. FLAC).
Therefore, use the standard term Sample for the central audio structure.

The class is also extracted to its own file, because it's becoming quite
large. Bundling these two changes means not distributing similar
modifications (changing names and paths) across commits.

Co-authored-by: kleines Filmröllchen <malu.bertsch@gmail.com>
2021-11-08 16:29:25 -08:00
David Isaksson
fa4255bcf1 LibAudio: Refactor out linear_to_log function and add its inverse
The conversion from a linear scale (how we think about audio) to a
logarithmic scale (how audio actually works) will be useful for other
operations, so let's extract it to its own utility function. Its inverse
will also allow reversible operations to be written more easily.
2021-11-08 16:29:25 -08:00
Linus Groh
1e3e0477cb LibJS: Implement Temporal.PlainMonthDay.prototype.with() 2021-11-08 22:19:45 +00:00
Linus Groh
fa1d5feec0 LibJS: Implement Temporal.PlainYearMonth.prototype.with() 2021-11-08 22:19:45 +00:00
Linus Groh
aca2ef9e1c LibJS: Implement Temporal.PlainDateTime.prototype.with() 2021-11-08 22:19:45 +00:00
Linus Groh
c3c9ac93d0 LibJS: Implement Temporal.PlainDate.prototype.with()
With one caveat: in the PreparePartialTemporalFields AO I made a change
to fix a spec issue that would require the input object to always have a
month or monthCode property.
This is tracked in https://github.com/tc39/proposal-temporal/issues/1910
and may get accepted as-is, in which case we simply need to remove the
NOTE comment.
2021-11-08 22:19:45 +00:00
Linus Groh
310016aee4 LibJS/Tests: Fix Temporal.PlainDate.prototype.equals() tests
Just calling "expect()" doesn't do anything!
2021-11-08 19:12:54 +00:00
Linus Groh
46d7c34028 LibJS: Use StringView literals in prepare_temporal_fields() 2021-11-08 19:12:47 +00:00
Tim Schumacher
22562b4b17 CMake: Assume working compiler instead of using static linking
We were previously using TRY_COMPILE_TARGET_TYPE to bypass the compiler
check at the beginning of the CMake build, since we don't have LibC
available and therefore can't link at that point.

However, this breaks a lot of assumptions in try_compile when it comes
to library checks. While this was the main idea behind our usage of the
flag, it also has some really nasty side effects when software wants
to find out what library a symbol is in.

Instead, just manually tell CMake that our compiler works as intended
and keep the target type setting at its default.
2021-11-07 20:11:23 -08:00
Daniel Bertalan
20bea3feff LibC: Fix huge libc.a file size due to the use of llvm-ar -q
Before this change, we would generate the static C library by running
the command `ar -qcs` to collect the various `*.o` files into a single
archive.

The `q` option stands for "quick append", which simply appends new files
to the archive, without replacing any pre-existing entries for the same
file. The problem with this is obvious: each LibC rebuild would add
approximately 1 MB (the size of a cleanly built libc.a) to the size of
the file. It got so bad on my machine that the total file size ended up
being 3 gigabytes.

Note that this did not affect the GNU toolchain, because, as the `ar(1)`
manpage says:
> Note - GNU ar treats the command qs as a synonym for r - replacing
> already existing files in the archive and appending new ones at the
> end.
2021-11-08 01:39:07 +01:00
Daniel Bertalan
05cb72e2c3 Ports: Unbreak and update oksh
This port has been broken since the introduction of `sys_signame` (which
was almost 3 months ago), as oksh provided a conflicting definition for
it.

This commit also cleans up some of the patches, defining the appropriate
config macro instead of commenting out code.

When I opened this program's GitHub releases page, I noticed that a new
version was available, so I also did the update.
2021-11-08 01:36:54 +01:00
Timothy Flynn
2530b6adf0 LibJS: Create the RegExpExec result's "input" field last
We move the input string into this field to avoid a string copy, so we
must do this step last to avoid using any views into it (note that
match.view here is a view into this string).
2021-11-08 01:36:29 +01:00
Andreas Kling
79fa9765ca Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>
We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace!
This was a slightly tedious refactoring that took a long time, so it's
not unlikely that some bugs crept in.

Nevertheless, it does pass basic functionality testing, and it's just
real nice to finally see the same pattern in all contexts. :^)
2021-11-08 01:10:53 +01:00