Commit graph

56203 commits

Author SHA1 Message Date
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
Simon Wanner 77dc7c4d36 LibJIT: Emit unwindable stack frames
Flip the order from save-registers,enter and leave,restore-registers
to enter,save-register and restore-registers,leave.

This way the return address is next to the saved frame pointer like
unwinding routines expect.
2023-11-02 07:37:41 +01:00
Simon Wanner 93908fcbcb LibJS+Embedders: Unify stack trace format for uncaught errors
Previously these handlers duplicated code and used formats that
were different from the one Error.prototype.stack uses.

Now they use the same Error::stack_string function, which accepts
a new parameter for compacting stack traces with repeating frames.
2023-11-02 07:37:41 +01:00
Aliaksandr Kalenik 2fb0cede9a LibWeb: Account for box-sizing in grid-items width calculation
Visual improvement on (now there is a gap between grid items):
https://twinings.co.uk/collections/earl-grey-tea
2023-11-02 07:37:11 +01:00
Hendiadyoin1 e02a4f5181 AK: Bring JsonParser's string consumption closer to the ECMA 404 spec
I added some spec comments, and implementation notices, this should not
change behavior in a significant way.

The previous code was quite unwieldy and repetitive.
The long `if(next_is('X'))` chain is now a smaller `switch`.
I also reinstated the fast path for long sequences of literal
characters, which was broken in 0aad21fff2
2023-11-01 17:28:19 -06:00
Andrew Kaster c990db0913 Ladybird/Android: Create a service for ImageDecoder
This follows the pattern for the other services spawned by WebContent.
The notable quirk about this service is that it's actually spawned by
the ImageCodecPlugin rather than in main.cpp in the non-Android port.

As a result we needed to do some ifdef surgery to get all the pieces
in place. But we can now load images in the Android port again :^).
2023-11-01 14:30:30 -06:00
Andrew Kaster a54baa2c34 Ladybird/Android: Use new capitalized name for main Ladybird shlib 2023-11-01 14:30:30 -06:00
Andrew Kaster 4956514dfb Ladybird/Android: Make bind_service helper public in WebContentService
We'll need to call this from other Ladybird files for future services.
2023-11-01 14:30:30 -06:00
Andrew Kaster 5b03135c46 Ladybird/Android: Set up a Core::Resource implementation in services
Use the File implementation until we get around to creating one that
uses AssetManager
2023-11-01 14:30:30 -06:00
Andrew Kaster c9499a9755 Ladybird: Install ImageDecoder 2023-11-01 14:30:30 -06:00
Andrew Kaster 2cc6abf309 LibAccelGfx: Don't predicate using EGL/egl.h on Linux
Any platform that has OpenGL and EGL should be able to use the class.
2023-11-01 14:30:30 -06:00
Andrew Kaster 40363f54d8 WebContent: Use the accelerated_graphics CMake helper
Instead of relying on AK_OS_LINUX, actually use the more accurate
HAS_ACCELERATED_GRAPHICS define to figure out if we should try to use
the generic LibAccelGfx GPU painter.
2023-11-01 14:30:30 -06:00
Andrew Kaster 26e5c20cfa LibJS: Don't try to use backtrace(3) on Android below API level 33 2023-11-01 14:30:30 -06:00
Nico Weber f8799885de LibPDF: Clamp sRGB channels before converting to u8 in CalRGB code
Sometimes the numbers end up just slightly above 1.0f, which previously
caused an overflow.
2023-11-01 11:45:13 -04:00
Nico Weber bdd2404453 LibPDF: Ignore input whitepoint in convert_to_d65()
CalRGBColorSpace::color() converts into a flat xyz space,
which already takes input whitepoint into account.

It shouldn't be taken into account again when converting from
the flat color space to D65.
2023-11-01 11:45:13 -04:00