Commit graph

3254 commits

Author SHA1 Message Date
Luke Warlow 33c315bad0 LibWeb: Implement CloseWatcher API
This implements most of the CloseWatcher API from the html spec.

AbortSignal support is unimplemented.

Integration with dialogs and popovers is also unimplemented.

(cherry picked from commit b216046234560df531e1a32269e5dfa18f8f240c,
manually amended to replace a single `UIEvents::KeyCode::Key_Escape`
with `KeyCode::Key_Escape` in EventHandler.cpp since we don't have
the second commit of https://github.com/LadybirdBrowser/ladybird/pull/86)
2024-06-28 00:55:43 +02:00
Luke Warlow 1739111d17 LibWeb: Refactor DOM parsing APIs
Multiple APIs have moved from the DOM Parsing and Serialization spec to
HTML.

Updates spec URLs and comments.

Delete InnerHTML file:
- Make parse_fragment a member of Element, matching serialize_fragment
on Node.
- Move inner_html_setter inline into Element and ShadowRoot as per the
spec.

Add FIXME to Range.idl for Trusted Types createContextualFragment

(cherry picked from commit 9171c3518358cd2d146ffbd7582e4c1247a1daa7)
2024-06-28 00:55:22 +02:00
Aliaksandr Kalenik c6e3c0a339 LibWeb: Create BlockContainer layout node for <input type="button">
...and shadow tree with TextNode for "value" attribute is created.
This means InlineFormattingContext is used, and button's text now
respects CSS text-decoration properties and unicode-ranges.

(cherry picked from commit 8feaecd5c8d02a2fdb989a9a9671e008d1c3a7de)
2024-06-27 19:02:45 +02:00
Nico Weber aef023a7f6 Meta: Port recent changes to the GN build
4033776fb5
2024-06-27 19:02:10 +02:00
Matthew Olsson 5e4e39d84a LibWeb: Remove TimingFunction in favor of EasingStyleValue::Function
Now that EasingStyleValue is a lot nicer to use, there isn't much reason
to keep TimingFunction around.

(cherry picked from commit 7950992fc21e2428a7f32954bbe893a2b2d58cf7,
manually amended with the output of `git clang-format master`)
2024-06-27 14:49:14 +02:00
Matthew Olsson 6c0859d412 Meta: Remove GenerateCSSEasingFunctions
(cherry picked from commit ac35f76e67f9a393ed5a2e5c8b7e7f56809a2a56)
2024-06-27 14:49:14 +02:00
Nico Weber 4bf4905131 Meta: Port recent changes to the GN build
f72805398b
2024-06-27 14:42:29 +02:00
Tim Ledbetter 1bf09a74b7 Meta: Ensure LibURL tests are built
(cherry picked from commit fd98076aca7a75a620672a7a1632b46a62641927,
manually resolved a conflict)
2024-06-27 14:00:51 +02:00
Simon Wanner 92600b3171 LibTextCodec: Use generated lookup tables for all single byte decoders
(cherry picked from commit 0ab4722cee11d27da79bb05c1d53693f39938cf6)
2024-06-27 00:27:56 +02:00
Simon Wanner c90963161e LibTextCodec: Fix ISO-8859-1 vs. windows-1252 handling in web contexts
The Encoding specification maps ISO-8859-1 to windows-1252 and expects
the windows-1252 translation table to be used, which differs from
ISO-8859-1 for 0x80-0x9F.

Other contexts expect to get the actual ISO-8859-1 encoding, with 1-to-1
mapping to U+0000-U+00FF, when requesting it.

`decoder_for_exact_name` is introduced, which skips the mapping from
aliases to the encoding name done by `get_standardized_encoding`.

(cherry picked from commit 6b2c4599017f512279cb26c0d3c48aa5a9453007)
2024-06-27 00:27:56 +02:00
Luke Warlow 39a8974840 LibWeb: Implement stub for ElementInternals
This implements a stub ElementInternals object which implements the
shadowRoot getter only.

Also implement attachInternals function.

(cherry picked from commit a65f1ecc375fa02deeab5d0e7ab4702972ffa72e)
2024-06-26 20:02:46 +02:00
Tim Ledbetter 36630bf859 LibIDL+LibWeb: Mark [FIXME] interfaces as [[Unimplemented]]
Methods and attributes marked with [FIXME] are now implemented as
direct properties with the value `undefined` and are marked with the
[[Unimplemented]] attribute. This allows accesses to these properties
to be reported, while having no other side-effects.

This fixes an issue where [FIXME] methods broke feature detection on
some sites.

(cherry picked from commit 2f5cf8ac204a58dc2a6f722dd95015c6c2fb7a78)
2024-06-26 16:34:37 +02:00
Andreas Kling 83d0599d1c LibWeb: Add Element.getHTML() and ShadowRoot.getHTML()
(cherry picked from commit fb9f3f10f3090cc2822d2c681bd7350dda17830e)
2024-06-26 08:48:11 +02:00
Nico Weber 22d737f370 Meta: Add a warning suppression used in the cmake build to the gn build
8263e0a619 added `-Wno-coroutine-missing-unhandled-exception` to the
cmake build, and the coroutine code does not build without it.

Unbreaks building e.g. `js` with GN.
2024-06-24 20:44:26 +02:00
Daniel Bertalan 8b189b7eb0 Fuzzers: Use libc++ on OSS-Fuzz for Lagom code generators
By unsetting `CXXFLAGS` in order to build Lagom code generators without
instrumentation, we were also removing `-stdlib=libc++`, so Clang ended
up using the runner image's libstdc++ 9 headers. These are too old, and
don't contain `<coroutine>`, leading to a build failure.

Fixes #24578
2024-06-22 20:44:13 +02:00
Ali Mohammad Pur fe3cdda2eb Contrib/VideoPlayerSDL: Disable on emscripten 2024-06-19 15:45:02 +02:00
Diego ab95169d3c LibWasm: Enable the loop.wast test file
(cherry picked from commit 1486780676fb558904b9bb9966b5a06c7eb128d8)
2024-06-13 23:14:39 +02:00
Diego 3131736164 LibWasm: Add missing spec-test imports
(cherry picked from commit 69e151e79f11d27fbe53ee0f2391ae8e86f90b5b)
2024-06-13 23:14:39 +02:00
Dan Klishch 77be5254e1 LibHTTP: Implement bare-bones HTTP/1.1 client using coroutines
We don't have asynchronous TCP socket implementation, so its usefulness
is a bit limited currently but we can still test it using memory
streams. Additionally, it serves as a temporary {show,test}case for the
asynchronous streams machinery.
2024-06-13 17:40:24 +02:00
Dan Klishch 8263e0a619 AK: Introduce AK::Coroutine 2024-06-13 17:40:24 +02:00
Nico Weber bb2d80a2bb Everywhere: Gently remove the ladybird android port
With Ladybird now being its own repository, there's little reason
to keep the Ladybird Android port in the SerenityOS repository.

(The Qt port is useful to be able to test changes to LibWeb in lagom
so it'll stay around. Similar for the AppKit port, since getting
Qt on macOS is a bit annoying. But if the AppKit port is too much
pain to keep working, we should toss that too.

Eventually, the lagom browser ports should move out from Ladybird/
to Meta/Lagom/Contrib, but for now it might make sense to leave them
where they are to keep cherry-picks from ladybird easier.)
2024-06-11 19:40:08 -04:00
Ali Mohammad Pur bf5c2d0859 Utilities: Add a crypto benchmarking tool 2024-06-10 11:59:14 +02:00
Diego 27905af9ec LibWasm: Generate all spec-tests properly 2024-06-09 16:30:09 +02:00
Jamie Mansfield 7814dad6cf LibWeb: Implement should block mixed content request 2024-06-08 14:07:54 -04:00
circl ec1692eed2 Browser: Display name as "Browser" once again
This basically reverts 15211cd, since Ladybird has been hard-forked from
the SerenityOS project, this chrome is no longer officially part of it.
2024-06-08 10:30:07 -04:00
Andrew Kaster 605aa2e34b Meta: Link librt to LibCoreMinimal on NetBSD
We were already linking librt to LibCore for shm_open and friends.
Now that we build the code that uses POSIX shm into LibCoreMinimal, we
need to link librt into that as well.
2024-06-06 09:27:50 -06:00
Jamie Mansfield bf8c6f939e LibWeb: Move NetworkPartitionKey into a header
This is used elsewhere, such as the HTMLLinkElement.
2024-06-05 05:02:55 +01:00
Matthew Olsson 74840de7fc LibWeb: Generate a method to get camel-cased CSS property names 2024-06-03 10:53:32 +02:00
Timothy Flynn d4734e920c Meta: Define HAVE_QT when building WebContent for Qt in the GN build
For some reason, WebContent fails to load simple sites like xkcd.com
without the Qt event loop, even when using RequestServer instead of the
Qt networking stack. The CMake build on Linux has the same issue if we
skip installing the Qt event loop. It's not clear why this is - whether
something depends on the Qt event loop, or if there's a bug in the Unix
event loop implementation.

This is, however, also needed to use the --enable-qt-networking feature.
2024-06-02 15:52:28 -04:00
Timothy Flynn 951aa44f87 Meta: Use the host CXX tool for linking as well
For example, if you set host_cxx=clang in your args.gn, we would still
use GCC for linking. This matches the CMake build now.
2024-06-02 15:52:28 -04:00
Timothy Flynn 847ee6e266 Meta: Do not launch linker commands with ccache 2024-06-02 15:52:28 -04:00
Timothy Flynn 017009437d Meta: Update compilation flags in the GN build to match the CMake build 2024-06-02 15:52:28 -04:00
Diego d906255cbb LibWasm: Improve table support
Implements `table.get`, `table.set`, `elem.drop`, `table.size`,
and `table.grow`. Also fixes a few issues when generating ref-related
spectests. Also changes the `TableInstance` type to use
`Vector<Reference>` instead of `Vector<Optional<Reference>>`, because
the ability to be null is already encoded in the `Reference` type.
2024-06-01 16:21:03 +02:00
Daniel Bertalan 30f6cef648 VideoPlayerSDL: Instruct the compiler to search SDL2's include path
On my Mac system with Homebrew SDL + self-built Clang, SDL2's include
directory is not in the library search path by default. Add it to
unbreak the build.
2024-06-01 08:24:01 -04:00
Timothy Flynn b01e810a89 LibWeb+LibWebView+WebContent: Support case-insensitive find-in-page
This allows searching for text with case-insensitivity. As this is
probably what most users expect, the default behavior is changes to
perform case-insensitive lookups. Chromes may add UI to change the
behavior as they see fit.
2024-06-01 07:37:54 +02:00
Timothy Flynn ac15c1cc01 Meta: Port recent changes to the GN build
2ce61fe6ea
2024-05-31 10:44:00 -04:00
Timothy Flynn d6732e5906 Ladybird/AppKit: Implement a basic find-in-page panel 2024-05-31 06:30:39 -04:00
Timothy Flynn 903078e4d1 Meta: Fix detection of QtMultimedia usage on macOS
We use Audio Unit for audio on macOS.
2024-05-31 06:30:39 -04:00
Timothy Flynn 5912df5e42 Meta: Port recent changes to the GN build
389a55fe36
2024-05-31 06:30:39 -04:00
Simon Wanner 7f3b457e62 LibTextCodec: Add EUC-KR decoder 2024-05-31 07:56:26 +02:00
Simon Wanner 45f0ae52be LibTextCodec: Add EUC-JP decoder 2024-05-31 07:56:26 +02:00
Simon Wanner 9943bb1d8e LibTextCodec: Add Big5 decoder 2024-05-31 07:56:26 +02:00
Simon Wanner 2ce61fe6ea LibTextCodec: Add GBK/GB18030 decoder
Includes changes from GB-18030-2022, which are not yet included in the
Encoding Specification, but WebKit, Blink and WPT are already updated.
2024-05-31 07:56:26 +02:00
Andrew Kaster e2d50dc5dd LibWeb: Move window.open TokenizedFeature parsing into its own file 2024-05-30 16:16:33 -04:00
Matthew Olsson 5740f93ef4 ClangPlugins: Check for strong root fields in GC allocated objects
GC-allocated objects should never have JS::SafeFunction/JS::Handle
fields.

For now the plugin only emits warnings here, as there are many cases
of this occurring in the codebase that aren't trivial to fix. It is also
behind a CMake flag since it is a _very_ loud warning.
2024-05-30 09:29:20 -06:00
Matthew Olsson 36d032b208 ClangPlugin: Emit diagnostics for incorrect usage of JS_CELL-like macros 2024-05-30 09:29:20 -06:00
Matthew Olsson 54fffef902 ClangPlugin: Add a PPCallbacks instance to collect JS_CELL-like macros 2024-05-30 09:29:20 -06:00
Matthew Olsson d74838f44d ClangPlugins: Use underscores instead of dashes in plugin names
This allows arguments to be passed to them from the command line
2024-05-30 09:29:20 -06:00
Matthew Olsson c739ae3e02 ClangPlugins: Change name of variable used for test compile options
This makes it more clear what it is used for
2024-05-30 09:29:20 -06:00
Timothy Flynn d9a277c139 Meta: Allow building Ladybird without QtMultimedia if Pulse is found 2024-05-30 11:07:08 -04:00