Commit graph

3893 commits

Author SHA1 Message Date
Luke Wilde
791c258754 LibWeb/WebGL2: Implement MAX_VERTEX_UNIFORM_COMPONENTS parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
b6388abb9b LibWeb/WebGL2: Implement MAX_COLOR_ATTACHMENTS parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
99a501bd09 LibWeb/WebGL2: Implement MAX_ARRAY_TEXTURE_LAYERS parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
6e42f401f9 LibWeb/WebGL2: Implement texImage3D with ArrayBufferView and offset 2024-12-14 09:06:28 +01:00
Luke Wilde
50b4d65540 LibWeb/WebGL2: Implement texImage2D with ArrayBufferView and offset 2024-12-14 09:06:28 +01:00
Luke Wilde
766f4d2ec4 LibWeb/WebGL2: Implement texSubImage2D with ArrayBufferView and offset 2024-12-14 09:06:28 +01:00
Luke Wilde
e6ebec853b LibWeb/WebGL2: Implement texSubImage3D with ArrayBufferView and offset 2024-12-14 09:06:28 +01:00
Luke Wilde
f266705bc6 LibWeb/WebGL2: Implement MAX_3D_TEXTURE_SIZE parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
dad30672d9 LibWeb/WebGL: Return GL_INVALID_ENUM for unknown buffer parameter names 2024-12-14 09:06:28 +01:00
Luke Wilde
776328e2e7 LibWeb/WebGL2: Implement getInternalformatParameter 2024-12-14 09:06:28 +01:00
Luke Wilde
ee500df7ec LibWeb/WebGL2: Implement MAX_SAMPLES parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
ff8a9549f1 LibWeb/WebGL2: Implement clientWaitSync 2024-12-14 09:06:28 +01:00
Luke Wilde
135ceb387e LibWeb/WebGL2: Implement fenceSync 2024-12-14 09:06:28 +01:00
Luke Wilde
f4f3e446a2 LibWeb/WebGL2: Implement bindSampler 2024-12-14 09:06:28 +01:00
Luke Wilde
8a9d1de1cf LibWeb/WebGL2: Implement createSampler 2024-12-14 09:06:28 +01:00
Luke Wilde
bd1cc239df LibWeb/WebGL2: Implement uniformMatrix{2,3,4}fv 2024-12-14 09:06:28 +01:00
sideshowbarker
583ca6af89 LibWeb: Implement <input type=checkbox switch> experimentally
In conformance with the requirements of the spec PR at
https://github.com/whatwg/html/pull/9546, this change adds support for
the “switch” attribute for type=checkbox “input” elements — which is
shipping in Safari (since Safari 17.4). This change also implements
support for exposing it to AT users with role=switch.
2024-12-13 11:31:27 +00:00
Aliaksandr Kalenik
897883f947 LibWeb/WebGL: Implement texStorage2D() 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
cfff38a176 LibWeb/WebGL: Implement uniform{1,2,3,4}{i,f}v calls for WebGL2 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
194edbfd89 CodeGenerators: Unify generation of uniform{1,2,3,4}{i,f}v [WebGL] 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
544a0216cf CodeGenerators: Change variable name from "matrix" to "vector" [WebGL] 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
73479d3f94 LibWeb/WebGL: Implement drawBuffers() 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
af4f0c5a81 LibWeb/WebGL: Implement texImage3D() 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
ba19328b98 LibWeb/WebGL: Implement vertexAttrib{1,2,3,4}fv 2024-12-13 09:19:10 +01:00
Aliaksandr Kalenik
4e8ec1e793 LibWeb/WebGL: Implement readPixels() 2024-12-13 09:19:10 +01:00
Andrew Kaster
c1596192fa CMake: Add workaround for binutils+patchelf incompatability 2024-12-12 17:22:34 -07:00
Nathan van der Kamp
158acabd21 BindingsGenerator: Add codegen for reflected nullable Element attributes 2024-12-12 17:11:27 +00:00
Tim Ledbetter
93a1c45eb2 Meta: Don't halt if importing a test fails in WPT.sh 2024-12-11 16:30:20 -07:00
Tim Ledbetter
cb8a1f6bb6 Meta: Add the ability to import entire test directories with WPT.sh
This uses the `WPT.sh list-tests` command to find which tests are in
each given path.
2024-12-11 16:30:20 -07:00
Tim Ledbetter
a4f1838798 Meta: Add a list-tests command to WPT.sh
This outputs a list of all the tests that would be run in the given
test directories.
2024-12-11 16:30:20 -07:00
Timothy Flynn
fe891727dc LibWeb: Use correct URL parsing methods throughout LibWeb
There are essentially 3 URL parsing AOs defined by the spec:
1. Parse a URL
2. Encoding parse a URL
3. Encoding parse a URL and serialize the result

