Commit graph

55111 commits

Author SHA1 Message Date
Karol Kosek 3944c39b3a LibGUI: Port tooltip in Breadcrumbbar to String 2023-10-06 08:20:11 +02:00
Karol Kosek dd92d09268 Applets/Network: Port get_adapter_info() to ErrorOr<String> 2023-10-06 08:20:11 +02:00
Karol Kosek a3ddba4191 Userland: Port GUI::Application::show_tooltip() to String
This most importantly gets rid of a chain of "String to DeprecatedString
to String" transformations when setting a tooltip from GUI::Widget's
set_tooltip function.
2023-10-06 08:20:11 +02:00
Karol Kosek 16defb4806 LibGUI: Parse ampersand string for tooltips only in GUI::Action
It seems unnecessary to pass every tooltip string through
Gfx::parse_ampersand_string() when only Action tooltips need to parse a
title.
2023-10-06 08:20:11 +02:00
Hendiadyoin1 aea244efe1 Kernel: Mark SDHC InterruptStatus structured view as const
This view is really nice to check flags, but when clearing them we must
make sure that we only ever try to set 1 bit at a time, which makes
setting bits through the structured view a footgun, as that fetches,
ors in and then sets, potentially resetting other flags.
2023-10-06 08:16:56 +02:00
Gurkirat Singh f51e8e785c Browser: Treat absolute path as local file 2023-10-06 08:12:41 +02:00
Adam Harald Jørgensen d6796d5123 Ladybird: Add keyboard shortcuts for jumping to a specific tab
It's now possible to open a specific tab by using Ctrl/Command plus the
number key corresponding to its position in the tab row.
2023-10-06 08:10:30 +02:00
Karol Kosek f2f98b7938 grep: Hyperlink filenames in tty
As the newly created function has been also applied to printing the
number of matched file lines, file names will now also be colored
with the `--count` option set. :^)
2023-10-06 08:10:00 +02:00
Karol Kosek db4a654e9f grep: Print filenames when counting lines and path size is less than 2
`grep --count --recursive foo` doesn't specify any file, but we should
show the paths anyway.
2023-10-06 08:10:00 +02:00
Karol Kosek 018dcf570e grep: Return exit code '2' on error 2023-10-06 08:10:00 +02:00
Karol Kosek 5a85449b23 grep: Don't end the program early after failing to grep a file
We should still try to read remaining files.
2023-10-06 08:10:00 +02:00
Karol Kosek 94eb31865a grep: Remove separate stdin handling logic
Previously we had two somewhat duplicated methods: one just for handling
stdin with the standard C API, and the other one used for everything
else with our Core::File class. By using always Core::File, the code
should be now a little bit cleaner.

Additionally, grep will now use the standard input when it finds a '-'
argument (previously it tried to open a file with that name.)
2023-10-06 08:10:00 +02:00
Karol Kosek e48b9d74ac grep: Add comment describing why we take leading characters from paths 2023-10-06 08:10:00 +02:00
Andreas Kling 3fb406b97e LibJS: Avoid ByteBuffer copying in NumericToRawBytes
Another 4% speed-up on Octane/gbemu.js :^)
2023-10-06 07:32:48 +02:00
Andreas Kling 285484874d LibJS: Avoid ByteBuffer copying in RawBytesToNumeric
4% speed-up on Octane/gbemu.js :^)
2023-10-06 07:32:48 +02:00
Timothy Flynn 03be26317f LibJS: Alphabetize handling some Intl.NumberFormat/PluralRules options
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/5a43090
2023-10-05 17:01:02 +02:00
Timothy Flynn eeb16f03bb LibLocale: Parse day-period hour cycle preferences
For example, the locale "fr-FR" will have the preferred hour cycle list
of "H hB", meaning h23 and h12-with-day-periods. Whether date-times are
actually formatted with day-periods is up to the user, but we need to
parse the hour cycle as h12 to know that the FR region supports h12.

This bug was revealed by LibJS no longer blindly falling back to h12 (if
the `hour12` option is true) or h24 (if the `hour12` option is false).
2023-10-05 17:01:02 +02:00
Timothy Flynn 05e080c4ba LibJS: Correctly resolve locale hour cycles in Intl.DateTimeFormat
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/2f002b2
2023-10-05 17:01:02 +02:00
Timothy Flynn 39be5cb73a LibJS: Allow formatting UTC-offset time zones with Intl.DateTimeFormat
These are normative changes in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/896ffcc
https://github.com/tc39/ecma402/commit/af4ec46
https://github.com/tc39/ecma402/commit/e25c455

