Commit graph

64930 commits

Author SHA1 Message Date
Sam Atkins
c5c5d97544 LibWeb: Match spec changes to "apply the history step"
Corresponds to https://github.com/whatwg/html/pull/10704
2024-11-09 15:18:37 +01:00
Sam Atkins
0a578ee345 LibWeb/HTML: Update spec comments for "URL and history update steps"
Corresponds to:
https://github.com/whatwg/html/pull/10587
2024-11-09 15:18:37 +01:00
Sam Atkins
36f8dfaed0 LibWeb/HTML: Dispatch toggle and beforetoggle events from dialogs
Corresponds to https://github.com/whatwg/html/pull/10091
2024-11-09 15:18:00 +01:00
Lucas CHOLLET
10dc7ff042 LibWeb/CSS: Support the xyz-d65 colorspace in the color() function
This also adds support for `xyz` as it defaults to `xyz-d65`. We now
pass the following WPT tests:
 - css/css-color/xyz-001.html
 - css/css-color/xyz-002.html
 - css/css-color/xyz-004.html
 - css/css-color/xyz-d65-001.html
 - css/css-color/xyz-d65-002.html
 - css/css-color/xyz-d65-004.html
2024-11-09 15:15:36 +01:00
Lucas CHOLLET
ff6102430e LibGfx: Add Color::from_linear_srgb()
This will be usefully on its own later on when supporting this color
space directly, but it also allows us to do some factorization in the
current codebase.
2024-11-09 15:15:36 +01:00
Gingeh
47992f7b39 LibWeb: Compute mimetype when loading a document
computed type != supplied type
2024-11-09 14:30:38 +01:00
Sam Atkins
7a104fef66 LibWeb/CSS: Make non-nested & selector have 0 specificity
If a & simple selector is on a style rule with no parent style rule,
then it behaves like :scope - but notably, :scope provides 1
specificity in the class category, but & is supposed to provide 0.

To solve this, we stop replacing it directly, and just handle the & like
any other simple selector. We know that if the selector engine ever
sees one, it's equivalent to :scope, because the nested ones will have
been replaced with :is() before that point.

This gets us one more subtest pass. :^)
2024-11-09 14:29:37 +01:00
Sam Atkins
219346011b LibWeb/CSS: Require that tag-name simple selectors go first
This fixes 1 subtest.
2024-11-09 14:29:37 +01:00
Sam Atkins
a0403ac427 LibWeb: Add & when setting nested style rule's selector text
When we first parse a nested CSSStyleRule's selectors, we treat them as
relative selectors and then patch them up with an `&` as needed.
However, we weren't doing this when assigning the `cssText` attribute.
So, let's do that!

This gives us a couple of subtest passes. :^)
2024-11-09 14:29:37 +01:00
Andrew Kaster
3e0c182344 DevContainer: Use correct path for vcpkg binary
Now more correct than 7ae7b9b695
2024-11-09 08:18:41 -05:00
Andrew Kaster
85515c0096 LibWeb: Queue the task for MessagePort receive in targetPort's realm
We were delaying sending an IPC message until the HTML PortMessage
task was run, but we were not queuing the task in on the receiver
side. The result of this was that message port posting was
needlessly creating an HTML task just to send an IPC message.

On the flip side, we were directly calling dispatch_event from the
socket notifier of the target port's message queue. This is a huge
problem, because it means that we were effectively running
javascript-aware code from an 'in parallel' context.

By switching around which side of the IPC interface is responsible
for queuing a task, we can avoid problems where a document is
destroyed from a port message-attached callback and crashes.
2024-11-09 08:18:41 -05:00
Pavel Shliak
6709905656 IPC: Remove Gfx::Bitmap encoder and decoder
The Gfx::Bitmap encoder and decoder have been replaced
by BitmapSequence in #1435, making them redundant and safe to remove.

Additionally, the base IPC::encode and IPC::decode implementations
will trigger a compiler error if these methods are called.