Further, these are replicated between the Document and the ESO.

This patch defines these methods in accordance with the spec and updates
existing users to invoke the correct method. In places where the correct
method is ambiguous, we use the encoding parser to preserve existing ad-
hoc behavior.
2024-12-10 10:37:01 -08:00
Feng Yu
f2eaf3381f LibWeb: Throw TypeError for new Headers(null)
The WebIDL for the `Headers` constructor specifies that the `init`
parameter is optional and must be of type `HeadersInit`. While the
parameter can be omitted (or explicitly set to `undefined`),
`null` is not a valid value.

This change fixes at least 2 "Create headers with null should throw"
WPT subtests which I have imported in this patch.
2024-12-10 06:46:31 -08:00
Andrew Kaster
85b87508bf ClangPlugins: Remove confusing hasType check for lambda capture types
This check asserts that templated types will never escape. Which doesn't
hold up at all in practice.
2024-12-10 07:13:00 +01:00
Aliaksandr Kalenik
46b95182a0 CodeGenerators: Delete unnecessary overrides in WebGL generator
getAttribLocation() and getAttribLocation() could be generated
automatically so we don't need to have overriden function bodies for
them.
2024-12-07 01:36:08 +01:00
Aliaksandr Kalenik
f074df171b CodeGenerators: Use snake case for function parameter names in WebGL 2024-12-07 01:36:08 +01:00
Aliaksandr Kalenik
86c230cd8e LibWeb/WebGL: Implement vertex array calls for WebGL2 2024-12-07 00:05:36 +01:00
Andrew Kaster
56d45282ea LibWeb/WebGL: Don't crash on unknown getParameter on the context
And allow the implementation to set the error code.
2024-12-06 15:35:36 +01:00
Andrew Kaster
af536e1192 LibWeb: Add stubbed-out WebGL2RenderingContext 2024-12-06 15:35:36 +01:00
Andrew Kaster
7868b03d90 LibWeb: Alphabetize WebGL type list in generator 2024-12-06 15:35:36 +01:00
Luke Wilde
460f5fe511 LibWeb/WebGL: Support ArrayBuffer and DataView for BufferSource 2024-12-05 21:27:32 +01:00
Luke Wilde
5392aabded LibWeb/WebGL: Implement texSubImage2D with ArrayBufferView 2024-12-05 21:27:32 +01:00
Luke Wilde
bf2b8c5f2b LibWeb/WebGL: Implement getShaderPrecisionFormat 2024-12-05 21:27:32 +01:00
Luke Wilde
2e1702a14b LibWeb/WebGL: Implement deleteFramebuffer 2024-12-05 21:27:32 +01:00
Luke Wilde
111c4495d9 LibWeb/WebGL: Implement deleteTexture 2024-12-05 21:27:32 +01:00
Luke Wilde
7b0c067f4d LibWeb/WebGL: Implement uniform{1,2,3,4}iv 2024-12-05 21:27:32 +01:00
Luke Wilde
2e1640a6c5 LibWeb/WebGL: Implement deleteBuffer 2024-12-05 21:27:32 +01:00
Luke Wilde
4c0872ea1b LibWeb/WebGL: Implement getBufferParameter 2024-12-05 21:27:32 +01:00
Luke Wilde
a65a981a6b LibWeb/WebGL: Add initial implementation of texImage2D with image source
a
2024-12-05 21:27:32 +01:00
Luke Wilde
a513bdaac6 LibWeb/WebGL: Implement bindRenderbuffer 2024-12-05 21:27:32 +01:00
Luke Wilde
d185c2c28c LibWeb/WebGL: Implement createRenderbuffer 2024-12-05 21:27:32 +01:00
Luke Wilde
b0bcecfc53 LibWeb/WebGL: Implement bindFramebuffer 2024-12-05 21:27:32 +01:00
Luke Wilde
c5e9615c29 LibWeb/WebGL: Implement createFramebuffer 2024-12-05 21:27:32 +01:00
R-Goc
2ac8408fef CMake: Fix Windows exceptions flag
This commit changes the exception flag to match the description and turn
off exceptions. This matches the behavior of -fno-exceptions. However,
on Windows SEH exceptions are always available, and there's no easy way
to turn them off. This flag should also suppress previous /EHsc flags,
if they get automatically set by cmake. Reference:
https://learn.microsoft.com/en-us/cpp/build/reference/eh-exception-handling-model?view=msvc-170
2024-12-05 20:34:22 +01:00
Sam Atkins
2c3c821305 LibWeb: Remove Realm parameter from property_initial_value()
We don't need the Realm to parse a style value.

