Commit Graph

55403 Commits

Author SHA1 Message Date
Hendiadyoin1
a390adcf35 Kernel: Load drivers before looking for the boot drive 2023-10-17 11:50:33 -06:00
Ali Mohammad Pur
f10dc9cb14 LibVT: Clear the href ID by setting it to None instead of "" 2023-10-17 11:02:48 -06:00
Ali Mohammad Pur
a8c7448ccb Shell: Implement the return POSIX builtin
This is also available in the regular shell mode, as it's a generally
useful builtin to have.
2023-10-17 11:02:48 -06:00
Ali Mohammad Pur
2d1c5dbfcb Shell: Allow word-expansion of ${var}, $N, $* and $-
Fixes #21463.
2023-10-17 11:02:48 -06:00
Andrew Kaster
39202f2222 CI: Re-enable booting aarch64 in CI self-test mode on CI 2023-10-17 11:02:25 -06:00
Andrew Kaster
424eca24ba Base: Only do a boot/shutdown smoke-test for aarch64 for CI testing
Instead of managing a large list of tests to skip as we break aarch64,
simply don't run any userspace tests. We need to keep a smoke test going
so that we don't break aarch64 boot with new Kernel changes and new
drivers.
2023-10-17 11:02:25 -06:00
Andrew Kaster
91816c15f8 Kernel: Don't register USB devices if USBManagement is not initialized 2023-10-17 11:02:25 -06:00
Andrew Kaster
639051d34e LibGfx: Inspect font paths using LexicalPath::has_extension()
This prevents us from trying to load a file named "fonts/.font"
2023-10-17 11:02:01 -06:00
Andrew Kaster
21d027129d LibGfx: Remove the ability to load fonts from a path directly 2023-10-17 11:02:01 -06:00
Andrew Kaster
4d039b05b2 MacPDF: Load fonts via Core::Resource instead of filesystem paths 2023-10-17 11:02:01 -06:00
Andrew Kaster
1af3da39fd headless-browser: Load fonts via Core::Resource URIs 2023-10-17 11:02:01 -06:00
Andrew Kaster
74707d151b pdf: Load fonts in debug mode via Core::Resource URIs 2023-10-17 11:02:01 -06:00
Andrew Kaster
09e3921ff8 Tests: Load Resources via Core::Resource URIs in FontHandling tests 2023-10-17 11:02:01 -06:00
Andrew Kaster
2e759656de Ladybird: Load fonts via Core::Resource URIs instead of filesystem paths 2023-10-17 11:02:01 -06:00
Andrew Kaster
e03357308c LibGfx: Load fonts with new Resource API instead of filesystem paths
The old API is in place until we remove all the users.
2023-10-17 11:02:01 -06:00
Andrew Kaster
0d417cd604 LibCore: Add Resource for platform agnostic application resource loading
The first implementation is simply raw files.
2023-10-17 11:02:01 -06:00
Tim Ledbetter
f4a89c31c6 LibGfx/ILBM: Explicitly fail decoding if body chunk isn't present
Previously, the decoder would crash in this case.
2023-10-17 10:24:27 +02:00
Nico Weber
cb961101c7 LibPDF: Implement CFF built-in Standard and Expert encodings
With this, all tables from the spec appendixes are in CFF.cpp.

This fixes a crash reading page 2 (and onward) of
2ThestructureoftheCIE1997ColourAppearanceModelCIECAM97s.pdf in
the pdffiles repo.
2023-10-17 10:21:38 +02:00
Nico Weber
eeada4678c LibPDF: Postpone CFF encoding processing after Top DICT has been read
The encoding offset defaults to 0, i.e. the Standard Encoding.
That means reading the encoding only if the tag is present causes
us to not read it if a font uses the Standard Encoding.

Now, we always read an encoding, even if it's the (implicit) default
one.
2023-10-17 10:21:38 +02:00
Nico Weber
1cfe639b6c LibPDF: Implement CFF supplemental encoding
The main encoding data maps glyph ID ("GID") to its codepoint.
If a glyph has several codepoints, then a secondary table mapping
codepoint to string ID ("SID") of the glyph's name is present.

(A separate table associates each glyph with its name already.)

