Commit graph

37566 commits

Author SHA1 Message Date
Leonardo Duarte
62baf25f0b LibGfx: Avoid signed comparison in find_largest_image
I believe the issue was caused by the product of two u16s being promoted
to (signed) int, which can cause unwanted overflow behaviour when
comparing to size_t. Casting each term to size_t before the
multiplication makes the comparison unsigned.
2022-04-20 16:01:09 +03:00
EWouters
d3bc3da873 Mandelbrot: Add BMP and QOI image formats as options for export
Inspired by #13558 I added the option to export as QOI to the
Mandelbrot demo. I added BMP as well for completeness.
2022-04-20 08:19:25 -04:00
Jelle Raaijmakers
65d4fb7649 LibGL: Set W-coordinate to 1 in glRect*
According to the spec, these calls should be identical to an invocation
of `glVertex2*`, which sets the W-coordinate to 1 by default.

This fixes the credits sequence rendering of Tux Racer.
2022-04-20 14:12:56 +02:00
Jelle Raaijmakers
e1a6966863 LibSoftGPU: Check for bottom edge in top-left rule in Device
If a triangle edge is completely horizontal and moving in a positive X
direction, we were erroneously treating it as a top edge. This adds
a better check that accounts for those edges. :^)
2022-04-20 14:12:56 +02:00
Jelle Raaijmakers
838cee37a2 LibSoftGPU: Simplify Clipper interpolation
By setting the clip plane normals' W coordinate to 1, we can skip two
coordinate retrievals and three additions. This works because the
Vector `.dot()` operation multiplies the W coordinates of both vectors.
2022-04-20 14:12:56 +02:00
Jelle Raaijmakers
f680d82086 LibSoftGPU: Reuse edge function for front/back culling
We sat on a throne of lies: our `edge_function()` returned positive
values for _clockwise_ vertex rotation instead of _counter-clockwise_,
which was hidden by the fact that we were forcing everything into CW
rotation by an erroneous area comparison (`> 0` instead of `< 0`).

This simplifies our culling code significantly.
2022-04-20 14:12:56 +02:00
Jelle Raaijmakers
26a463506e LibSoftGPU: Use AK::abs directly instead of fabsf
Let's not go through LibC.
2022-04-20 14:12:56 +02:00
Tim Schumacher
ec6016fa2c Meta: Allow setting a host IP address to bind to 2022-04-20 14:12:34 +02:00
Tim Schumacher
1878488c04 Meta: Commonize network device settings 2022-04-20 14:12:34 +02:00
djwisdom
44278fa5b4 Base: Update AtaraxiaBold8 add glyphs to widen coverage
Miscellaneous Symbols
2600-261F,2621,2640-2645,2647-2653,268A-2693,26A5,26A6,26A8-26Af
https://www.unicode.org/charts/PDF/U2600.pdf
2022-04-20 14:11:58 +02:00
stelar7
1c0d29b8da LibWeb: Add spec comments to Node
This also implements a few more steps of compare_document_position,
and removes an invalid step from clone_node
2022-04-20 14:07:38 +02:00
stelar7
62bd88dc14 LibWeb: Add spec comments to EventTarget 2022-04-20 14:07:38 +02:00
stelar7
8055b0a9b9 LibWeb: Add spec comments to Event 2022-04-20 14:07:38 +02:00
stelar7
6b859db2e0 LibWeb: Add spec comments to EventDispatcher 2022-04-20 14:07:38 +02:00
Lucas CHOLLET
c741db967c CrashReporter: Don't display an error when cancelling backtrace saving
Pressing the cancel button on the prompt displayed by try_save_file()
used to show an error.
2022-04-20 12:01:49 +02:00
Lucas CHOLLET
ad8c6d858e CrashReporter: Fix "Save Backtrace" button width
Previously, the size of the button changed with the window's size. Now
this parameter is fixed and consistent with the "Debug in Hack Studio"
button.
2022-04-20 12:01:49 +02:00
djwisdom
cb08609390 Base: Update Satori Mono Regular add glyphs to widen coverage
Latin Extended-B
0180-01EF
https://www.unicode.org/charts/PDF/U0180.pdf
2022-04-20 10:58:26 +02:00
djwisdom
0134832314 Base: Update Satori Regular add glyphs to widen coverage
Latin Extended-B
0180-01EF
https://www.unicode.org/charts/PDF/U0180.pdf
2022-04-20 10:58:26 +02:00
Linus Groh
e815d3f9ce LibJS: De-duplicate ClassFieldDefinition Records
This was defined twice, despite being the very same thing:
- ClassElement::ClassFieldDefinition
- ECMAScriptFunctionObject::InstanceField

