Commit graph

2099 commits

Author SHA1 Message Date
sideshowbarker
e1b4aa94db Meta: Fix “shadow-including-ancestors-descendant” generator check
This change fixes the IDLGenerators.cpp implementation of the “If
reflectedTarget's explicitly set attr-element is a descendant of any of
element's shadow-including ancestors” step from the “If a reflected IDL
attribute has the type T?, where T is either Element or an interface
that inherits from Element” case in the HTML spec at
http://whatwg.org/html/#reflecting-content-attributes-in-idl-attributes
2025-01-01 11:00:53 +00:00
sideshowbarker
f9d4852a22 Meta: Make IDLGenerators handle non-HTML and dash-containing attributes
This change updates the BindingsGenerator/IDLGenerators.cpp code to
handle reflected non-HTML::AttributeNames content-attribute names, and
to handle such names as-is — including names with dashes.
2025-01-01 11:00:53 +00:00
sideshowbarker
0c6a6d4457 LibWeb: Normalize getter name for reflected “Element?” IDL types
This change updates the bindings generator for the case defined at
https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes:element;
that is, the case “If a reflected IDL attribute has the type T?, where T
is either Element or an interface that inherits from Element”.

The change “normalizes” the generator behavior for that case — such that
the generated code expects a getter with a name of the form used in
other cases; e.g., popover_target_element().

Otherwise, without this change, the generator expects a name of the form
get_popover_target_element() for that case.
2024-12-28 08:34:40 -08:00
Timothy Flynn
2ec97b4548 Meta: Update to clang-19 in CI and build instructions 2024-12-28 05:39:32 -08:00
Andreas Kling
ceefe7d858 LibWeb: Make CustomElementDefinition relationship with GC more sane
1. Stop using GC::Root in member variables, since that usually creates
   a realm leak.

2. Stop putting OrderedHashMap<FlyString, GC::Ptr> on the stack while
   setting these up, since that won't protect the objects from GC.
2024-12-27 10:02:58 +01:00
Andreas Kling
3bfb0534be LibGC: Rename MarkedVector => RootVector
Let's try to make it a bit more clear that this is a Vector of GC roots.
2024-12-26 19:10:44 +01:00
Shannon Booth
f3e92f2ae5 LibWeb/HTML: Implement the StorageEvent interface 2024-12-25 11:57:14 +01:00
Andrew Kaster
67a6c9246c LibWeb: Throw when a setter is called with less than one argument
Some WPT tests expect that if you go out of your way to
Object.getOwnPropertyDescriptor on an interface object and extract
the setter out of it, that they throw when called with no arguments.
2024-12-24 15:20:28 +01:00
Andrew Kaster
44e3817219 LibWeb: Add WebAssembly.Global and exports support for global instances 2024-12-24 15:20:28 +01:00
Pavel Shliak
78595f05d8 Meta/LibWeb: Use correct shorthand range in is_inherited_property 2024-12-22 12:33:41 +01:00
Sam Atkins
eb11c35640 LibWeb/CSS: Use CSSNumericType for CalculationResult's numeric type
When we originally implemented calc(), the result of a calculation was
guaranteed to be a single CSS type like a Length or Angle. However, CSS
Values 4 now allows more complex type arithmetic, which is represented
by the CSSNumericType class. Using that directly makes us more correct,
and allows us to remove a large amount of now ad-hoc code.

Unfortunately this is a large commit but the changes it makes are
interconnected enough that doing one at a time causes test
regressions.

In no particular order:

- Update our "determine the type of a calculation" code to match the
  newest spec, which sets percent hints in a couple more cases. (One of
  these we're skipping for now, I think it fails because of the FIXMEs
  in CSSNumericType::matches_foo().)
- Make the generated math-function-parsing code aware of the difference
  between arguments being the same type, and being "consistent" types,
  for each function. Otherwise those extra percent hints would cause
  them to fail validation incorrectly.
- Use the CSSNumericType as the type for the CalculationResult.
- Calculate and assign each math function's type in its constructor,
  instead of calculating it repeatedly on-demand.

