Commit graph

56146 commits

Author SHA1 Message Date
Timothy Flynn
bb43bd2dee Ladybird: Remove the now-unused ModelTranslator 2023-11-05 09:11:23 +01:00
Timothy Flynn
cc316de0ee LibWebView: Remove the now-unused LibGUI model implementations 2023-11-05 09:11:23 +01:00
Timothy Flynn
55b53e98d7 Ladybird/Qt: Convert the inspector widget to the WebView model class
This creates a Qt-specific wrapper around the WebView model classes and
uses it for the inspector widget tree / table view models.
2023-11-05 09:11:23 +01:00
Timothy Flynn
c72b42ebb2 Ladybird/Qt: Add a couple of missing header includes
These are currently included implicitly, but this will no longer be the
case after upcoming refactoring.
2023-11-05 09:11:23 +01:00
Timothy Flynn
30fac0abb9 Browser: Convert the inspector widget to the WebView model class
This creates a LibGUI-specific wrapper around the WebView model classes
and uses it for the inspector widget tree / table view models.
2023-11-05 09:11:23 +01:00
Timothy Flynn
0aa375441a Browser: Mark the DOM tree as loaded before selecting any DOM node
The first thing that `set_selection` does is return early if the DOM-
loaded flag is false. Set it to true so it can actually do something.
This fixes inspecting a DOM node from the context menu.
2023-11-05 09:11:23 +01:00
Timothy Flynn
4d356cfca5 LibWebView: Create a PropertyTableModel helper class for table models
We currently have StylePropertiesModel and AriaPropertiesStateModel in
LibWebView. These depend on GUI::Model and GUI::ModelIndex, which is the
only reason that the non-Serenity Ladybird chromes require LibGUI.
Further, these classes are very nearly idenitical.

This creates a PropertyTableModel to provide the base functionality for
all table-based model types used by all Ladybird chromes. It contains
code common to the style / ARIA table models, and handles the slight
differences between the two (namely, just the manner in which the values
are flattened into a list during construction).

The Qt and Serenity chromes can create thin wrappers around this class
to adapt its interface to their chrome-specific model classes (i.e.
QAbstractItemModel and GUI::Model).
2023-11-05 09:11:23 +01:00
Timothy Flynn
3999c74237 LibWebView: Create a TreeModel helper class for DOM/accessibility models
We currently have DOMTreeModel and AccessibilityTreeModel in LibWebView.
These depend on GUI::Model and GUI::ModelIndex, which is the only reason
that the non-Serenity Ladybird chromes require LibGUI. Further, these
classes are very nearly idenitical.

This creates a TreeModel class to provide the base functionality for all
tree-based model types used by all Ladybird chromes. It contains code
common to the DOM / accessibility tree models, and handles the slight
differences between the two (namely, just the formatting of each node's
text for display).

The Qt and Serenity chromes can create thin wrappers around this class
to adapt its interface to their chrome-specific model classes (i.e.
QAbstractItemModel and GUI::Model).
2023-11-05 09:11:23 +01:00
Uku Loskit
2bec281ddc Kernel: Fix panic for Nagel's algorithm
It seems like the current implementation returns 0 in case we do not
have enough data for a whole packet yet. The 0 value gets propagated
to the return value of the syscall which according to the spec
should return non-zero values for non-errors cases. This causes panic,
as there is a VERIFY guard checking that more than > 0 bytes are
written if no error has occurred.
2023-11-05 09:07:39 +01:00
Rummskartoffel
dcbb8cf0ac NotificationServer: Make notifications not overlap when they appear
Before this patch, if two or more notifications were created after one
another, they would overlap. This was caused by the previously lowest
notification's m_original_rect being used to calculate the position for
each new notification instead of the notification's actual rect, which
can be different.
This patch makes notifications use each others' rect() method instead,
which makes them appear in the correct position. With that,
m_original_rect has no use anymore, so this patch removes it.
2023-11-05 09:06:33 +01:00
Rummskartoffel
a281fa3902 NotificationServer: Don't shuffle notifications on first hover
Before this patch, hovering with the mouse over one of at least two
newly created notifications would cause all notifications to be
reordered on the screen, when previously they appeared in order of
creation, growing downwards.
This happened because the position of all notifications is updated when
any of them is hovered, in case the hovered notification was resized.
By using an ordered HashMap instead, creation order is preserved.
2023-11-05 09:06:33 +01:00
Tim Ledbetter
438e9e146c LibGfx/JPEG: Refill reservoir if necessary when discarding bits
This condition was hit 157 times out of the 109,233 JPEG images in the
Govdocs1 corpus. This change allows all of these
images to load correctly.
2023-11-05 09:01:15 +01:00
MacDue
4c5d48f861 LibWeb: Support transforms, stroking, gradients, etc for SVG <text>
This makes use of the new Gfx::Path::text() to handle SVG text elements,
with this text is just a regular path, and can be manipulated like any
other graphics element.

