Commit graph

64456 commits

Author SHA1 Message Date
Vincent Sgherzi
9ce139a3f0 LibWeb: Fix boolean logic mistake in XMLSerializer for empty public ID
Fixes 5 subtests on http://wpt.live/domparsing/xml-serialization.xhtml
2024-10-21 10:53:02 +02:00
stelar7
d81f31c699 LibWeb/Meta: Adjust how missing/invalid default values are generated 2024-10-21 10:34:26 +02:00
Andreas Kling
a8d0712c28 LibWeb: Unbreak harfbuzz text layout
The reason we were keeping track of the pre-shaping buffer was to know
where we had tab characters in the input. This is a very strange way of
doing that, but since it broke the web, let's patch it up quickly.

Follow-up to #1870 which broke text layout on many web pages.
2024-10-21 10:30:12 +02:00
Ben Wiederhake
14f5f51147 LibGfx: Use actual vector size as indicated by HarfBuzz
This fixes a browser crash as experienced on Wikipedia when encountering
the ≠ entity. As a side-effect, this also affects some tab-align and
-wrap tests.
2024-10-21 10:15:39 +02:00
Gabriel Tassinari
07400b515c Qt: Fix -Werror=deprecated-declarations when using Qt > 6.7
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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-10-20 21:35:42 -06:00
Jim Broadbent
97ca6036fa LibWeb/XHR: Progess event handle empty length
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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-10-20 22:22:59 +02:00
samu698
50f642613d LibWeb/HTML: Implement inner text set according to spec
Replaced the ad-hoc implementation with a spec compliant one.
This change fixes 36 WPT tests.
2024-10-20 22:15:04 +02:00
Andreas Kling
58c523ae46 LibWeb: Honor appearance: none when creating input element layout node
Per css-ui-4, setting `appearance: none` is supposed to suppress the
creation of a native-looking widget for stuff like checkboxes, radio
buttons, etc.

This patch implements this behavior by simply falling back to creating
a layout node based on the CSS `display` property in such cases.

This fixes an issue on the hey.com imbox page where we were rendering
checkboxes on top of sender profile photos.
2024-10-20 21:58:58 +02:00
stasoid
6b73a2d8a4 LibCore: Port File to Windows
Co-authored-by: Cameron Youell <cameronyouell@gmail.com>
2024-10-20 10:18:03 -06:00
stasoid
f6430035e7 LibCore/System: Add initial Windows support
Co-authored-by: Cameron Youell <cameronyouell@gmail.com>
2024-10-20 10:18:03 -06:00
Timothy Flynn
6cba55893e WebContent: Return the handle of the newly opened window from New Window
We were returning the handle of the already opened window, rather than
the handle of the window we just opened.
2024-10-20 16:41:11 +01:00
Timothy Flynn
981aaba96c LibWeb: Break the Window open steps into two methods for internal use
Some callers (namely WebDriver) will need access to the navigable opened
by these steps. But if the noopener parameter is set, the returned proxy
will always be null.

This splits some of the Window open steps into an internal method that
returns the chosen navigable.
2024-10-20 16:41:11 +01:00
Bastian Müller
748e3c2e6c LibWeb/XHR: Pass API URL character encoding
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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-10-20 07:58:22 -04:00
Bastian Müller
3be93ac49f LibWeb/XHR: Parse URL to resolve blob 2024-10-20 07:58:22 -04:00
Andreas Kling
4fdb266077 LibWeb: Make DOM Node unique IDs strongly typed (and 64 bit)
This is strictly nicer than passing them around as i32 everywhere,
and by switching to i64 as the underlying type, ID allocation becomes as
simple as incrementing an integer.
2024-10-20 13:42:33 +02:00
Tim Ledbetter
eca2318390 WebContent: Use window open steps to create a new window with WebDriver
This matches the specification steps and fixes a WPT regression caused
by us not loading `about:blank` when opening a new window.
2024-10-20 11:42:19 +01:00
Tim Ledbetter
f3c6326f27 LibWeb: Rename Window::open_impl() to Window::window_open_steps()
This is the same name used in the specification.
2024-10-20 11:42:19 +01:00
Shannon Booth
b999f925dc LibWeb: Allow splitting surrogate pairs in CharacterData.substringData() 2024-10-20 11:18:57 +01:00
thislooksfun
0b775da7c7 LibWeb/CSS: Evaluate media queries in shadow roots
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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 fixes a rendering issue on https://prodengi.kz/ that someone on
Discord reported. :^)
2024-10-20 07:57:09 +01:00
Timothy Flynn
1aab7b51ea LibWebView: Generate hyperlinks for attributes that represent links
On the view-source page, generate anchor tags for any 'href' or 'src'
attribute value we come across. This handles both when the attribute
contains an absolute URL and a URL relative to the page.