I haven't seen this used in the wild, but the structure of the
supplemental data is also going to be needed for built-in encodings.
2023-10-17 10:21:38 +02:00
Nico Weber
37daeae6fd LibPDF: Add spec comments, dbgln_if()s to CFF's parse_encoding() 2023-10-17 10:21:38 +02:00
Aliaksandr Kalenik
c41e742de4 LibWeb: Fix min-content width calculation in dimension_box_on_line()
If inline-block is sized under min-content width constraint we should
use its min-content width instead of max-content width like it was
before.
2023-10-16 21:44:48 +02:00
Ali Mohammad Pur
91bb3af505 Shell: Implement the '$*' special variable in the POSIX parser
Fixes #21421.
2023-10-16 19:11:37 +03:30
Ali Mohammad Pur
5cb994d4dd Shell: Minimally implement the 'set' builtin
This only implements the printing and argv setting behaviours.
2023-10-16 19:11:37 +03:30
Ali Mohammad Pur
867f7da017 AK: Avoid nullptr deref in DeprecatedString(DeprecatedFlyString const&)
Prior to this commit, constructing a DS from a null DFS would cause a
nullptr deref, which broke (at least) Profiler.
This commit converts the null DFS to an empty DS, avoiding the nullptr
deref (until DFS loses its null state, or we decide to not make it
convertible to a DS).
2023-10-16 09:06:15 -04:00
Timothy Flynn
a8f0fa5dd4 LibWebView+LibPublicSuffix: Merge LibPublicSuffix into LibWebView
After d2c7e1ea7d, there is now only one
user of LibPublicSuffix - the URL sanitation utility within LibWebView.
Rather than having an entire library for the small Public Suffix data
accessor, merge it into LibWebView.
2023-10-16 09:06:02 -04:00
circl
a1cce69db0 LibWeb/HTMLInputElement: Improve appearance of color picker
Instead of a plain ButtonBox, it now appears as a color well styled
after the buttons.
2023-10-16 12:46:30 +01:00
circl
63cd6b0d3c LibWeb: Make Default.css clearer about the style of input elements
Previously, all input elements were given a textbox-like style by
default, this was then undone by another CSS rule in the case of certain
types of input element. This commit makes it so that the first rule
simply ignores those types instead.

Co-authored-by: Sam Atkins <atkinssj@serenityos.org>
2023-10-16 12:46:30 +01:00
circl
ce48ac3101 LibWeb/HTMLInputElement: Move text input shadow tree into a function 2023-10-16 12:46:30 +01:00
Liav A
81169ee6e6 DynamicLoader: Add an option to explicitly run an ELF executable binary
If the user runs /usr/lib/Loader.so and pass a second string to argv, we
will try to run it as if it was running that program without invoking
the dynamic loader explicitly.
2023-10-16 12:09:04 +02:00
Kenneth Myhra
a3073824a9 Ports/curl: Set CMake cache variable HAVE_GETADDRINFO_THREADSAFE to 1
According to the issue https://github.com/curl/curl/issues/12093 the
curl build doesn't properly detect that Serenity has getaddrinfo() and
outputs the following:
---
Performing Test HAVE_H_ERRNO_ASSIGNABLE
CMake Error: try_run() invoked in cross-compiling mode, please set the
following cache variables appropriately:
HAVE_H_ERRNO_ASSIGNABLE_EXITCODE (advanced)
---

Setting the CMake cache variable HAVE_GETADDRINFO_THREADSAFE=1 solves
the mentioned error.

Also see: https://github.com/curl/curl/pull/12094
2023-10-16 09:41:00 +02:00
Nico Weber
007d7cdd53 LibPDF: Fix sign (and fixed point) in glyph decoding opcode 24
Two bugs:

1. We decoded a u32, not an i32 as the spec wants
2. (minor) Our fixed-point divisor was off by one

Fixes text rendering in Bakke2010a.pdf in pdffiles, and rendering of
other fonts with negative width adjustments from optcode 255.
That PDF was produced by "Apple pstopdf" and uses font SFBX1200,
which is apparently a variant of Computer Modern. So maybe this
helps with lots of PDFs produced from TeX files, but I haven't
checked that.
2023-10-16 08:33:35 +02:00
Nico Weber
96a4936567 LibPDF: Checking for built-in CFF encodings
Only prints a warning for them for now.

Also warn on the not-yet-implemented encoding supplement.
2023-10-16 08:32:18 +02:00
Nico Weber
414a164850 LibPDF: Be louder about unimplemented CFF dict entries 2023-10-16 08:32:18 +02:00
Nico Weber
c825194fb9 LibPDF: Reject CFFs with more than one font
The code assumes that there's just one Top DICT, so let's be loud
when that isn't the case.
2023-10-16 08:32:18 +02:00
Edwin Rijkee
8388fe51b5 Kernel: Add a framebuffer driver for 3Dfx Voodoo 3
A bit old but a relatively uncomplicated device capable of outputting
1920x1080 video with 32-bit color. Tested with a Voodoo 3 3000 16MB
PCI card. Resolution switching from DisplaySettings also works.

