Commit graph

53228 commits

Author SHA1 Message Date
ronak69 06ee4b66d0 Userland: Add aliases to the macro in BuggieBox
Before, the `ENUMERATE_UTILITIES` macro only included utilities, and all
the aliases to the utilities were explicitly handled. This patch
combines utilities and aliases into one macro. This has the benefit of
being able to do operations involving both utilities and aliases without
having to choose which group to operate on first. Currently, aliases are
mixed with utilities while maintaining alphabetical sort.
2023-08-09 02:10:02 +02:00
Sam Atkins debf38ee9d LibWeb: Add namespaces to Attribute selectors
For now, we parse these, but don't actually consider the namespace when
matching them. `DOM::Element` does not (yet) store attribute namespaces
so we can't check what they are.
2023-08-08 20:49:45 +01:00
Sam Atkins 1858f06881 LibWeb: Add namespaces to Universal and TagName selectors 2023-08-08 20:49:45 +01:00
Sam Atkins 6c2ed0f51b LibWeb: Fix use-after-free in CSSNamespaceRule parsing
Holding the `prefix` as a StringView meant it pointed at string data
held by `token`. `token` gets reassigned shortly afterwards, meaning
`prefix` would hold invalid character data.
2023-08-08 20:49:45 +01:00
Sam Atkins 5042c903be LibWeb: Add SimpleSelector::QualifiedName, with parsing
This is basically a name with a namespace prefix. It will be used for
adding namespaces to Universal, TagName, and Attribute selectors.

For convenience, this can also optionally parse/store the `*` wildcard
character as the name.
2023-08-08 20:49:45 +01:00
Sam Atkins 4b7b726888 LibWeb: Track all namespace rules in a CSSStyleSheet, and expose them 2023-08-08 20:49:45 +01:00
Sam Atkins a8096d33ec LibWeb: Serialize @namespace using spec algorithms 2023-08-08 20:49:45 +01:00
Lucas CHOLLET e83b04417b LibGfx/JPEGXL: Implement the ANS decoder
This allows us to read many more images. This decoder is one of the two
possibilities (along Brotli) that can be used for modular images. All
the logic is directly taken from the spec.

