Commit graph

56227 commits

Author SHA1 Message Date
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
Andreas Kling
82635083dc LibJS/JIT: Add fast path for Int32 & Int32 2023-11-03 10:48:02 +01:00
Andreas Kling
17ae6edd8e LibJS+LibJIT: Add fast path for Int32 - Int32 2023-11-03 10:48:02 +01:00
Andreas Kling
56b4586d65 LibJIT: Factor out JO instruction from add32()
Also add a jump_if(Condition, Label) helper. This will make it easier
to add more 32-bit binary ops that branch on overflow.
2023-11-03 10:48:02 +01:00
Simon Wanner
dd466ec83a LibJS/Bytecode: Remove the PushDeclarativeEnvironment instruction 2023-11-03 07:31:11 +01:00
Simon Wanner
c810d4784e LibJS/JIT: Compile the Await instruction 2023-11-03 07:31:11 +01:00
Simon Wanner
4671520c0a LibJS/JIT: Compile the Yield instruction 2023-11-03 07:31:11 +01:00
Simon Wanner
e400682fb1 LibJS/JIT: Support alternative entry point blocks
If Interpreter::run_and_return_frame is called with a specific entry
point we now map that to a native instruction address, which the JIT
code jumps to after the function prologue.
2023-11-03 07:31:11 +01:00
Idan Horowitz
38f3b78a1d LibJS: Store the bytecode accumulator in a dedicated physical register
We now use a dedicated physical register to store the bytecode
accumulator, instead of loading and storing it to the memory everytime.
2023-11-02 22:35:35 +01:00
Andreas Kling
f9cab320e6 LibWeb: Only propagate CSS overflow to the viewport once per tree build
Before this change, we were doing it after every layout, which meant
that already-propagated overflow could be propagated again, which led to
incorrect scrolling behavior.
2023-11-02 20:50:48 +01:00
Andrew Kaster
bc6f19da0e Ladybird: Disable Qt autogeneration for ImageDecoder
This fixes the macOS Qt build.
2023-11-02 12:34:02 -06:00
Andreas Kling
f5771a5789 LibWeb: Check node type first in fast_is<ShadowRoot>()
We know that shadow roots are always document fragments, so we can
check that before calling is_shadow_root() to avoid the cost of
a virtual call.
2023-11-02 17:09:34 +01:00
Andreas Kling
204c46f097 LibWeb: Use Element::id() when deciding whether to update SVG use trees 2023-11-02 17:09:34 +01:00
Andreas Kling
65787fffe4 LibWeb: Use Element::id() when collecting matching CSS rules 2023-11-02 17:09:34 +01:00
Andreas Kling
d0d7e5a782 LibWeb: Use Element::id() in getElementById()
This avoids the O(n) walk of element attributes, although there is still
a huge space for improvement here if we start keeping a lookup cache for
elements-by-ID.
2023-11-02 17:09:34 +01:00
Andreas Kling
e205f93cbb LibWeb: Add missing super call in SVGSymbolElement::attribute_changed()
This would cause subsequent commits to break tests otherwise.
2023-11-02 17:09:34 +01:00
Andreas Kling
83c3490bc4 LibWeb: Use Element::id() in SelectorEngine
This makes ID selector matching O(1) instead of O(n).
2023-11-02 17:09:34 +01:00
Andreas Kling
1c62ee9396 LibWeb: Cache the "id" attribute value on DOM::Element as FlyString
This will allow us to do O(1) checks against the element ID when
matching selectors, etc.
2023-11-02 17:09:34 +01:00
Andreas Kling
6b580d68a3 LibWeb: Rename DOM::Node::id() to unique_id()
The old name was pretty confusing, since it had nothing to do with the
common "id" content attribute.

This makes way for using id() to return the "id" attribute instead. :^)
2023-11-02 17:09:34 +01:00
Simon Wanner
1030776f92 LibJS: Avoid crash on empty stack trace
We were trying to stringify the stack trace without the last element,
leading to a loop bound of (size_t)(0 - 1) and accessing m_traceback[0]
out-of-bounds.

Instead, just return an empty string in that case.

Fixes #21747
2023-11-02 16:12:43 +01:00