Andreas Kling
09cba7c780
LibGfx: Use ErrorOr<T> for Bitmap infrastructure used by ShareableBitmap
...
This also allows us to get rid of the ShareableBitmap(Bitmap)
constructor which was easy to misuse. Everyone now uses Bitmap's
to_shareable_bitmap() helper instead.
2021-11-08 00:35:27 +01:00
Andreas Kling
8262bbf624
LibGfx: Use ErrorOr<T> for Bitmap::cropped()
2021-11-08 00:35:27 +01:00
Andreas Kling
5e41c70e83
LibGfx: Use ErrorOr<T> for Bitmap::scaled()
2021-11-08 00:35:27 +01:00
Andreas Kling
db90b4554e
LibGfx: Use ErrorOr<T> for Bitmap::flipped()
2021-11-08 00:35:27 +01:00
Andreas Kling
69c4614a94
LibGfx: Use ErrorOr<T> for Bitmap::rotated()
2021-11-08 00:35:27 +01:00
Andreas Kling
2da4cfcc80
LibGfx: Use ErrorOr<T> for Bitmap::clone()
2021-11-08 00:35:27 +01:00
Andreas Kling
c417820bff
LibGfx: Use ErrorOr<T> for Bitmap::try_create_shareable()
2021-11-08 00:35:27 +01:00
Andreas Kling
83d1460ee8
LibGfx: Use ErrorOr<T> for Bitmap::try_create_wrapper()
2021-11-08 00:35:27 +01:00
Andreas Kling
f23f99d51b
LibGfx: Use ErrorOr<T> for Bitmap::try_create_with_anonymous_buffer()
2021-11-08 00:35:27 +01:00
Andreas Kling
c6b4e7a2f6
LibIPC: Add ClientConnection::shutdown_with_error()
...
Before this, we only had ClientConnection::did_misbehave() to report an
error and shut the connection down. But it's not fair to say that *all*
errors are the client misbehaving! A typical non-misbehavior is resource
allocation failure on the server side.
2021-11-08 00:35:27 +01:00
Andreas Kling
e5dde37e24
AK: Bring AK::Error into the global namespace
2021-11-08 00:35:27 +01:00
Andreas Kling
a54be656ae
LibRegex: Don't push LibRegex's "Error" into the global namespace
2021-11-08 00:35:27 +01:00
Andreas Kling
af562c857e
LibGfx: Use ErrorOr<T> for Gfx::Bitmap::allocate_backing_store()
2021-11-08 00:35:27 +01:00
Andreas Kling
e2eabb4132
LibCore: Use ErrorOr<T> in Core::AnonymousBuffer
2021-11-08 00:35:27 +01:00
Linus Groh
a3b8303f3c
LibJS: Fix modulo() template argument deduction on i686
...
Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp:283:24:
note: deduced conflicting types for parameter 'T' ('long long int'
and 'long int')
283 | nanosecond = modulo(nanosecond, 1000l);
| ~~~~~~^~~~~~~~~~~~~~~~~~~
Worked fine on x86_84 :yakshrug:
2021-11-07 21:33:56 +00:00
Linus Groh
b3ea7332b2
LibJS: Fix use of "modulo" for negative values in balance_time()
2021-11-07 21:11:31 +00:00
Linus Groh
3d84fb64c3
LibJS: Add a modulo() function to represent the "x modulo y" notation
...
This *not* being the same as C++ "%" in all cases is a massive footgun,
and hopefully one I came across for the last time.
2021-11-07 21:11:31 +00:00
Linus Groh
e93ce1ff69
LibJS: Fix nanoseconds formatting in format_time_zone_offset_string()
...
Two issues:
- The format string said "{:9}", which left-pads with spaces and not
zeros as required
- Even when correcting that, we were not accounting for step 11 b:
"Set fraction to the longest possible substring of fraction starting
at position 0 and not ending with the code unit 0x0030 (DIGIT ZERO)."
We can safely use trim() for that as the formatted string is known to
not contain only zeros (which would leave the left-most in place).
Also adds tests for "UTC" and various numeric offsets.
2021-11-07 20:06:28 +00:00
Linus Groh
68d80d239b
LibJS: Fix fraction substring in parse_time_zone_offset_string()
...
We're supposed to get the substring from `fraction`, which is guaranteed
to have the required length. `fraction_part` is the user-supplied value
and trying to get a substring view from 0-9 might crash.
2021-11-07 20:01:31 +00:00
Linus Groh
df2ccb3d38
LibJS: Implement Temporal.Duration.prototype.toLocaleString()
2021-11-07 15:31:28 +01:00
Linus Groh
90fa356b93
LibJS: Implement Temporal.Duration.prototype.toJSON()
2021-11-07 15:31:28 +01:00
Linus Groh
b2548393d2
LibJS: Implement Temporal.Duration.prototype.toString()
...
I hereby claim "implemented largest AO in LibJS ever" (450 lines). :^)
2021-11-07 15:31:28 +01:00
Linus Groh
36b51276d5
LibJS: Change calendar_date_add() date parameter from PlainDate to Value
...
Turns out use of this AO is a bit more flexible than I anticipated.
2021-11-07 15:31:28 +01:00
Luke Wilde
706296374b
LibJS: Implement Temporal.ZonedDateTime.prototype.equals
2021-11-07 15:35:16 +02:00
Luke Wilde
ac12581140
LibJS: Implement Temporal.ZonedDateTime.compare
2021-11-07 15:35:16 +02:00
Luke Wilde
c9ec3295d9
LibJS: Implement Temporal.ZonedDateTime.from
2021-11-07 15:35:16 +02:00
Luke Wilde
2b89d2a360
LibJS: Implement ToTemporalZonedDateTime and the required AOs
2021-11-07 15:35:16 +02:00
Tim Schumacher
3d3304332a
LibC: Correctly evaluate addr in IN6_IS_ADDR_LOOPBACK
...
Without putting the argument in parentheses we might not evaluate it
correctly.
2021-11-06 00:31:01 -07:00
Sam Atkins
f22043a225
LibGfx: Add FlagRole to GUI::Variant
2021-11-05 23:34:22 +01:00
Sam Atkins
d68268f791
LibGfx: Use read_bool_entry()
to read theme flags
...
I didn't notice this function existed the first time around. Oops!
2021-11-05 23:34:22 +01:00
Luke Wilde
b8db0ddc70
LibJS: Implement Temporal.ZonedDateTime.prototype.withCalendar
2021-11-05 09:49:47 +01:00
Luke Wilde
58bb73b60f
LibJS: Implement Temporal.ZonedDateTime.prototype.withTimeZone
2021-11-05 09:49:47 +01:00
Luke Wilde
d5f2745a19
LibJS: Implement Temporal.ZonedDateTime.prototype.withPlainDate
2021-11-05 09:49:47 +01:00
Luke Wilde
132a56f07c
LibJS: Implement Temporal.ZonedDateTime.prototype.withPlainTime
2021-11-05 09:49:47 +01:00
Andreas Kling
c098a6495b
LibGUI: Use default Button and TextBox heights in InputBox
2021-11-05 01:37:00 +01:00
Linus Groh
1dc32fed8f
LibJS: Adjust approximated result in year_from_time() if necessary
2021-11-05 01:18:27 +01:00
Linus Groh
37146e305a
LibJS: Account for leap days in year_from_time()
...
A year has 365.2425 days, not 365. This lead to off-by-one results for
time values (milliseconds) near the end of a year, which would lead to
calculation issues and crashes in other AOs.
Fixes #10796 .
2021-11-05 01:09:18 +01:00
Linus Groh
0dae7c9420
LibJS: Replace a couple of TODO()'s in Temporal with InternalError
...
This helps us to distinguish between crashes because of incomplete code
paths and crashes because of genuine bugs more easily when running
test262.
2021-11-04 23:59:40 +01:00
Linus Groh
dd1a808f7e
LibJS: Remove TODO() from implemented code path
...
Well, that's embarassing. TODO()'d it, implemented it, forgot to remove
the TODO().
2021-11-04 23:59:40 +01:00
networkException
2462fb5f0e
LibWeb: Convert NumberType::Integer to i64 instead of i32
2021-11-04 23:45:07 +01:00
Ben Wiederhake
f9167c9265
Base+LibCore: Store booleans in human-readable format
...
Fixes #10640 .
2021-11-04 23:44:02 +01:00
Ben Wiederhake
2798a19c70
LibC+LookupServer: Use u32 for the endpoint magic
...
That's how LibIPC treats it, too.
2021-11-05 00:17:01 +03:30
Ben Wiederhake
34a8ee6da5
LibC+LookupServer: Compute magic number to avoid hardcoding
2021-11-05 00:17:01 +03:30
Tor-björn Claesson
53c8faaafc
LibCore: Trim trailing whitespaces from ConfigFile values
...
Previously, trailing whitespaces were not removed from values in
config files. This could cause errors with poorly formatted files.
This commit fixes this by trimming whitespaces from values in
ConfigFile::reparse().
2021-11-04 18:53:17 +01:00
Linus Groh
38809f90d9
LibJS: Introduce & use FormatISOTimeZoneOffsetString
...
This is a normative change in the Temporal spec.
See: 6b7a993
2021-11-04 16:45:54 +01:00
Linus Groh
d129e1ff29
LibJS: Move common code into RejectObjectWithCalendarOrTimeZone
...
This is an editorial change in the Temporal spec.
See: 5654fe0
2021-11-04 16:17:26 +01:00
Linus Groh
bb60629d3b
LibJS: Update ToTemporalTimeRecord to not require all properties
...
This is a normative change in the Temporal spec.
See: 84b7d53
2021-11-04 16:17:26 +01:00
Luke Wilde
c001926752
LibJS: Implement Temporal.ZonedDateTime.prototype.startOfDay
2021-11-04 12:11:33 +01:00
Andreas Kling
99a33c9a67
Revert "LibIPC: Use a zero-delay timer for message processing"
...
This reverts commit 3bed7d5a5e
.
As discovered by tomuta, this caused a large increase in WindowServer
CPU usage.
2021-11-03 19:56:47 +01:00
Andreas Kling
60a245b065
LibGUI: Don't ask WindowServer to destroy windows during app teardown
...
This makes teardown faster since we don't have to wait for responses to
each destroy_window request. It also avoids doing IPC during teardown,
which is a general source of problems.
2021-11-03 19:56:47 +01:00