Commit graph

64044 commits

Author SHA1 Message Date
Andrew Kaster
1322a7e917 LibGfx: Use more Span methods in BitmapSequence instead of memcpy
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
And a few assorted cleanups to use more moves() to avoid copying Vectors
and NonnullRefPtrs.
2024-10-02 16:37:19 -06:00
Zachary Huang
e0bd42be95 ImageDecoder+LibGfx: Collate decoded bitmaps before sending over IPC
There is an issue where gifs with many frames cannot be loaded, as each
bitmap is sent over IPC using a separate file descriptor, and there is
limit on the maximum number of descriptors per IPC message. Thus, trying
to load gifs with more than 64 frames (the current limit) causes the
image decoder process to die.

This commit introduces the BitmapSequence class, which is a thin wrapper
around the type Vector<Optional<NonnullRefPtr<Gfx::Bitmap>>> and
provides an IPC encode/decode routine that collates all bitmap data into
a single buffer so that only a single file descriptor is required per
IPC transfer, even if multiple frames are being sent.
2024-10-02 15:57:41 -06:00
Kemal Zebari
b8a5e18a01 LibWeb/MimeSniff: Update the MIME type sniffing algo to meet specs
The spec moved/added the xml and html checks to the beginning and
removed sniffing resource feeds.
2024-10-02 16:15:23 -04:00
Sam Atkins
ea95e32539 Tests: Use .invalid TLD for invalid requests
RFC2606 and RFC6761 define .invalid as a guaranteed-invalid TLD, so
let's use it. Theoretically this should make the request fail much
faster.
2024-10-02 16:04:17 -04:00
Arhcout
c31f9815b4 LibWeb: Readonly input element's arrow buttons don't change the value 2024-10-02 16:04:00 -04:00
Andrew Kaster
ebaba7fb7b LibMedia: Mark ffmpeg as required, and reorganize CMakeLists
Now it should be clearer looking at the build scripts what options
are available for building LibMedia, and what packages are required.
2024-10-02 16:03:33 -04:00
Jelle Raaijmakers
768d814ffd LibGfx: Set correct alpha type for webp decoding
The libwebp decoder gives us unpremultiplied color data, so mark our
bitmaps as such.
2024-10-02 16:37:22 +01:00
Sam Atkins
07300a5bb4 headless-browser: Clean up unused includes 2024-10-02 16:36:10 +01:00
Sam Atkins
ae2959959b headless-browser: Use ByteString for paths 2024-10-02 16:36:10 +01:00
Sam Atkins
260074af87 headless-browser: Ensure test path is always absolute
Previously, if you ran with a relative path, then everything would run
fine except that the test name would be blank in the output, eg:

  1/1234:

instead of:

  1/1234: Text/input/canvas/export.html
2024-10-02 16:36:10 +01:00
Sam Atkins
c4b62ab04d headless-browser: Add a --dry-run flag
--dry-run causes headless-browser to collect and then list tests,
without running them.
2024-10-02 16:36:10 +01:00
Sam Atkins
c497e5f850 LibWeb: Serialize more @font-face descriptors
Adapt the existing `font-face-src-local-serialization.html` test into a
more general test for these.
2024-10-02 16:28:55 +01:00
Sam Atkins
e43f3e4808 LibWeb/CSS: Parse font-[feature,variation]-settings descriptors 2024-10-02 16:28:55 +01:00
Sam Atkins
95c17dfab5 LibWeb/CSS: Parse and propagate font-feature-settings property 2024-10-02 16:28:55 +01:00
Sam Atkins
55812aaed2 LibWeb/CSS: Parse and propagate font-variation-settings property 2024-10-02 16:28:55 +01:00
Sam Atkins
1a127c9d37 LibWeb/CSS: Expand single-none-parsing helper to parse any keyword
Multiple font properties are either the `normal` keyword or some
non-keyword value, so this lets us avoid some boilerplate for those, at
the cost of the existing `none` users having marginally more verbose
code.
2024-10-02 16:28:55 +01:00
Sam Atkins
cd13b30fb8 LibWeb/CSS: Add parsing for <opentype-tag>
This is a special form of `<string>` so doesn't need its own style value
type. It's used in a couple of font-related properties. For completeness
it's included in ValueType.
2024-10-02 16:28:55 +01:00
Sam Atkins
f7f8d2fe0d LibWeb/CSS: Return StringStyleValue's FlyString by reference
Most of the time this copy is completely unnecessary, so let's avoid it!
2024-10-02 16:28:55 +01:00
Sam Atkins
2516297c86 LibWeb/CSS: Return StringStyleValue from parse_string_value()
Callers already relied on this being true, so let's make it contractual.
2024-10-02 16:28:55 +01:00
Sam Atkins
c22a2d8f2b LibWeb/CSS: Introduce OpenTypeTaggedStyleValue
Two font properties, font-feature-settings and font-variation-settings,
contain a list of values that are an `<opentype-tag>` followed by a
single value. This class is intended to fill both roles.
2024-10-02 16:28:55 +01:00
Aliaksandr Kalenik
94b3b84dd8 LibWeb: Make sure style is up-to-date in getAnimations()
StyleComputer is responsible for assigning animation targets, so we
have to make sure there are no pending style updates before querying
animations of an element.