This requires sending the document's base URL over IPC to resolve
relative URLs.
2024-10-20 08:50:01 +02:00
Timothy Flynn
0703ba118b AK: Add a comparison operator for Utf32View 2024-10-20 08:50:01 +02:00
Timothy Flynn
cf9693169c AK: Allow constructing Utf32 from a span of u32 2024-10-20 08:50:01 +02:00
Cameron Youell
94601e1ffd LibCore: Add Windows version of DirIterator
Co-authored-by: stasoid <stasoid@yahoo.com>
2024-10-19 18:14:48 -06:00
Cameron Youell
c5219b0193 CMake: Fix linker issues on Windows
Co-authored-by: Andrew Kaster <akaster@serenityos.org>
2024-10-19 18:14:48 -06:00
rmg-x
57f82c029c LibWeb/HTML: Check if evaluationStatus has a value before dereferencing
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
Previously, we would crash if scripting was disabled and a javascript
URL was evaluated.
2024-10-19 18:28:12 -04:00
thislooksfun
feaf2feab8 LibWeb: Skip DedicatedWorkerGlobalScope-instanceof test
It is consistently hanging on mac. See #1306 for details.
2024-10-19 16:59:51 -04:00
Andreas Kling
f106aa9e8a LibWeb: Stop traversal early when marking nodes for child style update
These flags always propagate to the root, so once we encounter an
ancestor with the flag set, we can stop traversal since everything above
it will already be set as well.
2024-10-19 21:13:54 +02:00
Andreas Kling
d21c5631aa LibWeb: Avoid a weird reparse of style attributes for pseudo elements
For pseudo elements that represent a browser-generated shadow tree
element, such as ::placeholder, we were reparsing their style attribute
in StyleComputer for some reason.

Instead of doing this, just access the already-parsed version via
Element::inline_style().
2024-10-19 21:13:54 +02:00
Kemal Zebari
04d16a1ee3 LibWeb/HTML: Add missing HTMLElement IDL autocorrect as a stub
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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 adds an IDL stub for the autocorrect HTMLElement attribute.
2024-10-19 07:34:15 +01:00
Jelle Raaijmakers
4c189166f4 LibWeb: Implement indexed property support for HTML::Storage
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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 only supported named properties on Storage, and as a result
`localStorage[0]` would be disconnected from the Storage's backing map.

Fixes at least 20 subtests in WPT in /webstorage.
2024-10-18 23:10:22 +02:00
Timothy Flynn
999c591e83 LibCore: Remove unused Core::System wrappers
As efforts to begin porting to Windows is underway, doing so should be a
bit less daunting if we clean up syscall wrappers that aren't used.