.ipc files already exclude references to Gfx::Bitmap.
2024-11-09 08:11:51 -05:00
Shannon Booth
45537efcef LibWeb: Enable callbacks for ByteStreamTeeBYOBReadRequest::on_chunk
Fixes a crash running the imported WPT test.
2024-11-09 08:10:57 -05:00
Shannon Booth
d31014d135 LibWeb: Reorder step to get chunk size after checking for aborted stream
This fixes a crash seen on:

http://wpt.live/streams/writable-streams/aborting.any.html

I believe this is a spec bug, which has been reported to the Streams
spec.
2024-11-09 08:09:54 -05:00
sideshowbarker
3594cdf948 LibWeb: Fix accessible-name computation for “tooltip” & empty-alt cases
This change fixes accessible-name computation for:

- an element that has empty text content but that also has a title
  attribute (“tooltip”) with a non-empty value
- an img element whose alt attribute is the empty string but that also
  has a “title” attribute with a non-empty value

Otherwise, without this change, the accessible name unexpectedly isn’t
computed correctly for those cases.
2024-11-09 08:08:05 -05:00
Timothy Flynn
4ae1bca67d UI/AppKit: Handle window resize events during live resizing
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
Build Dev Container Image / build (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 lets us redraw the WebView while live resize events are ongoing. By
doing so, we can also update the window rect from within the WebView,
rather than requiring a separate method invocation (which the Inspector
and Task Manager windows were missing).
2024-11-08 15:31:08 -05:00
Timothy Flynn
3bbe1b0c62 UI/AppKit: Register socket notifiers in the common run loop mode
When the user resizes the browser window, AppKit will spin the current
run loop in the common mode. This patch allows socket events from IPC to
be processed while the resize is ongoing. This includes the WebView hook
to repaint.

Co-Authored-By: Andreas Kling <andreas@ladybird.org>
2024-11-08 15:31:08 -05:00
Timothy Flynn
52c828be2b LibWeb: Disable slow imported CSS animation tests 2024-11-08 15:02:30 -05:00
Andrew Kaster
7ae7b9b695 DevContainer: Update path to vcpkg 2024-11-08 11:29:31 -07:00
Timothy Flynn
f9df95af50 CI: Use clang for js artifacts on Linux
We have optimizations that only work with clang (namely, our use of
FLATTEN in the bytecode interpreter).
2024-11-08 11:29:18 -07:00
Timothy Flynn
74fe899d79 CI: Use the distribution release configuration for js artifacts 2024-11-08 11:29:18 -07:00
Timothy Flynn
0447d05d52 Meta: Support fully static distribution release builds
This adds the vcpkg triplets and CMake preset to perform release
builds for distribution. These builds are fully static, and currently
intended to be used for the `js` ESVU release.

In the future, linking everything statically into the final binary is
probably not what we will do for released Ladybird builds. Instead, we
may have a "libladybird.so", which is then linked into the binary. But
this should be fine for `js` for now.
2024-11-08 11:29:18 -07:00
Jonne Ransijn
e53e1d3586 LibJS: Preserve the original this value
As shown in the test added by this patch, it was possible to re-assign
the `this` value of a member function call while it was executing.
Let's copy the original this value like we already do with the callee.

Fixes #2226.
2024-11-08 19:16:56 +01:00
Andrew Kaster
f4124c7f40 CI+DevContainer+Documentation: Remove install steps for ffmpeg libs 2024-11-08 11:10:31 -07:00
Andrew Kaster
eda7f03994 Meta: Add ffmpeg to vcpkg dependencies
Now that we are using shared libraries, it is possible to add
into our vcpkg dependencies without worrying about LGPL
2024-11-08 11:10:31 -07:00
Andrew Kaster
eaafaa53ef Meta: Explicitly list required features for harfbuzz and skia 2024-11-08 11:10:31 -07:00
Andrew Kaster
3226aee666 CMake: Force-load fontconfig into dependencies of skia
The dynamic shared lib build of skia doesn't seem to actually express
any dependencies in its DT_NEEDED section, so we need to force-load
fontconfig into the dependencies of the skia target to avoid runtime
linker errors.
2024-11-08 11:10:31 -07:00
Andrew Kaster
e65eff22e8 CMake: Add include_guard() statements to fontconfig and vulkan
This should prevent extra calls to find_package() from causing
issues.
2024-11-08 11:10:31 -07:00
stelar7
c453761c3e LibWeb: Implement and use fire_a_version_change_event 2024-11-08 11:10:15 -07:00
stelar7
54b5822e0b LibWeb: Add IDBVersionChangeEvent 2024-11-08 11:10:15 -07:00
stelar7
20a30dee46 LibWeb: Use open_a_database_connection in IDBFactory::open 2024-11-08 11:10:15 -07:00
stelar7
6a15866277 LibWeb: Implement most of open_a_database_connection 2024-11-08 11:10:15 -07:00
stelar7
ef75cc53f9 LibWeb: Add getters and setters to IDBRequest 2024-11-08 11:10:15 -07:00
stelar7
914ad7bbd6 LibWeb: Stub out a Database connection store 2024-11-08 11:10:15 -07:00
stelar7
60ae5e75f8 LibWeb: Implement the IDBDatabase interface 2024-11-08 11:10:15 -07:00
stelar7
5d9b13a970 LibWeb: Add versionchange as possible value for EventName 2024-11-08 11:10:15 -07:00
stelar7
d65e3099bc LibWeb: Add the concept of a Database 2024-11-08 11:10:15 -07:00
stelar7
64eea90f29 LibWeb: Implement most of IDBFactory::open 2024-11-08 11:10:15 -07:00
stelar7
47d6499f6d LibWeb: Allow constructing a IDBOpenDBRequest 2024-11-08 11:10:15 -07:00
stelar7
67fccf4eb2 LibWeb: Add DatabaseAccess as a task source 2024-11-08 11:10:15 -07:00
Sam Atkins
de1552342b Documentation: Stop telling people to get gn from homebrew
Homebrew doesn't have an entry for gn, so this was confusing.
2024-11-08 10:22:09 -07:00
Sam Atkins
1cc83db0c9 Tests: Disable an animation test that's flaky on CI 2024-11-08 10:12:42 -07:00
Sam Atkins
1777ddc5e2 LibWeb/DOM: Update a spec comment in Range::create_contextual_fragment()
Some checks are pending
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, 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
Corresponds to https://github.com/whatwg/html/pull/10732
2024-11-08 16:19:33 +00:00
Jonne Ransijn
635d4842d1 LibWeb: Return CSS::StyleProperties::property results by reference
This removes unnecessary reference counting.
2024-11-08 10:21:26 +00:00
Timothy Flynn
acc74f5e72 CI: Upgrade to macOS 15
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
For some reason, Microsoft have decided to remove Xcode 16 from macOS 14
images. We require Xcode 16 for Swift 6.

See: https://github.com/actions/runner-images/issues/10703

Because macOS 15 images are still in preview, their availability is much
lower than macOS 14 images. To hopefully alleviate the amount of time we
are waiting in the runner queue, for now this only upgrades the workflow
which uses Swift.
2024-11-07 19:30:34 -05:00
Timothy Flynn
41a812156c LibWeb+LibWebView+WebContent: Remove unused layout notification IPC 2024-11-07 22:52:01 +01:00
Timothy Flynn
0345c67e14 UI/Qt: Do not place the WebView inside a scroll view
Now that scrolling and rendering scrollbars is handled entirely in the
WebContent process, there's no reason to place the WebView inside scroll
views.
2024-11-07 22:52:01 +01:00
Timothy Flynn
43ed03145d UI/AppKit: Do not place the WebView inside a scroll view
Now that scrolling and rendering scrollbars is handled entirely in the
WebContent process, there's no reason to place the WebView inside scroll
views.
2024-11-07 22:52:01 +01:00
Timothy Flynn
44443689f2 LibWeb: Add missing include to CSS/Parser/Types.h
CSS::Parser::Token is not forward-declarable here. This was caught by
the Swift build on my machine.
2024-11-07 22:52:01 +01:00
Jonne Ransijn
b625a92a0b Tests: Use FileSystem::real_path when comparing paths
Paths in `headless-browser` tests were being compared by string value.
With this patch, they will be compared by their real path instead,
ensuring relative paths and symlinks are handled correctly.
2024-11-07 16:51:32 -05:00