Kenneth Myhra
0b86574293
LibWeb: Verify argument_check before generating if statement
...
This fixes an error where we would generate an empty 'if' statement body
if argument_check was empty.
2022-04-05 22:33:44 +02:00
Kenneth Myhra
887e13f364
LibWeb: Get argument count from Function::parameters::size()
...
Previously this retrieved argument count from Function::length() which
did not return the correct count in all situations.
2022-04-05 22:33:44 +02:00
Kenneth Myhra
ba23d036bd
LibWeb: Add IDLGenerators::is_primitive()
...
This adds the is_primitive() method as described in the Web IDL
specification. is_primitive() returns true if the type is a bigint,
boolean or numeric type.
2022-04-05 22:33:44 +02:00
Idan Horowitz
b172b56757
LibWeb: Include relevant headers in IDL constructor implementations
...
Similarly to implementations of prototype methods, the implementations
of constructors sometimes require generated types.
2022-04-02 13:13:37 +03:00
Idan Horowitz
a7f2d46b49
LibWeb: Support integral default values for IDL unions
2022-04-02 13:13:37 +03:00
Idan Horowitz
32d142b06c
LibWeb: Remove no-op calls to emit_includes_for_all_imports for headers
...
When called with is_header=true the method was essentailly a no-op.
2022-04-02 13:13:37 +03:00
Idan Horowitz
110d73d786
LibWeb: Strip double quotes from IDL enum default values
2022-04-02 13:13:37 +03:00
Idan Horowitz
3ee8b5e534
LibWeb: Cache and reuse resolved IDL imports instead of rejecting them
...
This ensures that transitive imports succeed even if they were directly
imported beforehand.
2022-04-02 12:22:48 +04:30
Idan Horowitz
f45d361f03
LibWeb: Replace ad-hoc EventHandler type with callback function typedef
2022-03-31 01:10:47 +02:00
Idan Horowitz
1c4f128fd1
LibWeb: Add support for IDL callback functions
2022-03-31 01:10:47 +02:00
Idan Horowitz
9ff79c9d54
LibWeb: Support non-interface top-level extended attributes
2022-03-31 01:10:47 +02:00
Idan Horowitz
c14cb65215
LibWeb: Add support for IDL typedefs
2022-03-31 01:10:47 +02:00
Idan Horowitz
f0cd28dedd
LibWeb: Stop generating C++ includes for non-code-generating IDL files
...
Specifically, IDL files that do not include interface or enumeration
declarations do not generate any code, and as such should not be
included.
2022-03-31 01:10:47 +02:00
Idan Horowitz
824cf570d3
LibWeb: Stop casting unsigned long IDL return values to i32
...
These values may not fit into an i32.
2022-03-30 08:56:25 +03:00
Idan Horowitz
44601a8e74
LibWeb: Support IDL optional integer arguments
2022-03-30 08:56:25 +03:00
Andreas Kling
ab4c73746c
LibWeb: Add @@toStringTag own property on wrappers
...
This makes wrappers stringify to the expected "[object InterfaceName]"
instead of just "[object Object]".
2022-03-29 17:03:15 +02:00
Timothy Flynn
324f709d29
LibWeb: Support IDL default values of "null" for optional arguments
...
This is a bit strange in the IDL syntax, but e.g., in HTMLSelectElement,
we have (simplified):
undefined add(optional (HTMLElement or long)? before = null)
This could instead become:
undefined add(optional (HTMLElement or long) before)
This change generates code for the former as if it were the latter.
2022-03-22 02:08:15 +01:00
Timothy Flynn
57296393ed
LibWeb: Begin implementing SVGRectElement's SVGAnimatedLength attributes
2022-03-21 21:04:39 +01:00
Timothy Flynn
3ebc5cc58e
LibWeb: Support generating IDL float types
...
The float type is used quite a bit in the SVG spec.
2022-03-21 21:04:39 +01:00
stelar7
60c228b914
LibWeb: Handle nullish this_value when creating idl functions
2022-03-19 17:40:23 +00:00
sin-ack
436262ea3a
Meta: Use the ImplementedAs value in the attribute setter
...
Co-Authored-By: Luke Wilde <lukew@serenityos.org>
2022-03-16 00:38:31 +01:00
Andreas Kling
fabcee016f
LibWeb: Add basic support for DOM's NodeIterator and NodeFilter
...
This patch adds NodeIterator (created via Document.createNodeIterator())
which allows you to iterate through all the nodes in a subtree while
filtering with a provided NodeFilter callback along the way.
This first cut implements the full API, but does not yet handle nodes
being removed from the document while referenced by the iterator. That
will be done in a subsequent patch.
2022-03-09 16:43:00 +01:00
Linus Groh
1422bd45eb
LibWeb: Move Window from DOM directory & namespace to HTML
...
The Window object is part of the HTML spec. :^)
https://html.spec.whatwg.org/multipage/window-object.html
2022-03-08 00:30:30 +01:00
Idan Horowitz
59e9e7cc61
LibWeb: Add a very basic and ad-hoc version of IDL overload resolution
...
This initial version lays down the basic foundation of IDL overload
resolution, but much of it will have to be replaced with the actual IDL
overload resolution algorithms once we start implementing more complex
IDL overloading scenarios.
2022-03-05 23:40:08 +01:00
Luke Wilde
0e6c7eea0f
LibWeb: Add AbortSignal as a wrappable type
2022-02-20 02:03:24 +01:00
Luke Wilde
ced7e8ab28
LibWeb: Add support for dictionary types to union types
...
This also fixes some indentation issues in the generated code.
2022-02-20 02:03:24 +01:00
Luke Wilde
d0ebe80f69
LibWeb: Add dictionary types to idl_type_name_to_cpp_type
...
This allows dictionaries to appear in sequences, records and unions.
2022-02-20 02:03:24 +01:00
Luke Wilde
567abd52a3
LibWeb: Add support for optional, non-nullable wrapper types
2022-02-20 02:03:24 +01:00
Luke Wilde
86650e37fe
LibWeb: Don't perform ToObject when converting values to wrapper types
...
WebIDL checks the type of the value is Object instead of performing
ToObject on the value.
https://webidl.spec.whatwg.org/#implements
2022-02-20 02:03:24 +01:00
Linus Groh
fb1dca2c4b
LibWeb: Move WebSocket into the Web::WebSockets namespace
...
WebSockets got moved from the HTML standard to their own, the new
WebSockets Standard (https://websockets.spec.whatwg.org ).
Move the IDL file and implementation into a new WebSockets directory and
C++ namespace accordingly.
2022-02-18 19:34:08 +00:00
Ben Abraham
ae346cff6b
LibWeb: Add partially functioning Worker API
...
Add a partial implementation of HTML5 Worker API.
Messages can be sent from the inner context externally.
2022-02-17 22:45:21 +01:00
Ali Mohammad Pur
144ef3eb9f
WrapperGenerator: Don't emit code for imported enumerations
2022-02-17 19:55:27 +01:00
Ali Mohammad Pur
c38163494a
WrapperGenerator: Add support for IDL mixin interfaces
2022-02-17 19:55:27 +01:00
Ali Mohammad Pur
e9c76d339b
Meta: Split and refactor the WrapperGenerator a bit
...
The single 4000-line WrapperGenerator.cpp file was proving to be a pain
to hack, and was filled with spaghetti, split it into a bunch of files
to lessen the impact of the spaghetti.
Also refactor the whole parser to use a class instead of a giant
function with a million lambdas.
2022-02-17 19:55:27 +01:00