Commit graph

57207 commits

Author SHA1 Message Date
Sam Atkins
b569ab72e8 LibWeb: Correct grid-template-areas definition
The spec syntax is `none | <string>+` and `none` is the default.
2023-12-08 10:47:23 +00:00
Sam Atkins
c3583317ee LibWeb: Parse grid-auto-flow property using TokenStream
RefPtr is already `[[nodiscard]]` so we can remove that extra noise from
the declaration.
2023-12-08 10:47:23 +00:00
Sam Atkins
bbbd9c14ac LibWeb: Parse grid-area property using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
a16b35a755 LibWeb: Parse grid-column and grid-row properties using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
b18c334a4f LibWeb: Ensure there are no trailing tokens when parsing font-family 2023-12-08 10:47:23 +00:00
Sam Atkins
f84ccb8627 LibWeb: Part font property using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
333b705f25 LibWeb: Parse flex-flow property using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
bf3576667a LibWeb: Parse flex property using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
4f3136c230 LibWeb: Parse shadow values using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
3a36b2eea9 LibWeb: Parse border properties using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
0e00d9a67d LibWeb: Parse background property using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
64a44b719e LibWeb: Parse FilterValueListStyleValue using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
2efaadd63c LibWeb: Parse aspect-ratio property using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
647d52ff9a LibWeb: Parse quotes property using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
ebad94658a LibWeb: Parse display property using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
3d6eb36664 LibWeb: Parse content property using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
4d6e8d8f37 LibWeb: Parse border-radius properties using TokenStream 2023-12-08 10:47:23 +00:00
Sam Atkins
28c719fff5 LibWeb: Extract contains_single_none_ident() helper function
Several CSS properties can be `none` instead of their usual value.
2023-12-08 10:47:23 +00:00
Sam Atkins
1cc88dc4bc LibWeb: Make parse_comma_separated_value_list() take a TokenStream
This lets us use it from inside places that use TokenStreams.
2023-12-08 10:47:23 +00:00
Sam Atkins
cd9344d4c1 LibWeb: Clarify naming of TokenStreams in parse_css_value()
Originally, the input was named `tokens`, and we later created a
`tokens_without_whitespace` from the filtered contents of `tokens`.
Since `tokens_without_whitespace` is what we actually want to use while
parsing, let's rename `tokens` -> `unprocessed_tokens` and use the
`tokens` name for the processed ones.
2023-12-08 10:47:23 +00:00
Andreas Kling
81daf1752b LibWeb: Retreive CSS cursor before changing hovered node
This fixes an elusive issue where changing the hovered node would cause
a JS event handler to run, changing the shape of the paint tree before
we had a chance to get the cursor.

