Commit graph

26568 commits

Author SHA1 Message Date
Luke Wilde
1d8f8ea5b1 LibWeb: Add initial support for AbortController and AbortSignal
The DOM specification says that the primary use case for these is to
give Promises abort semantics. It is also a prerequisite for Fetch,
as it is used to make Fetch abortable.
a
2021-09-02 09:12:17 +02:00
Luke Wilde
dd1a49ff93 LibWeb: Add missing shadow including ancestor checks in EventDispatcher 2021-09-02 09:11:24 +02:00
Luke Wilde
bd55f0ad64 LibWeb: Add shadow including ancestor/descendant checks 2021-09-02 09:11:24 +02:00
Mustafa Quraish
dd5ceb74e9 PixelPaint: Ctrl+click on palette colors now sets primary/secondary
Previously it would only change the color of the ColorWidget itself,
but not make it the primary/secondary color. I think it feels nicer
this way, if I'm adding a color to the palette I likely want to use
it.

If you *really* need to only change the color of the palette, you
can just Ctrl+Middle click.
2021-09-02 09:09:12 +02:00
Mustafa Quraish
8d8ec6365b PixelPaint: Allow changing colors temporarily without palette
Previously, if you wanted to use a custom color, the only way to
do so was to first Ctrl+click on one of the pallette colors, which
would just change that palette item. Then, you would need to
manually click on that color.

Now, you can just click on the preview of the primary/secondary
color to open up the picker and only temporarily use the new color
without affecting the palette at all.
2021-09-02 09:09:12 +02:00
Andrew Kaster
58797a1289 Tests: Remove all file(GLOB) from CMakeLists in Tests
Using a file(GLOB) to find all the test files in a directory is an easy
hack to get things started, but has some drawbacks. Namely, if you add
a test, it won't be found again without re-running CMake. `ninja` seems
to do this automatically, but it would be nice to one day stop seeing it
rechecking our globbed directories.
2021-09-02 09:08:23 +02:00
sin-ack
b5a145b466 Tests: Add tests for Core::deferred_invoke 2021-09-02 03:47:47 +04:30
sin-ack
749f62860e LibCore: Remove deferred_invoke overload with Object& parameter
This is not necessary because the user can just use this, which is
referenced until the deferred invocation is complete.
2021-09-02 03:47:47 +04:30
sin-ack
8ea22121ac Userland: Migrate to argument-less deferred_invoke
Only one place used this argument and it was to hold on to a strong ref
for the object. Since we already do that now, there's no need to keep
this argument around since this can be easily captured.

This commit contains no changes.
2021-09-02 03:47:47 +04:30
sin-ack
e9121f8b1f LibCore+Userland: Implement Core::deferred_invoke
Core::deferred_invoke is a way of executing an action after previously
queued events have been processed. It removes the requirement of
having/being a Core::Object subclass in order to defer invocation
through Core::Object::deferred_invoke.

Core::Object::deferred_invoke now delegates to Core::deferred_invoke.
The version with the Object& argument is still present but will be
removed in the following commits.

