Commit graph

35442 commits

Author SHA1 Message Date
Shannon Booth
088b659abd LibURL: Do not treat port of 0 as a null port in Origin
It is not treated as the same thing in the specification, or by us in
other places too. This fixes 8 more origin related URL tests on WPT.
2024-10-05 10:46:30 +02:00
Shannon Booth
501f92b54e LibWeb+LibURL: Consolidate Origin parsing and serialization into LibURL
Because of the previous awkward factoring of Origin we had two
implementations of Origin serializing and creation. Move the
implementation of DOMURL::url_origin into URL::origin, and
instead use the implemenation of URL::Origin::serialize for
serialization (replacing URL::serialize_origin).

This happens to fix 8 URL subtests as the two implemenations had
diverged, and URL::serialize_origin was previously missing the spec
changes of: whatwg/url@eee49fd and whatwg/url@fff33c3
2024-10-05 10:46:30 +02:00
Shannon Booth
12ea470417 LibWeb+LibURL: Get blob's environments origin from URL's blob entry
This closer matches specification - and removes any dependency on
LibWeb in the implementation of DOMURL::url_origin.

It is also one step closer to moving BlobURLRegistry to a singleton
process to match LibWeb's multiprocess Worker architecture.
2024-10-05 10:46:30 +02:00
Shannon Booth
43973f2d0a LibURL: Define Origin methods depending on URL::Parser out of line
This is also in an effort towards resolving a future circular dependency
between Origin.h and URL.h
2024-10-05 10:46:30 +02:00
Shannon Booth
53ad982bb7 LibURL: Factor Host into a standalone header file
This will help solve a future circular dependency between URL.h
and Origin.h
2024-10-05 10:46:30 +02:00
Shannon Booth
dc401f49ea LibWeb+LibURL: Move HTML::Origin to URL::Origin
While Origin is defined in the HTML spec - this leaves us with quite an
awkward relationship as the URL spec makes use of AO's from what is
defined in the HTML spec.

To simplify this factoring, relocate Origin into LibURL.
2024-10-05 10:46:30 +02:00
Totto16
abe1172d70 LibWeb: Make HTMLVideoElement part of CanvasImageSource union
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-05 09:20:58 +02:00
rmg-x
d8c36ed458 LibCore: Remove unused classes and headers 2024-10-05 09:18:54 +02:00
Tim Ledbetter
1fa948f114 LibWeb: Implement the "check if unloading is canceled" AO
This method is responsible for firing `beforeunload` events.
2024-10-05 09:17:34 +02:00
Tim Ledbetter
f807b2800e LibWeb: Ensure special error event handling applies to workers 2024-10-05 09:17:34 +02:00
Tim Ledbetter
99ef078c97 LibWeb: Implement BeforeUnloadEvent
This is required to support legacy behavior of the `returnValue`
attribute.
2024-10-05 09:17:34 +02:00
scorpion-26
d00adabc3c LibWeb: Preserve order of HTMLCollection property names
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
The supported property names should be ordered in "tree order", though
m_cached_name_to_element_mappings doesn't preserve this ordering, which
breaks Object.getOwnPropertyNames.

Fixes at least the following WPT tests:
 - https://wpt.live/dom/nodes/Element-children.html
 - https://wpt.live/dom/collections/HTMLCollection-live-mutations.window.html
 - https://wpt.live/dom/collections/HTMLCollection-supported-property-names.html
2024-10-04 22:43:44 +01:00
stelar7
193c0dcafc LibWeb: Parse mimetype when creating Blob and File 2024-10-04 20:03:49 +02:00
stelar7
0739f1b1e6 LibWeb: Iterate over utf8 codepoints when checking validity 2024-10-04 20:03:49 +02:00
Edwin Hoksberg
cbe4ba7f8c LibWeb: Handle Refresh header
Fixes a bunch of tests in:
- https://staging.wpt.fyi/results/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh
2024-10-04 20:02:35 +02:00
Andreas Kling
cd0e4a49b8 LibWeb: Make SVGImageElement part of CanvasImageSource union
This is very janky at the moment but it also more correct. :^)
2024-10-04 20:01:22 +02:00
Andreas Kling
902586a21d LibWeb: Fail CSS color parse for "rgba(123, 123, 123, "
This matches the behavior of other browsers and fixes a WPT test.
2024-10-04 20:01:22 +02:00
Andreas Kling
4590c081c2 LibWeb+LibGfx: Serialize HTML canvas fill/strokeStyle colors correctly
Before this change we were serializing them in a bogus 8-digit hex color
format that isn't actually recognized by HTML.

This code will need more work when we start supporting color spaces
other than sRGB.
2024-10-04 20:01:22 +02:00
Tim Ledbetter
d0b97873d4 LibWeb: Follow spec steps to set the selectionDirection attribute value 2024-10-04 19:42:33 +02:00
Andreas Kling
cc4b3cbacc Meta: Update my e-mail address everywhere
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-04 13:19:50 +02:00
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