One of the image that can now be decoded is "Lucifer's Dominion:
Synthesis" that can be found on `https://jpegxl.info/art/`, it also
makes us pass one more test of the conformance test suite, namely
"alpha_triangles".
2023-08-08 20:03:16 +02:00
Lucas CHOLLET 4da8c45e43 LibGfx/JPEGXL: Store distributions in a Variant
JPEG XL supports two types of entropy encoding: the first one is
Huffman-based (Brotli) and the second one is based on ANS. To introduce
the latter, we start by storing the `Vector` of distributions in a
`Variant`. This will allow us to choose which entropy decoder we use
during execution.
2023-08-08 20:03:16 +02:00
Tim Schumacher fb4db096cb Ports: Remove the filename entry from files 2023-08-08 19:57:43 +02:00
Tim Schumacher 2732545b4c Ports: Ensure that the download filename matches the URL basename
This is a preparation step for removing support for explicitly setting a
download filename entirely.
2023-08-08 19:57:43 +02:00
Tim Schumacher c71815bc91 Ports: Move handling for simple downloads into a separate function 2023-08-08 19:57:43 +02:00
Tim Schumacher a37b95f465 Ports: Do file downloading in a single big loop 2023-08-08 19:57:43 +02:00
Tim Schumacher 284fee9e77 Ports: Make files a proper array 2023-08-08 19:57:43 +02:00
Timothy Flynn 3c2d846b94 CI: Restore running test262 and Wasm tests 2023-08-08 10:59:41 -04:00
Aliaksandr Kalenik 5f364e9bc1 LibWeb: Rename is_scrollable() to is_user_scrollable()
is_user_scrollable() is more appropriate name since this function
returns true only for boxes scrollable by user interaction.
2023-08-08 16:55:14 +02:00
Aliaksandr Kalenik 491da2a810 LibWeb: Use is_scroll_container instead of is_scrollable in JS APIs
is_scroll_container() returns true for "overflow: hidden" which allows
programmable scrolling while is_scrollable() returns true only for
"overflow: scroll" and "overflow: auto" which allow scrolling only by
user interactions.
2023-08-08 16:55:14 +02:00
Aliaksandr Kalenik 869bef523e LibWeb: Return true for "overflow: auto" from Box::is_scrollable()
is_scrollable() is currently used to determine if box support scroll
user interaction so it should return true for "auto" overflow.
2023-08-08 16:55:14 +02:00
Aliaksandr Kalenik 1b63095271 LibWeb: Compensate scroll offset translation before clip rect is applied
Position where box clip rect is applied should not be affected by
current scroll offset.
2023-08-08 16:55:14 +02:00
Aliaksandr Kalenik cdf8b9e943 LibWeb/Painting: Translate by scroll offset before painting descendants
Fixes painting of nested nodes in scrollable containers by moving
painter's scroll offset translation from paint_node() to
before_children_paint() and after_children_paint().
2023-08-08 16:55:14 +02:00
Tom L 325d1553ca Base+LibCards: Add basic set of playing card backs 2023-08-08 14:56:25 +01:00
Tim Ledbetter b073d1dd8c usermod: Make error message less verbose 2023-08-08 15:15:43 +02:00
Tim Ledbetter 0875446b38 usermod: Remove premature root user check
This allows the use of `--help`, for example.
2023-08-08 15:15:43 +02:00
Tim Ledbetter 827e23940a usermod: Don't set the EGID to 0
This is unnecessary, as usermod isn't a SUID binary.
2023-08-08 15:15:43 +02:00
Karol Kosek 55b6e07a0f Userland: Open files for save in write-only mode
WavWriter and the shot utility open files with this mode and never
truncate the files, which might leave some contents of a previous file
during overwriting.
2023-08-08 15:13:43 +02:00
Daniel Bertalan fb305b66c2 LibJS: Enable await test that used to crash in AST mode
Now that the AST interpreter has been removed, this can be a simple
XFAIL.
2023-08-08 15:09:53 +02:00
Daniel Bertalan 7ac6af1998 LibJS: Uncomment passing tests 2023-08-08 15:09:53 +02:00
MacDue 5f0d3c083f LibWeb: Allow (explicitly) converting CSSPixels to float and int
...and remove some unnecessary cast chains.
2023-08-08 14:58:26 +02:00
Timothy Flynn c20df34b79 LibJS: Remove bytecode option from the test262 runner
This scripts have been updated to not use this option.
2023-08-08 13:30:45 +02:00
Sam Kravitz c97eec030c LibJS: Test function toBeCloseTo takes an optional precision argument
Modeled after the equivalent Jest function.
https://jestjs.io/docs/expect#tobeclosetonumber-numdigits
2023-08-08 13:29:56 +02:00
Sam Kravitz 73c8650ea0 LibJS: Expect this.target to have typeof number in toBeCloseTo
The previous expectation of typeof value was inconsistent with the
expect message.
2023-08-08 13:29:56 +02:00
Andreas Kling 2eaa528a0e LibJS: Rip out the AST interpreter :^)
This has been superseded by the bytecode VM, which is both faster
and more capable.
2023-08-08 13:07:13 +02:00
Andreas Kling fcc72a787b Spreadsheet: Use the LibJS bytecode VM 2023-08-08 13:07:13 +02:00
Andreas Kling acd366eddd Assistant: Use the LibJS bytecode VM 2023-08-08 13:07:13 +02:00
Andreas Kling 3bb06cc719 Fuzzers: Use the LibJS bytecode VM 2023-08-08 13:07:13 +02:00
Andreas Kling e2c8d5859e LibJS: Remove ability to disable bytecode VM 2023-08-08 13:07:13 +02:00
Andreas Kling 9a709e03a3 test262-runner: Remove ability to run with AST interpreter
I'm leaving the --use-bytecode CLI option here as a no-op for now, until
we get all the scripts updated. But the program always runs in bytecode
mode now.
2023-08-08 13:07:13 +02:00
Andreas Kling 99ac34eeae Ladybird+LibWebView+Browser: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andreas Kling e769776bdd Ladybird: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andreas Kling 4eb43cc107 Browser: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andreas Kling e7e52f95ec headless-browser: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andreas Kling efe3eb8f4c test-js: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andreas Kling a75b51de10 js: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andreas Kling 9df7bf79cc LibJS: Add create_simple_execution_context<GlobalObjectType>() helper
This makes it easy to set up a realm, global object and root execution
context with a single call to LibJS. It will be useful to basically
everyone except LibWeb.
2023-08-08 13:07:13 +02:00
Andreas Kling d1d24569f8 LibJS/Bytecode: Remove unused AST interpreter hacks from bytecode VM 2023-08-08 13:07:13 +02:00
Andreas Kling 196e04d1c7 CI: Stop running test-js with the AST interpreter 2023-08-08 13:07:13 +02:00
Andi Gallo 7bd00d6a42 LibWeb: Snap table grid to device pixels in separate borders mode
Build a grid snapped to device pixels and use it to construct the
rectangles for the cell edges, same as for collapsed borders. This is
especially important when border-spacing is set to 0 since it avoids
gaps between adjacent cells which have borders set.
2023-08-08 12:26:11 +02:00
Jelle Raaijmakers 14091f32c6 Browser: Synchronize database statements used for cookies
Since SQLServer is inherently asynchronous, database statements can run
in parallel. Our `CookieJar` did not require synchronous actions on the
database for its cookies, resulting in cookies not being set
immediately. This resulted in a bug that could be exposed by setting
`document.cookie` and immediately querying its value, revealing that the
cookie was not yet persisted.

Solve this by requiring all database statements to be executed
synchronously. Ideally SQLServer has a mechanism to determine interquery
dependencies and blocks until dependent queries are fully executed, but
until we have that, this works around that limitation.
2023-08-08 06:25:11 -04:00
Aliaksandr Kalenik 568c486610 LibWeb: Support positioning of abspos boxes inside grid container
- Out-of-flow items should not affect grid layout
- "The static position of an absolutely-positioned child of a grid
  container is determined as if it were the sole grid item in a grid
  area whose edges coincide with the content edges of the grid
  container."
2023-08-08 11:31:35 +02:00
Sam Kravitz 073eb46824 LibJS: Apply the correct precedence for unary + and - operators
When determining the precedence of the + and - operators, the parser
always returned the precedence using these operators in a binary
expression (lower than division!). The context of whether the operator
is used in a unary or binary expression must be taken into account.
2023-08-08 07:41:07 +02:00