A more robust fix here will be to let paintables own their used/computed
values (so they don't have to look into the layout tree for them) but
that's a much bigger change.
2023-12-08 10:54:40 +01:00
tetektoza
8118ea764f NetworkSettings: Port NetworkSettings to GML compilation 2023-12-08 01:06:09 +01:00
tetektoza
1e11116d65 VideoPlayer: Port VideoPlayer to GML compilation 2023-12-08 01:06:09 +01:00
tetektoza
e26548989a GamesSettings: Port GamesSettings to GML compilation
Co-Authored-By: Tim Schumacher <timschumi@gmx.de>
2023-12-08 01:06:09 +01:00
tetektoza
935aaab757 HexEditor: Port HexEditor to GML compilation 2023-12-08 01:06:09 +01:00
tetektoza
bcec05a7cb GMLCompiler: Add enum initializer for button_style property
This patch adds missing enum initializer for button_style property in
enum initializer generator in GML compiler.
2023-12-08 01:06:09 +01:00
tetektoza
c583888cc9 GMLCompiler: Add enum initializer for checkbox_position property
This patch adds a enum initializer for checkbox_position property
used in .gml files which are parsed by GML compiler.
2023-12-08 01:06:09 +01:00
tetektoza
0be70ed97a GMLCompiler: Add enum initializer for opportunistic_resizee property
This patch adds a enum initializer for opportunistic_resizee and
makes the method that uses this property public so it's available for
GML compiler.
2023-12-08 01:06:09 +01:00
Tim Schumacher
35d4b36201 GMLCompiler: Fully qualify child class names
If we don't do this, and there a class in a namespace with the same
name, type resolution gets confused between `<namespace>::<class>` and
`<class>::<constructor>`.
2023-12-08 01:06:09 +01:00
tetektoza
9deaa74ad6 LibGUI: Split HorizontalSlider to separate header
This patch splits HorizontalSlider to separate header so it can be used
as a component in .gml files with new GML compiler.
2023-12-08 01:06:09 +01:00
Andreas Kling
f47a14b9d6 LibJS: Use a premade shape when creating iterator result objects
Instead of going through the steps of creating an empty new object,
and adding two properties ("value" and "done") to it, we can pre-bake
a shape object and cache the property offsets.

This makes creating iterator result objects in the runtime much faster.

47% speedup on this microbenchmark:

    function go(a) {
        for (const p of a) {
        }
    }
    const a = [];
    a.length = 1_000_000;
    go(a);
2023-12-08 00:54:05 +01:00
Jesús (gsus) Lapastora
706710fa13 LibJS/JIT: Make generating GDB images opt-in
Since generating GDB image can be expensive, it is disabled by default
and can be activated by setting the `LIBJS_JIT_GDB` environment
variable.
2023-12-07 15:34:38 -07:00
Jesús (gsus) Lapastora
f0b984567a LibJS/JIT: Produce & register an ELF image for GDB JIT Interface
Using the code that it has just produced, the JIT::Compiler can build an
ELF image so that we can attach meaningful symbols to JITted code, and
thus enable GDB to display more information about the code that we're
running.
2023-12-07 15:34:38 -07:00
Jesús "gsus" Lapastora
149e382735 LibJIT: Integrate GDB JIT Interface with ELF builders
Provide a function to create an ELF image in a format GDB expects.
Outside of ELF platforms this image doesn't make much sense, and in
MacOS a Mach-O memory image is required: see
https://chromium.googlesource.com/v8/v8.git/+/refs/heads/main/src/diagnostics/gdb-jit.cc#1802

Since GDB requires active runtime addresses for the code, copying the
generated code into the image will not help. Instead, `build_gdb_image`
writes the runtime addresses of the code into a NOBITS `.text` section.
2023-12-07 15:34:38 -07:00
Jesús (gsus) Lapastora
48a9d0ede8 LibELF: Add builders to help with creating ELF images
Introduces new builders, mainly `SectionTable` and `StringTable`, and a
final `build_elf_image` to merge everything into a single memory image.

Each of the builders are fully detached from one another, although
StringTable provides an extra API to remove steps when using it with a
SectionTable.

This automates the part of figuring out and properly writing offsets to
headers, and making sure all required data is properly copied and
referenced in the final image.
2023-12-07 15:34:38 -07:00
Jesús (gsus) Lapastora
bc70144df1 LibJIT: Enable registering JITted objects into GDB
The new JIT::GDB namespace enables registering JITted objects into GDB
dynamically.

Its clients just have to ensure the memory they give to
`register_into_gdb` is in a format that GDB can understand, either by
generating an object file in memory with debug info + symbols or by
registering a custom debug info parser.
None of these are implemented by this API; it only implements the
registering part and lets the client to choose the data format.

GDB JIT Interface:
https://sourceware.org/gdb/current/onlinedocs/gdb.html/JIT-Interface.html#JIT-Interface
Things to take into account from v8's docs, some of which we may
improve: https://v8.dev/docs/gdb-jit#known-limitations
2023-12-07 15:34:38 -07:00
Timothy Flynn
7e974f530d Ladybird+LibWebView: Add an Inspector action to clone a DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
d5d6ff8bf1 Ladybird+LibWebView: Add an Inspector action to insert a child DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
c6a11a77b5 LibWebView+WebContent: Add a WebContent IPC to clone a DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
111e53a2f6 LibWebView+WebContent: Add WebContent IPC to create children DOM nodes
This adds IPC to create append a child <div> element or a text node to
a DOM node.
2023-12-07 23:16:34 +01:00
Andrew Kaster
bb217fb0d7 Meta: Add Bastiaan van der Plaat to the contributors list :^) 2023-12-07 14:56:19 -07:00
Bastiaan van der Plaat
3bfc2f5e95 LibWeb: Declare optional parse results inlined in if statements 2023-12-07 16:46:50 -05:00
Bastiaan van der Plaat
1b9a961fb0 LibWeb: Add input stepUp and stepDown functions 2023-12-07 16:46:28 -05:00
Bastiaan van der Plaat
1a63639518 LibWeb: Move logic to check if valueAsNumber applies to its own function 2023-12-07 16:46:28 -05:00
Bastiaan van der Plaat
c0751b2a49 LibWeb: Add basis of the convert number to string algorithm functions 2023-12-07 16:46:28 -05:00
Andrew Kaster
39c4a5e948 LibWeb: Add config file for LibWeb tests that skips Worker-echo.html 2023-12-07 16:46:20 -05:00
Andrew Kaster
4786d9e3e6 headless-browser: Add ability to skip tests 2023-12-07 16:46:20 -05:00
Reimar
4299fb604b LibWeb: Add window.status property 2023-12-07 11:02:50 -07:00
Kemal Zebari
3a820ddbdf LibWeb/MimeSniff: Add sniffing in an audio or video context 2023-12-07 10:31:54 -07:00
Kemal Zebari
02ea85da2c LibWeb/MimeSniff: Add sniffing in an image context 2023-12-07 10:31:54 -07:00