Commit graph

36398 commits

Author SHA1 Message Date
Hendiadyoin1 50b6e74d33 LibIPC: Add IPCErrorOr Type alias 2022-03-28 23:08:08 +02:00
Hendiadyoin1 6b20496758 AK: Add appendln helper to SourceGenerator 2022-03-28 23:08:08 +02:00
Hendiadyoin1 f6f7280fe3 AK: Explicitly move value String in SourceGenerator::set 2022-03-28 23:08:08 +02:00
Hendiadyoin1 14caecefb1 AK: Make SourceGenerator move constructible
This makes us able to return one from a function
2022-03-28 23:08:08 +02:00
Sam Atkins 6672c19c93 LibWeb: Parse @font-face rules
This is very limited for now, only caring about `font-family` and `src`.
2022-03-28 22:25:25 +02:00
Sam Atkins 804b8c85e8 LibWeb: Implement initial CSSFontFaceRule and FontFace classes
For now, this is the bare minimum that's needed: font-family and src.
2022-03-28 22:25:25 +02:00
Sam Atkins 1dcde57922 LibWeb: Bring "parse a list of declarations" closer to spec
The work to create a PropertyOwningCSSStyleDeclaration is now moved to
convert_to_style_declaration() instead.
2022-03-28 22:25:25 +02:00
Sam Atkins da1a819858 LibWeb: Rename parse_css_declaration() -> parse_css_style_attribute() 2022-03-28 22:25:25 +02:00
Ali Mohammad Pur bcbe258619 LibCore: Set the correct invariant length for consecutive short options
When completing `ls -l` to add another short option, the invariant
length should be zero as we are not replacing anything with our
suggestion.
Also skip the initial dash if there already is one.
Fixes #13301.
2022-03-28 20:02:49 +02:00
Karol Kosek d665492e35 Spreadsheet: Don't remove on_change tab function after loading a file
Forgot to remove that in c0c9825f67, as
this function was no longer declared and used... Until the previous
commit.

This meant that pressing the F2 key after opening a file no longer
matched the current tab.
2022-03-28 22:28:40 +04:30
Karol Kosek 07b369b7d9 Spreadsheet: Create rename action using the GUI::CommonActions helper
Besides from reusing more parts from the code, this allows us to call
the action using the F2 key. That is also the reason why we have
to reassign `m_tab_context_menu_sheet_view` on tab change.
2022-03-28 22:28:40 +04:30
Karol Kosek 3b352e46d6 Spreadsheet: Reuse save and rename actions
These parts of code were identical to their action counterparts.
2022-03-28 22:28:40 +04:30
Daniel Bertalan b23edd418c LibC: Fix inttypes.h macros for x86-64 and extend them
On x86-64, `int64_t` is defined to be `long` (not `long long`) , so for
printing, the "l" format specifier has to be used instead of i686's
"ll".

A couple of these macros weren't updated when the x86-64 target was
added, so using them produced warnings like this:

> warning: format specifies type 'long long' but the argument has type
> 'int64_t' (aka 'long') [-Wformat]
>
>       "DW_CFA_GNU_negative_offset_extended(%" PRId64 ")\n", offset);
>       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

This commit changes the macros to be correct for both architectures, and
reorders them to be consistent and adds a couple missing ones for the
sake of completeness.
2022-03-28 22:24:05 +04:30
Tim Schumacher 022aed2541 Ports: Upgrade to sed 4.8 2022-03-28 10:38:02 -07:00
Tim Schumacher 4917a610ab LibC: Partially implement __fpending 2022-03-28 10:38:02 -07:00
Simon Wanner 304dbb0242 LibWeb: Set a cell's content width based on the column(s) it's in 2022-03-28 15:25:25 +02:00
Simon Wanner 6dbd00970d LibWeb: Calculate a cell's width using min-content 2022-03-28 15:25:25 +02:00
Simon Wanner e5a779aecf LibWeb: Apply the layout_mode argument in BFC::compute_width 2022-03-28 15:25:25 +02:00
Simon Wanner 9b3229da17 LibWeb: Distribute the width of a table cell spanning multiple columns 2022-03-28 15:25:25 +02:00
Simon Wanner 4fe154bd6a LibWeb: Expand the last cell in a row to the right edge 2022-03-28 15:25:25 +02:00
Simon Wanner 5f265eebf5 LibWeb: Apply a table row's height to all cells 2022-03-28 15:25:25 +02:00
Luke Wilde bd809b7787 LibJS: Add more delete operator tests 2022-03-28 14:05:33 +02:00
Luke Wilde 7cc53b7ef1 LibJS/Bytecode: Implement the delete unary expression
`delete` has to operate directly on Reference Records, so this
introduces a new set of operations called DeleteByValue, DeleteVariable
and DeleteById. They operate similarly to their Get counterparts,
except they end in creating a (temporary) Reference and calling delete_
on it.
2022-03-28 14:05:33 +02:00
Luke Wilde 589c3771e9 LibJS: Only store MemberExpression object when loading a computed prop
When calling emit_load_from_reference with a MemberExpression, it is
only necessary to store the result of evaluating MemberExpression's
object when performing computed property lookup.

