Commit graph

6099 commits

Author SHA1 Message Date
Ali Mohammad Pur
5a4d657a4e LibRegex: Avoid generating ForkJumps when jumping to the next alt block
Fixes #2398.
2024-11-17 20:12:39 +01:00
Shannon Booth
b264d18ad1 LibWeb: Fix missing auxiliary logic for cross document navigation
I noticed this missing check when trying to debug an unrelated issue. I
don't know what it could fix, but this seems like an oversight.
2024-11-17 11:37:43 -05:00
Ali Mohammad Pur
00bc22c332 LibRegex: Don't immediately ignore TempInverse in optimizer
fe46b2c141 added the reset-temp-inverse flag, but set it up so all
tempinverse ops were negated at the start of the next op; this commit
makes it so these flags actually persist for one op and not zero.

Fixes #2296.
2024-11-17 09:03:29 -05:00
Andreas Kling
69c84d3f63 LibWeb: Make sure we don't fire "once" event listeners twice
Spec bug: https://github.com/whatwg/dom/issues/1323
2024-11-17 14:56:35 +01:00
Shannon Booth
0339ece565 LibWeb: Add missing initialize call to WritableStreamDefaultController 2024-11-17 08:51:41 -05:00
Shannon Booth
8d93cac983 LibWeb: Return GC::Ref for some Stream promise returning functions
These will never return null.
2024-11-16 18:33:58 +01:00
Shannon Booth
ab309dcc58 LibWeb: Change URL parsing sequence for window open steps
This adapts to the latest HTML spec which fixed the issue we had
reported of:

https://github.com/whatwg/html/commit/316b83
2024-11-16 18:22:35 +01:00
sideshowbarker
ed7ec7a0f8 LibWeb: Fix accname computation for all aria-labelledby cases
This change ensures that:

- if an element for which an accessible name otherwise wouldn’t be
  computed is referenced in an aria-labelledby value, the accessible
  name for the element will be computed as expected.

- if an element has both an aria-label value and also an
  aria-labelledby value, the text from the aria-label value gets
  included in the computation of the element’s accessible name.

Otherwise, without this change, some elements with aria-labelledby
values will unexpectedly end up without accessible names, and some
elements with aria-label values will unexpectedly not have that
aria-label value included in the element’s accessible name.
2024-11-16 18:21:37 +01:00
Andreas Kling
13bd52249d LibWeb: Make Selection APIs throw on DocumentType node inputs
This matches the behavior of all major engines, and is covered by
hundreds of subtests in WPT.

Spec PR: https://github.com/w3c/selection-api/pull/342
2024-11-16 14:39:55 +01:00
Jonne Ransijn
c3783cf3bd LibIDL: Fix use-after-free in GenerateWindowOrWorkerInterfaces
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
`lexical_bases` was storing `StringView`s into `ByteString`s returned
from `LexicalPath::string()` that might no longer exist.
2024-11-16 10:30:14 +01:00
Lucas CHOLLET
63873f3809 LibWeb/CSS: Add support for the rec2020 color space in color()
This color space is often used as a reference in WPT tests, having
support for it makes us pass 15 new tests:
  - css/css-color/rec2020-001.html
  - css/css-color/rec2020-002.html
  - css/css-color/rec2020-003.html
  - css/css-color/rec2020-004.html
  - css/css-color/rec2020-005.html
  - css/css-color/predefined-011.html
  - css/css-color/predefined-012.html
2024-11-16 10:29:46 +01:00
Lucas CHOLLET
2173219eac LibGfx: Fix parameters name of Color::from_linear_srgb
And sort the declarations alphabetically while touching it.
2024-11-16 10:29:46 +01:00
Lucas CHOLLET
0b9c4b8adc LibWeb/CSS: Add support for the prophoto-rgb color space in color()
That makes us pass the following WPT tests:
 - css/css-color/prophoto-rgb-001.html
 - css/css-color/prophoto-rgb-002.html
 - css/css-color/prophoto-rgb-003.html
 - css/css-color/prophoto-rgb-004.html
 - css/css-color/prophoto-rgb-005.html
 - css/css-color/predefined-009.html
 - css/css-color/predefined-010.html
2024-11-16 10:29:46 +01:00
Lucas CHOLLET
596a4e55dd LibWeb/CSS: Add support for the display-p3 color space in color()
This color space is often used as a reference in WPT tests, having
support for it makes us pass 15 new tests:
  - css/css-color/display-p3-001.html
  - css/css-color/display-p3-002.html
  - css/css-color/display-p3-003.html
  - css/css-color/display-p3-004.html
  - css/css-color/display-p3-005.html
  - css/css-color/display-p3-006.html
  - css/css-color/lab-008.html
  - css/css-color/lch-008.html
  - css/css-color/oklab-008.html
  - css/css-color/oklch-008.html
  - css/css-color/predefined-005.html
  - css/css-color/predefined-006.html
  - css/css-color/xyz-005.html
  - css/css-color/xyz-d50-005.html
  - css/css-color/xyz-d65-005.html
2024-11-16 10:29:46 +01:00
Lucas CHOLLET
f949334a9a LibGfx: Use a more explicit formula in Color::from_linear_srgb
NFC. I prefer having the constants expanded, it makes it easier to trace
them back to the initial formula.
2024-11-16 10:29:46 +01:00
Lucas CHOLLET
a59d9a3986 LibWeb/CSS: Add support for the a98-rgb color space in color()
This makes us pass the following WPT tests:
 - css/css-color/a98rgb-001.html
 - css/css-color/a98rgb-002.html
 - css/css-color/a98rgb-003.html
 - css/css-color/a98rgb-004.html
 - css/css-color/predefined-007.html
 - css/css-color/predefined-008.html
