Commit graph

34813 commits

Author SHA1 Message Date
u9g
d00781de36 Spreadsheet: Replace range function with R function
As discussed on discord, the R function is much more user friendly
and shorter to write.
2022-02-21 16:02:04 +03:30
u9g
78804eda85 Spreadsheet: Make R function syntax more simple 2022-02-21 16:02:04 +03:30
Sviatoslav Peleshko
073f472c51 Kernel: Init receive buffer for dynamically created VirtIO console port
We already init receive buffer if we have singleport console, but if
we have multiport console that dynamically allocates ports we never
initted their receive buffers.
2022-02-20 20:32:22 -08:00
Sviatoslav Peleshko
9399698aaa Meta: Add "vdagent" character device for both qemu-vdagent and spicevmc
Previously we added it only if spice was available, but it's possible to
build qemu with --disable-spice --enable-spice-protocol, which provides
qemu-vdagent but no spicevmc. In such case we still configured
qemu-vdagent to use "vdagent" device, but never actually defined it, so
the qemu-vdagent was never working.
2022-02-20 20:32:22 -08:00
Idan Horowitz
7ae2debf6e LibJS: Re-implement String.localeCompare using the StringCompare AO
This follows the ECMA402 spec and means String.prototype.localeCompare
will automatically become actually locale aware once StringCompare is
actually implemented based on UTS #10.
2022-02-20 22:05:59 -05:00
Idan Horowitz
6558f4ae6b LibJS: Implement get Intl.Collator.prototype.compare 2022-02-20 22:05:59 -05:00
Idan Horowitz
0bdb293262 LibJS: Add an initial implementation of Collator Compare Functions
This commit adds an initial implementation (without any real locale
support) of Collator Compare Functions, as well as the matching
CompareStrings AO. These two are used to implement the ECMA402 version
of String.localeCompare() and Int.Collator.compare().
2022-02-20 22:05:59 -05:00
Linus Groh
7feeb2df0d LibJS: Capture values as handles in Promise.prototype.finally callbacks 2022-02-20 23:21:40 +00:00
Linus Groh
47cdd90836 LibJS: Use new NativeFunction::create() in most places
Resolves one FIXME where we can now pass a realm, and sets the length
correctly in a bunch of places that previously didn't.
Also reduces the number of "format function name string from arbitrary
PropertyKey" implementations, although two more remain present in the
AST (used with ECMAScriptFunctionObjects, which is a different beast).
2022-02-20 23:21:40 +00:00
Linus Groh
e4f165d460 LibJS: Add NativeFunction::create() overload for CreateBuiltinFunction
Also take a length argument and set the name and length properties
internally, instead of at the call site. Additionally, allow passing a
realm, prototype, and prefix.
2022-02-20 23:21:40 +00:00
Linus Groh
e657e88ed6 LibJS: Add [[InitialName]] and use it in Function.prototype.toString() 2022-02-20 23:21:40 +00:00
Daniel Bertalan
0be67ef12c Ports: Use the objcopy built as part of the toolchain
Relying on host tools working correctly is not a good idea, as they may
be outdated (and therefore not support features like RELR relocations)
or may not exist at all (like objcopy on macOS).
2022-02-20 23:07:31 +00:00
u9g
b3591d28df Spreadsheet: Prevent infinite loop in Range ctor 2022-02-21 00:11:00 +03:30
kleines Filmröllchen
54b4eb6bd1 Base: Add a quote to the fortunes database 2022-02-20 20:15:13 +00:00
u9g
0d50ac1657 Spreadsheet: Remove Debug Statement 2022-02-20 20:05:31 +00:00
Liav A
53b65ddc41 Kernel: Make i8042 existence check more robust against faulty hardware
Some hardware controllers might reset when trying to do self-test, so
keep the configuration byte to restore it later on.
To ensure we are not missing the response from the i8042 controller,
bump the attempts count to 20 times after initiating self-test check.

Also, try to drain the i8042 controller output buffer as it might be a
early good indication on whether i8042 is present or not.
To ensure we drain all the output buffer, we attempt to read from the
buffer 50 times and not 20 times.
2022-02-20 19:48:46 +00:00
Andrew Kaster
b92df530d3 LibAudio: Simplify empty Audio::Buffer state to be truly empty
The old FIXME asserting that Core::AnonymousBuffer cannot be invalid
or zero-sized is no longer accurate. Add a default constructor for
Audio::Buffer that has all invalid state instead of going to the OS to
allocate a 1 sample buffer for the "no more samples" states in the WAV
and FLAC plugins.
2022-02-20 19:04:59 +00:00
Andrew Kaster
fb179bc289 Fuzzers: Avoid unnecessary ByteBuffer copies in FuzzWAVLoader
Avoid trying to memcpy from 0-byte sources as well, by bailing early on
nullptr data inputs.
2022-02-20 19:04:59 +00:00
Andrew Kaster
0c95d9962c Lagom: Add two-stage build for Fuzzers to enable fuzzing generated code
This allows us to fuzz the generated unicode and timezone database
helpers, and to fuzz things like LibJS using Fuzzilli to get proper
coverage of our unicode handling code.