This allows us to skip unnecessary stores for identifier lookup.
For example, this would generate 3 unnecessary stores:
```
> Temporal.PlainDateTime.prototype.add
JS::Bytecode::Executable (REPL)
1:
[   0] GetVariable 0 (Temporal)
[  28] Store $2
[  30] GetById 1 (PlainDateTime)
[  40] Store $3
[  48] GetById 2 (prototype)
[  58] Store $4
[  60] GetById 3 (add)
```

With this, it generates:
```
> Temporal.PlainDateTime.prototype.add
JS::Bytecode::Executable (REPL)
1:
[   0] GetVariable 0 (Temporal)
[  28] GetById 1 (PlainDateTime)
[  38] GetById 2 (prototype)
[  48] GetById 3 (add)
```
2022-03-28 14:05:33 +02:00
Luke Wilde 88901182b8 LibJS: Generate update Jump in for/in/of only if block is not terminated
The body of for/in/of can contain an unconditional block terminator
(e.g. return, throw), so we have to check for that before generating
the Jump to the loop update block.
2022-03-28 14:05:33 +02:00
Luke Wilde 741745baab LibJS/Bytecode: Update NewArray stringifier to print a register range
NewArray now only contains two elements maximum in `m_elements` to
indicate the range of registers to create the array from.

However, `m_element_count` still contains how many registers are in the
range and the stringifier was not updated to account for this. Thus, if
the range contained more than 2 registers, it would do a read OOB on
`m_elements`.

This makes it now just print the first and second entries in
`m_elements` in the format of `[<reg>-<reg>]`.
2022-03-28 14:05:33 +02:00
Lorenz Steinert 78f8821152 Kernel: Propagate HIDManagement initialisation error to init
Initialisation errors for HIDManagement are now returned to the init. In
the init we assert by MUST if we get an error.
2022-03-28 11:36:17 +02:00
Lorenz Steinert d3ce97e8b2 Kernel/Devices/HID: Propagate errors of HIDDevices properly
Some error indication was done by returning bool. This was changed to
propagate the error by ErrorOr from the underlying functions. The
returntype of the underlying functions was also changed to propagate the
error.
2022-03-28 11:36:17 +02:00
Brian Gianforcaro 83e96569ed LibAudio: Make sure we initialize ResampleHelper member variables
Found by Static Analysis: Sonar Cloud
2022-03-27 16:43:05 -07:00
Brian Gianforcaro ecc0459f76 LibC: Fix potential double free in ttyname_r_for_directory
If we break out of the loop before we attempt to allocate again,
then we double free the memory pointed to by `name_path`.

Found by Static Analysis: Sonar Cloud
2022-03-27 16:43:05 -07:00
Brian Gianforcaro 4674577d80 Everywhere: Rename CommandResult stdout, stderr members to output, error
The names stdout / stderr are bound to conflict with existing
declarations when compiling against other LibC's. The build on OpenBSD
is broken for this reason at the moment.

Lets rename the members to more generic names to resolve the situation.
2022-03-27 16:41:39 -07:00
Ali Chraghi f3f3b32a00 Base: Add SQL filetype icon 2022-03-27 23:16:38 +01:00
Ali Chraghi cee460ab0b Base: Add Database filetype icon 2022-03-27 23:16:38 +01:00
Andreas Kling 3ac9ea369d LibWeb: Don't choke on ICB with inline children
Let's relax our assumption about what kind of children the ICB has.
This is preparation for loading XHTML documents.
2022-03-27 23:38:27 +02:00
Andreas Kling 4575ab558b LibWeb: Make whitespace collapsing stateless
Previously, the whitespace collapsing code had a parameter telling it
whether the previous text node ended in whitespace. This was not
actually necessary, so let's get rid of it.
2022-03-27 21:56:21 +02:00
Daniel Bertalan 66582a875f Meta: Specify -z when decompressing tar.gz archives
While GNU tar automatically detects the used compression algorithm,
POSIX requires that we specify -z if the tarball is compressed with
gzip.