2024-11-16 10:29:46 +01:00
Luke Wilde
c0ae3aa884 LibWeb: Add CMake dependencies for GeneratedCSSStyleProperties.idl
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Co-Authored-By: Andrew Kaster <andrew@ladybird.org>
2024-11-15 16:08:19 -07:00
Jelle Raaijmakers
e5d71a6c82 LibWeb: Apply the paint transformation in SVGGradientElement
In commit 1b82cb43c2 I accidentally
removed the paint transformation altogether. The result was that
zoomed-in SVGs, or SVG elements with a transformation applied could have
their gradient coordinates misplaced significantly.

This was also exposed in the `svg-text-effects` test by way of a slight
visual difference. Add a new test that very clearly exposes the fixed
issue by rotating the gradient coordinates by 45 degrees.
2024-11-15 23:21:13 +01:00
Jelle Raaijmakers
e21b5cab32 LibWeb: Change Array<T,Size> to Array in DisplayListPlayerSkia
No functional changes.
2024-11-15 23:21:13 +01:00
Nico Weber
ae7ee22aea LibWeb: Don't copy url when calling determine_the_origin() in Navigable
In #1537, determine_the_origin() changed to take
`Optional<URL::URL> const&` as first parameter, but it's passed
`Web::Fetch::Infrastructure::Response::url()`, which returns
`Optional<URL::URL const&>`. Ladybird does not have
SerenityOS/serenity#22870 (yet?), so this mismatch silently creates
a copy.

Change determine_the_origin() to take `Optional<URL::URL const&>`
instead. No behavior change, saves a copy, and is probably what
was originally intended.
2024-11-15 23:19:40 +01:00
Andreas Kling
87fc7028d7 LibWeb: Add WebSocket task source
The WebSocket spec tells us to queue tasks instead of firing events
synchronously at WebSockets, so this commit does exactly that.

The way we've implemented web sockets means that the work is spread
across multiple libraries and even processes, which is why it doesn't
look like the spec verbatim.
2024-11-15 23:18:10 +01:00
Lucas CHOLLET
7c2601f315 LibWeb/CSS: Add support for the srgb-linear color space in color()
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
That makes us pass the following WPT tests:
 - css/css-color/srgb-linear-001.html
 - css/css-color/srgb-linear-002.html
 - css/css-color/srgb-linear-003.html
2024-11-15 20:34:18 +01:00
Luke Wilde
6319dedbcd LibJS: Perform TLA async function construction in the module context
Previously it was only pushing the module context for the call to
capture the module execution context. This is incorrect, as the capture
occurs upon function construction. This resulted in it capturing the
execution context that execute_module was called from, instead of the
newly created module_context.
f87041bf3a/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp (L92)

This can be demonstrated with the following setup:
index.html:
```html
<script>
    var foo = 1;
</script>
<script type="module">
    import {test} from "./scriptA.mjs";
</script>
```

scriptA.mjs:
```js
function foo() {
	return {a: "b"};
}
export let test = await foo();
```

Before this fix, this would throw:
```
[TypeError] 1 is not a function (evaluated from 'foo')
    at module code with top-level await
    at module code with top-level await
    at <unknown>
    at <unknown>
```

Fixes #2245.
2024-11-15 18:52:22 +01:00
Andrew Kaster
1383d03c02 LibWeb: Add remaining states to the Swift tokenizer
This includes all the DOCTYPE and Character reference states, as well as
a few RAWTEXT ones that were missing by accident.
2024-11-15 10:51:45 -07:00
Andrew Kaster
9812fac2c3 Meta+LibGfx: Exclude Metal and Vulkan headers from Clang module map
These headers are platform-specific, and shouldn't need to be used by
Swift code anyway.
2024-11-15 10:51:45 -07:00
Jelle Raaijmakers
b895a135d5 LibWeb: Update spec implementation for SubtleCrypto.deriveKey()
Our spec issue got resolved, including a bonus fix!

See: https://github.com/w3c/webcrypto/pull/384
2024-11-15 18:51:15 +01:00
Aliaksandr Kalenik
71eded0471 LibCore: Recognize .xht as XHTML in MIME parser for file names
Fixes a bug when https://wpt.live/css/CSS2/positioning/abspos-001.xht
saved as file fails because we incorrectly recognized its MIME type
as HTML, leading to incorrect self-closing tag handling and thus
incorrect rendering.
2024-11-15 18:50:38 +01:00
Luke Wilde
079c28d5e6 LibWeb: Make MessageEvents from {Window,MessagePort}.postMessage trusted
The MessagePort one in particular is required by Cloudflare Turnstile,
as the method it takes to run JS in a worker is to `eval` the contents
of `MessageEvent.data`. However, it will only do this if
`MessageEvent.isTrusted` is true, `MessageEvent.origin` is the empty
string and `MessageEvent.source` is `null`.

The Window version is a quick fix whilst in the vicinity, as its
MessageEvent should also be trusted.
2024-11-15 18:50:08 +01:00
Shannon Booth
f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00
Andreas Kling
ce23efc5f6 LibWeb: Make CSS display serialization match other engines
The spec just says to follow "most backwards-compatible, then shortest"
when serializing these (and it does so in a very hand-wavy fashion).