Fixes #2720
2024-12-05 19:59:57 +01:00
Lucas CHOLLET
4d7b7178f9 Meta/vcpkg: Set default visibility for skcms symbols
Without this patch, as skia is compiled with -fvisibility=hidden, no
skcms function is accessible from outside skia's code.
2024-12-05 17:16:41 +01:00
Aliaksandr Kalenik
ae6edfb845 LibWeb/WebGL: Implement getProgramInfoLog() 2024-12-05 16:42:19 +01:00
Aliaksandr Kalenik
b8109c3047 LibWeb/WebGL: Implement bindAttribLocation() 2024-12-05 16:42:19 +01:00
Aliaksandr Kalenik
11ddc88ed7 LibWeb/WebGL: Remove FIXME from isContextLost() IDL method
Currently this function always returns false, but that's better than
not having it at all.
2024-12-05 16:42:19 +01:00
Aliaksandr Kalenik
c817eb8d2b LibWeb/WebGL: Implement getContextAttributes() 2024-12-05 09:57:10 +01:00
Aliaksandr Kalenik
a8c282a30e IDLGenerators: Allow returning nullable dictionaries from IDL methods 2024-12-05 09:57:10 +01:00
Aliaksandr Kalenik
110f89ee25 LibWeb/WebGL: Implement getShaderInfoLog()
With this change we have enough WebGL support to display demos on
https://ciechanow.ski/lights-and-shadows/ but most of them are not
redering correctly yet.
2024-12-05 01:23:10 +01:00
Aliaksandr Kalenik
66a38f1abc CodeGenerators: Implement getParameter() according to the WebGL spec
Fixes https://github.com/LadybirdBrowser/ladybird/issues/2759
2024-12-04 22:21:13 +01:00
Tim Ledbetter
9c63785d0f Meta: Disallow importing ref tests with multiple match or mismatch links
Our internal test runner does not currently support this, so let's
explicitly disallow it for now to avoid potential confusion.
2024-12-04 19:50:00 +00:00
Tim Ledbetter
e059ac6a1a Meta: Allow importing WPT ref tests with mismatch conditions
Previously, ref tests with mismatch conditions were misclassified as
text tests.
2024-12-04 19:50:00 +00:00
Jonne Ransijn
1ddc4050f7 Meta: Print failed pre-commit steps in bold
This makes them easier to find, especially for colorblind people.
2024-12-04 16:45:58 +00:00
Shannon Booth
0fa54c2327 LibURL+LibWeb: Make URL::serialize return a String
Simplifying a bunch of uneeded error handling around the place.
2024-12-04 16:34:13 +00:00
Jonne Ransijn
d7596a0a61 AK: Don't implicitly convert Optional<T&> to Optional<T>
C++ will jovially select the implicit conversion operator, even if it's
complete bogus, such as for unknown-size types or non-destructible
types. Therefore, all such conversions (which incur a copy) must
(unfortunately) be explicit so that non-copyable types continue to work.

NOTE: We make an exception for trivially copyable types, since they
are, well, trivially copyable.