This removes the SVGTextPaintable and makes both <text> and geometry
elements use a new (shared) SVGPathPaintable. This is identical to the
old SVGGeometryPaintable. This simplifies painting as once something is
resolved to a Gfx::Path, the painting logic is the same.
2023-11-05 02:46:46 +01:00
MacDue
50d33f79fa LibGfx: Allow extracting paths from fonts and add Gfx::Path::text()
This updates fonts so rather than rastering directly to a bitmap, you
can extract paths for glyphs. This is then used to implement a
Gfx::Path::text("some text", font) API, that if given a vector font
appends the path of the text to your Gfx::Path. This then allows
arbitrary manipulation of the text (rotation, skewing, etc), paving the
way for Word Art in Serenity.
2023-11-05 02:46:46 +01:00
kleines Filmröllchen
b4cabde4a4 LibELF: Add initial RISC-V support
This is an almost-minimal patchset to get RISC-V ELF files to pass
validation. Unlike other architectures, eflags are actually used here.
2023-11-04 22:13:52 +01:00
LevitatingBusinessMan (Rein Fernhout)
edd38358c2 ls: Use indicator for sockets and pipes
= indicator for sockets, | for pipes.
Pipes are now colored yellow like other special files
2023-11-04 22:08:56 +01:00
Nico Weber
4a5136fc8c LibPDF: Implement CalGrayColorSpace
I haven't seen this being used in the wild, but it's used in
Tests/LibPDF/colorspaces.pdf.
2023-11-04 17:02:37 -04:00
Nico Weber
a207ab709a LibPDF: In convert_to_srgb(), also apply sRGB curve (ish)
We did convert from the input space to linear space and then
to linear sRGB, but we forgot to re-apply gamma.

This uses the x^2.2 curve instead of the real sRGB curve for now.
2023-11-04 17:02:37 -04:00
Nico Weber
641365b235 LibPDF: Move colorspace conversion functions up a bit
No code change, no behavior change. Pure code move.
2023-11-04 17:02:37 -04:00
Nico Weber
00f1a6cf86 Tests: Add a pdf file for testing color spaces
Covers DeviceGray, CalRGB, DeviceRGB, DeviceCMYK, Lab, CalGray for now.

Does not yet cover Indexed, Pattern, Separation, DeviceN, ICCBased.

Lovingly hand-written, with the xref table fixed up by mutool.
2023-11-04 17:02:37 -04:00
Andreas Kling
3ff81dcb65 LibWeb: Make Web::Namespace::Foo strings be FlyString
This required dealing with a *lot* of fallout, but it's all basically
just switching from DeprecatedFlyString to either FlyString or
Optional<FlyString> in a hundred places to accommodate the change.
2023-11-04 21:28:30 +01:00
Andreas Kling
6b20a109c6 LibWeb: Pass DOM namespace strings as FlyString in more places 2023-11-04 21:28:30 +01:00
Andreas Kling
b341aeb5c1 LibWeb: Switch HTMLToken and HTMLTokenizer to String & FlyString 2023-11-04 21:28:30 +01:00
Andreas Kling
0902f552a3 AK: Bring some missing DeprecatedString API over to String
Specifically, case sensitivity parameters for starts/ends with,
and the equals_ignoring_ascii_case() helper.
2023-11-04 21:28:30 +01:00
Andreas Kling
f052823f5f LibWeb: Use FlyString for create_element() namespace strings 2023-11-04 21:28:30 +01:00
Andreas Kling
8f82bd044b LibWeb: Use FlyString for create_element() prefix strings 2023-11-04 21:28:30 +01:00
Dan Klishch
e169d99bec LibCore: Remove strtol call from parse_sockets_from_system_server 2023-11-04 18:06:30 +01:00
Dan Klishch
568e5d5631 LibCore: Port DateTime::parse to GenericLexer
The main motivation is to get rid of pesky `strtol`, which requires zero
termination of a `string` argument. This also somewhat simplifies the
code.
2023-11-04 18:06:30 +01:00
Dan Klishch
b65d281bbb AK: Add GenericLexer::{consume_decimal_integer,peek_string} 2023-11-04 18:06:30 +01:00
circl
6b30847120 LibWeb: Don't add an extra glyph spacing to width of TextNode
When calculating the width of text using a bitmap font, a glyph spacing
is added at the end of each fragment, including the last one. This meant
that everything was 1 pixel too long. This bug did not affect vector
fonts.
2023-11-04 17:39:04 +01:00
Aliaksandr Kalenik
2660bbb94f LibWeb: Consider colgroups while calculating table grid size
We should take in account <col> elements in column groups while finding
number of columns in a table.
2023-11-04 17:37:38 +01:00
Romain Chardiny
6d31d81309 Kernel: Allow negative value for backlog in sys$listen 2023-11-04 17:35:54 +01:00
Timothy Flynn
a6fde58682 CI: Add a step to ensure the Qt chrome can compile on macOS
The AppKit chrome is now the default, but the Qt chrome may still be
enabled for testing. Let's ensure it can compile in CI, as it has
already broken since the default change.
2023-11-04 08:36:34 -04:00
Timothy Flynn
bbdd624d50 Ladybird: Do not require Qt6 Multimedia if PulseAudio is available
If PulseAudio is available, the Qt6 audio plugin will never be used. So
let's remove it from the build.