By omitting some keywords when they are implied, we end up matching
other engines and pass a bunch of WPT tests.
2024-11-15 14:46:09 +01:00
Andreas Kling
3ecc843cff LibWeb: Handle undefined arguments correctly in the Option constructor
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
The hand-rolled factory function wasn't handling undefined values
entirely correctly.
2024-11-15 12:54:41 +01:00
Andreas Kling
77d30a0cb7 LibWeb: Don't include SVG script element in HTMLOptionElement.text
We had an old FIXME for this from times before SVGScriptElement was
a thing in our codebase.
2024-11-15 12:54:41 +01:00
Andreas Kling
4c2d4cdf50 LibWeb: Implement HTMLOptionElement.label more correctly
This shouldn't just be a simple reflection of the label attribute.
It also needs fallback to the HTMLOptionElement.text property if the
label attribute is absent.
2024-11-15 12:54:41 +01:00
Jelle Raaijmakers
f7993495bd LibWeb: Set key extractability in SubtleCrypto::derive_key()
None of the algorithms actually set the `extractable` internal slot in
their implementations, and looking at `SubtleCrypto::import_key()` it
seems likely that a step is missing here.
2024-11-15 12:32:04 +01:00
Jelle Raaijmakers
f8c853712e LibWeb: Add some missing spec links to Crypto 2024-11-15 12:32:04 +01:00
Jelle Raaijmakers
b290c180e0 LibWeb: Move PBKDF2::import_key() up in the file
Let's try to keep algorithm implementations together. No functional
changes.
2024-11-15 12:32:04 +01:00
justus2510
a6e9f107eb LibWeb: Fix Canvas.toDataURL and Canvas.toBlob signatures
Fix the function signatures of Canvas.toDataURL() and Canvas.toBlob()
and make both functions accept non-numbers as the quality parameter, in
which case it will just use the default quality instead of raising an
exception.
This makes toDataURL.arguments.1.html, toDataURL.arguments.2.html and
toDataURL.jpeg.quality.notnumber.html in
wpt/html/semantics/embedded-content/the-canvas-element pass :^)
2024-11-15 10:46:24 +01:00
Andreas Kling
dc9179bb1b LibWeb: Keep track of the order in which option elements are selected
This allows us to locate the most-recently-selected when running the
selectedness update algorithm.
2024-11-14 23:06:30 +01:00
Sam Atkins
c747b1c6b5 LibWeb: Calculate hidden password text using code-point count
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
This means that an `<input type=password>` will show the correct number
of *s in it when non-ASCII characters are entered.

We also don't need to perform text-transform on these as that doesn't
affect the output length, so I've moved it earlier.
2024-11-14 20:23:58 +01:00
Sam Atkins
3a71b8cda3 LibWeb/CSS: Reject invalid :has() contents after absolutizing nesting
After we absolutize the contents of :has(), we check that those child
selectors don't contain anything that :has() rejects.

This is a separate path than the checks inside the parser, which is
unfortunate.

Fixes a WPT ref test. :^)
2024-11-14 19:51:45 +01:00
Sam Atkins
da31c10ce1 LibWeb/CSS: Allow Selector::absolutized() to return null
It's possible for absolutizing a selector to return an invalid selector
(eg, it could cause `:has()` inside `:has()`) so we need to be able to
express that.
2024-11-14 19:51:45 +01:00
Sam Atkins
3a43fa9e35 LibWeb/CSS: Tag forgiving selector lists while parsing 2024-11-14 19:51:45 +01:00
Sam Atkins
7f803c5c3d LibWeb/CSS: Disallow :has() and pseudo-elements in :has() when parsing 2024-11-14 19:51:45 +01:00
Sam Atkins
ad1f93504e LibWeb/CSS: Make :has() take a <relative-selector-list>
The spec changed this at some point.
2024-11-14 19:51:45 +01:00
Luke Wilde
a94282e0e8 LibWeb: Make CSSStyleDeclaration a legacy platform object with indices
CSSStyleDeclaration has an indexed property getter, which returns
properties associated with the object in the order they were specified
in.
2024-11-14 19:50:22 +01:00
Luke Wilde
aacf9b08ed LibWeb: Generate IDL attributes for all supported CSS properties
The CSSOM spec tells us to potentially add up to three different IDL
attributes to CSSStyleDeclaration for every CSS property we support:
- A camelCased attribute, where a dash indicates the next character
  should be uppercase
- A camelCased attribute for every -webkit- prefixed property, with the
  first letter always being lowercase
- A dashed-attribute for every property with a dash in it.

Additionally, every attribute must have the CEReactions and
LegacyNullToEmptyString extended attributes specified on it.

Since we specify every property we support with Properties.json, we can
use that file to generate the IDL file and it's implementation.

