Commit graph

33446 commits

Author SHA1 Message Date
Tim Ledbetter 272cd30f17 LibWeb: Add missing visit to m_labels in HTMLElement 2024-05-18 18:29:52 +02:00
Tim Ledbetter c36ba450be LibWeb: Generate binding for HTMLObjectElement.contentWindow attribute
This only required adding the appropriate definition to the IDL file,
as `NavigableContainer` already implements the logic that we need.
2024-05-18 18:12:08 +02:00
Andreas Kling b2e6843055 LibJS+AK: Fix integer overflow UB on (any Int32 - -2147483648)
It wasn't safe to use addition_would_overflow(a, -b) to check if
subtraction (a - b) would overflow, since it doesn't cover this case.

I don't know why we didn't have subtraction_would_overflow(), so this
patch adds it. :^)
2024-05-18 18:11:50 +02:00
Hendiadyoin1 1de475b404 LibJS: Prepare yield object before re-routing it through finally 2024-05-18 18:11:10 +02:00
Tim Ledbetter 2447a25753 LibWeb: Implement the labels attribute for all labelable elements
This returns a `NodeList` of all the labels associated with the given
element.
2024-05-18 18:09:18 +02:00
Tim Ledbetter 3dc86747f0 LibWeb: Implement the HTMLOutputElement.htmlFor attribute
This returns a DOMTokenList that reflects the `for` attribute.
2024-05-18 11:23:20 +02:00
Tim Ledbetter acc1fa3c62 LibWeb: Generate binding for the HTMLObjectElement.form attribute
This only required adding the appropriate definition to the IDL file,
as `FormAssociatedElement` already implements the logic that we need.
2024-05-18 11:04:04 +02:00
Tim Ledbetter 6bf22075ed LibWeb: Implement the HTMLLabelElement.form attribute
This returns the form element associated with the given label element's
control or null if the label has no control.
2024-05-18 11:04:04 +02:00
Tim Ledbetter 5296338e7a LibWeb: Check all elements in same tree to determine labeled control
Previously, when looking for the labeled control of a label element, we
were only checking its child elements. The specification says we should
check all elements in the same tree as the label element.
2024-05-18 11:04:04 +02:00
Tim Ledbetter fc395716e9 LibWeb: Return NonnullGCPtr<DOMTokenList> from relList getters 2024-05-18 11:03:49 +02:00
Tim Ledbetter d0555f3176 LibWeb: Flesh out DOMTokenList::supports() implementation
This change makes `DOMTokenList::supports()` work as expected for
`relList` attributes.
2024-05-16 20:31:23 +02:00
dgaston 55fe04a6fa Chess: Port application to GML
This commit ports the chess application to GML in order to
facilitate the addition of widgets in the future.
2024-05-16 07:41:05 +01:00
dgaston 10dbadced8 Chess: Add chess application to Chess namespace
This is required to port the application to GML.
2024-05-16 07:41:05 +01:00
Nico Weber b6bbff5f3f LibGfx/WebPWriter: Move VP8L compression to WebPWriterLossless.{h,cpp}
* Matches how the loader is organized
* `compress_VP8L_image_data()` will grow longer when we add actual
  compression
* Maybe someone wants to write a lossy compressor one day

No behavior change.
2024-05-16 08:06:50 +02:00
Nico Weber c0f67a0188 LibGfx/WebPWriter: Remove a copy in the animated frame writing code path
This code path now also compresses to memory once, and then writes to
the output stream.

Since the animation writer has a SeekableStream, it could compress to
the stream directly and fix up offsets later. That's more complicated
though, and keeping the animated and non-animated code paths similar
seems nice. And the drawback is just temporary higher memory use, and
the used memory is smaller than the memory needed by the input bitmap.
2024-05-16 08:06:50 +02:00
Nico Weber 0b06cbdca2 LibGfx/WebPWriter: Move frame data writing out of write_ANMF_chunk()
No behavior change. This also makes it clear that the conditional
alignment at the end can just be a VERIFY() instead of a conditional.
2024-05-16 08:06:50 +02:00
Nico Weber 768a7ea1e5 LibGfx/WebP: Split out ANMFChunk header data into ANMFChunkHeader
No behavior change.
2024-05-16 08:06:50 +02:00
Nico Weber c183f73922 LibGfx/WebPWriter: Use write_VP8L_chunk() in animation frame writing
This code path still has a redundant copy of the compressed data
after this change, but it's less code this way.

No behavior change.
2024-05-16 08:06:50 +02:00
Nico Weber 885a3d8c5c LibGfx/WebPWriter: One fewer copy of encoded data when saving still webp
Before, we used to compress the image data to memory, then make another
copy to memory, and then write to the output stream.

Now, we compress to memory once and then write to the output stream.