This change also introduces a version of getAnimations() that does not
check style updates and used by StyleComputer to avoid mutual recursion.
2024-10-02 16:28:37 +01:00
Timothy Flynn
c412181683 CI: Switch Linux runners to Ubuntu 24.04
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-02 06:41:20 -04:00
Timothy Flynn
04b45a8961 CI: Switch to the stable Xcode 16 toolchain
We had to use beta before Xcode 16 was officially released, but we can
now use the stable version.
2024-10-02 06:41:20 -04:00
Jelle Raaijmakers
5661da78a4 CI: Use explicit label for test262 workflow
Merely specifying `self-hosted` is not enough - to get closer to
reproducible timings, we want these jobs to run on dedicated hardware.
The `test262-runner` label was introduced for runners that offer this.
2024-10-02 06:40:27 -04:00
Kostya Farber
68a28ff33a LibWeb/CSS: Parse the tab-size property 2024-10-02 10:27:15 +01:00
Tim Ledbetter
140dc95e67 LibWeb: Map dimension attributes for table elements 2024-10-02 09:50:54 +02:00
Tim Ledbetter
728236f4d2 LibWeb: Map embedded content element attributes to dimension properties 2024-10-02 09:50:54 +02:00
Tim Ledbetter
baca0e5e55 Libweb: Map marquee attributes to dimension properties 2024-10-02 09:50:54 +02:00
Tim Ledbetter
4c3101e021 LibWeb: Map hr width attribute to the width dimension property 2024-10-02 09:50:54 +02:00
Andreas Kling
45a3360a62 Meta: Add code of conduct (from the Ruby community) 2024-10-02 09:49:52 +02:00
Andrew Kaster
d96c7edfb6 LibWeb: Add more HTML tokenization states to Swift implementation
This patch adds support for start and end tags, as well as script tag
rules.
2024-10-02 09:44:38 +02:00
Andrew Kaster
91de0438fe Meta: Add swift-format linter script
Some checks are pending
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.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-22.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
swift-format is available in the Xcode 16 Beta and homebrew.
We will need some extra docs to tell Linux developers how to get it on
their distribution.

This also makes use of the fact that you can pass git diff a colon
delimited pattern to include ':*pattern' or exclude ':!*pattern'
matching files, which is pretty neat.
2024-10-01 13:33:05 -06:00
Andrew Kaster
2575cfb14c CI: Convert lint job to macOS and install swift-format
swift-format is only packaged for homebrew, Arch, and nixpkgs at the
moment. Rather than installing swiftly and a swift toolchain, let's
change the job to run on macOS.
2024-10-01 13:33:05 -06:00
Andrew Kaster
951f4f0984 Tests: Run swift-format on TestLibWebSwiftBindings 2024-10-01 13:33:05 -06:00
Timothy Flynn
3393a74771 UI/Qt: Do not create signal notifiers until after an event loop exists
We are currently creating a signal socket and socket notifier before the
Qt event loop itself has been created. Thus, when we receive a signal,
we are not actually notified when we write that signal number to the
signal socket.