Co-authored-by: kleines Filmröllchen <filmroellchen@serenityos.org>
2024-12-04 01:58:22 +01:00
Aliaksandr Kalenik
7e78d7d332 LibWeb/WebGL+Meta: Stub getSupportedExtensions() and getExtension() 2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
64fec8b2de LibWeb/WebGL: Implement texImage2D() 2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
3c2ac309ca LibWeb/WebGL: Implement getActiveAttrib() and getActiveUniform() 2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
f3a24d1569 LibWeb: Implement more WebGL calls 2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
46cbbda944 LibWeb: Increase SkSurface's generation id when it's modified by WebGL
Skia is not aware of surface modifications done by WebGL, so we need to
manually increase generation id whenver WebGL invokes a writing
function.
2024-12-03 23:35:45 +01:00
Aliaksandr Kalenik
e2e54dccc3 LibWeb: Generate WebGLRenderingContext implementation 2024-12-03 23:35:45 +01:00
Ben Wiederhake
079fdf50d4 Meta+Documentation: Update config for QtCreator
We no longer use C or raw assembly (*.S), and generated include files
have moved to Build/release/Lagom/.
2024-12-02 09:45:32 +00:00
Jonne Ransijn
58631e9eef LibJS: Add missing CommonPropertyNamess and StringMayBeNumber::Nos 2024-12-01 10:42:49 +01:00
Sam Atkins
3124dca528 LibURL+LibWebView: Move public suffix data to LibURL 2024-11-30 12:07:39 +01:00
Sam Atkins
edcdcea92d LibWebView: Simplify string joining in GeneratePublicSuffixData
Super minor, but gets rid of a clangd warning about the builder name
already being used.
2024-11-30 12:07:39 +01:00
Shannon Booth
286c177896 LibWeb: Support 'Worklet' exposed 2024-11-30 11:19:35 +01:00
Shannon Booth
4417f63ca0 LibWeb: Move ServiceWorker classes to ServiceWorker namespace
These are defined by the ServiceWorker spec, not the HTML one.
2024-11-30 11:19:35 +01:00
Shannon Booth
04508841e9 LibWeb: Fix indent of the IDL generator using namespace hack 2024-11-30 11:19:35 +01:00
devgianlu
1f7586ce14 LibCrypto: Use ASN1 macros for RSA key parsing
Improve error handling in `RSA::parse_rsa_key` by using ASN1 macros and
generalizing the parsing to both private and public keys.
2024-11-30 11:17:44 +01:00
Sam Atkins
c405c4bcf1 LibWeb: Allow calling property_initial_value() without a Realm
In this situation we're only able to get initial values that have
already been parsed. It's a little sketchy but doesn't seem to break
anything.
2024-11-30 11:01:12 +01:00
Pavel Shliak
d223cf25af LibWeb: Fix LegacyNullToEmptyString flag handler in IDL 2024-11-29 20:23:01 +00:00
Tim Ledbetter
e5c99b475a IDLGenerators: Set reflected unsigned long value according to spec
Setting an unsigned long attribute with IDL to a value outside the
range 0 to 2147483647, the value should be set to the default value.
2024-11-27 11:00:25 +01:00
Andreas Kling
dd7623eb30 LibWeb: Rename NestedBrowsingContextP => NavigableContainerViewportP
...where P is for Paintable :^)
2024-11-26 18:32:48 +01:00
Andreas Kling
443a8539e9 LibWeb: Rename Layout::FrameBox => NavigableContainerViewport 2024-11-26 18:32:48 +01:00
stelar7
48fae7b64f LibWeb: Add IDBKeyRange 2024-11-26 14:50:27 +01:00
stelar7
20a92a81c4 LibWeb: Add IDBTransaction 2024-11-26 14:50:27 +01:00
stelar7
16ce2b975a LibWeb: Add IDBObjectStore 2024-11-26 14:50:27 +01:00
stelar7
297c775b34 LibWeb: Add IDBIndex 2024-11-26 14:50:27 +01:00
stelar7
71772d97dc LibWeb: Add IDBCursor 2024-11-26 14:50:27 +01:00
Jelle Raaijmakers
614b93beca Meta: Set constructor prototype in IDLGenerators
Without this, retrieving `__proto__` from any interface will always
yield an instance of `FunctionPrototype`.
2024-11-26 12:44:05 +00:00
Jelle Raaijmakers
db43ed03a8 Meta: Use namespaced JS::call invocations in IDLGenerators
When experimenting with different inheritance structures, I ended up
seeing compilation failures whenever a parent class defined a `call`
method. This seems more in line with the rest of the code.
2024-11-26 12:44:05 +00:00
Andrew Kaster
0075048206 LibCore: Remove SessionManagement utilities
We don't need these, they are only relevant for SerenityOS system
builds of LibCore.
2024-11-26 11:00:48 +01:00
stasoid
3f7affa825 LibCore/System: Add mmap, munmap for Windows 2024-11-26 10:00:11 +01:00
Pavel Shliak
af9d855b70 LibGfx: Delete DeprecatedPath 2024-11-25 21:13:53 +01:00
Pavel Shliak
dbfe5be9ff LibGfx: Delete DeprecatedPainter 2024-11-25 21:13:53 +01:00
Jelle Raaijmakers
be3a941f44 LibWeb: Add ChannelMergerNode interface 2024-11-25 17:16:06 +01:00
devgianlu
49c388b891 LibTLS+LibWeb+LibCrypto: Move Certificate to LibCrypto
By moving `Certificate` to `LibCrypto` it is possible to reuse a bunch
of code from in `LibCrypto` itself. It also moves some constants
and pieces of code to a more appropriate place than `LibTLS`.

