Commit Graph

29996 Commits

Author SHA1 Message Date
Pedro Pereira
5fd58a2663 3DFileViewer: Add 'normals' to Mesh constructor
This change allows a Mesh object to be created with a vector of normals.
2021-11-13 12:52:22 +01:00
Pedro Pereira
7fb8af73bf 3DFileViewer: Add vertex normal parsing to WavefrontOBJLoader
This change allows us to parse vertex-normal lines "vn x y z"
and map them to the correct index on face lines ("f v1/vt1/vn1").
2021-11-13 12:52:22 +01:00
Andreas Kling
a8fed919e7 WindowServer: Clear active input tracking window on menu popup
This fixes an issue with menus not being immediately "usable" with the
the right mouse button after opening a context menu.

The bug was that we were clearing a local pointer to the active input
tracking window instead of the pointer in WindowStack.
2021-11-13 12:48:43 +01:00
Andreas Kling
68dc2e62fb WindowServer: Replace "Pin/Unpin Window" => "Always on Top" 2021-11-13 12:48:43 +01:00
Andreas Kling
d21dc1f451 Everywhere: Replace "virtual desktop" => "workspace" 2021-11-13 12:48:43 +01:00
Tim Schumacher
8417c0fb1e Tests/LibRegex: Add tests for line end anchors in PosixBasic 2021-11-13 15:06:52 +03:30
Tim Schumacher
ff38062318 LibRegex: Correctly translate BRE pattern end anchors
Previously we were always choosing the "nothing special" code path, even
if the dollar symbol was at the end of the pattern (and therefore should
have been considered special).

Fix that by actually checking if the pattern end follows, and emitting
the correct instruction if necessary.
2021-11-13 15:06:52 +03:30
Daniel Bertalan
fe1726521a Meta: Resolve cyclic dependency between LibPthread and libc++
libc++ uses a Pthread condition variable in one of its initialization
functions. This means that Pthread forwarding has to be set up in LibC
before libc++ can be initialized. Also, because LibPthread is written in
C++, (at least some) parts of the C++ standard library have to be linked
against it.

This is a circular dependency, which means that the order in which these
two libraries' initialization functions are called is undefined. In some
cases, libc++ will come first, which will then trigger an assert due to
the missing Pthread forwarding.

This issue isn't necessarily unique to LibPthread, as all libraries that
libc++ depends on exhibit the same circular dependency issue.

The reason why this issue didn't affect the GNU toolchain is that
libstdc++ is always linked statically. If we were to change that, I
believe that we would run into the same issue.
2021-11-13 11:15:33 +00:00
Maciej
62169fda03 SystemMonitor: Ask user before trying to kill/stop process
These actions can be dangerous, especially for important system
processes. Let's make accidental breaking of the system a bit
harder. :^)
2021-11-13 11:14:20 +00:00
Maciej
7f7db7dbec SystemMonitor: Add Delete as alternate shortcut for killing a process
This matches behaviour of other "system monitors", like Windows's Task
Manager
2021-11-13 11:14:20 +00:00
Elyse
f19cb6bb22 SoundPlayer: Add keyboard shortcuts for stop and volume
These shortcuts allow us to stop the player (key S) and adjust
the volume level (key Up and key Down).
2021-11-13 11:53:31 +01:00
Elyse
ccced92ac2 SoundPlayer: Make 'volume_slider' a member variable
This change will allow us to modify the volume slider from any event
inside the widget.
2021-11-13 11:53:31 +01:00
Elyse
11a4fa6067 SoundPlayer: Allow volume output of up to 150%
Previously the volume slider could go up to 150% but the real
output volume stayed the same between 100% and 150%.
2021-11-13 11:53:31 +01:00
Andreas Kling
ea8c6e796f SystemMonitor: Shrink oversized GroupBox margins
Now that GroupBox reports accurate content margins, we don't need to
account for the title height in internal layout margins.
2021-11-13 11:47:46 +01:00
Tim Schumacher
6fe37a1e52 Utilities/grep: Implement using multiple patterns 2021-11-13 11:42:26 +01:00
Tim Schumacher
c94574d313 Utilities/tar: Ignore directory entry if it already exists 2021-11-13 11:42:08 +01:00
Liav A
1ae76676a5 Kernel/Storage: Don't use interrupts when identifying AHCI devices
Don't use interrupts when trying to identify a device that is connected
to a port on the AHCI controller, and instead poll for changes in status
to end the transaction.