This was also the source of the following error message being displayed
on every launch of the browser:

    QSocketNotifier: Can only be used with threads started with QThread
2024-10-01 12:23:35 -04:00
dependabot[bot]
3385eb43f4 CI: Bump JamesIves/github-pages-deploy-action from 4.6.4 to 4.6.8
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.4 to 4.6.8.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.6.4...v4.6.8)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 10:14:34 -06:00
Saleem Abdulrasool
cf702d21d1 Meta: Remove unused code generate tools
These are no longer in the tree, remove their definitions.
2024-10-01 10:14:16 -06:00
Andrew Kaster
7aa0165fe7 LibWeb: Deduplicate attributes when emitting start and end tags
Some checks are pending
CI / Lagom (true, NO_FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-22.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-22.04, Linux, GNU) (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-22.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 HTML tokenizer specification says that we're supposed to do this
when leaving the Attribute name or when emitting the token, as
appropriate.

Hopefully 'as appropriate' can mean only when emitting the token, as
that's the easiest place to insert this logic without complicating the
tokenizer any more.
2024-10-01 11:04:28 +02:00
Timothy Flynn
b3f8d63372 WebContent: Implement the Release Actions endpoint 2024-10-01 11:02:27 +02:00
Timothy Flynn
709deeb482 LibWeb+WebContent+WebDriver: Implement the Perform Actions endpoint
Similar to script execution, this spins the WebDriver process until the
action is complete (rather than spinning the WebContent process, which
we've seen result in deadlocks).
2024-10-01 11:02:27 +02:00
Timothy Flynn
8000837f78 LibWeb: Implement WebDriver pointer action execution
This implements execution of the pointer up, pointer down, and pointer
move actions.

This isn't 100% complete. Pointer move actions are supposed to break
the move into iterations over the specified duration, which we currently
do not do.
2024-10-01 11:02:27 +02:00
Timothy Flynn
6cf7d07a98 LibWeb: Implement WebDriver action extraction
There's a lot of parsing involved in action extraction. So this patch
implements only that - actually executing actions will be a future
patch.
2024-10-01 11:02:27 +02:00
Timothy Flynn
0c98c7637e LibWeb: Begin implementing the WebDriver Input State and Input Source
These concepts are rather tightly coupled. This implements the types and
AOs needed to handle the Perform Actions endoint.
2024-10-01 11:02:27 +02:00
Timothy Flynn
94c243acd6 LibWeb+WebContent: Partially implement WebDriver's JSON deserialize AO
In particular, we need to convert web element references to the actual
element. The AO isn't fully implemented because we will need to work out
mixing JsonValue types with JS value types, which currently isn't very
straight forward with our JSON clone algorithm.
2024-10-01 11:02:27 +02:00
Timothy Flynn
434663b1c6 LibWeb: Ensure numbers provided to WebDriver are "safe"
Numbers are limited to JS's Number.MAX_SAFE_INTEGER.
2024-10-01 11:02:27 +02:00
Timothy Flynn
71c1a1d8f4 LibWeb: Add a few more helpers to extract WebDriver properties 2024-10-01 11:02:27 +02:00
Timothy Flynn
8944c6db3f LibWeb+WebContent: Move WebDriver property extraction to a helper file
This will be needed outside of WebContent.
2024-10-01 11:02:27 +02:00
Timothy Flynn
5e99715377 LibWeb: Add helpers to convert a MouseButton to/from its DOM event code
Move the helper to convert MouseButton to its DOM event code to a public
header. And add a helper to convert in the opposite direction.
2024-10-01 11:02:27 +02:00
Sam Atkins
1217e7733f LibCore: Add StandardPaths::system_data_directories()
This is only used for finding font directories for now, but having a
convenient function for it means if anyone needs to use XDG_DATA_DIRS
in future, they're less likely to implement it themselves and miss the
case of it being present but empty.

We also now canonicalize the data directory paths, as we do for the
other standard paths.
2024-09-30 18:48:45 +02:00
Sam Atkins
3a935aa076 LibCore: Clarify StandardPaths::data_directory() name
Let's make it clear that this is for user data.
2024-09-30 18:48:45 +02:00