This also makes future work on WebCryptoAPI easier.
2024-11-25 13:38:38 +01:00
rmg-x
03b9e555c0 Libraries: Remove LibArchive
This library isn't used by anything but the Android build which
currently doesn't work. We most likely won't be using a homegrown
implementation for archive formats in the future, regardless.
2024-11-25 13:37:45 +01:00
Tim Ledbetter
19a5780f0c IDLGenerators: Throw TypeError if IDL ByteString contains element > 255 2024-11-21 15:49:48 -05:00
Andrew Kaster
4cb19c65b4 CMake: Check for Swift-aware C++ compiler more robustly
Instead of looking for "AppleClang", we can just check whether the
CMAKE_CXX_COMPILER understands swift_attr and swift_name.
2024-11-21 12:17:44 -07:00
Pavel Shliak
8d13115d9a LibCrypto: Clean up #include directives
This change aims to improve the speed of incremental builds.
2024-11-21 14:08:33 +01:00
Aliaksandr Kalenik
0448d4d609 LibWeb: Update property_id_from_string() generator to handle ::Custom 2024-11-21 13:16:08 +01:00
Shannon Booth
d6bcd3fb0b LibWeb: Make CallbackType take a realm instead of settings object
In line with the ShadowRealm proposal changes in the WebIDL spec:
webidl#1437 and supporting changes in HTML spec.

This is required for ShadowRealms as they have no relevant settings
object on the shadow realm, so fixes a crash in the QueueingStrategy
test in this commit.
2024-11-20 18:01:21 -07:00
Ali Mohammad Pur
3bcd91b109 LibDNS: Hide some debug logs behind DNS_DEBUG 2024-11-20 21:37:58 +01:00
Ali Mohammad Pur
7e20f4726f LibDNS+LibWeb+Ladybird+RequestServer: Let there be DNS over TLS
This commit adds our own DNS resolver, with the aim of implementing DoT
(and eventually DoH, maybe even DNSSEC etc.)
2024-11-20 21:37:58 +01:00
Andrew Kaster
4b4a6991e3 Tests: Use ABI entry point for swift-testing tests
Avoid the unstable SwiftPM entry point in favor of the stable ABI entry
point.
2024-11-19 14:32:11 -07:00
Andrew Kaster
fca6fd0b85 LibGC: Add Swift bindings to the GC heap
This includes a protocol for creating LibGC Heap allocated Swift
objects. Pay no attention to the Unmanaged shenanigans, they are
all behind the curtain.
2024-11-19 14:32:11 -07:00
Andrew Kaster
829391e714 LibGC: Add a ForeignCell class for ownership of non-C++ objects
This will allow us to use the GC to manage the lifetime of objects
that are not C++ objects, such as Swift objects. In the future we
could expand this cursed FFI to other languages as well.
2024-11-19 14:32:11 -07:00
Andrew Kaster
7b7bb60393 CMake: Store the CMake sauce to add no-as-needed libraries to cache
This was causing issues for my Ubuntu 24.04 build when building
the Distribution preset, so just stash this constant config in
the CMake cache to not worry about it anymore.
2024-11-18 14:19:24 -07:00
Andreas Kling
3e8c8b185e LibWeb: Use WindowProxy instead of Window in UI Events IDL
I believe this is an error in the UI Events spec, and it should be
updated to match the HTML spec (which uses WindowProxy everywhere).

This fixes a bunch of issues already covered by existing WPT tests.

Spec bug: https://github.com/w3c/uievents/issues/388