(This combines the above commits into one patch as they each do not work
on their own).
2023-10-05 17:01:02 +02:00
Timothy Flynn f31540e419 LibJS: Implement time zone identifier AOs centrally within Date
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/73926a5

The idea here is to reduce duplication of these AOs between ECMA-262,
ECMA-402, and Temporal. This patch contains only the ECMA-262 changes.
2023-10-05 17:01:02 +02:00
Timothy Flynn 0bc401a1d6 LibTimeZone+Userland: Include Link entries when returning all time zones
We currently only return primary time zones, i.e. time zones that are
not a Link. LibJS will require knowledge of Link entries, and whether
each entry is or is not a Link.
2023-10-05 17:01:02 +02:00
Timothy Flynn ddaba88340 LibJS: Convert Date-related equations into proper AOs
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/7178fa8
2023-10-05 17:01:02 +02:00
Andreas Kling 021a141b53 LibJS: Make array-like Put access on ordinary objects much faster
This patch adds a fast path to the PutByValue bytecode op that bypasses
a ton of things *if* a set of assumptions hold:

- The property key must be a non-negative Int32
- The base object must not interfere with indexed property access
- The base object must have simple indexed property storage
- The property key must already be present as an own property
- The existing value must not have any accessors defined

If this holds (which it should in many common cases), we can skip all
kinds of checks and poke directly at the property storage, saving time.

16% speed-up on the entire Kraken benchmark :^)
(including: 88% speed-up on Kraken/imaging-desaturate.js)
(including: 55% speed-up on Kraken/audio-fft.js)
(including: 54% speed-up on Kraken/audio-beat-detection.js)
2023-10-05 16:57:45 +02:00
Andreas Kling 27a83f7e5e LibJS: Make array-like Get access on ordinary objects much faster
This patch adds a fast path to the GetByValue bytecode op that bypasses
a ton of things *if* a set of assumptions hold:

- The property key must be a non-negative Int32
- The base object must not interfere with indexed property access
- The property key must already be present as an own property
- The existing value must not have any accessors defined

If this holds (which it should in the common case), we can poke directly
at the indexed property storage and save a boatload of time.

10% speed-up on the entire Kraken benchmark :^)
(including: 31% speed-up on Kraken/audio-dft.js)
(including: 23% speed-up on Kraken/stanford-crypto-aes.js)
2023-10-05 16:57:45 +02:00
Andreas Kling a3ee8ff377 LibJS: Add IndexedProperties::storage() to access the underlying storage
This will be used in GetByValue and PutByValue fast paths.
2023-10-05 16:57:45 +02:00
Andreas Kling 7df1692580 LibJS: Add Object::may_interfere_with_indexed_property_access() virtual
This function must return true if the object may intercept and customize
access to indexed properties (properties where the property name is a
non-negative integer.)

This will be used to implement fast path optimizations for array-like
accesses in subsequent commits.
2023-10-05 16:57:45 +02:00
Sönke Holz 900334a4aa Ports: Add riscv64 target to QEMU 2023-10-05 15:34:01 +02:00
Gurkirat Singh fb5353e7e2 Utilities: Remove redundant target_link_libraries 2023-10-05 15:19:19 +02:00
Tim Schumacher a8084072c6 Meta: Remove myself from LibELF-related CODEOWNERS entries 2023-10-05 08:58:36 +02:00
kleines Filmröllchen 1a29ff6e9e Base: Specify the installed.db port database format 2023-10-04 22:28:05 +02:00
kleines Filmröllchen 05af549bad pkg: Parse dependencies as part of the main port entry
The "dependency" lines really belong to the main port entry, it doesn't
make sense logically to represent them separately and handling them
together will also allow easier dependency management later on. This
commit greatly simplifies the port database parsing to facilitate this,
and removes the -d option from the command line. Instead, ports are
listed with their dependencies, if they have any.
2023-10-04 22:28:05 +02:00
kleines Filmröllchen a5f566c2c6 pkg: Always use correct installed.db
The access() check was on the wrong file previously.
2023-10-04 22:28:05 +02:00
Andreas Kling feef542c73 LibJS: Don't worry about deduplicating bytecode string tables
The strings will get deduplicated when actually turned into
PrimitiveString objects at runtime anyway, and keeping the string
tables deduplicated was actually wasting a lot of time.