Note: While this removes Serenity-only wrappers, it leaves the Serenity
implementations of used wrappers in place for now, to not needlessly
complicate merging between the two orgs.
2024-10-18 18:16:18 +02:00
Timothy Flynn
1ce10d6b39 Utilities: Remove no-op calls to unveil and pledge 2024-10-18 18:16:18 +02:00
Jelle Raaijmakers
8419a5f60f LibGfx: Remove unused, deprecated code 2024-10-18 18:12:45 +02:00
Aliaksandr Kalenik
11e10d0532 LibWeb: Add missing flex-start and flex-end in to_alignment [GFC]
Fixes crashing on https://tweakers.net/
2024-10-18 18:11:46 +02:00
Edward Banner
912511a152 LibWeb: Use containing block to compute scrollable overflow
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
Instead of using child boxes to compute scrollable overflow for the box,
we use descendants which have the box as their containing block.
2024-10-18 15:26:42 +02:00
Aliaksandr Kalenik
de238328eb LibWeb: Accept paintable instead of layout node in resolve_background() 2024-10-18 14:59:41 +02:00
Aliaksandr Kalenik
78d8989ea4 LibWeb: Accept paintable instead of layout node in paint_background()
After InlinePaintable is gone it's possible to make this function accept
a PaintableBox instead of more broad
Layout::NodeWithStyleAndBoxModelMetrics type.
2024-10-18 14:59:41 +02:00
Timothy Flynn
048b51eb54 WebContent: Add a JS visitor to WebDriver's IPC connection
We've added a few JS::Handle members to this class over time. Let's
avoid creating a new GC root for each of these, and explicitly add a
visitation method.
2024-10-18 09:45:04 +02:00
Timothy Flynn
022e2b8a94 LibWeb+WebContent: Rename the WebDriver get-known-element AO
The underlying concept is the same, but this method was renamed in the
spec to drop the word "connected".
2024-10-18 09:45:04 +02:00
Timothy Flynn
a96a762305 LibWeb+WebContent: Use NNGCPtr in WebDriver code where appropriate
Some of this code is older than widespread use of GCPtr. These functions
returning raw pointers has been a point of confusion at times, so lets
just indicate that they are non-null.
2024-10-18 09:45:04 +02:00
Totto16
93954dcd9a Meta: Replace deprecated pre-commit stage name
Also set minimum_pre_commit_version to 3.2.0
as this stage name is supported since then
2024-10-18 09:40:59 +02:00
Jelle Raaijmakers
2a98f2a12d LibWeb: Implement AudioListener
This exposes BaseAudioContext.listener, which is a container for
parameters related to the configuration of an actual "listener" in 3D
space.
2024-10-18 09:39:04 +02:00
Timothy Flynn
eeee6ba3f5 LibWeb: Visit the MessagePort's associated Worker target
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
Without this, a worker can be GC'd in a very simple script such as:

    const worker = new Worker("script.js");
    worker.onmessage = () => {};

Where script.js attempts to post a message back to the parent window.

When the Worker is GC'd, the IPC connection from the WebContent process
to the WebWorker process is closed. When this occurs, the WebWorker will
exit() from LibIPC, and any message from the worker to its parent does
not have a chance to run.
2024-10-17 16:34:32 -04:00
Timothy Flynn
ba1b26cdc2 LibWeb: Disentangle associated MessagePorts when a document is destroyed 2024-10-17 16:34:32 -04:00
Timothy Flynn
d44dd756b3 LibWeb: Reset MessagePort's worker event target when it is disentangled 2024-10-17 16:34:32 -04:00
Timothy Flynn
83be2606db LibWeb: Update spec steps for destroying a DOM document
This just updates our copied spec steps - new steps are not implemented
here. This is mostly just to highlight new steps we are missing around
MessagePorts.

No behavior change, but this does resolve an outstanding FIXME around
spec step ordering.
2024-10-17 16:34:32 -04:00
Timothy Flynn
32a22c49e3 LibWeb: Move StructuredSerializeOptions to its own header
This largely reduces the number of files needed to be compiled when we
change the MessagePort header.
2024-10-17 16:34:32 -04:00
Timothy Flynn
5ed702e211 LibWeb: Sort the forwarding header 2024-10-17 16:34:32 -04:00
Andreas Kling
3c5819a6d2 LibJS: Allow GetById to cache getters
1.25x speed-up on this microbenchmark:

    let o = { get x() { return 1; } };
    for (let i = 0; i < 10_000_000; ++i)
        o.x;

I looked into this because I noticed getter invocation when profiling
long-running WPT tests. We already had the mechanism for non-getter
properties, and the change to support getters turned out to be trivial.
2024-10-17 22:06:16 +02:00
Sam Atkins
e4245dc39e LibWeb/CSS: Process style properties from CSSNestedDeclarations rules
These are created when a style rule has properties listed after another
rule. For example:

```css

.test {
  --a: 1;
  --b: 1;
  --c: 1;

  .thing {
    /* ... */
  }

  /* These are after a rule (.thing) so they're wrapped in a
     CSSNestedDeclarations: */
  --d: 1;
  --e: 1;
  --f: 1;
}
```

They're treated like a nested style rule with the exact same selectors
as their containing style rule.
2024-10-17 20:55:55 +02:00