The `CalculationNode::resolved_type()` method is now entirely unused and
has been removed.
2024-12-21 18:14:28 +01:00
Sam Atkins
0d19007cb5 LibWeb/CSS: Make CSSNumericType dump() infallible
This is a remnant of the tiny-OOM-propagation party.
2024-12-21 18:14:28 +01:00
Sam Atkins
69a0f28d04 Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue"
This reverts commit 76daba3069.

We're going to need separate types for the JS-exposed style values, so
it doesn't make sense for us to match their names with our internal
types.
2024-12-21 18:14:28 +01:00
Feng Yu
b3edbd7bf2 LibWeb: Implement the ClipboardItem API
Spec: https://w3c.github.io/clipboard-apis/#clipboard-item-interface
2024-12-20 15:29:18 +00:00
Aliaksandr Kalenik
99b49a5978 CodeGenerators: Add support for LegacyNoInterfaceObject IDL attribute
When applied, corresponding interface object will not be exposed on the
global object, e.g. for the following IDL:
```
Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface ANGLE_instanced_arrays {
};
```

executing `"ANGLE_instanced_arrays" in window` will return `false`.
2024-12-20 15:31:58 +01:00
Andreas Kling
6737b8b065 IPCCompiler: Don't silently ignore failure to encode IPC message
When message encoding failed for some reason, we'd just swallow the
error without saying a word, and carry on without sending anything.

This led to some very confusing situations.
2024-12-19 16:49:28 +01:00
Aliaksandr Kalenik
07635d4554 LibWeb/WebGL: Set INVALID_OPERATION if object does not belong to context
Some checks are pending
CI / path-changes (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Blocked by required conditions
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Blocked by required conditions
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Blocked by required conditions
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Blocked by required conditions
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
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2024-12-19 13:38:43 +01:00
Aliaksandr Kalenik
fbae24f7a9 LibWeb/WebGL: Don't treat WebGLUniformLocation as WebGLObject
...in code generator. `is_webgl_object_type()` is only supposed to
return true for objects inheriting from WebGLObject.
2024-12-19 13:38:43 +01:00
Aliaksandr Kalenik
cf730870c5 LibWeb: Save WebGL context pointer in WebGLObject
This way we could be sure that context object won't be deallocated
before any of the objects that belong to it.

Having a context pointer is also going to be used in upcoming changes
to generate an INVALID_OPERATION error if an object does not belong to
the context it's being used in.
2024-12-19 13:38:43 +01:00
Sam Atkins
5651c6fd9b LibWeb: Match spec changes for "custom element registry" concept
Corresponds to https://github.com/whatwg/html/pull/10845 and
https://github.com/whatwg/html/pull/10865
2024-12-18 19:22:44 +00:00
stasoid
15a96e841b Meta: Make pthread and mman available for all libraries on Windows
by default
2024-12-18 05:55:58 +01:00
Lucas CHOLLET
2174e5dfcc LibGfx: Remove ICC::Profile and friends
This is not really used anymore since the fork.
2024-12-16 07:39:49 +01:00
Luke Wilde
ced5eea610 LibWeb/WebGL2: Implement MAX_COMBINED_UNIFORM_BLOCKS parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
5d383fdd11 LibWeb/WebGL2: Implement MAX_FRAGMENT_INPUT_COMPONENTS parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
f1d194a97a LibWeb/WebGL2: Implement MAX_VERTEX_UNIFORM_BLOCKS parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
a19fb0a759 LibWeb/WebGL2: Implement MAX_DRAW_BUFFERS parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
1fc8353da0 LibWeb/WebGL2: Implement UNIFORM_BUFFER_OFFSET_ALIGNMENT parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
2adacbc8bb LibWeb/WebGL2: Implement MAX_UNIFORM_BUFFER_BINDINGS parameter 2024-12-14 09:06:28 +01:00
Luke Wilde
0e5e0d922f LibWeb/WebGL2: Implement MAX_UNIFORM_BLOCK_SIZE parameter 2024-12-14 09:06:28 +01:00
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