This commit additionally fixes a new places where the
DeferredInvocationEvent was dispatched to the event loop directly, and
replaces them with the Core::deferred_invoke equivalent.
2021-09-02 03:47:47 +04:30
thankyouverycool
ac24842f48 Welcome: Update tips.txt
Super+Wheeling window opacity was removed in 370d374.
Guilty only of being ahead of its time.
2021-09-02 00:39:12 +02:00
thankyouverycool
902d24136b Welcome: Replace rand()/srand() with AK::get_random_uniform() 2021-09-02 00:39:12 +02:00
thankyouverycool
02121336b4 Welcome: Make license headers uniform 2021-09-02 00:39:12 +02:00
thankyouverycool
03b6f8e7fd LibGUI: Don't draw Scrollbar scrubber when scrubber rect is null
Fixes null scrubbers drawing over the decrement button when
window dimensions dictate they disappear.
2021-09-01 23:02:01 +01:00
thankyouverycool
93e45588e5 LibGUI:: Style Combo and SpinBox buttons as ThickCaps
These suffered the same visual defect as scrollbars when styled
as normal buttons: against backgrounds with the same color as
their highlighting, aspect was lost.
2021-09-01 23:02:01 +01:00
sin-ack
c93c54c656 js: Use CodepointOriented spans and use the codepoint length of token
We were previously using byte-oriented spans. This would work if not for
token.line_column() being in codepoints.
2021-09-01 23:04:26 +02:00
Dawid Wolosowicz
977b62a213 3DFileViewer: Maintain the FPS counter's position
Without this, any resize of the GLContextWidget might leave the label
somewhere it shouldn't be. Toggling fullscreen is a single example of
that behavior.
2021-09-01 23:04:10 +02:00
Andreas Kling
51ae913bfe LibIMAP: Stop leaking a Core::Promise<bool> in IMAP::Client::connect() 2021-09-01 23:02:18 +02:00
Andreas Kling
f4c4b42db9 AK: Move forward() into the std namespace
Same as we already did with move(). This allows compiler diagnostics
and static analyzers like SonarCloud to detect more issues.
2021-09-01 23:02:18 +02:00
Andreas Kling
ee562a8ed7 LibIMAP: Remove accidental use of STL 2021-09-01 23:02:18 +02:00
Karol Kosek
848c4fc43d LibGUI: Show an error message box in the FilePicker on no permissions
The first attempt in #9037 used a special label as a view, if it wanted
to communicate any kind of error, but that sure did look a bit ugly.

Here, we are just showing a message box right before setting the new
path as:
- the contents of the previous directory will be visible in background,
  which I find pretty nice, and
- I don't have to deal with adding a path history vector to reopen
  the previous directory (which might not even exist then). :^)
2021-09-01 23:01:18 +02:00
Dawid Wolosowicz
14c30af7d8 SpaceAnalyzer: Enable icons within the breadcrumbbar
The breadcrumbbar in here serves exactly the same purpose as the one in
File Manager. Given that, I believe it's worth to keep these two
visually consistent.
2021-09-01 23:00:28 +02:00
Thitat Auareesuksakul
1600d5a446 SoundPlayer: Use GUI::ActionGroup for Visualization menu
Removed the old custom checkbox selection code in the Visualization
menu and replaced them with GUI::ActionGroup with set_exclusive
enabled instead :^)
2021-09-01 19:19:35 +02:00
Brian Gianforcaro
4de0f68486 Profiler: Minor static code analysis issues in FlameGraphView 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
16f0248ca2 Profiler: Use = default for empty destructor 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
c0341215de Kernel: Use = default for empty destructors 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
e15be89e18 Meta: Add Sonar Cloud link / badge to the README.md 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
511822c9fe HackStudio: Fix typo in C++ file extension mapping code
This looks like a copy past bug where we were checking "cc" twice
instead of checking for the equivalent header extension.

Found by Sonar Cloud.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
0bd089b282 SoundPlayer: Fix file leak in M3UParser::from_file(..)
Found by Sonar Cloud.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
afa0fb55b0 Kernel: Don't cast to NetworkOrdered<u16>* from random data
NetworkOrdered is a non trivial type, and it's undefined behavior to
cast a random pointer to it and then pretend it's that type.

Instead just call AK::convert_between_host_and_network_endian on the
individual u16*. This suppresses static analysis warnings.

I don't think there was a "bug" in the previous code, it worked, but
it was very brittle.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
668c429900 Kernel: Convert UserOrKernelBuffer callbacks to use AK::Bytes 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
f3baa5d8c9 Kernel: Convert random bytes interface to use AK::Bytes 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
0678ac265c Kernel: Pass InodeMetadata by reference in TmpFSInode::create
This struct is non-trivially large, it makes sense to pass it by
reference instead of by value in the factory method.

Found by Sonar Cloud.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
fee2a03ba9 AK: Pass AK::Format TypeErasedFormatParams by reference in AK::String
This silences a overeager warning in sonar cloud, warning that
slicing could occur with `VariadicFormatParams` which derives from
`TypeErasedFormatParams`.