If the requested mode contains timing information, it is used directly.
Otherwise, display timing values are selected from the EDID. First the
detailed timings are checked, and then standard and established
timings for which there is a matching DMT mode. The driver does not
(yet) read the actual EDID, so the generic EDID in DisplayConnector now
includes a set of common display modes to make this work.

The driver should also be compatible with the Voodoo Banshee, 4 and 5
but I don't have these cards to test this with. The PCI IDs of these
cards are included as a commented line in case someone wants to give it
a try.
2023-10-16 01:25:45 +02:00
Liav A
77441079dd Kernel/HID: Introduce initial USB mouse support 2023-10-15 22:56:30 +02:00
Liav A
430e987078 Kernel/USB: Don't invoke async callback if transfer data size is 0
We can't do anything valuable with such "transfer" so just discard it.
2023-10-15 22:56:30 +02:00
Liav A
e7c1148ec6 Kernel/USB: Handle NAK correctly in a transfer status bits 2023-10-15 22:56:30 +02:00
Liav A
62c2c9df69 Kernel/HID: Add methods to attach and detach standalone devices 2023-10-15 22:56:30 +02:00
Liav A
83835c7256 Kernel/HID: Add boot option to disable PS2 Mouse 2023-10-15 22:56:30 +02:00
MacDue
95bf6ddb8e LibGfx: Fix serializing Gfx::Bitmaps
a396bb0 removed the palette field but did not update the allocation size
in `Bitmap::serialize_to_byte_buffer()`. This led to a few crashes (I
noticed this from a drag/drop crash in the file manager).

Fixes #21434
2023-10-15 20:34:29 +02:00
MacDue
f0cd7adaf8 LibGUI: Fix FileSystemModel/FileManager after aeee98b
Previously, the null state of m_root_path was use to (subtly) mark the
parent of the root. The empty path is always replaced with "." so after
aeee98b there was no "parent of root" node. This lead to the file
manager crashing when opened.
2023-10-15 21:34:15 +03:30
Nico Weber
6f783929dd LibPDF: Implement support for CFF charset format 2
I haven't seen this being used in the wild (yet), but it's easy
to implement, and with this we support all charset formats.

So we can now mention if we see a format we don't know about.
2023-10-15 15:27:15 +02:00
Nico Weber
5b915fb15c LibPDF: Add more spec comments to parse_charset() 2023-10-15 15:27:15 +02:00
Nico Weber
49275c4b17 LibPDF: Don't overflow SIDs in type 1 charset parsing
first_sid has type SID (aka u16), so don't store it in an u8.

This fixes (among other things) page 24 on the PDF 1.7 spec.
2023-10-15 15:27:15 +02:00
Jelle Raaijmakers
403d3bbdaf LibSoftGPU: Optimize GPU::Vertex lists
On my machine, benchmarking 3DFileViewer revealed ~2.5% of CPU time
spent in `Vector<GPU::Vertex>::try_append`. By carefully managing list
capacities, we can remove this method from profiles altogether.
2023-10-15 12:14:07 +02:00
Jelle Raaijmakers
c978891dda LibGL: Optimize appends in gl_vertex
Optimize a very hot function by always performing unchecked appends.
When benchmarking 3DFileViewer on my machine, this takes the time spent
in `gl_vertex` down from ~8% to ~2%.
2023-10-15 12:14:07 +02:00
Jelle Raaijmakers
edcb6176ce LibGL+Lib*GPU: Set model view and projection matrices separately
LibSoftGPU used to calculate the normal transformation based on the
model view transformation for every primitive, because that's when we
sent over the matrix. By making LibGL a bit smarter and only update the
matrices when they could have changed, we only need to calculate the
normal transformation once on every matrix update.

When viewing `Tuba.obj` in 3DFileViewer, this brings the percentage of
time spent in `FloatMatrix4x4::inverse()` down from 15% to 0%. :^)
2023-10-15 12:14:07 +02:00
Jelle Raaijmakers
126adfc392 3DFileViewer: Set timer to 15ms instead of 20ms
This approaches 60FPS and feels a bit smoother.
2023-10-15 12:14:07 +02:00