Commit graph

2231 commits

Author SHA1 Message Date
Shannon Booth
64eeda6450 LibWeb: Return a representation of an 'Agent' in 'relevant agent'
This makes it more convenient to use the 'relvant agent' concept,
instead of the awkward dynamic casts we needed to do for every call
site.

mutation_observers is also changed to hold a GC::Root instead of raw
GC::Ptr. Somehow this was not causing problems before, but trips up CI
after these changes.
2025-01-11 10:39:48 -05:00
Tim Ledbetter
b6ec055bf9 IDLGenerators: Set Iterator @@toStringTag with correct descriptor 2025-01-11 10:02:48 -05:00
Shannon Booth
627b7dd936 LibWeb/Bindings: Define constructor properties in the correct order 2025-01-11 01:43:31 +00:00
Luke Wilde
876d26c32e LibWeb/WebGL: Respect subarrays in readPixels 2025-01-08 17:55:17 +03:00
Luke Wilde
71746c47c2 LibWeb/WebGL: Bind default frame/render buffer when binding is null
This fixes the depth issues on github.com, as the depth commands are
now sent to the right frame/render buffer.
2025-01-08 17:55:17 +03:00
Luke Wilde
e5d59a2d42 LibWeb/WebGL2: Implement getSyncParameter 2025-01-08 17:55:17 +03:00
Luke Wilde
6bf6cd3f19 LibWeb/WebGL: Account for subarrays in tex(Sub)Image{2D,3D}
This allows Ruffle to correctly upload textures.
2025-01-08 17:55:17 +03:00
Luke Wilde
2b20b8aaff LibWeb/WebGL: Return correct types from get{Shader,Program}Parameter
Returning numbers instead of booleans for the statuses made Ruffle
(through the wgpu crate) think a shader/program failed to compile/link,
as it does a strict type comparison.
2025-01-08 17:55:17 +03:00
Luke Wilde
c30c1d65f4 LibWeb/WebGL2: Implement clearBuffer{fv,iv,uiv,fi} 2025-01-08 17:55:17 +03:00
Luke Wilde
f627c91bf3 LibWeb/WebGL2: Implement deleteSampler 2025-01-08 17:55:17 +03:00
Luke Wilde
09ad685238 LibWeb/WebGL2: Implement samplerParameter{i,f} 2025-01-08 17:55:17 +03:00
Luke Wilde
aa2eb7ac7d LibWeb/WebGL2: Implement MAX_VARYING_COMPONENTS parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
c4ff1a1eb0 LibWeb/WebGL2: Implement MAX_FRAGMENT_UNIFORM_BLOCKS parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
0390a2328c LibWeb/WebGL2: Implement MAX_ELEMENT_INDEX parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
2d94953047 LibWeb/WebGL2: Implement COPY_WRITE_BUFFER_BINDING parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
af8cb211eb LibWeb/WebGL2: Implement COPY_READ_BUFFER_BINDING parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
47699360e5 LibWeb/WebGL2: Implement TEXTURE_BINDING_2D_ARRAY parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
b8416570e0 LibWeb/WebGL2: Implement UNIFORM_BUFFER_BINDING parameter 2025-01-08 17:55:17 +03:00
Luke Wilde
9b4bad4255 LibWeb/WebGL: Factor in subarrays for typed arrays for generic methods 2025-01-08 17:55:17 +03:00
Luke Wilde
42cce393f4 LibWeb/WebGL2: Implement drawElementsInstanced 2025-01-08 17:55:17 +03:00
Luke Wilde
b6bc5912d6 LibWeb/WebGL: Implement tex(Sub)Image2D with TexImageSource 2025-01-08 17:55:17 +03:00
Luke Wilde
8e453d5069 LibWeb/WebGL: Preserve original bound objects to return in getParameter
Required by https://qwasm2.m-h.org.uk, which adds a custom `name`
attribute to objects it generates. It then gets some of these objects
out with getParameter, and expects the `name` attribute to be there.
2025-01-08 17:55:17 +03:00
Luke Wilde
c067271897 LibWeb/WebGL2: Implement getActiveUniformBlockParameter 2025-01-08 17:55:17 +03:00
Luke Wilde
191ceb0f61 LibWeb/WebGL2: Implement getActiveUniformBlockName 2025-01-08 17:55:17 +03:00
Luke Wilde
28a73dc392 LibWeb/WebGL: Implement deleteRenderbuffer 2025-01-08 17:55:17 +03:00
Luke Wilde
4e33d8e577 LibWeb/WebGL: Mark clear as a draw operation instead of clearColor 2025-01-08 17:55:17 +03:00
Luke Wilde
e26b524721 LibWeb/WebGL2: Implement invalidateFramebuffer 2025-01-08 17:55:17 +03:00
Luke Wilde
2983ad10bc LibWeb/WebGL2: Correctly handle offsets in uniform(Matrix) functions 2025-01-08 17:55:17 +03:00
Luke Wilde
63b792c205 LibWeb/WebGL2: Implement bufferSubData with offset and length 2025-01-08 17:55:17 +03:00
Luke Wilde
18ea91715b LibWeb/WebGL2: Implement bufferData with offset and length 2025-01-08 17:55:17 +03:00
Andrew Kaster
223b13ae93 CMake: Enable -Wl,--no-undefined on ELF platforms
This is mostly a development helper, to move all undefined symbols
in shared libraries to link time rather than load time.

At the same time, set --no-allow-shlib-undefined and -z,defs to
further enforce the rule.
2025-01-06 12:41:47 -07:00
Tim Ledbetter
10c5b9c07b IDLGenerators: Allow methods with multiple sequence arguments
Previously, a method with multiple sequence arguments would cause a
compile error, as the same variable name was redeclared when iterating
the sequence for each argument. This change disambiguates these
variable names.
2025-01-03 14:54:18 +01:00
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 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