Update the Azure CI to use the new two-stage build as well, and cleanup
some unused CMake options there.
2022-02-20 19:04:59 +00:00
Linus Groh
bfa4bc6f2d LibJS: Remove unused FunctionNode::set_name() 2022-02-20 15:40:41 +00:00
Linus Groh
93372e0a0d LibJS: Remove unused BoundFunction.h include from FunctionObject.cpp 2022-02-20 15:40:40 +00:00
Jaime Valenzuela Durán
f6000a26a8 Base: Add Gruvbox Dark theme
Add Gruvbox Dark theme matching the terminal one
2022-02-20 15:45:17 +01:00
Liav A
6a998c1a8b HexEditor: Add support for handling PageUp and PageDown key events
In such case, move the cursor up or down the amount of bytes per row,
multiplied by the visible content rectangle height, if possible.
2022-02-20 15:44:36 +01:00
Liav A
c8e691f917 HexEditor: Reduce code duplication when handling key down events
Instead of having the same update block for each event we can use lambda
functions to help updating the cursor when handling key down events.
2022-02-20 15:44:36 +01:00
Karol Kosek
410254dbe2 Spreadsheet: Use the system-wide unsaved changes dialog 2022-02-20 08:40:26 -05:00
Karol Kosek
42d19977b3 HexEditor: Use the system-wide unsaved changes dialog 2022-02-20 08:40:26 -05:00
Karol Kosek
cb332bdd2a Playground: Show last saved time when asked about unsaved changes 2022-02-20 08:40:26 -05:00
Daniel Bertalan
92449e2f1c Ports: Update libjpeg to 9e 2022-02-20 12:42:13 +00:00
Ali Mohammad Pur
97a333608e LibRegex: Make codegen+optimisation for alternatives much faster
Just a little thinking outside the box, and we can now parse and
optimise a million copies of "a|" chained together in just a second :^)
2022-02-20 11:53:59 +01:00
Ali Mohammad Pur
4be7239626 LibRegex: Make parse_disjunction() consume all disjunctions in one frame
This helps us not blow up when too many disjunctions are chained togther
in the regex we're parsing.
Fixes #12615.
2022-02-20 11:53:59 +01:00
Ali Mohammad Pur
627bbee055 LibRegex: Allow quantifiers after quantifiable assertions
While quantifying assertions is very much meaningless, the specification
allows them with annex B's extended grammar for browsers, so read and
apply the quantifiers.
Fixes #12373.
2022-02-20 11:53:59 +01:00
Karol Kosek
6a1ae4c185 LibWeb: Make i, em, address, cite, dfn and var elements italic
Although it is not said that some of the elements need to be italic,
*most* browsers mark them as such to distinguish them from the normal
text, so let's do that too!
2022-02-20 11:50:38 +01:00
Karol Kosek
4e50f8a8b7 LibWeb+Base: Parse font-style CSS property 2022-02-20 11:50:38 +01:00
Brian Gianforcaro
e56262caed Ports/gdb: Implement wait and mourn_inferior overrides for our target
While troubleshooting why gdb wasn't working when attempting to debug
serenity programs I noticed two things:

 - The contract of serenity's `waitpid(..)` appears to be slightly
   different than the generic ptrace target expects. We need to make
   sure we pass `WSTOPPED`, and it can return different errno values
   that we would want to re-try on.

-  The contract of serenity's `ptrace(..)` implementation appears to
   diverge as well, as we are expected to call `PT_ATTACH` before we
   call `PT_CONTINUE`, otherwise `ptrace(..)` will just error out.

These two patches fix the behavior of wait and mourn_inferior so that
they work as expected on serenity and allow us to attach and then wait
for a process to exit while running under gdb.
2022-02-20 11:49:41 +01:00
Brian Gianforcaro
f01e1d0c17 Ports/gdb: Add descriptions to all gdb patches and remove dead code
Before working on the gdb port some more, I wanted to get these patches
cleaned up to have a good base to build upon.
2022-02-20 11:49:41 +01:00
Luke Wilde
9845164f6a LibWeb: Handle markers when reconstructing active formatting elements
The entry we get from the active formatting elements list during the
Rewind step of "reconstruct the active formatting elements" can be a
marker. Previously we assumed it was not a marker, which can trigger
an assertion failure with certain malformed HTML.