We import it from the Build directory with the help of multiple import
base paths. Then, we add it to CSSStyleDeclaration via the mixin
functionality and inheriting the generated class in
CSSStyleDeclaration.
2024-11-14 19:50:22 +01:00
Luke Wilde
d95ae629ee LibIDL: Allow overwriting the generated attribute callback name
This will allow the CSSStyleDeclaration IDL attribute generator to
implement it's own C++ acceptable identifier sanitization and
deduplication.
2024-11-14 19:50:22 +01:00
Luke Wilde
300f212044 LibIDL: Support multiple import base paths for resolving imports
This allows us to specify multiple base paths to look for imported IDL
files in. This will allow us to import IDL files from sources and from
the Build directory (i.e. for generated IDL files).
2024-11-14 19:50:22 +01:00
Luke Wilde
5aacb053a3 LibWeb: Fix OBOE in bounds check of ResolvedCSSStyleDeclaration#item
Without this, it would return "(invalid CSS::PropertyID)" when
requesting item(decl.length).
2024-11-14 19:50:22 +01:00
Aliaksandr Kalenik
1a1fb14e26 LibWeb: Recompute selection state in Document::update_layout()
Fixes a bug when text selection disappears after relayout.
2024-11-14 19:48:43 +01:00
Aliaksandr Kalenik
d7caa426a0 LibWeb: Delete m_selected flag from Paintable
This was redundant when Paintable already has `m_selection_state` that
could be none.
2024-11-14 19:48:43 +01:00
stelar7
5b67f17551 LibWeb: Sset the key_usages on X25519 export in a better way 2024-11-14 19:48:06 +01:00
stelar7
19ee8ddec2 LibWeb: Correctly set the key_usages on HMAC export 2024-11-14 19:48:06 +01:00
stasoid
1c77135948 LibCore: Port EventLoop to Windows 2024-11-14 11:18:38 -07:00
Timothy Flynn
d4f8b598cb LibWeb: Consolidate the attribute change handlers
We currently have 2 virtual methods to inform DOM::Element subclasses
when an attribute has changed, one of which is spec-compliant. This
patch removes the non-compliant variant.
2024-11-14 15:39:02 +01:00
Shannon Booth
c2988a7dd5 LibJS: Don't directly teach the heap about the javascript VM or Realm
Instead, smuggle it in as a `void*` private data and let Javascript
aware code cast out that pointer to a VM&.

In order to make this split, rename JS::Cell to JS::CellImpl. Once we
have a LibGC, this will become GC::Cell. CellImpl then has no specific
knowledge of the VM& and Realm&. That knowledge is instead put into
JS::Cell, which inherits from CellImpl. JS::Cell is responsible for
JavaScript's realm initialization, as well as converting of the void*
private data to what it knows should be the VM&.
2024-11-14 15:38:45 +01:00
Shannon Booth
ae6d105f41 LibJS: Use a Function to indirectly let Heap visit VM's GC roots
This allows the heap to mark cells that it needs to mark as roots
without needing to directly reference the VM.
2024-11-14 15:38:45 +01:00
Shannon Booth
0bf2a8362a LibJS: Make Value inherit from a NanBoxedValue
NanBoxedValue is intended to be a GC-allocatable type which is not
specific to javascript, towards the effort of factoring out the GC
implementation from LibJS.
2024-11-14 15:38:45 +01:00
Shannon Booth
c0bcebeb08 LibJS: Add const versions of Cell::visit 2024-11-14 15:38:45 +01:00
Sam Atkins
5a1eb9e220 LibWeb/CSS: Keep invalid parts of <forgiving-selector-list>s around
Attempt 2! Reverts 2a5dbedad4

This time, set up a different combinator when producing a relative
invalid selector rather than a standalone one. This fixes the crash.

Original description below for simplicity because it still applies.

---

Selectors like `:is(.valid, &!?!?!invalid)` need to keep the invalid
part around, even though it will never match, for a couple of reasons:

- Serialization needs to include them
- For nesting, we care if a `&` appeared anywhere in the selector, even
  in an invalid part.

So this patch introduces an `Invalid` simple selector type, which simply
holds its original ComponentValues. We search through these looking for
`&`, and we dump them out directly when asked to serialize.
2024-11-14 13:20:01 +01:00
Jelle Raaijmakers
329cd946ac LibWeb: Implement Web Crypto HMAC algorithm
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
2024-11-14 11:52:18 +01:00
Jelle Raaijmakers
884a4163a0 LibWeb: Centralize validating a JWK's key_ops field
This gets rid of a couple FIXMEs and allows reusing the logic of
validating this field between different algorithms. While we're here,
expand its logic to match the constraints as outlined in RFC 7517.
2024-11-14 11:52:18 +01:00
Jelle Raaijmakers
f73a434177 LibWeb: Centralize getting the hash algorithm identifier for crypto 2024-11-14 11:52:18 +01:00
Timothy Flynn
4e1dab477a LibWebView+UI: Handle common WebView client initialization in LibWebView
No need to have every UI manually implement these common steps.
2024-11-14 11:47:32 +01:00
Timothy Flynn
44d6601dc5 LibWebView+UI: Handle worker agent requests from within LibWebView
There is no longer any UI-specific facilities needed to launch a worker
agent.
2024-11-14 11:47:32 +01:00
Timothy Flynn
652dde5022 LibWebView+UI: Acquire the paths to helper processes inside LibWebView
We no longer need to acquire these paths from the UI and pass them into
LibWebView - we can figure out these paths internally.
2024-11-14 11:47:32 +01:00
Timothy Flynn
bb7dff7dfe LibWebView+UI: Move ownership of application services to LibWebView
LibWebView now knows how to launch RequestServer and ImageDecoderServer
without help from the UI, so let's move ownership of these services over
to LibWebView for de-duplication.
2024-11-14 11:47:32 +01:00
Lucas CHOLLET
1b38ebcc7f LibWeb/CSS: Resolve percentage values against 1 in CSSColor
This was a silly mistake on my end and percentages values are not
covered by device-independent color space, so I had to add support for
srgb to run a WPT test that made me realize the mistake.