4.4% speed-up on Kraken/stanford-crypto-ccm.js :^)
2023-10-04 20:10:12 +02:00
Andreas Kling 111622a164 LibJS: Add fast path for multiplying two Int32 values
We can avoid a lot of work here, as long as the result doesn't overflow
the Int32 range.

5% speed-up on Kraken/imaging-gaussian-blur.js :^)
2023-10-04 20:10:12 +02:00
Andreas Kling 14a9cfef4d LibJS: Add fast-path for Int32 values in Math.abs()
This function becomes very simple when the input is already an Int32.

2.3% speed-up on Kraken/imaging-gaussian-blur.js :^)
2023-10-04 20:10:12 +02:00
Sam Atkins b53a633388 Hearts: Paint player names in white when background is a dark color 2023-10-04 20:10:04 +02:00
Sam Atkins 09d42261c7 LibCards: Keep markings visible on very dark or light backgrounds
Color::lightened() and Color::darkened() multiply the color values, so
they don't work for black. So for simplicity, we use a semi-transparent
white or black instead.
2023-10-04 20:10:04 +02:00
Aliaksandr Kalenik 09c1eccb50 LibWeb: Fix crash in XMLHttpRequest::response_xml() if response empty
If response object is empty we should return nullptr.

Fixes crash on https://store.steampowered.com/
2023-10-04 20:09:21 +02:00
Andreas Kling 732b39d120 LibJS: Don't evaluate computed MemberExpression LHS twice in assignments
The following snippet would cause "i" to be incremented twice(!):

    let a = []
    let i = 0
    a[++i] += 0

This patch solves the issue by remembering the base object and property
name for computed MemberExpression LHS in codegen. We the store the
result of the assignment to the same object and property (instead of
computing the LHS again).

3 new passes on test262. :^)
2023-10-04 18:58:29 +02:00
Andreas Kling 2083376618 LibJS: Use MUST instead of TRY for infallible calls to TrimString
When the spec says to call "! TrimString", we should use MUST instead
of TRY. (We were previously using TRY in order to propagate OOM errors,
but we don't care about such OOMs anymore.)
2023-10-04 15:21:37 +02:00
Cubic Love be4579b771 Base: Add ‘Classic’ face cards
Hand-drawn face/court cards for traditional French-suited playing cards.
For each of the four suits (Clubs, Hearts, Diamonds & Spades) there is a
corresponding King, Queen, Jack and a standalone symbol which can be
used for the numeral card patterns, including Ace. There is a special
Ace of Spades card. Also included is a Joker card.
2023-10-04 13:46:49 +01:00
Cubic Love 02913e2184 LibCards: Adjust card design
Alter the card dimensions to be 80x110px with a corner radius of 7px.
This is inspired by the dimensions of physical playing cards. It gives
12px of padding between the illustration and the card's border.

Move the card letter and symbol closer to the edge to make space.

Adjust the Club symbol to have the same dimensions as the other symbols.
2023-10-04 13:46:49 +01:00
Kemal Zebari 355e373ce5 LibWeb/MimeSniff: Add MimeType::is_json() 2023-10-04 09:20:47 +01:00
Kemal Zebari b110e4649e LibWeb/MimeSniff: Add MimeType::is_scriptable() 2023-10-04 09:20:47 +01:00
Kemal Zebari 644cc1d7ee LibWeb/MimeSniff: Add MimeType::is_archive() 2023-10-04 09:20:47 +01:00
Kemal Zebari 99a47b9276 LibWeb/MimeSniff: Add MimeType::is_zip_based() 2023-10-04 09:20:47 +01:00
Kemal Zebari 75c42258f2 LibWeb/MimeSniff: Add MimeType::is_font() 2023-10-04 09:20:47 +01:00
Kemal Zebari 3a0fa0e471 LibWeb/MimeSniff: Add MimeType::is_audio_or_video() 2023-10-04 09:20:47 +01:00
Kemal Zebari d2c88faf00 LibWeb/MimeSniff: Add MimeType::is_image() 2023-10-04 09:20:47 +01:00
Tim Ledbetter 2c0f6d8c7b find: Ensure the terminating ; is present when using -exec
The program now terminates with an error if the command passed to
`-exec` is not terminated with a semicolon.

This commit also ensures that the argument containing the terminating
semicolon must be 1 byte long. Previously, any argument whose first
byte was a semicolon was treated as a valid terminator.
2023-10-04 09:14:15 +01:00