Not only this simplifies the initialization sequence, it ensures that
for whatever reason the controller doesn't send an IRQ, we are never
getting stuck at this point.
2021-11-13 10:05:22 +01:00
Liav A
4dc3617f3c Kernel/Storage: Move all ATA related code to a new subdirectory
Like what happened with the PCI and USB code, this feels like the right
thing to do because we can improve on the ATA capabilities and keep it
distinguished from the rest of the subsystem.
2021-11-13 10:05:22 +01:00
Daniel Bertalan
648a139af3 Kernel+LibC: Pass off_t to pread() via a pointer
`off_t` is a 64-bit signed integer, so passing it in a register on i686
is not the best idea.

This fix gets us one step closer to making the LLVM port work.
2021-11-13 10:04:46 +01:00
Linus Groh
7f8dc395c1 LibJS: Implement Temporal.ZonedDateTime.prototype.with() 2021-11-13 00:25:40 +00:00
Linus Groh
0d9defdad8 LibJS: Rename MatchBehavior members back to their old names
I changed this in 6ef1a27 to "match the spec", but the spec calls it
`match exactly` and `match minutes` - so what we had before was correct
and the change made no sense whatsoever.
2021-11-13 00:25:40 +00:00
Andreas Kling
778268b1a5 LibWeb: Allow setting the width & height properties on <canvas> elements 2021-11-13 00:55:07 +01:00
Andreas Kling
47edd6ae89 LibGfx: Remove all load_FORMAT_from_memory() decoder wrappers
There are no more clients of these APIs, now that everyone has been made
to use ImageDecoderPlugin objects instead.
2021-11-13 00:55:07 +01:00
Andreas Kling
481e7b7971 SpiceAgent: Use image decoder plugins instead of deprecated wrappers 2021-11-13 00:55:07 +01:00
Andreas Kling
62ce7653cb LibGUI: Use PNGImageDecoderPlugin for ELF icon extraction
Getting rid of all the remaining calls to load_png_from_memory() and the
related wrappers for each decoder.
2021-11-13 00:55:07 +01:00
Andreas Kling
b189c88ec2 Fuzzers: Use ImageDecoders instead of load_FORMAT_from_memory() wrappers 2021-11-13 00:55:07 +01:00
Tom
32d59257d6 WindowServer: Ensure menu visibility after pushing menu to the stack
We need to make sure the menu was pushed to the open menu stack before
calling set_visible, as this may trigger cursor re-evaluation, which
in turn expects the menu to be considered open.

Fixes #10836
2021-11-13 00:38:36 +01:00
Linus Groh
81786f6abe Base: Update synopsis of grep(1) and tr(1) manpages as well 2021-11-12 21:59:25 +00:00
Linus Groh
2a04f1fa80 Base: Add missing options to grep(1) and tr(1) manpages 2021-11-12 21:56:02 +00:00
Tim Schumacher
c81cef614a Utilities/grep: Implement line-counting mode 2021-11-12 21:29:18 +00:00
Tim Schumacher
7ce693840b Utilities/tr: Implement squeezing repeated characters 2021-11-12 21:23:29 +00:00
Timothy Flynn
1f2ac0ab41 LibUnicode: Move number formatting code generator to UnicodeNumberFormat 2021-11-12 20:46:38 +00:00
Timothy Flynn
04e6b43f05 LibUnicode: Move (soon-to-be) common code out of GenerateUnicodeLocale
The data used for number formatting is going to grow quite a bit when
the cldr-units package is parsed. To prevent the generated UnicodeLocale
file from growing outrageously large, the number formatting data can go
into its own file. To prepare for this, move code that will be common
between the generators for UnicodeLocale and UnicodeNumberFormat to the
utility header.
2021-11-12 20:46:38 +00:00
Linus Groh
a53542e0a3 LibJS: Clear exception after running each queued Promise job
It's not what the spec tells us to do. In fact, the spec tells us the
exact opposite:

    9.5 Jobs and Host Operations to Enqueue Jobs
    https://tc39.es/ecma262/#sec-jobs

    A Job is an Abstract Closure with no parameters that initiates an
    ECMAScript computation when no other ECMAScript computation is
    currently in progress.
    ...
    Their implementations must conform to the following requirements:
    - ...
    - The Abstract Closure must return a normal completion, implementing
      its own handling of errors.