This makes the following test pass:
 - css/css-color/predefined-002.html
2024-11-14 09:26:28 +00:00
Lucas CHOLLET
a3ef24e30a LibWeb/CSS: Add support for the srgb color space in color()
It makes the following WPT tests pass:
 - css/css-color/predefined-001.html
 - css/css-color/xyz-003.html
 - css/css-color/xyz-d50-003.html
 - css/css-color/xyz-d50-004.html
 - css/css-color/xyz-d65-003.html

Also we now render the reference of color-mix-currentcolor-nested-for-
color-property.html properly. Which means that it's now different from
the actual test, that is still rendered incorrectly. In other word, the
false positive for this test is now turned into a true negative.
2024-11-14 09:26:28 +00:00
Shannon Booth
3b04c983f1 LibWeb: Check for overflow when creating ImageData
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
We would overwise crash on overflow.
2024-11-13 19:23:25 -05:00
Shannon Booth
1e54003cb1 LibJS+LibWeb: Rename Heap::allocate_without_realm to Heap::allocate
Now that the heap has no knowledge about a JavaScript realm and is
purely for managing the memory of the heap, it does not make sense
to name this function to say that it is a non-realm variant.
2024-11-13 16:51:44 -05:00
Shannon Booth
9b79a686eb LibJS+LibWeb: Use realm.create<T> instead of heap.allocate<T>
The main motivation behind this is to remove JS specifics of the Realm
from the implementation of the Heap.

As a side effect of this change, this is a bit nicer to read than the
previous approach, and in my opinion, also makes it a little more clear
that this method is specific to a JavaScript Realm.
2024-11-13 16:51:44 -05:00
Andreas Kling
2a5dbedad4 Revert "LibWeb/CSS: Keep invalid parts of <forgiving-selector-list>s around"
This reverts commit 698dd600f2.

This caused multiple tests to crash on macOS:
https://github.com/LadybirdBrowser/ladybird/pull/2317#issuecomment-2474725826
2024-11-13 21:37:34 +01:00
Sam Atkins
698dd600f2 LibWeb/CSS: Keep invalid parts of <forgiving-selector-list>s around
Selectors like `:is(.valid, &!?!?!invalid)` need to keep the invalid
part around, even though it will never match, for a couple of reasons:

- Serialization needs to include them
- For nesting, we care if a `&` appeared anywhere in the selector, even
  in an invalid part.

So this patch introduces an `Invalid` simple selector type, which simply
holds its original ComponentValues. We search through these looking for
`&`, and we dump them out directly when asked to serialize.
2024-11-13 20:38:12 +01:00
Timothy Flynn
83b1db785a LibWebView+WebContent+UI: Remember the current system visibility state
We will want to re-inform WebContent of the system visibility state when
we create a new process after a crash. This changes the IPC to just send
the enum value directly, instead of a boolean, so that we can just store
that enum value directly on the ViewImplementation class.
2024-11-13 20:36:47 +01:00
Shannon Booth
c04b14d0cb LibWeb: Use alternative workaround for null strategy algorithm on abort
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
This unfortunately caused a regression for the included WPT test.
Instead of reordering the spec step, fall back to the default size
strategy of 1.
2024-11-13 10:44:22 -05:00
Sam Atkins
a6822986bb LibWeb/Painting: Apply clip and mask operations that are off-screen
These operations should still apply even if they are off screen, because
they affect painting of things outside of their bounding rectangles.

This commit makes us always apply these, regardless of if they are in
the visible region. However, if they are outside that region, we
replace them with simple clip-rect commands, which have the same
effect (not painting anything) but are cheaper than computing a full
mask bitmap.
2024-11-13 16:10:15 +01:00
Timothy Flynn
3e5476c9e0 LibWeb: Guard MediaQueryList event listener removal against null
A recently imported WPT test has a subtest that effectively does the
following:

    const mql = window.matchMedia("");
    mql.removeListener(null);
2024-11-13 14:59:14 +01:00
Timothy Flynn
213155ad7d LibWeb: Use GCPtr in MediaQueryList 2024-11-13 14:59:14 +01:00
Luke Wilde
4dd14d812f LibWeb: Make iframe insertion steps check the shadow including root
The insertion steps for iframes were following an old version of the
spec, where it was checking if the iframe was "in a document tree",
which doesn't cross shadow root boundaries. The spec has since been
updated to check the shadow including root instead.

This is now needed for Cloudflare Turnstile iframe widgets to appear,
as they are now inserted into a shadow root.
2024-11-13 14:40:02 +01:00
Luke Wilde
6df4e5f5e7 LibWeb: Actually traverse the shadow root of the inclusive descendant
Previously, the inclusive descendant, which is the node that
for_each_shadow_including_inclusive_descendant was called on, would not
have it's shadow root traversed if it had one.