Move the former to a new header and use it everywhere. Also update the
define_field() AO to take a single field instead of separate name and
initializer arguments.
2022-04-20 00:08:32 +02:00
Ali Mohammad Pur
7a02d33cd5 LibGUI: Make GUI::Variant an actual Variant
Previously this had its own massive tagged union implementation with
some POD types to represent non-POD types that could be put in the
variant; implement it via a Variant and get rid of the manual
pointer/ref handling.

This commit does not change any semantics on the type, just the
underlying implementation (and removes an unused ::clear() method).
2022-04-20 00:15:23 +04:30
Ali Mohammad Pur
dd370fcdd1 AK: Explicitly instantiate String::to_uint<unsigned long{, long}>()
Instead of just to_uint<u64>().
2022-04-20 00:15:23 +04:30
Ali Mohammad Pur
2b79f36148 AK: Add a OneOfIgnoringCV concept
Some functions want to ignore cv-qualifiers, and it's much easier to
constrain the type through a concept than a separate requires clause on
the function.
2022-04-20 00:15:23 +04:30
stelar7
5d1deac9a8 Base: Add GlobalSign Root R3 certificate 2022-04-19 20:08:58 +04:30
Tim Schumacher
880bb53247 Ports: Update git to 2.36.0 2022-04-19 10:07:09 -04:00
Tim Schumacher
cf308643c7 Ports: Update coreutils to 9.1 2022-04-19 10:07:09 -04:00
Leonardo Duarte
335fae9a71 LibC: Return early in time_to_tm for large time_t
POSIX says that localtime should fail with EOVERFLOW if the result
cannot be represented, which is the case for most large (in absolute
value) time_t inputs, since they overflow (or underflow) tm_year, which
is an int. This patch introduces this functionality. Previously, tm_year
just overflowed (or underflowed) silently.

Incidentally, this partially fixes #12729 without solving the root
problem, which is that time_to_tm is linear in its input to determine
the number of years since epoch.

This means that the bash port mktime test no longer times-out in 60s,
but it still fails (faster) in some other place. Due to underlying issue
in the algorithm, the worst case inputs still take a couple of seconds
on my machine.
2022-04-19 10:06:23 -04:00
Tim Schumacher
a99c4a7a7d Ports: Pass a proper sysroot value for mpc 2022-04-19 10:51:11 +02:00
Tim Schumacher
02a6ca43a9 Ports: Don't force GCC when linking libiconv into a shared library 2022-04-19 10:51:11 +02:00
brapru
d797031b65 Base: Spawn the LookupServer for generate-manpages SystemMode
Previously the CI would hang on the "Check manpages for completeness"
step on any utility that unveils the /tmp/portal/lookup file because
it was not created during the generate-manpages SystemMode.

This will allow utilities that resolve hostnames (e.g. netstat, arp) to
pass the export-argsparser-mangpages.sh check.
2022-04-19 10:50:55 +02:00
Sam Atkins
9272c3283b LibWeb: Add missing StyleValue::equals() methods
Every StyleValue type now has its own `equals()` method, rather than
relying on the default "compare the to_string() output" method, which
has now been removed. This logic is still used by UnresolvedSV and
CalculatedSV, because it's probably the best option for them unless
performance becomes a real issue.