However, this turned out to not be true in all cases. More specifically,
the NewPromiseReactionJob AO returns the completion result of calling a
user-provided function (PromiseCapability's [[Resolve]] / [[Reject]]),
which may be an abrupt completion:

    27.2.2.1 NewPromiseReactionJob ( reaction, argument )
    https://tc39.es/ecma262/#sec-newpromisereactionjob

    1. Let job be a new Job Abstract Closure with no parameters that
       captures reaction and argument and performs the following steps
       when called:
       ...
       h. If handlerResult is an abrupt completion, then
          i. Let status be Call(promiseCapability.[[Reject]],
             undefined, « handlerResult.[[Value]] »).
       i. Else,
          i. Let status be Call(promiseCapability.[[Resolve]],
             undefined, « handlerResult.[[Value]] »).
       j. Return Completion(status).

Interestingly, this case is explicitly handled in the HTML spec's
implementation of jobs as microtasks:

    8.1.5.3.3 HostEnqueuePromiseJob(job, realm)
    https://html.spec.whatwg.org/webappapis.html#hostenqueuepromisejob

    2. Queue a microtask on the surrounding agent's event loop to
       perform the following steps:
       ...
       5. If result is an abrupt completion, then report the exception
          given by result.[[Value]].

This is precisely what all the major engines do - but not only in
browsers; the provided code snippet in the test added in this commit
works just fine in Node.js, for example.

SpiderMonkey:
https://searchfox.org/mozilla-central/rev/25997ce8267ec9e3ea4b727e0973bd9ef02bba79/js/src/builtin/Promise.cpp#6292
https://searchfox.org/mozilla-central/rev/25997ce8267ec9e3ea4b727e0973bd9ef02bba79/js/src/builtin/Promise.cpp#1277
https://searchfox.org/mozilla-central/rev/25997ce8267ec9e3ea4b727e0973bd9ef02bba79/js/src/vm/JSContext.cpp#845

JavaScriptCore:
https://trac.webkit.org/browser/webkit/trunk/Source/JavaScriptCore/builtins/PromiseOperations.js?rev=273718#L562
https://trac.webkit.org/browser/webkit/trunk/Source/JavaScriptCore/runtime/JSMicrotask.cpp?rev=273718#L94

V8:
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/builtins/promise-abstract-operations.tq;l=481;drc=a760f03a6e99bf4863d8d21c5f7896a74a0a39ea
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/builtins/builtins-microtask-queue-gen.cc;l=331;drc=65c9257f1777731d6d0669598f6fe6fe65fa61d3

This should probably be fixed in the ECMAScript spec to relax the rule
that Jobs may not return an abrupt completion, just like in the HTML
spec. The important bit is that those are not surfaced to user code in
any way.
2021-11-12 15:35:03 +02:00
Brendan Coles
754bcea12a Base: Add /res/icons/16x16/sidebar.png icon for PDFViewer 2021-11-12 13:24:35 +00:00
Ali Mohammad Pur
c08bfd450b Meta: Update the gdb script for the new RefPtr layout 2021-11-12 13:01:59 +00:00
Ali Mohammad Pur
070d2eaa51 LibJS+LibTest+js: Convert BC::Interpreter::run to ThrowCompletionOr<>
Note that this is just a shallow API change.
2021-11-12 13:01:59 +00:00
Ali Mohammad Pur
3b0bf05fa5 LibJS: Implement async functions as generator functions in BC mode
This applies a simple transformation, and adds a simple wrapper that
translates the generator interface to the async function interface.
2021-11-12 13:01:59 +00:00
Ali Mohammad Pur
c604e95993 LibJS: Run the queued promise reaction jobs on bytecode interpreter exit
This is the same as what the AST interpreter does.
2021-11-12 13:01:59 +00:00
Ali Mohammad Pur
e4a7f1a696 LibJS: Make Bytecode::Interpreter return the popped frame
And use it to _correctly_ implement state saving for generators.
Prior to this, we were capturing the caller frame, which is completely
irrelevant to the generator frame.
2021-11-12 13:01:59 +00:00
Ali Mohammad Pur
b96118b5d1 LibJS: Fix codegen for nodes after try statements without 'finally'
Previously we were just dropping them on the ground :P
2021-11-12 13:01:59 +00:00
Ali Mohammad Pur
5a38f86f1b LibJS: Use a 'Return' completion for generator object body evaluation
The comment a few lines above explains the issue, this one was forgotten
and caused generator functions to return `undefined` when called.
2021-11-12 13:01:59 +00:00
Ali Mohammad Pur
3ec0183b51 LibJS: Use the correct prototype for generator functions 2021-11-12 13:01:59 +00:00
Luke Wilde
f65d25682c LibJS: Implement Temporal.ZonedDateTime.prototype.subtract 2021-11-12 09:24:36 +00:00
Luke Wilde
9b8524b463 LibJS: Implement Temporal.ZonedDateTime.prototype.add 2021-11-12 09:24:36 +00:00
Timothy Flynn
89523f70cf LibJS: Begin implementing Intl.NumberFormat.prototype.format
There is quite a lot to be done here so this is just a first pass at
number formatting. Decimal and percent formatting are mostly working,
but only for standard and compact notation (engineering and scientific
notation are not implemented here). Currency formatting is parsed, but
there is more work to be done to handle e.g. using symbols instead of
currency codes ("$" instead of "USD"), and putting spaces around the
currency symbol ("USD 2.00" instead of "USD2.00").
2021-11-12 09:17:08 +00:00
Timothy Flynn
0469006263 LibJS: Change Intl's PatternPartition record to hold a String value
It was previously holding a StringView, which was either a view into a
LibUnicode-generated string or a string passed from the user.

Intl.NumberFormat will need this record to hold internally-created
strings, so a StringView will not suffice (the way the steps are laid
out, that view will ultimately end up dangling).

This shouldn't be too wasteful since the StringView it was holding was
converted to a String eventually anyways.
2021-11-12 09:17:08 +00:00
Timothy Flynn
be69eae651 LibUnicode: Precompute the compact scale of each number formatting rule
This will be needed for the ComputeExponentForMagnitude AO for compact
formatting, namely step 5b:

  Let exponent be an implementation- and locale-dependent (ILD) integer
  by which to scale a number of the given magnitude in compact notation
  for the current locale.
2021-11-12 09:17:08 +00:00
Timothy Flynn
230b133ee3 LibUnicode: Parse number formats into zero/positive/negative patterns
A number formatting pattern in the CLDR contains one or two entries,
delimited by a semi-colon. Previously, LibUnicode was just storing the
entire pattern as one string. This changes the generator to split the
pattern on that delimiter and generate the 3 unique patterns expected by
ECMA-402.

The rules for generating the 3 patterns are as follows:

* If the pattern contains 1 entry, it is the zero pattern. The positive
  pattern is the zero pattern prepended with {plusSign}. The negative
  pattern is the zero pattern prepended with {minusSign}.

* If the pattern contains 2 entries, the first is the zero pattern, and
  the second is the negative pattern. The positive pattern is the zero
  pattern prepended with {plusSign}.
2021-11-12 09:17:08 +00:00
Timothy Flynn
1244ebcd4f LibUnicode: Parse and generate standard accounting formatting rules
Also known as "currency-accounting" in some CLDR documentation.
2021-11-12 09:17:08 +00:00