Note that on macOS, the Qt6 audio plugin will be used if the Qt chrome
is enabled. Otherwise, Audio Unit will be used for the AppKit chrome.
2023-11-04 08:36:34 -04:00
Timothy Flynn
b98864e022 LibAudio: Remove unused TRY-like macro
This was added, unused, in bc4d4f0f95.
2023-11-04 08:36:34 -04:00
Tim Ledbetter
a1f9d2420f Fuzzers: Disable debug logging for all fuzzers
Previously, some fuzzers were generating an excessive amount of debug
logging. This change explicitly disables debug logging for all fuzzers.
This allows higher test throughput and makes the logs easier to read
when fuzzing locally.
2023-11-03 20:56:44 -06:00
Timothy Flynn
cdbde1765a LibWeb: Skip assigning slottables for non-shadow roots
For example, on https://html.spec.whatwg.org, there are hundreds of
thousands of nodes. This method is invoked as each node is inserted.
Traversing the entire tree each time takes a prohibitively long time,
so let's bail early when we know the operation is a no-op.
2023-11-03 20:50:34 +01:00
Timothy Flynn
f3e14d7f64 LibWeb: Use correct variable when handling slottables in node insertion
Errantly copied the variable name from the spec. The `node` variable in
this scope is what we passed to Node::insert_before; `node_to_insert` is
what the spec is actually referring to as `node` here.
2023-11-03 20:50:34 +01:00
Idan Horowitz
58e2fe895c LibJS: Stash thrown exception in a register before executing finalizer
This kills 2 birds with one stone:
1. It makes sure generated check_exception() calls in the finalizer
   don't mis-read the pending exception as caused by their matching
   operation.
2. It implicitly ensures that terminated finally blocks (by a return
   statement) overwrite any pending exceptions, since they will never
   execute the ContinuePendingUnwind operation that restores the
   stashed exception.
This additional logic is required in the JIT (as opposed to the
interpreter), since the JIT uses the exception register to store and
check the possibly-exceptional results from each individual operation,
while the interpreter only modifies it when an operation has thrown an
exception.
2023-11-03 20:27:45 +01:00
Idan Horowitz
aaa81cd3b9 Revert "LibJS/JIT: Clear exception before executing finalizer"
This reverts commit 0daebef727.

Finally blocks do not unconditionally swallow pending exceptions.
This resolves #21759 and fixes the 2 remaining failing test-js tests.
2023-11-03 20:27:45 +01:00
hanaa12G
0391096286 HackStudio: Pass the correct VariableInfo address to create_index
Previously, we tried to store `VariableInfo` to `ModelIndex` internal
data, but accidently stored address of wrapper class `NonnullOwnPtr`.
When we retrieved it later in `VariablesModel::data()` it made
program to crash.

This allows us to run debug normally after setting any break point in
`HackStudio`.
2023-11-03 16:05:46 +00:00
Ostap Brehin
7e6722abe8 Ports/php: Enable curl 2023-11-03 15:32:44 +01:00
Liav A
55ea2d892c Utilities/beep: Restrict possible capabilities
We can now just unveil the /dev/beep device node, as well as to restrict
the utility functionality for rpath, wpath & stdio related syscalls only
because we don't actually need anything else.
2023-11-03 15:19:33 +01:00
Liav A
26f96d2a42 Kernel+Userland: Add option for duration of /dev/beep producing sound 2023-11-03 15:19:33 +01:00
Liav A
1b00618fd9 Kernel+Userland: Replace the beep syscall with the new /dev/beep device
There's no need to have separate syscall for this kind of functionality,
as we can just have a device node in /dev, called "beep", that allows
writing tone generation packets to emulate the same behavior.

In addition to that, we remove LibC sysbeep function, as this function
was never being used by any C program nor it was standardized in any
way.
Instead, we move the userspace implementation to LibCore.
2023-11-03 15:19:33 +01:00
Liav A
ac70abcb73 DeviceMapper: Add a mechanism to handle pluggable-once char devices 2023-11-03 15:19:33 +01:00
Ostap Brehin
a30939feba Ports/composer: Update to version 2.6.5 2023-11-03 11:57:27 +01:00
Andreas Kling
24fb009cf5 LibJS+LibJIT: Add fast path for Int32 * Int32 2023-11-03 10:48:02 +01:00
Andreas Kling
0aeb83b03f LibJS+LibJIT: Add fast path for Int32 ^ Int32 2023-11-03 10:48:02 +01:00
Andreas Kling
3a5c177025 LibJS/JIT: Add fast path for Int32 | Int32 2023-11-03 10:48:02 +01:00