Note that WebKit has been using WindowProxy instead of Window in
UI Events IDL since 2018:
816158b4aa
2024-11-17 23:47:24 +01:00
Timothy Flynn
638a8aecad LibWeb: Implement the CompressionStream interface 2024-11-17 22:37:45 +01:00
Timothy Flynn
a91af764f6 Utilities: Remove unused compression utilities
Some LibCompress API changes for LibWeb will make these utilities a bit
difficult to keep up to date. Given that these are unused anways, let's
just not bother.
2024-11-17 22:37:45 +01:00
Shannon Booth
98dadb0ce6 LibWeb: Always return a rejected Promise for functions which throw
We were previously throwing an exception if the generated code was
throwing an exception before it hit the implementation of the interface.
Instead, we are meant to catch any exception, and wrap that in a
rejected promise.

For example, this was impacting the fixed test in this commit as an
exception was being thrown when invoking WebIDL::convert_to_int<T>
as the given number was out of range, and the [EnforceRange]
extended attribute decorates that attribute.

This same type of case is seen for a few tests in WPT.
2024-11-16 18:33:58 +01:00
Jonne Ransijn
c3783cf3bd LibIDL: Fix use-after-free in GenerateWindowOrWorkerInterfaces
`lexical_bases` was storing `StringView`s into `ByteString`s returned
from `LexicalPath::string()` that might no longer exist.
2024-11-16 10:30:14 +01:00
Luke Wilde
c0ae3aa884 LibWeb: Add CMake dependencies for GeneratedCSSStyleProperties.idl
Co-Authored-By: Andrew Kaster <andrew@ladybird.org>
2024-11-15 16:08:19 -07:00
Andrew Kaster
9812fac2c3 Meta+LibGfx: Exclude Metal and Vulkan headers from Clang module map
These headers are platform-specific, and shouldn't need to be used by
Swift code anyway.
2024-11-15 10:51:45 -07:00
Andrew Kaster
c998f22f9e CMake: Enable no-as-needed hack for all link languages, not just C++ 2024-11-15 10:51:45 -07:00
Andrew Kaster
137db0e38e Meta: Add -Wlogical-op to the default compile options 2024-11-15 10:50:45 -07:00
Shannon Booth
f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00
Tim Ledbetter
02268e9c60 Meta: Use headless-browser by default when running tests with WPT.sh
This change removes the `--headless` option, which is now the default
behavior and adds the `--show-window` option to force tests to run in a
visible browser window.
2024-11-15 07:14:07 -05:00
Sam Atkins
ad1f93504e LibWeb/CSS: Make :has() take a <relative-selector-list>
The spec changed this at some point.
2024-11-14 19:51:45 +01:00
Luke Wilde
aacf9b08ed LibWeb: Generate IDL attributes for all supported CSS properties
The CSSOM spec tells us to potentially add up to three different IDL
attributes to CSSStyleDeclaration for every CSS property we support:
- A camelCased attribute, where a dash indicates the next character
  should be uppercase
- A camelCased attribute for every -webkit- prefixed property, with the
  first letter always being lowercase
- A dashed-attribute for every property with a dash in it.

Additionally, every attribute must have the CEReactions and
LegacyNullToEmptyString extended attributes specified on it.

Since we specify every property we support with Properties.json, we can
use that file to generate the IDL file and it's implementation.

We import it from the Build directory with the help of multiple import
base paths. Then, we add it to CSSStyleDeclaration via the mixin
functionality and inheriting the generated class in
CSSStyleDeclaration.
2024-11-14 19:50:22 +01:00
Luke Wilde
d95ae629ee LibIDL: Allow overwriting the generated attribute callback name
This will allow the CSSStyleDeclaration IDL attribute generator to
implement it's own C++ acceptable identifier sanitization and
deduplication.
2024-11-14 19:50:22 +01:00
Luke Wilde
300f212044 LibIDL: Support multiple import base paths for resolving imports
This allows us to specify multiple base paths to look for imported IDL
files in. This will allow us to import IDL files from sources and from
the Build directory (i.e. for generated IDL files).
2024-11-14 19:50:22 +01:00
Shannon Booth
c2988a7dd5 LibJS: Don't directly teach the heap about the javascript VM or Realm
Instead, smuggle it in as a `void*` private data and let Javascript
aware code cast out that pointer to a VM&.

