Commit graph

35422 commits

Author SHA1 Message Date
Jamie Mansfield
797e1d3ee6 LibWeb: Update spec comments for HostLoadImportedModule 2024-10-04 07:08:37 +02:00
Jamie Mansfield
d6db6edaf6 LibWeb: Remove 'classic' from 'default classic script fetch options'
See:
- https://github.com/whatwg/html/commit/5ee6b7b
2024-10-04 07:08:37 +02:00
Andrew Kaster
29416befe6 LibWeb: Add ServiceWorker job registration and execution
Now we can register jobs and they will be executed on the event loop
"later". This doesn't feel like the right place to execute them, but
the spec needs some updates in this regard anyway.
2024-10-04 07:08:08 +02:00
Aliaksandr Kalenik
4a43d0ac98 LibWeb: Move updating the rendering into HTML task
Implements https://github.com/whatwg/html/pull/10007 which basically
moves style, layout and painting from HTML processing task into HTML
task with "rendering" source.

The biggest difference is that now we no longer schedule HTML event loop
processing whenever we might need a repaint, but instead queue a global
rendering task 60 times per second that will check if any documents
need a style/layout/paint update.

That is a great simplification of our repaint scheduling model. Before
we had:
- Optional timer that schedules animation updates 60 hz
- Optional timer that schedules rAF updates
- PaintWhenReady state to schedule a paint if navigable doesn't have a
  rendering opportunity on the last event loop iteration

Now all that is gone and replaced with a single timer that drives
repainting at 60 hz and we don't have to worry about excessive repaints.

In the future, hard-coded 60 hz refresh interval could be replaced with
CADisplayLink on macOS and similar API on linux to drive repainting in
synchronization with display's refresh rate.
2024-10-04 07:07:01 +02:00
Aliaksandr Kalenik
9754b480fa LibWeb: Move update_layout() to happen earlier in find_matching_text()
update_layout() need to be invoked before checking if layout node is
present, because layout not being updated might be the reason why layout
node doesn't exist yet.
2024-10-04 07:07:01 +02:00
Aliaksandr Kalenik
32e79bd12e LibWeb: Invalidate animated style even if target doesn't have paintable
...otherwise animated style invalidation will be skipped.

This change is a preparation before applying latest HTML event loop
procesing spec changes to avoid regressing our tests.
2024-10-04 07:07:01 +02:00
Aliaksandr Kalenik
dc1a646764 LibWeb: Remove layout node check in EventHandler::handle_keydown()
This function does not rely on having a layout node.
2024-10-04 07:07:01 +02:00
Andreas Kling
0b403d30d7 LibWeb: Don't swallow args when forwarding cross-origin WindowProxy call
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
Fixes at least one WPT test that was previously timing out:
- html/semantics/document-metadata/the-base-element/base_target_does_not_affect_iframe_src_navigation.html
2024-10-03 20:49:45 +02:00
ronak69
8cfe51cef4 LibWeb: Make horizontal scrollbar start from the left edge of viewport
Horizontal scrollbar has to leave space at right edge for the vertical
scrollbar to fully extend from top-to-bottom edge of viewport. Before,
this was done by just moving it leftward beyond the edge of viewport.

Now, it gets scaled down appropriately to fit between left edge of
viewport & vertical scrollbar without clipping.
2024-10-03 19:43:08 +02:00
Kostya Farber
09aec4be71 LibWeb/CSS: Implement delete method for FontFaceSet
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-03 16:36:44 +02:00
Timothy Flynn
f56b33f8d5 headless-browser: Add a flag to rebaseline executed layout / text tests
The existing rebaseline script is a bit limiting in that it can only
rebaseline a single test at a time. When making sweeping changes, this
patch will let us rebaseline any number of tests at once.
2024-10-03 09:15:45 -04:00
Timothy Flynn
bf668696de LibWeb+WebContent: Do not include DOM HTML in text test expectations
For example, in the following abbreviated test HTML:

    <span>some text</span>
    <script>println("whf")</script>

We would have to craft the expectation file to include the "some text"
segment, usually with some leading whitespace. This is a bit annoying,
and makes it difficult to manually craft expectation files.

So instead of comparing the expectation against the entire DOM inner
text, we now send the inner text of just the <pre> element containing
the test output when we invoke `internals.signalTextTestIsDone`.
2024-10-03 07:07:28 -04:00
Andrew Kaster
3ecf6de652 LibMedia+Ladybird: Use pkg_check_modules to find pulseaudio
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 20:23:03 -04:00
Jelle Raaijmakers
2106617f5b LibWeb: Implement history.scrollRestoration 2024-10-02 17:08:17 -06:00
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
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
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
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
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