Commit graph

65091 commits

Author SHA1 Message Date
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
Andreas Kling
87dd8714c5 Tests: Import WPT tests from css/css-backgrounds/animation
These give us some basic coverage of backgrounds, borders and animation
mechanisms.
2024-11-07 22:50:33 +01:00
Andreas Kling
5bdbc34a63 LibWeb: Resolve initial/inherit/unset before interpolating properties
This was preventing a number of WPT tests relating to CSS animation from
running at all.
2024-11-07 22:50:33 +01:00
Nico Weber
7ac3806a1d LibWeb: Plumbing for lineCap, lineJoin, miterLimit, lineDashOffset
Not used for painting yet, but adds a FIXME for what's missing.

Also tweak some existing spec comments minorly.
2024-11-07 19:54:10 +01:00
sideshowbarker
96ded779e2 Docs: Recommend “Web Browser Engineering” book in GettingStarted guide
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-11-07 15:39:31 +01:00
Sam Atkins
b0e79ce549 Tests: Import all WPT css/css-nesting tests
A few are skipped for now:
- A few ref tests fail
- Crash tests are not supported by our runner and time out
- top-level-is-scope.html crashes and needs further investigation
2024-11-07 15:11:24 +01:00
Sam Atkins
6bb1ffbcd3 LibWeb/CSS: Accept nested style rules in grouping at-rules
When converting an AtRule to a grouping rule, allow both style rules,
and lists of declarations.
2024-11-07 15:11:24 +01:00
Sam Atkins
ce947ff983 LibWeb/CSS: Stop assuming CSSNestedDeclarations's parent is CSSStyleRule
This will no longer be true once we implement at-rules nested inside
style rules, for example:

```css
.foo {
  color: yellow;

  @media (min-width: 800px) {
    color: orange;
  }
}
```
2024-11-07 15:11:24 +01:00
Sam Atkins
0b23dddb4b LibWeb/CSS: Clear child CSS rules' caches too
If a rule gets its caches cleared because it's moved in the OM, then its
child rules' caches are likely invalid and need clearing too.

Assuming that caches only point "upwards", this will correctly clear
them all. For the time being that will be true.
2024-11-07 15:11:24 +01:00
Sam Atkins
e6291c8d0e LibWeb/CSS: Correct position indicator when dumping a TokenStream
Since b645e26e9b, m_index points at the
"next" token, not the one that we're currently on.
2024-11-07 15:11:24 +01:00
Sam Atkins
a703aad082 LibWeb/CSS: Reject invalid rules and declarations during parsing
This implements the `is_valid_in_the_current_context()` methods by
maintaining a stack of contexts, such as whether we're inside a style
rule, or an `@media` block, or the condition of a `@supports` rule.
2024-11-07 15:11:24 +01:00
Sam Atkins
3b36ca2711 LibWeb/CSS: Update a FIXME that's completed elsewhere 2024-11-07 15:11:24 +01:00
Sam Atkins
a9a25d4eca Tests: Add a test for @supports
This is derived from our old demo page.

Notably, we currently do claim to support `::-webkit-foo` selectors,
which is a bug. According to the spec [1], we have to parse those as
valid, but `@supports` should still fail for them [2], which is a bit
confusing.

[1] https://www.w3.org/TR/selectors-4/#compat
[2] https://drafts.csswg.org/css-conditional-4/#support-definition-ext
2024-11-07 15:11:24 +01:00
Sam Atkins
398e112c8c LibWeb: Make dumping of @supports more useful
The string representation doesn't tell you what the internals look like,
which is what you want when dumping.
2024-11-07 15:11:24 +01:00
Aliaksandr Kalenik
a7cbc7a6b8 LibWeb+LibGfx: Use GPU backend for <canvas>
This is implemented by using a GPU-accelerated surface for <canvas> when
a GPU context is available.

A side effect of this change is that all canvas modifications have to be
performed through Gfx::Painter, and whenever its content has to be
accessed, we need to take a snapshot of the corresponding GPU surface.