This is because the shadow root traversal was in the `for` loop, which
begins with the node's first child. The fix here is to move the shadow
root traversal outside of the loop, and check if the current node is an
element instead.
2024-11-13 14:40:02 +01:00
Tim Ledbetter
d3c21e4038 LibWeb: Copy bitmap onto the returned canvas when taking a screenshot 2024-11-13 14:38:39 +01:00
Tim Ledbetter
b08f12d3e6 LibGfx: Add a method to copy a Bitmap to a PaintingSurface 2024-11-13 14:38:39 +01:00
Jelle Raaijmakers
3d8ab0e67c LibWeb: Add WebGLShaderPrecisionFormat
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
d63a979bde LibWeb: Add WebGLActiveInfo 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
889e7942fa LibWeb: Add WebGLUniformLocation 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
f2a1643650 LibWeb: Add WebGLTexture 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
2b09afb971 LibWeb: Add WebGLShader 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
d53cb9833b LibWeb: Add WebGLRenderbuffer 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
6b7d5dbec6 LibWeb: Add WebGLProgram 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
5d0b206d6e LibWeb: Add WebGLFramebuffer 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
b21857b265 LibWeb: Add WebGLBuffer 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
e6ee7f3e64 LibWeb: Add WebGLObject interface 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
e8d91f2234 LibWeb: Add missing RGBA8 constant to WebGLRenderingContext 2024-11-13 11:41:54 +01:00
Michael Watt
3b1d1d4582 LibWeb: Compute display: contents as none for unusual elements
https://drafts.csswg.org/css-display-3/#unbox-html specifies certain
elements that have their `display` style computed as `none` when
specified as `contents`.

This fixes at least one WPT test:
http://wpt.live/css/css-display/display-contents-suppression-dynamic-001.html
2024-11-13 11:11:07 +01:00
Shannon Booth
eef9a53eec LibJS: Make Heap own its own StackInfo instance
While this does mean that we keep one copy of the stack info in the VM,
and another in the Heap; keeping a separate instance removes one more
instance of coupling between the heap and LibJS specific details.
2024-11-13 11:08:35 +01:00
Shannon Booth
d199bf60cf LibJS: Do not clear VM's string cache in Heap's destructor
There is definitely a possibility I am misunderstanding the reason
behind it - but this does not appear neccessary. The VM owns both the
string cache and Heap. On destruction, the VM should clear out both
the heap and its string cache.
2024-11-13 11:08:35 +01:00
Shannon Booth
cf27eef583 LibJS: Move WeakContainer into the Heap folder
While this is used in the implementation of Runtime objects itself, Heap
seems like a more appropriate home. This will also help in factoring out
the GC implementation into it's own library as the heap explicitly has
knowledge of WeakContainer.
2024-11-13 11:08:35 +01:00
Shannon Booth
2f6bcb3538 LibJS: Remove some unused runtime headers from Heap folder 2024-11-13 11:08:35 +01:00
Shannon Booth
520aa04092 LibJS: Move Handle's Value specialization to Value header
This is part of an effort to keep JS runtime specifics outside of the
Heap implementation.
2024-11-13 11:08:35 +01:00
Hermes Junior
77a46ab1b8 LibJS: Correctly return cached value for global var bindings
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
When the cached value was not an accessor, it was simply ignored.
This is the value we really want, so we can just return it.
Shows up to 5x improvements on some benchmarks,
and 1.4x in general js-benchmarks.
2024-11-12 21:13:48 +01:00
Andreas Kling
b6a5b7e186 LibJS: Stop having AsyncFunctionDriverWrapper leak itself
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Async functions whose promise is never resolved were leaking, since they
had a strong root JS::Handle on themselves.

This doesn't appear to actually be necessary, since the wrapper will be
kept alive as long as it's reachable (and if it's not reachable, nobody
is going to resolve/reject the promise either).

This fixes the vast majority of leaks on Speedometer, bringing memory
usage at the end of a full run from ~12 GiB to ~3 GiB.
2024-11-12 17:38:21 +01:00
Andreas Kling
10724a7cb3 LibJS: Use ConservativeVector when instantiating static class fields
This fixes an issue where a badly-timed garbage collection could swallow
a static field initializer.

Caught by running test262 in GC-on-every-allocation mode.
2024-11-12 17:38:21 +01:00
Andreas Kling
2fb3b6c542 LibJS: Make ConservativeVector<T> visit all possible values
We were miscalculating the length of the buffer in pointer-sized chunks,
which is what the conservative root scan cares about.

This could cause some values to be prematurely garbage-collected.
2024-11-12 17:38:21 +01:00
Luke Wilde
faf6fd1189 LibWeb: Remove LegacyOverrideBuiltIns flag from Storage
This was preventing https://ubereats.com/ from fully loading, because
they are attempting to overwrite setItem. They seem to be trying to add
error logging to setItem if it throws, as all they do is add a
try/catch block that emits an error log to their monitoring service if
it throws.

However, because Storage is a legacy platform object with a named
property setter (setItem), it will call setItem with the stringified
version of the function. This is actually expected as per the spec,
Firefox (Gecko) and Epiphany (WebKit) does this too, but Chromium does
not as it actually overwrites the function with the new function and
does not store the stringified function.

The problem is that we had the LegacyOverrideBuiltIns flag accidentally
set, so it would return the stored string instead of the built-in
function (hence the name), then it would try and call it and throw a
"not a function" error. This prevented their JS from going any further.

