Commit graph

56217 commits

Author SHA1 Message Date
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
Aliaksandr Kalenik 38531ce7cf LibWeb: Do not unload during same-document history step application
See https://github.com/whatwg/html/pull/9904
2023-11-02 16:06:16 +01:00
Nick Hawke 67566e5017 LibJS: Migrate DeprecatedString to String
This changes BasicBlock's constructor and create().
2023-11-02 14:55:12 +01:00
0GreenClover0 4c915a9e67 HackStudio: Add an 'Auto Save before Build or Run' option 2023-11-02 11:08:14 +00:00
Andreas Kling 0e9bdfa822 LibWeb: Avoid QualifiedName copy when matching tag name selectors 2023-11-02 08:09:01 +01:00
Andreas Kling e4621704ce LibWeb: Avoid unnecessary JS::Handles in Node::queue_mutation_record()
We don't need to make a list of the target node's ancestors before
iterating over them, since nothing happens while iterating them that
can disturb the list anyway (no arbitrary JS execution etc).

The incessant construction and destruction of handles here was showing
up in profiles of basically every website that uses JavaScript to build
some or all of their DOM tree.
2023-11-02 07:48:51 +01:00
Aliaksandr Kalenik aa6c008450 LibAccelGfx+LibWeb: Implement draw_scaled_bitmap()
Very basic implementation of command to paint bitmap. In the future we
should reuse loaded textures across repaints whenever it is possible.
2023-11-02 07:41:51 +01:00
Aliaksandr Kalenik b7f8d7e357 LibAccelGfx: Compile all needed shaders during Painter construction
Instead of recompiling shaders on each paint command call we can
compile them once.
2023-11-02 07:41:51 +01:00
Aliaksandr Kalenik 1e85bf221d LibAccelGfx+WebContent: Use the same Painter across page repaints
In the upcoming changes, Painter will be used to store the state of
OpenGL context. For example, if Painter is aware of the shader that
have already been loaded, it will be possible to reuse them across
repaints. Also, it would be possible to manage state of loaded textures
and add/remove them depending on which ones are present in the next
sequence of painting commands.
2023-11-02 07:41:51 +01:00
Simon Wanner e73a1803ac LibJS/JIT: Avoid crashing while disassembling empty functions 2023-11-02 07:37:41 +01:00
Simon Wanner 68f4d21de2 LibJS: Lazily collect stack trace information
The previous implementation was calling `backtrace()` for every
function call, which is quite slow.

Instead, this implementation provides VM::stack_trace() which unwinds
the native stack, maps it through NativeExecutable::get_source_range
and combines it with source ranges from interpreted call frames.
2023-11-02 07:37:41 +01:00