No behavior change.
2024-05-16 08:06:50 +02:00
Nico Weber 33acd4e747 LibGfx/WebPWriter: Extract another align_to_two() helper 2024-05-16 08:06:50 +02:00
Nico Weber 0175fff659 LibGfx/WebPWriter: Extract compress_VP8L_image_data() function 2024-05-16 08:06:50 +02:00
Tim Ledbetter 51fc30a191 LibWeb: Implement the HTMLLinkElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter fc4e0cf10e LibWeb: Implement the HTMLFormElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter 0a3e1846f0 LibWeb: Implement the HTMLAreaElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter b7fd39c2e6 LibWeb: Implement the HTMLAnchorElement.relList attribute
This returns a DOMTokenList that reflects the `rel` attribute.
2024-05-16 08:06:26 +02:00
Tim Ledbetter 63246577d2 LibWeb: Use correct type for MessageEventInit.ports
This didn't work previously because the IDL generator used the
incorrect type for some types of sequences within dictionaries.
2024-05-16 08:04:01 +02:00
Tim Ledbetter 763b7f0e0c LibWeb: Implement the HTMLOptionElement.form attribute
This returns the parent form of a HTMLOptionElement or null if the
element has no parent form.
2024-05-16 08:03:13 +02:00
Tim Ledbetter fe7df98d7d LibWeb: Use correct IDL definition for CanvasImageData methods
It is now possible to pass an optional `ImageDataSettings` object to
the `CanvasImageData.createImageData()` and
`CanvasImageData.getImageData()` methods.
2024-05-16 08:02:59 +02:00
Andrew Kaster 28f728dfdb LibWeb: Implement FontFace.load() for url() based font sources 2024-05-16 08:02:43 +02:00
Andrew Kaster b7526a39b0 LibWeb: Expose StyleComputer's FontLoader class publicly
We'll want to explicitly load fonts from FontFace and other Web APIs
in the future. A future refactor should also move this completely away
from StyleComputer and call it something like 'FontCache'.
2024-05-16 08:02:43 +02:00
Andrew Kaster d76167b8a4 LibWeb: Add CSS ParsingContext constructor with a realm and URL
This is useful for when we want to parse paths relative to the current
ESO's api base url when there isn't a document, such as in a Worker
context.
2024-05-16 08:02:43 +02:00
Andrew Kaster 8872008958 LibWeb: Use correct JS_CELL name for WorkerEnvironmentSettingsObject 2024-05-16 08:02:43 +02:00
Tim Ledbetter 6290f96aa7 LibGUI: Don't crash when rendering a collapsible toolbar with no items
This prevents a crash in GML Playground that would occur when
previewing a GUI with a collapsible toolbar.
2024-05-15 08:28:24 +02:00
Hendiadyoin1 c8e4499b08 LibJS: Make return control flow more static
With this only `ContinuePendingUnwind` needs to dynamically check if a
scheduled return needs to go through a `finally` block, making the
interpreter loop a bit nicer
2024-05-15 04:25:14 +02:00
Hendiadyoin1 73fdd31124 LibJS: Avoid returning Completions from more Bytecode instructions 2024-05-15 04:25:14 +02:00
MacDue 99579f1f5e LibWeb: Use "valid-types" to define fill-rule in Properties.json
No behaviour change.
2024-05-14 23:01:18 +01:00
MacDue 6c9069fa5d LibWeb: Implement the SVG clip-rule attribute
This controls the fill rule used when rasterizing `<clipPath>` elements.
2024-05-14 23:01:18 +01:00
MacDue 8e00fba71d LibWeb: Correct naming in SVGPathPaintable
The DOM node is a graphics element (not a geometry element) as this
paintable was generalized (to handle things like text).

No behaviour change.
2024-05-14 23:01:18 +01:00
theonlyasdk 6da1d5eb57 Demos: Add sleep option to CatDog
Now you can put your CatDog to sleep while
you're at work :)
2024-05-14 15:45:33 -06:00
Liav A 40a8b009db DynamicLoader: Add an option to list all ELF loaded dependencies
This actually allows us to re-introduce the ldd utility as a symlink to
our dynamic loader, so now ldd behaves exactly like on Linux - it will
load all dynamic dependencies for an ELF exectuable.

This has the advantage that running ldd on an ELF executable will
provide an exact preview of how the order in which the dynamic loader
loads the executable and its dependencies.
2024-05-14 15:42:42 -06:00
Liav A 56790098ea Utilities: Rename ldd => elfdeps
As a preparation to introducing ldd as a symlink to /usr/lib/Loader.so
we rename the ldd utility to be elfdeps, at its sole purpose is to list
ELF object dependencies, and not how the dynamic loader loads them.
2024-05-14 15:42:42 -06:00
Liav A 7437ccd66d DynamicLoader: Add an option to change argv0
This is useful for testing ELF binaries that expose other functionalites
based on the argv0 string (BuggieBox, for example, does it to determine
which utility to run).
2024-05-14 15:42:42 -06:00
Liav A a5e2694ebf DynamicLoader: Add an option to dry-run an ELF exectuable
This option is useful for measuring time of dynamic linking and
profiling the DynamicLoader itself.
2024-05-14 15:42:42 -06:00
Liav A 8fc1f470ef DynamicLoader: Add standard argument parsing for executing ELF binaries
This change essentially puts the DynamicLoader with 2 roles - the first
one is to be invoked by the kernel to dynamically link an ELF executable
in runtime.

The second role is to allow running ELF executables explicitly from
userspace so the kernel runs the DynamicLoader as the "intended" program
but now the DynamicLoader can do its own commandline argument parsing
and run a specified binary, with future options being possible to
implement easily.
2024-05-14 15:42:42 -06:00
Liav A 7e8dfe758c LibCore: Add a small library with only ArgsParser for DynamicLoader
This will be used in the DynamicLoader code, as it can't do syscalls via
LibCore code.
Because we can't use most of the LibCore code, we convert the versioning
code in Version.cpp to use LibC uname() function.
2024-05-14 15:42:42 -06:00
implicitfield c44a8fa57c LibC: Implement mkfifoat(2) 2024-05-14 22:30:39 +02:00
implicitfield 4574a8c334 Kernel+LibC+LibCore: Implement mknodat(2) 2024-05-14 22:30:39 +02:00
Sönke Holz 53a1c25638 LibCoredump: Use AK::unwind_stack_from_frame_pointer 2024-05-14 14:02:06 -06:00
Sönke Holz 3059ac71f3 HackStudio: Use AK::unwind_stack_from_frame_pointer 2024-05-14 14:02:06 -06:00
Andreas Kling ce7c925924 LibJS/Bytecode: Allow assignment expression to write directly to locals 2024-05-14 21:46:36 +02:00