Also took this opportunity to move all the `equals()` implementations
into the .cpp file, which may or may not actually help with compile
times but StyleValue.h is huge and included everywhere, so it can't
hurt.
2022-04-18 21:30:51 +02:00
Sam Atkins
ce5914230f LibWeb: Actually use BorderRadiusShorthandStyleValue
Somehow we were never actually using this before, but parsing the
property as a StyleValueList instead.
2022-04-18 21:30:51 +02:00
Sam Atkins
025ee02144 LibWeb: Add missing [as/is]_border_radius_shorthand() methods 2022-04-18 21:30:51 +02:00
Sam Atkins
d9afc2d6f2 LibWeb: Rename CombinedBorderRadiusSV -> BorderRadiusShorthandSV 2022-04-18 21:30:51 +02:00
Ali Mohammad Pur
e1cd36559d LibJS: Make the BC generator.next(value) work
This used to put the value in the previous frame's accumulator register,
which is only correct for the first invocation of the generator.
2022-04-18 23:59:30 +04:30
Ali Mohammad Pur
d5791c85b4 LibJS: Avoid copying the frame into the interpreter in BC generators 2022-04-18 23:59:30 +04:30
Liav A
063ea0088e Kernel: Enable PS2 keyboard scan code translation if not already enabled
On the QEMU microvm machine type, it became apparent that the BIOS was
not setting the i8042 controller to function as expected. To ensure that
the controller is always outputting correct scan codes, set it to scan
code 2 and enable first port translation to ensure all scan codes are
translated to scan code set 1. This is the expected behavior when using
SeaBIOS, but on qboot (the BIOS for the QEMU microvm machine type), the
firmware doesn't take care of this so we need to do this ourselves.
2022-04-18 19:36:42 +03:00
Eli Youngs
04763c4a12 Spreadsheet: Sort functions by name in the help window 2022-04-18 17:36:34 +02:00
Ali Mohammad Pur
dd5fb7b32a LibLine: Reset next suggestion index when resetting suggestions
Otherwise we'd end up starting at the previous index on another
suggestion list.
2022-04-18 19:53:10 +04:30
Ali Mohammad Pur
ae27d7e442 Shell: Make program-based completion with no actual token possible
31ca48e made this default to paths, but now that we have a few sensible
ways to complete things, let's make those work too.
For instance, prior to this `kill <tab>` would've suggested paths, but
now it will suggest processes.
2022-04-18 19:53:10 +04:30
Ali Mohammad Pur
302a0c54f0 Base: Add some default completions to shellrc 2022-04-18 19:53:10 +04:30
Ali Mohammad Pur
1699ddc186 LibLine: Make it possible to avoid autocompletion if requested
Setting 'allow_commit_without_listing' to false will now make LibLine
show the suggestion before actually committing to it; this is useful for
completions that will replace all the user input, where mistakes can go
unnoticed without some visual cue.
2022-04-18 19:53:10 +04:30
Ali Mohammad Pur
d5b3998d23 LibLine: Respect the provided completion static offset
Now that we can resolve these correctly and they're per-suggestion, we
can finally use them for their intended purpose of letting suggestions
overwrite stuff in the buffer.
2022-04-18 19:53:10 +04:30
Ali Mohammad Pur
4ea9ca06b4 Shell: Allow completions to request further action from the shell
The shell now expects a JSON object of the form {"kind":<kind>,...} per
line in the standard output of the completion process, where 'kind' is
one of:
- "plain": Just a plain suggestion.
- "program": Prompts the shell to complete a program name starting with
  the given "name".
- "proxy": Prompts the shell to act as if a completion for "argv" was
  requested.
- "path": Prompts the shell to complete a path given the "base" and
  "part" (same as completing part in cwd=base).
2022-04-18 19:53:10 +04:30
Ali Mohammad Pur
4ede121d31 Shell: Add support for regex match patterns
We previously allowed globs as match pattern, but for more complex
matching needs, it's nice to have regular expressions.
And as the existing "name a part of the match" concept maps nicely to
named capture groups, we can simply reuse the same code and make groups
with names available in the match body.
2022-04-18 19:53:10 +04:30
Ali Mohammad Pur
6aceec4535 LibLine: Don't use fdopen() for stream in edit_in_external_editor()
We would have to fclose() it to be clean and nice, but that would close
the fd; instead just duplicate it and write through that, this makes it
actually write to the file.
2022-04-18 19:53:10 +04:30
Karol Kosek
35cb5ea47c Utilities/profile: Call split_view() using StringView for command parts
This fixes the always appearing 'No such file' error when using the -c
flag, as the String was deconstructed right after running this line.
2022-04-18 14:17:01 +02:00
Sam Atkins
00782d9a59 LibWeb: Disallow trailing commas in transform function arguments 2022-04-18 14:16:28 +02:00
Sam Atkins
b3a6044fd8 LibWeb: Disallow non-whitespace tokens after "none" in transform
Before this, a declaration like `transform: none yellow 20;` would be
parsed as `transform: none;`. Now it's correctly rejected as invalid.
2022-04-18 14:16:28 +02:00
Sam Atkins
a52f6fb5b0 LibWeb: Use TransformFunctionMetadata when parsing their arguments
Now, the parser will reject a transform function if:
- There are too many arguments.
- There are too few arguments.
- An argument is the wrong type.
2022-04-18 14:16:28 +02:00
Sam Atkins
42d87239a8 LibWeb: Generate some metadata about transform functions
This will be used to parse and validate their parameters.
2022-04-18 14:16:28 +02:00