This fix allows their UI to fully load and be fully interactive, though
it is quite slow at the moment!
2024-11-12 15:34:36 +01:00
Timothy Flynn
4add737e88 LibWebView: Log the last URL we loaded when WebContent crashes
We display this URL in the error page, but let's log it for headless-
browser as well.
2024-11-12 14:25:59 +00:00
Timothy Flynn
d2151e444e LibWebView: Make loading an error page after a crash optional
We won't need this in headless-browser (who isn't calling this helper
yet).
2024-11-12 14:25:59 +00:00
Luke Wilde
956b279ae1 LibJS: Parse dates like "November 19 2024 00:00:00 +0900"
This format is used on https://jojowiki.com/ to show countdowns to new
releases.
2024-11-12 13:23:34 +01:00
Ali Mohammad Pur
dabd60180f LibRegex: Don't ignore references that weren't bound in checked blocks
Fixes #2281.
2024-11-12 10:37:57 +01:00
sideshowbarker
55b19c3177 LibWeb: Remove unused append_with_space etc functions from DOM::Node
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
This change removes the append_without_space, append_with_space,
prepend_without_space, and prepend_with_space functions from DOM::Node.

All those methods were added with the initial “Implement Accessible Name
and Description Calculation” commit in da5c918 and were only used in the
code related to accessible-name computation. But subsequent changes to
that code have removed all the calls to those functions — so now they’re
all completely unused.
2024-11-11 14:56:46 -07:00
sideshowbarker
dfd50afa4e LibWeb: Add an alternative_text() getter
This change adds an alternative_text()·getter, for use in computing
accessible names.
2024-11-11 14:56:46 -07:00
sideshowbarker
6d29afaa6c LibWeb: Fix accessible-name computation for aria-labelledby cases
This change ensures that when the aria-labelledby attribute is used, the
expected text from the element referenced in the aria-labelledby value
appears in the computed accessible name. Otherwise, without this change,
the expected text doesn’t appear in the computed accessible name.
2024-11-11 14:56:46 -07:00
sideshowbarker
b1587cc60f LibWeb: Fix accessible-name computation for pseudo-element content
This change fixes handling for substep ii of the “F. Name From Content”
step at https://w3c.github.io/accname/#step2F in the “Accessible Name
and Description Computation” spec — to correctly include any ::before
and ::after pseudo-element content in the computation of accessible
names. Otherwise, without this change, accessible names unexpectedly
don’t include that pseudo-element content.
2024-11-11 14:56:46 -07:00
sideshowbarker
3ba7c53668 LibWeb: Ensure spaces get added where expected within accessible names
This change implements the https://w3c.github.io/accname/#comp_append
step in the “Accessible Name and Description Computation” spec — so that
when an accessible name is computed from multiple sources in a document
subtree, the parts of the computed text are joined together with spaces.

Otherwise without this change, in accessible names computed from
multiple sources in a document subtree, the parts of the computed text
are unexpectedly run together, with no spaces between the parts.
2024-11-11 14:56:46 -07:00
Andreas Kling
b3b97d2049 LibWeb: Unregister network requests *after* invoking callbacks
This ensures that the network request actually gets unreffed and deleted
at the right time.
2024-11-11 21:40:56 +01:00
Andreas Kling
b397a0d535 LibWeb: Make Document::m_intersection_observers a weak mapping
These registrations are not meant to keep the observers alive.
This fixes a handful of world leaks on Speedometer.
2024-11-11 21:40:56 +01:00
Andreas Kling
6a6618f5ea LibJS: Add RawNonnullGCPtr<T>
This is really just a type alias for NonnullGCPtr<T>, but it provides
a way to have non-owning non-visited NonnullGCPtr<T> without getting
yelled at by the Clang plugin for catching GC errors.
2024-11-11 21:40:56 +01:00
Andreas Kling
e240084437 LibJS: Use correct cell address for HeapFunction captures in GC dumps
We were previously dumping the address of the cell pointer instead of
the address of the cell itself. This was causing mysterious orphans
in GC dumps, and it took me way too long to figure this out.
2024-11-11 21:40:56 +01:00
Aliaksandr Kalenik
7efc89e92b LibWeb: Remove usage of containing_block to get available height in GFC
There is no need to do containing block lookup when this value is
provided in argument of ::run()
2024-11-11 20:20:39 +01:00
Aliaksandr Kalenik
a073e35562 LibWeb: Delete unused functions in FormattingContext 2024-11-11 20:20:39 +01:00
Aliaksandr Kalenik
a8c1d12e84 LibWeb: Fix percentage insets resolution for grid items
compute_inset() was incorrectly retrieving the containing block size
because containing_block() is unaware of grid areas that form a
containing block for grid items but do not exist in the layout tree.
With this change, we explicitly pass the containing block into
compute_inset(), allowing it to correctly provide the containing block
sizes for grid items.
2024-11-11 20:20:39 +01:00
Aliaksandr Kalenik
07d8ddb5fa LibWeb: Reduce usage of Node::containing_block() in BFC
Explicitly pass containing block width in
resolve_vertical_box_model_metrics() instead of doing containing block
box lookup.

This is a part of refactoring towards removing containing_block() usage
that will allow us introduce partial layout.
2024-11-11 20:20:39 +01:00
Sam Atkins
20a78a42d6 LibWeb/DOM: Combine implementations of scope-matching a selectors string 2024-11-11 20:19:41 +01:00
Luke Wilde
bd4c29322c LibJS: Allow division after IdentifierNames in optional chain
The following syntax is valid:
```js
e?.example / 1.2
```

Previously, the `/` would be treated as a unterminated regex literal,
because it was calling the regular `consume` instead of
`consume_and_allow_division`.

This is what is done when parsing IdentifierNames in
parse_secondary_expression when a period is encountered.