If the entry in this step is a marker, the spec simply ignores it.
This is step 6 of the algorithm.

This also makes the index unsigned, as this algorithm is a no-op if
the list is empty.

Additionally, this also adds spec comments to this algorithm.

Fixes #12668.
2022-02-20 10:59:42 +01:00
Kenneth Myhra
655f054b4f LibWeb: Add default padding around contents of text <input> elements
This patch adds a default padding around the contents of text <input>
elements. It adds these defaults to the existing style attribute in
'HTMLInputElement::create_shadow_tree_if_needed()'.

Use a default padding for text <input> elements:
- padding-top and padding-bottom: 1px
- padding-left and padding-right: 2px

These values seems to align with what other browsers do.
2022-02-20 10:57:30 +01:00
Kenneth Myhra
fde9c1bfb2 LibWeb: Add key code 'Esc' to ignored Keydown Events in EventHandler
This filters out the key code 'Esc' so it won't be printed to editable
text nodes, e.g. text <input> elements.
2022-02-20 10:57:30 +01:00
Kenneth Myhra
8a168b2bc0 LibWeb: Add support for navigating text <input> with End key 2022-02-20 10:57:30 +01:00
Kenneth Myhra
939c10b201 LibWeb: Add support for navigating text <input> with Home key 2022-02-20 10:57:30 +01:00
Karol Kosek
f18ae27fe9 HexEditor: Display dirty close icon when the file is changed 2022-02-20 00:06:14 -05:00
Brian Gianforcaro
f648a79f42 Base: Add new quote to fortunes.json 2022-02-19 19:43:24 -08:00
Anton Kling
1ad7aa7136 ls: Add option -1 which lists one file per line 2022-02-19 18:18:13 -08:00
Brian Gianforcaro
70f3fa2dd2 Kernel: Set new process name in do_exec before waiting for the tracer
While investigating why gdb is failing when it calls `PT_CONTINUE`
against Serenity I noticed that the names of the programs in the
System Monitor didn't make sense. They were seemingly stale.

After inspecting the kernel code, it became apparent that the sequence
occurs as follows:

    1. Debugger calls `fork()`
    2. The forked child calls `PT_TRACE_ME`
    3. The `PT_TRACE_ME` instructs the forked process to block in the
       kernel waiting for a signal from the tracer on the next call
       to `execve(..)`.
    4. Debugger waits for forked child to spawn and stop, and then it
       calls `PT_ATTACH` followed by `PT_CONTINUE` on the child.
    5. Currently the `PT_CONTINUE` fails because of some other yet to
       be found bug.
    6. The process name is set immediately AFTER we are woken up by
       the `PT_CONTINUE` which never happens in the case I'm debugging.

This chain of events leaves the process suspended, with the name  of
the original (forked) process instead of the name we inherit from
the `execve(..)` call.

To avoid such confusion in the future, we set the new name before we
block waiting for the tracer.
2022-02-19 18:04:32 -08:00
Luke Wilde
3479f1c4e8 LibWeb: Add support for the options variant of {add,remove}EventListener
This also adds a variant of {add,remove}_event_listener called
{add,remove}_event_listener_with_options.

This is used internally to perform {add,remove}_event_listener with a
default constructed options struct. It was done like this because
default constructing the Variant with the options struct requires the
struct defintions to be present, which requires us to include
AbortSignal.h, which would cause a circular include as AbortSignal.h
includes EventTarget.h.
2022-02-20 02:03:24 +01:00
Luke Wilde
0e6c7eea0f LibWeb: Add AbortSignal as a wrappable type 2022-02-20 02:03:24 +01:00
Luke Wilde
ced7e8ab28 LibWeb: Add support for dictionary types to union types
This also fixes some indentation issues in the generated code.
2022-02-20 02:03:24 +01:00
Luke Wilde
d0ebe80f69 LibWeb: Add dictionary types to idl_type_name_to_cpp_type
This allows dictionaries to appear in sequences, records and unions.
2022-02-20 02:03:24 +01:00
Luke Wilde
567abd52a3 LibWeb: Add support for optional, non-nullable wrapper types 2022-02-20 02:03:24 +01:00
Luke Wilde
86650e37fe LibWeb: Don't perform ToObject when converting values to wrapper types
WebIDL checks the type of the value is Object instead of performing
ToObject on the value.

https://webidl.spec.whatwg.org/#implements
2022-02-20 02:03:24 +01:00