Fixes a build error on OpenBSD.
2022-03-27 12:17:59 -07:00
Linus Groh 192f4b0258 LibWeb: Ensure lazy WindowObject creation when activating event handler 2022-03-27 20:14:25 +01:00
Andreas Kling f9e8f02451 LibWeb: Don't crash in IFC if very first chunk is collapsible whitespace 2022-03-27 21:06:02 +02:00
Ali Mohammad Pur b732edf61c LibLine: Avoid pointless size_t <-> ssize_t cast
Just a small cleanup.
2022-03-27 21:05:44 +02:00
Ali Mohammad Pur f6afb70b07 LibLine: Handle read events serially
Previously LibLine accepted read callbacks while it was in the process
of reading input, this wasn't an issue as no async code was being
executed up until the Shell autocompletion came along.
Simply defer input processing while processing input to avoid causing
problems.
Fixes #13280.
2022-03-27 21:05:44 +02:00
Ali Mohammad Pur 5e541aaebd Shell: Keep the stdio and rpath pledges for execute_process()
If the command fails, we'd like to still be capable of printing out
diagnostics, so restore stdio and rpath.
Fixes #13281.
2022-03-27 21:05:44 +02:00
Linus Groh 46ad69cd1e LookupServer: Fix confusing copy/paste error in debug message 2022-03-27 18:39:47 +01:00
Linus Groh 1e82c2708d Kernel: Support all AMD-defined CPUID feature flags for EAX=80000001h
We're now able to detect all the AMD-defined CPUID feature flags from
ECX/EDX for EAX=80000001h :^)
2022-03-27 18:54:56 +02:00
Linus Groh 96e6420d8d Kernel: Support all Intel-defined extended CPUID feature flags for EAX=7
We're now able to detect all the extended CPUID feature flags from
EBX/ECX/EDX for EAX=7 :^)
2022-03-27 18:54:56 +02:00
Linus Groh 6ca03b915e Kernel: Support all Intel-defined CPUID feature flags for EAX=1
We're now able to detect all the regular CPUID feature flags from
ECX/EDX for EAX=1 :^)

None of the new ones are being used for anything yet, but they will show
up in /proc/cpuinfo and subsequently lscpu and SystemMonitor.

Note that I replaced the periods from the SSE 4.1 and 4.2 instructions
with underscores, which matches the internal enum names, Linux's
/proc/cpuinfo and the general pattern of replacing special characters
with underscores to limit feature names to [a-z0-9_].

The enum member stringification has been moved to a new function for
better re-usability and to avoid cluttering up Processor.cpp.
2022-03-27 18:54:56 +02:00
Linus Groh bc7ec02a82 Kernel: Implement CPUFeature as an ArbitrarySizedEnum
This will make it possible to add many, many more CPU features - more
than the current limit 32 and later limit of 64 if we stick with an enum
class to be specific :^)
2022-03-27 18:54:56 +02:00
Linus Groh e284ee7dcf Kernel: Fix whack formatting of the CPUID constructor 2022-03-27 18:54:56 +02:00
Linus Groh c895780829 Kernel: Reorder code in Processor::cpu_detect() for readability
Checks of ECX go before EDX, and the bit indices are now ordered
properly. Additionally, handling of the EDX[11] bit has been moved into
a lambda function to keep the series of if statements neatly together.
All of this makes it *a lot* easier to follow along and compare the
implementation to the tables in the Intel manual, e.g. to find missing
checks.
2022-03-27 18:54:56 +02:00
Tom c2f6152db8 Kernel: Change the BSP Processor instance to not have a constructor
This solves a problem where any non-trivial member in the global BSP
Processor instance would get re-initialized (improperly), losing data
that was already initialized earlier.
2022-03-27 18:54:56 +02:00
Linus Groh 22308e52cf AK: Add an ArbitrarySizedEnum template
This is an enum-like type that works with arbitrary sized storage > u64,
which is the limit for a regular enum class - which limits it to 64
members when needing bit field behavior.

Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
2022-03-27 18:54:56 +02:00