Allows us to parse clients-main-[hash].js on https://ubereats.com/
2024-11-11 20:19:26 +01:00
Pavel Shliak
1bdc41faa1 LibWeb: Reduce SelectItemOption struct from 40 to 32 bytes
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
2024-11-11 17:06:20 +01:00
Pavel Shliak
566870b2bd LibWeb: Reduce PaintTextShadow struct from 72 to 64 bytes 2024-11-11 17:06:20 +01:00
Pavel Shliak
d1c7c0ba19 LibWeb: Reduce DrawGlyphRun struct from 56 to 48 bytes 2024-11-11 17:06:20 +01:00
Pavel Shliak
ddc3017464 LibWeb: Reduce ShadowData struct from 80 to 72 bytes 2024-11-11 17:06:20 +01:00
Timothy Flynn
0ff91a5273 LibWebView+Services+UI: Move process helpers to LibWebView 2024-11-11 07:35:43 -05:00
Timothy Flynn
a14937c45e LibWebView+Services+UI: Move the Web plugins to LibWebView 2024-11-11 07:35:43 -05:00
Timothy Flynn
9e1f001ffe LibWebView+Services+UI: Move the EventLoop implementations to LibWebView
We currently compile the Qt event loop files multiple times, for every
target which wants to use them. This patch moves these to LibWebView as
a central location to avoid this.
2024-11-11 07:35:43 -05:00
Aliaksandr Kalenik
7460f0c6e2 LibGfx: Delete unused DisjointRectSet
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
2024-11-11 02:46:35 +01:00
Aliaksandr Kalenik
1e05457cd1 LibGfx: Delete unused paint styles
These are no longer used after we've switched to using Skia.
2024-11-11 02:46:35 +01:00
Gingeh
6862d33e7c LibWeb: Don't crash from clipping grid spans 2024-11-11 00:57:10 +01:00
Pavel Shliak
b4e5afa8d5 LibGfx: Remove OffsetPaintStyle 2024-11-11 00:07:11 +01:00
rmg-x
9ee7d4d90a LibWeb: Add builtin Float16Array type and remove related FIXME 2024-11-10 14:48:20 -07:00
rmg-x
ea20545853 LibJS: Add support for Float16Array
Implements TC39 stage three proposal for Float16Arrays:
https://tc39.es/proposal-float16array
2024-11-10 14:48:20 -07:00
Shannon Booth
653c8f231d LibWeb: Implement HTMLElement.innerText setter 2024-11-10 21:31:30 +01:00
Shannon Booth
a1a740bb3e LibWeb: Make rendered_text_fragment return a DocumentFragment
This closer matches the spec and is needed in the implementation of the
innerText setter.
2024-11-10 21:31:30 +01:00
Aliaksandr Kalenik
dd11d48a1d LibWeb: Use available space to resolve sizes in FFC
If available space is definite it should always match the size of the
containing block. Therefore, there is no need to do containing block
node lookup.
2024-11-10 19:14:54 +01:00
Andreas Kling
5aa1d7837f LibJS: Don't leak class field initializers
We were storing these in Handle (strong GC roots) hanging off of
ECMAScriptFunctionObject which effectively turned into world leaks.
2024-11-10 19:12:59 +01:00
Andreas Kling
8c809fa5ee LibCore: Don't reserve 2 KiB of stack memory when processing event queue
The inline capacity on ThreadEventQueue::Private::queued_events caused
us to reserve (and importantly, not initialize!) 2 KiB of stack memory
when entering ThreadEventQueue::process().

This was causing any leftover pointers to GC-allocated objects within
that memory range to keep those objects alive, even when all other
references were gone.
2024-11-10 19:12:59 +01:00
Aliaksandr Kalenik
68f58b23ce LibWeb: Save Gfx::ImmutableBitmap in ApplyBitmapMask display list item
Some checks are pending
Lint Code / lint (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Push notes / build (push) Waiting to run
This allows to delete duplicated code between DisplayListPlayerSkia.cpp
and ImmutableBitmap.cpp responsible for wrapping Gfx::Bitmap in SkImage.
2024-11-10 17:20:34 +01:00
Shannon Booth
e02ca0480f LibJS: Allow unpaired surrogates in String.prototype.replace
This was resulting in a crash for the WPT test case:

https://wpt.live/xhr/send-data-string-invalid-unicode.any.html
2024-11-10 09:14:03 -05:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Andreas Kling
52b05a08c7 LibCrypto: Reduce use of ByteBuffer in AES code
Use Bytes/ReadonlyBytes more where possible.
2021-01-12 09:34:04 +01:00
Lenny Maiorani
e6f907a155 AK: Simplify constructors and conversions from nullptr_t
Problem:
- Many constructors are defined as `{}` rather than using the ` =
  default` compiler-provided constructor.
- Some types provide an implicit conversion operator from `nullptr_t`
  instead of requiring the caller to default construct. This violates
  the C++ Core Guidelines suggestion to declare single-argument
  constructors explicit
  (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit).

Solution:
- Change default constructors to use the compiler-provided default
  constructor.
- Remove implicit conversion operators from `nullptr_t` and change
  usage to enforce type consistency without conversion.
2021-01-12 09:11:45 +01:00
Nick Vella
4b3c61fad8 LibGUI: Add 'on_doubleclick' event to BreadcrumbBar. 2021-01-12 08:58:49 +01:00
Andreas Kling
127ce32d9e LibGfx: Adjust margin between window title/stripes by 1px
This makes it symmetrical with the margin between window icon/title.
2021-01-11 22:15:09 +01:00