Reference:
https://sonarcloud.io/project/issues?id=SerenityOS_serenity&issues=AXuVPBW3k92xXUF3qXTE&open=AXuVPBW3k92xXUF3qXTE

This is a continuation of f0b3aa0331.
2021-09-01 18:06:14 +02:00
Linus Groh
8105d3f3d6 LibJS: Change offset in ISODateTimeWithinLimits to actually 24h
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/1d61d6f
2021-09-01 15:11:35 +01:00
Linus Groh
59df50a950 LibJS: Throw RangeError for +/-∞ argument values in Temporal.Duration()
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/ababe1b
2021-09-01 15:11:35 +01:00
Linus Groh
f169ad61a4 LibJS: Make 'options' argument of Calendar prototype functions optional
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/9cc913e
2021-09-01 15:11:35 +01:00
Linus Groh
ed98c1afc7 LibJS: Throw RangeError in PrepareTemporalFields for +/-∞
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/499282a
2021-09-01 15:11:35 +01:00
Linus Groh
e845e7c814 LibJS: Throw TypeError if Instant.prototype.round() options is undefined
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/943018f
2021-09-01 15:11:35 +01:00
Linus Groh
38bef3e28e LibJS: Handle undefined, NaN, and Infinity in ToTemporalDurationRecord
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/d4b9bcf
2021-09-01 15:11:35 +01:00
Timothy Flynn
fd0011989a LibUnicode: Resolve the most likely territory alias when there are many 2021-09-01 14:14:47 +01:00
Timothy Flynn
1fbc5dba08 LibUnicode: Generate Unicode locale likely subtag data
CLDR contains a set of likely subtag data where, given a locale, you can
resolve what is the most likely language, script, or territory of that
locale. This data is needed for resolving territory aliases. These
aliases might contain multiple territories, and we need to resolve which
of those territories is most likely correct for a locale.

Note that the likely subtag data is quite huge (a few thousand entries).
As an optimization encouraged by the spec, we only generate the smallest
subset of this data that we actually need (about 150 entries).
2021-09-01 14:14:47 +01:00
Timothy Flynn
72f49e42b4 LibUnicode: Perform complex Unicode locale alias substitution 2021-09-01 14:14:47 +01:00
Timothy Flynn
9ae7ac4c87 LibUnicode: Generate complex Unicode locale alias matching
Most alias substitutions are "simple", meaning that alias matching is
done by examining a single locale subtag. However, there are a handful
of "complex" aliases where matching is done by examining multiple
subtags. For example, the variant subtag "lojban" causes the locale
"art-lojban" to be canonicalized to "jbo", but only when the language
subtag is "art" (i.e. this should not occur for the locale "en-lojban").

This generates a method to perform complex alias matching.
2021-09-01 14:14:47 +01:00
Timothy Flynn
da89cf9afb LibUnicode: Canonicalize calendar subtags
Calendar subtags are a bit of an odd-man-out in that we must match the
variants "ethiopic-amete-alem" in that order, without any other variant
in the locale. So a separate method is needed for this, and we now defer
sorting the variant list until after other canonicalization is done.
2021-09-01 14:14:47 +01:00
Timothy Flynn
8458f477a4 LibUnicode: Canonicalize timezone subtags 2021-09-01 14:14:47 +01:00
Timothy Flynn
335f985b31 LibUnicode: Canonicalize the subtag "imperial" to "uksystem" 2021-09-01 14:14:47 +01:00
Timothy Flynn
2d90144888 LibUnicode: Canonicalize the subtag "primary" and "tertiary" to "levelN" 2021-09-01 14:14:47 +01:00
Timothy Flynn
409f39b336 LibUnicode: Canonicalize the subtag "names" to "prprname" 2021-09-01 14:14:47 +01:00
Timothy Flynn
f907a7dc38 LibUnicode: Canonicalize the subtag "yes" to "true" 2021-09-01 14:14:47 +01:00