In order to make this split, rename JS::Cell to JS::CellImpl. Once we
have a LibGC, this will become GC::Cell. CellImpl then has no specific
knowledge of the VM& and Realm&. That knowledge is instead put into
JS::Cell, which inherits from CellImpl. JS::Cell is responsible for
JavaScript's realm initialization, as well as converting of the void*
private data to what it knows should be the VM&.
2024-11-14 15:38:45 +01:00
Shannon Booth
1e54003cb1 LibJS+LibWeb: Rename Heap::allocate_without_realm to Heap::allocate
Now that the heap has no knowledge about a JavaScript realm and is
purely for managing the memory of the heap, it does not make sense
to name this function to say that it is a non-realm variant.
2024-11-13 16:51:44 -05:00
Shannon Booth
9b79a686eb LibJS+LibWeb: Use realm.create<T> instead of heap.allocate<T>
The main motivation behind this is to remove JS specifics of the Realm
from the implementation of the Heap.

As a side effect of this change, this is a bit nicer to read than the
previous approach, and in my opinion, also makes it a little more clear
that this method is specific to a JavaScript Realm.
2024-11-13 16:51:44 -05:00
Timothy Flynn
83b1db785a LibWebView+WebContent+UI: Remember the current system visibility state
We will want to re-inform WebContent of the system visibility state when
we create a new process after a crash. This changes the IPC to just send
the enum value directly, instead of a boolean, so that we can just store
that enum value directly on the ViewImplementation class.
2024-11-13 20:36:47 +01:00
Jelle Raaijmakers
3d8ab0e67c LibWeb: Add WebGLShaderPrecisionFormat 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
d63a979bde LibWeb: Add WebGLActiveInfo 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
889e7942fa LibWeb: Add WebGLUniformLocation 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
f2a1643650 LibWeb: Add WebGLTexture 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
2b09afb971 LibWeb: Add WebGLShader 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
d53cb9833b LibWeb: Add WebGLRenderbuffer 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
6b7d5dbec6 LibWeb: Add WebGLProgram 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
5d0b206d6e LibWeb: Add WebGLFramebuffer 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
b21857b265 LibWeb: Add WebGLBuffer 2024-11-13 11:41:54 +01:00
Jelle Raaijmakers
e6ee7f3e64 LibWeb: Add WebGLObject interface 2024-11-13 11:41:54 +01:00
Andreas Kling
6a6618f5ea LibJS: Add RawNonnullGCPtr<T>
This is really just a type alias for NonnullGCPtr<T>, but it provides
a way to have non-owning non-visited NonnullGCPtr<T> without getting
yelled at by the Clang plugin for catching GC errors.
2024-11-11 21:40:56 +01:00
Timothy Flynn
9e1f001ffe LibWebView+Services+UI: Move the EventLoop implementations to LibWebView
We currently compile the Qt event loop files multiple times, for every
target which wants to use them. This patch moves these to LibWebView as
a central location to avoid this.
2024-11-11 07:35:43 -05:00
rmg-x
9ee7d4d90a LibWeb: Add builtin Float16Array type and remove related FIXME 2024-11-10 14:48:20 -07:00
Timothy Flynn
db47cc41f8 Everywhere: Move the Ladybird folder to UI 2024-11-10 12:50:45 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Timothy Flynn
950e819ee7 Everywhere: Hoist the Utilities folder to the top-level 2024-11-10 12:50:45 +01:00
Timothy Flynn
22e0eeada2 Everywhere: Hoist the Services folder to the top-level 2024-11-10 12:50:45 +01:00
stasoid
31bf40b659 AK: Make LexicalPath::relative_path() fallible 2024-11-09 12:42:27 -07:00
Shannon Booth
2ea31fad32 LibWeb: Add support for interfaces being exposed for shadow realm 2024-11-09 12:36:12 -07:00
sideshowbarker
0a773b408a Tests: Allow wpt.live URLs for both “WPT.sh run” and “WPT.sh import”
This change allows you to give http[s]://wpt.live/ URLs to the WPT.sh
script for both the “WPT.sh run” and “WPT.sh import” commands.

That facilitates the use case where you’ve navigated to a wpt.live URL
in a browser, and you want to just directly copy-paste the URL in order
to either run the test in Ladybird, or import the test into the repo.

Otherwise, without this change, when using WPT.sh, you’re limited to
needing to specify either a WPT path fragment or filesystem pathname —
which doesn’t allow for easy copy-paste directly from wpt.fyi.
2024-11-09 15:32:51 +01:00