Commit graph

28753 commits

Author SHA1 Message Date
Tim Ledbetter
6f1f0710f8 find: Don't canonicalize path operands
The POSIX specification for `find` says that: "Each path operand shall
be evaluated unaltered as it was provided, including all trailing
<slash> characters". This also matches the behavior of `find` on
FreeBSD and Linux.
2023-10-07 11:37:53 +02:00
Tim Ledbetter
881581820f GameOfLife: Allow pressing escape to clear the selected pattern 2023-10-07 11:36:57 +02:00
Tim Ledbetter
f25f2ba047 GameOfLife: Focus on the game board when not editing settings
This makes single key shortcuts work again :^)
2023-10-07 11:36:57 +02:00
Tim Ledbetter
649c7ee11f GameOfLife: Use the GML compiler 2023-10-07 11:36:57 +02:00
Tim Ledbetter
3930702bd2 LibGUI: Make Statusbar::set_segment_count() public
This allows the GML compiler to handle the `segment_count` property
and allows the status bar segment count to be changed after
construction.
2023-10-07 11:36:57 +02:00
Andreas Kling
8a727abd23 LibJS: Move Heap intrusive list manipulation inline
The functions for registering and unregistering MarkedVector, Handle,
etc. were quite prominent in benchmark profiles.

4% speed-up on the entire Kraken benchmark :^)
(including: 7% speed-up on Kraken/imaging-gaussian-blur.js, the current
slowest subtest)
2023-10-07 11:36:28 +02:00
Andreas Kling
0762388709 LibWeb: Make XHR.response an actual XMLDocument for XML documents
Before this change, we were producing a generic DOM::Document, which
was not distinguishable from an XMLDocument by IDL interface type.
2023-10-07 10:19:18 +02:00
Andreas Kling
2b343c9508 LibWeb: Don't crash in XHR.response{,XML} for empty XML document
There were some unhandled paths due to the liberally typed XHR response
object. This patch flushes out those issues by using a tighter type set
in the Variant. (NonnullGCPtr<Object> instead of Value)
2023-10-07 10:19:18 +02:00
Tim Ledbetter
c21efdfc8a LibGfx/ICC: Avoid overflow when checking tag bounds 2023-10-07 09:48:01 +02:00
Andreas Kling
65717e3b75 LibJS: Inline fast case for Value::to_{boolean,number,numeric,primitive}
These functions all have a very common case that can be dealt with a
very simple inline check, often avoiding the need to call an out-of-line
function. This patch moves the common case to inline functions in a new
ValueInlines.h header (necessary due to header dependency issues..)

8% speed-up on the entire Kraken benchmark :^)
2023-10-07 07:13:52 +02:00
stelar7
42d80aab06 LibTLS: Reorder supported ciphers 2023-10-06 22:32:07 +02:00
Tim Ledbetter
80238f29d2 LibIMAP: Handle invalid escape sequences in Quoted-Printable parser
When an invalid escape sequence is encountered, we now output the
characters unaltered instead of crashing.
2023-10-06 22:31:43 +02:00
Tim Ledbetter
debb4edcc8 LibGUI: Update model every 100ms when generating thumbmnails
This dramatically improves the responsiveness of FileManager when
navigating to folders with many images.
2023-10-06 22:18:40 +02:00
Tim Ledbetter
1abc52a689 LibGfx/DDSLoader: Avoid integer overflow in decode_color_block() 2023-10-06 22:18:27 +02:00
Tim Ledbetter
b25efa219b LibGfx/DDSLoader: Allow image dimensions that are not divisible by 4 2023-10-06 22:18:27 +02:00
Tim Ledbetter
9fefb434f2 LibHTTP: Return an error if HTTP request URL is not valid UTF-8 2023-10-06 11:28:17 +03:30
Shannon Booth
57d7637b59 LibWeb: Remove DeprecatedString support from {Child,Parent}Node
No interface pulls this in that requires DeprecatedString support.
2023-10-06 08:25:40 +02:00
Shannon Booth
4321606bba LibWeb: Port Element interface from DeprecatedString
This is the last IDL interface which was using DeprecatedString! :^)
2023-10-06 08:25:40 +02:00
circl
274e0f4988 LibWeb/Canvas: Calculate text width for measureText correctly
Previously this simply added the widths of each glyph, not accounting
for glyph spacing.
2023-10-06 08:23:54 +02:00
Aliaksandr Kalenik
28c9015bd8 LibWeb: Resolve percentages in calc() for font-size
Fixes crashing on https://react.dev/
2023-10-06 08:23:03 +02:00
Tim Ledbetter
b64ed060d8 LibGfx/PNGLoader: Add validation for IHDR width, height and bit depth 2023-10-06 08:21:58 +02:00
Tim Ledbetter
0068e91aad open: Display a meaningful error if the specified file doesn't exist
Previously, the error given for any non-existent file was:
"Failed to open ':'".
2023-10-06 08:20:28 +02:00
Karol Kosek
1f2ab4ebfc LibGUI: Remove unused Widget::(set_)tooltip_deprecated() 2023-10-06 08:20:11 +02:00
Karol Kosek
03a54a519a Userland: Port remaining calls to Widget::set_tooltip_deprecated()
Replaces `set_tooltip_deprecated(string);` with
`set_tooltip(MUST(String::from_deprecated_string(string)));`
purely to get rid of the deprecated function in the following commit.
2023-10-06 08:20:11 +02:00
Karol Kosek
ed3e729d4e Userland: Use nondeprecated set_tooltip for static and formatted strings 2023-10-06 08:20:11 +02:00
Karol Kosek
46a97844c7 Applications: Stop calling set_tooltip_deprecated when we do have String 2023-10-06 08:20:11 +02:00
Karol Kosek
9c923f20f4 Spreadsheet: Make cell metadata hint return String 2023-10-06 08:20:11 +02:00
Karol Kosek
4836d33ae4 Assistant: Port tooltips to String 2023-10-06 08:20:11 +02:00
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
Gurkirat Singh
f51e8e785c Browser: Treat absolute path as local file 2023-10-06 08:12:41 +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