A new DrawPaintingSurface display list command is introduced to allow
cheap blitting of canvas content without having to read GPU surface
content into RAM.
2024-11-07 13:48:12 +01:00
Aliaksandr Kalenik
ab9ecbd79d LibCore+LibGfx+LibWeb: Move VulkanContext into LibGfx
Since the Vulkan context is currently only used by LibGfx, it could be
moved there to avoid having Vulkan as a dependency for everything that
uses LibCore.
2024-11-07 13:48:12 +01:00
Aliaksandr Kalenik
c4bc4fc5f6 LibCore+LibGfx+LibWeb: Move MetalContext into LibGfx
Since the Metal context is currently only used by LibGfx, it could be
moved there to avoid having Metal as a dependency for everything that
uses LibCore.
2024-11-07 13:48:12 +01:00
Aliaksandr Kalenik
25f264b7e7 LibGfx+LibWeb: Introduce PaintingSurface that wraps SkSurface from Skia
Adds a new class in LibGfx that represents GPU-accelerated surface and
will be used for both <canvas> and page rendering (display list player).
2024-11-07 13:48:12 +01:00
Aliaksandr Kalenik
5c1f6bf8ee LibGfx+LibWeb: Make SkiaBackendContext ref-counted 2024-11-07 13:48:12 +01:00
Aliaksandr Kalenik
1688cbc991 LibWeb+LibGfx: Move class that represents Skia GPU context to LibGfx
This is required to share GPU context creation code between display list
player, which resides in LibWeb, and PainterSkia, which handles <canvas>
painting.
2024-11-07 13:48:12 +01:00
Tim Ledbetter
29f419d637 Tests: Import an xht test from WPT 2024-11-07 12:02:31 +00:00
Tim Ledbetter
2681525534 headless-browser: Support running tests with the ".xht" extension 2024-11-07 12:02:31 +00:00
Pavel Shliak
1389ae02be LibGfx: Fix 24bit BMPs being transparent and send them as RGBx to Skia 2024-11-07 12:27:00 +01:00
Timothy Flynn
ad1ba30b27 WebContent: Serialize the document element's outer HTML for WebDriver
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-11-06 20:44:19 -05:00
Timothy Flynn
7b64942fe2 WebContent: Return element tag names as lowercase for WebDriver
Erring on the side of web reality on this one, as other engines return
lowercase tag names, and this is expected by WPT.
2024-11-06 20:44:19 -05:00
Timothy Flynn
1417314aa9 WebContent: Do not coerce element properties to strings for WebDriver
We want the "raw" value here. The spec sort of assumes we are sending JS
values over the wire, whereas we are actually sending AK::JsonValue. So
using the JSON clone AO here is our best bet.
2024-11-06 20:44:19 -05:00
Timothy Flynn
33a00f45fd WebContent: Ensure the document's style is up to date for WebDriver
Otherwise, we have a timing issue retrieving computed styles.
2024-11-06 20:44:19 -05:00
Timothy Flynn
ecaacd2adf LibWeb+WebContent: Update our list of boolean attributes for WebDriver
Chromium has a larger list of boolean attributes, and WPT depends on it.
We must also compare attribute names case-insensitively.

Note this method is only used by WebDriver.
2024-11-06 20:44:19 -05:00
Andreas Kling
81e75530d9 LibWeb: Make :nth-* selectors match children of non-elements
Some checks failed
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
Build Dev Container Image / build (push) Has been cancelled
This was covered by WPT, which caught us not allowing :nth-child(1)
to match the root HTML element, and other similar issues.
2024-11-06 21:42:53 +01:00
Andreas Kling
eeba30f988 LibWeb: Allow :link and :any-link to match SVG <a> elements 2024-11-06 21:42:53 +01:00
Andreas Kling
92d9907f8f LibWeb: Add style invalidation for :target, :focus, :active and :link 2024-11-06 21:42:53 +01:00
Andreas Kling
1045000c28 LibWeb: Style invalidation for DOM node removal needs to happen earlier
We can't invalidate after the removal has taken effect, since that means
invalidation won't be able to find potentially affected siblings and
ancestors by traversing from the invalidation target.
2024-11-06 21:42:53 +01:00
Andreas Kling
adfc69bc67 LibWeb: Add style invalidation for :defined selector 2024-11-06 21:42:53 +01:00
Andreas Kling
6c945fc353 Tests: Import more CSS selector tests from WPT 2024-11-06 21:42:53 +01:00
Andreas Kling
9dff6bca1f Tests: Import more style invalidation tests from WPT
These will help us work on style invalidation with more confidence.
2024-11-06 21:42:53 +01:00
Timothy Flynn
80c6268431 Meta+LibJS: Upgrade to prettier version 3.3.3
Prettier v3 was released over a year ago, and most users will have it by
default by now.
2024-11-06 15:10:27 -05:00
Timothy Flynn
deb5947fc0 Meta: Fix regex version check in the lint-prettier script
If your local version is 3.2.0, this check would errantly pass.
2024-11-06 15:10:27 -05:00
Sam Atkins
f61a41d7a6 Meta: Add imported WPT ref tests to .prettierignore 2024-11-06 20:03:38 +01:00
Sam Atkins
8f21513902 Tests: Re-import tests that used ahem.css
This causes 36 new subtests to pass locally. :^)

Unfortunately at least one of these is flaky when it's able to load the
font file, apparently because we don't wait for the font and its
stylesheet to actually load before the tests run.
2024-11-06 20:03:38 +01:00
Sam Atkins
f2407cd511 Meta: Support importing WPT ref tests that use an absolute path
For example, a few ref tests have a match like this:
```
<link rel="match"
      href="/css/reference/ref-filled-green-100px-square-only.html">
```

Previously we'd interpret this as `http://css/reference/...` which made
the test runner sad.
2024-11-06 20:03:38 +01:00