Commit Graph

186 Commits

Author SHA1 Message Date
Andrew Kaster
51c2835044 LibWeb: Add NavigationCurrentEntryChangeEvent, fired when navigating
This event will be fired by Navigation when changing the current
NavigationHistoryEntry.
2023-08-24 11:03:57 -06:00
Andrew Kaster
3c1d4eab24 LibWeb: Add NavigationHistoryEntry, a wrapper around SessionHistoryEntry 2023-08-24 11:03:57 -06:00
Bastiaan van der Plaat
c88f14902b LibWeb: Add DOMQuad and text tests 2023-08-23 12:11:21 +01:00
Shannon Booth
27dd2a40ad LibWeb: Implement HTMLFormControlsCollection
This collection is used in the form element for when element lookup
yields multiple elements.
2023-08-20 11:04:03 +02:00
Shannon Booth
daefe744ba LibWeb: Implement RadioNodeList
This interface is used in the interface for HTMLFormControlsCollection
as a live view over its matching elements.

Currently the "value" attribute for this interface is left
unimplemented.
2023-08-20 11:04:03 +02:00
Jonah
52d6df5ee5 LibWeb: Add the MathML Element
This patch introduces the MathML element, which provides the interface
all MathML elements are built from.
2023-08-12 07:59:23 +01:00
Andreas Kling
9e22f01eba LibWeb: Stub out SVGMaskElement
Just enough that we stop creating layout nodes for mask elements, which
was making some SVG content look very wrong. :^)
2023-08-10 11:36:17 +02:00
Andreas Kling
9f6ceff7cf LibWeb: Implement basic version of CSSOM View's VisualViewport
We got some errors while loading https://twinings.co.uk/ about this
interface missing, and it looked fairly simple so I sketched it out.
Note that I did leave some FIXMEs where it's not clear exactly which
metrics we should be returning.
2023-08-06 16:29:24 +02:00
Andreas Kling
ec24d7555a LibWeb: Add a simple internals objects only available during testing
This object is available as `window.internals` (or just `internals`) and
is only accessible while running in "test mode".

This first version only has one API: gc(), which triggers a garbage
collection immediately.

In the future, we can add more APIs here to help us test parts of the
engine that are hard or impossible to reach via public web APIs.
2023-08-06 15:26:34 +02:00
Jonah
60e35f2a97 LibWeb: Rough implementation of CSS namespace rule
This provides a rough implementation of the CSS @namespace rule.
Currently we just support default namespaces, namespace prefixes
are still to come.
2023-07-30 20:27:19 +01:00
MacDue
b30a1b957d LibWeb: Add support for SVG <tspan> elements 2023-07-23 06:32:39 +02:00
MacDue
0e12503586 LibWeb: Split SVGTextContentElement into spec defined subclasses
As part of this move properties/methods to the correct subclass
(position related properties go under SVGTextPositioningElement).

SVG text element hierarchy:

  SVGTextContentElement
           ^- SVGTextPositioningElement
                     ^- SVGTextElement
                     ^- SVGTSpanElement
           ^- SVGTextPathElement (TODO)
           ^- SVGTRefElement (TODO)
2023-07-23 06:32:39 +02:00
Andrew Kaster
5c2c412318 Meta: Bind WritableStreamDefaultController to JS
This was missed in 868cd95069.
2023-07-17 00:00:49 +01:00
Kenneth Myhra
0091a60448 LibWeb: Add TransformStreamDefaultController scaffolding
This adds the scaffolding of TransformStreamDefaultController so we can
start implementing the necessary abstract operations for it.
2023-07-15 11:59:39 +02:00
Kenneth Myhra
f1d69d789b LibWeb: Add TransformStream scaffolding
This adds the scaffolding of TransformStream so we can start
implementing the necessary abstract operations for it.
2023-07-15 11:59:39 +02:00
Luke Wilde
165abafb80 LibWeb: Add initial implementation of IntersectionObserver
The main missing features are rootMargin, proper nested browsing
context support and content clip/clip-path support.

This makes images appear on some sites, such as YouTube and
howstuffworks.com.
2023-07-07 05:27:25 +02:00
Andreas Kling
8f927eaa68 LibWeb: Add HTMLDocument class
This class is currently not in the spec, but it *is* still in all the
major browser engines. For compatibility reasons, let's do what other
engines do.

There is discussion about bringing HTMLDocument back into specs:
- https://github.com/whatwg/html/issues/4792
- https://github.com/whatwg/dom/issues/221
2023-06-21 16:30:27 +02:00
Shannon Booth
f86c3ab148 LibWeb: Implement ByteLengthQueuingStrategy highWaterMark property 2023-06-21 12:27:04 +02:00
Shannon Booth
c9941ba95b LibWeb: Implement CountQueuingStrategy highWaterMark property 2023-06-21 12:27:04 +02:00
Caoimhe
5ef01e562a LibWeb: Generate JavaScript bindings for CSSKeyframesRule
This one also needs a bit of work, but it's a nice start.
2023-06-21 12:26:22 +02:00
Caoimhe
e3612708c7 LibWeb: Generate JavaScript bindings for CSSKeyframeRule
We still need to do a bit of work. For example: `set_key_text` isn't
implemented due to its requirements being quite complex, but it's
a start.
2023-06-21 12:26:22 +02:00
Timothy Flynn
c89fd6dff0 LibWeb: Implement the AudioTrack and AudioTrackList interfaces
These are used to own and manage the playing of audio data.
2023-06-13 06:14:01 +02:00
PrestonLTaylor
e2a935b1dc LibWeb: Implement the <style> SVG element
The `<style>` element is allowed to be in the SVG namespace, so we now
support this element.

It has the same behaviour as the HTML namespace `<style>` element as
described in the spec.

"The semantics and processing of a ‘style’ and its attributes must be
the same as is defined for the HTML ‘style’ element."
2023-06-09 17:14:50 +02:00
Timothy Flynn
e2e4e6da52 LibWeb: Implement the SVG title element 2023-06-09 01:12:48 +02:00
PrestonLTaylor
aa691c22d4 LibWeb: Implement the <symbol> SVG element 2023-06-03 05:58:00 +02:00
PrestonLTaylor
c7c3043aa2 LibWeb: Implement the <use> SVG element
The SVG <use> element is used to be able to reuse other SVG graphics
without having to re-write the svg element.

We now support this feature! :^)
2023-06-03 05:58:00 +02:00
Luke Wilde
a5936864d9 LibWeb: Stub AudioContext constructor
This is enough to make Discord not throw up "Well this is awkward" on
login.
2023-05-22 06:07:05 +02:00
Luke Wilde
036e1e1bcf LibWeb: Implement performance.{measure,clearMeasures} 2023-05-13 16:31:10 +02:00
MacDue
9b652842e4 LibWeb: Add an initial implementation of SVG <radialGradient>
This follows on from the SVG linear gradients. It supports the same
features (xlink:href, gradientUnits, gradientTransform).

With this commit I have now implemented all web gradients :^)

(Though we are still missing a few parameters for SVG gradients,
e.g. spreadMethod).
2023-05-04 16:50:01 +02:00
MacDue
aa3464466e LibWeb: Implement SVGLinearGradientElement (<linearGradient>)
This represents the SVG <linearGradient>. The actual gradient is
converted to a Gfx::PaintStyle for use in SVG fills... There is a little
guesswork in the implementation, but it seems to match Chrome/Firefox.

Note: Still not hooked up to actual painting in this commit.
2023-04-28 09:42:28 +02:00
MacDue
71938550fa LibWeb: Implement SVGGradientElement
This is the base class for all SVG gradient types. This supports:

- The `gradientUnits` attribute
- The `gradientTransform` attribute
- And following `xlink:hrefs` for inheriting <stops>/attributes
2023-04-28 09:42:28 +02:00
MacDue
b19d2634f6 LibWeb: Implement SVGStopElement (<stop>)
This is used to specify the color/position of color stops for SVG
gradients.
2023-04-28 09:42:28 +02:00
MacDue
66d1b78348 LibWeb: Implement SVGAnimatedNumber
See https://www.w3.org/TR/2013/WD-SVG2-20130409/types.html#InterfaceSVGAnimatedNumber
2023-04-28 09:42:28 +02:00
Matthew Olsson
e8ad571082 LibWeb: Add ReadableStreamBYOBReader interface 2023-04-27 07:57:53 +02:00
Timothy Flynn
73a80b7047 LibWeb: Implement the MediaError IDL interface 2023-04-23 16:22:45 +02:00
Luke Wilde
1f863de9aa LibWeb: Add XMLDocument stub
Required by old versions of Pixi.js's XMLFormat bitmap font loader.
db824181dc/packages/text-bitmap/src/formats/XMLFormat.ts (L16)
2023-04-21 07:59:50 +02:00
Timothy Flynn
680a9f748e LibWeb: Stub out the HTML TimeRanges IDL interface
This is used by media elements. Provide a stub for websites which depend
on the interface existing.
2023-04-19 07:57:52 +02:00
Matthew Olsson
819b6332d1 LibWeb: Add ReadableStreamByteController interface 2023-04-12 01:47:48 +02:00
Matthew Olsson
c7aa4fa166 LibWeb: Add ReadableStreamBYOBRequest interface 2023-04-12 01:47:48 +02:00
Timothy Flynn
460e1bd072 LibWeb: Implement TrackEvent for media events 2023-04-07 16:02:22 +02:00
Timothy Flynn
3f1badf9b2 LibWeb: Implement VideoTrack and VideoTrackList
This implements the IDL for these types and some event handling around
them.
2023-04-07 16:02:22 +02:00
Matthew Olsson
bdab61ad93 LibWeb: Add the WritableStreamDefaultWriter interface 2023-04-06 22:54:58 +02:00
Matthew Olsson
e93560b769 LibWeb: Add the WritableStream interface 2023-04-06 22:54:58 +02:00
Luke Wilde
034aaf3f51 LibWeb: Introduce CustomElementRegistry and creating custom elements
The main missing feature here is form associated custom elements.
2023-04-06 11:36:56 +02:00
Matthew Olsson
bc9919178e LibWeb: Add ReadableStreamDefaultController 2023-04-01 23:43:07 +01:00
Matthew Olsson
222e3c32cd LibWeb: Add ReadableStreamDefaultReader 2023-04-01 23:43:07 +01:00
Luke Wilde
cbe0901706 LibWeb: Implement performance.mark and performance.clearMarks 2023-03-23 21:00:43 +00:00
Luke Wilde
31b507afbf LibWeb: Introduce Performance Timeline and its Performance functions 2023-03-23 21:00:43 +00:00
Timothy Flynn
57646c86ef LibWeb: Port the WebAssembly namespace to IDL 2023-03-16 19:39:17 +00:00
Timothy Flynn
2cfcbccdb5 LibWeb: Port WebAssembly.Table to IDL 2023-03-16 13:54:16 +01:00
Timothy Flynn
ca96f8e364 LibWeb: Port WebAssembly.Memory to IDL 2023-03-16 13:54:16 +01:00
Timothy Flynn
de32c44762 LibWeb: Port WebAssembly.Instance to IDL 2023-03-16 13:54:16 +01:00
Timothy Flynn
fb1f15774f LibWeb: Port WebAssembly.Module to IDL 2023-03-16 13:54:16 +01:00
Timothy Flynn
2d45e1fca5 LibWeb: Port the CSS namespace to IDL 2023-03-15 12:48:25 -04:00
Kenneth Myhra
be52e7171a LibWeb: Add FormDataIterator implementation
This adds the FormDataIterator implementation so we can iterate over
FormData.{keys(),values(),entries()}.
2023-03-08 18:57:36 +00:00
Linus Groh
c130fd6993 LibWeb: Start generating code for the Window object from IDL :^) 2023-03-07 23:33:34 +00:00
Linus Groh
de83f5422d LibWeb: Generate Window{Constructor,Prototype} from IDL
The Window object is massive, so let's do the conversion to IDL step
by step. First up: getting rid of the manual constructor and prototype
definitions, which can be generated from an empty `interface Window`.
2023-03-07 23:33:34 +00:00
Luke Wilde
d036862f2b LibWeb: Refactor XHR (almost) exactly to the spec
This makes XHR now rely on Fetch, which allows it to correct send
Origin and Referer headers, CORS-preflight and filtering and many other
goodies.

The main thing that's missing is Streams, which means we can't properly
produce progress events or switch to the Loading ready state.

This also doesn't implement the Document responseType just yet.
2023-03-07 11:51:12 +00:00
Luke Wilde
4d0277cd9a LibWeb: Implement navigator.{plugins,mimeTypes} 2023-02-28 12:36:14 +01:00
Luke Wilde
a90667e79c LibWeb: Add initial implementation of DOMMatrix(ReadOnly)
This is currently missing a lot of functions and initialisation from a
<transform-list> string, but is enough for Ruffle.
2023-02-27 20:55:09 +01:00
Kenneth Myhra
a6cdf6374f LibWeb: Introduce the FormDataEvent interface 2023-02-12 00:18:09 +00:00
Kenneth Myhra
d5b5b94a35 LibWeb: Introduce the FormData interface from the XHR specification 2023-02-12 00:18:09 +00:00
MacDue
f74e2da875 LibWeb: Implement CanvasRenderingContext2D.createPattern()
This is a first pass at implementing CRC2D.createPattern() and the
associated CanvasPattern object. This implementation only works for a
few of the required image sources [like CRC2D.drawImage()], and does
not yet support transforms. Other than that it supports everything
else (which is mainly the various repeat modes).
2023-02-03 20:36:21 +01:00
Linus Groh
afc055c088 LibWeb: Convert the Location object to IDL
This includes:

- Moving it from Bindings/ to HTML/
- Renaming it from LocationObject to Location
- Removing the manual definitions of the constructor and prototype
- Removing special handling of the Location interface from the bindings
  generator
- Converting the JS_DEFINE_NATIVE_FUNCTIONs to regular functions
  returning DeprecatedString instead of PrimitiveString
- Adding missing (no-op) setters for the various attributes, which are
  expected to exist by the bindings generator
2023-01-18 17:36:39 -05:00
Andreas Kling
0555684682 LibWeb: Sketch out basic support for SVG <foreignObject> elements
This patch adds basic DOM construction and IDL bindings for foreign
objects in SVG trees.
2022-11-16 13:01:21 +01:00
Luke Wilde
62e3117dfd LibWeb: Expose NodeFilter on the Window object 2022-10-28 16:17:08 +01:00
Aliaksandr Kalenik
501fb1cccb LibWeb: Dispatch "wheel" event 2022-10-23 15:58:16 +02:00
Andrew Kaster
2d5bee256e LibWeb: Re-implement HTML::Navigator using IDL
Get rid of the bespoke NavigatorObject class and use the modern IDL
strategies for creating platform objects to re-implement Navigator and
its associcated mixin interfaces. While we're here, implement it in a
way that brings WorkerNavigator up to spec :^)
2022-10-09 10:14:57 +02:00
Andrew Kaster
ffab9fb44e LibWeb: Add FileList from the FileAPI spec 2022-10-04 22:05:14 +02:00
Linus Groh
0b52b883af LibWeb: Implement '5.5. Response class' from the Fetch API :^) 2022-09-27 14:56:17 +01:00
Linus Groh
9fb672e981 LibWeb: Implement '5.4. Request class' from the Fetch API :^) 2022-09-27 14:56:17 +01:00
Linus Groh
bbaa05fcf9 LibWeb: Move DOMException from DOM/ to WebIDL/ 2022-09-25 19:13:31 +01:00
Linus Groh
87654f5b51 LibWeb: Start fleshing out the ReadableStream interface
This is so we can just assume it exists in Fetch APIs (while still
skipping functionality that relies on a full implementation, of
course).
2022-09-22 21:01:13 +01:00
Linus Groh
edfef8e2f5 Everywhere: Rename WrapperGenerator to BindingsGenerator
This code generator no longer creates JS wrappers for platform objects
in the old sense, instead they're JS objects internally themselves.
Most of what we generate now are prototypes - which can be seen as
bindings for the internal C++ methods implementing getters, setters, and
methods - as well as object constructors, i.e. bindings for the internal
create_with_global_object() method.

Also tweak the naming of various CMake glue code existing around this.
2022-09-21 23:06:08 +01:00
Andreas Kling
530675993b LibWeb: Rename Attribute to Attr
This name is not very good, but it's what the specification calls it.
2022-09-18 02:08:01 +02:00
Andreas Kling
ac274eee72 LibWeb: Remove the NO_INSTANCE option now that all wrappers are gone 2022-09-06 00:27:09 +02:00
Andreas Kling
497ead37bc LibWeb: Make DOMException GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
2fe97fa8db LibWeb: Make WorkerNavigator GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
9da72cdaba LibWeb: Make WorkerLocation GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
25daa14a05 LibWeb: Make IntersectionObserver GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
fe9c5395d4 LibWeb: Make URL, URLSearchParams & URLSearchParamsIterator GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
0dc2c27fa3 LibWeb: Make ResizeObserver GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
915a240944 LibWeb: Make IdleDeadline GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
8f2a711132 LibWeb: Make Selection GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
be9d3860b9 LibWeb: Make Crypto GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
96f6c7fae5 LibWeb: Make Headers and HeadersIterator GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
647ac1bdba LibWeb: Make Blob and File GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
018d236439 LibWeb: Make TextDecoder GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
7e508456a0 LibWeb: Make TextEncoder GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
57db2529cf LibWeb: Make DOMRect, DOMRectReadOnly and DOMRectList GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
44415af428 LibWeb: Make DOMPoint and DOMPointReadOnly GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
7a9b8ced38 LibWeb: Make SubtleCrypto GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
2ac8e3db3a LibWeb: Make Storage GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
233208b640 LibWeb: Make XMLSerializer GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
6b7a1d13e9 LibWeb: Make TextMetrics GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
2704bcdaaa LibWeb: Make Path2D GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
0d2fee351a LibWeb: Make CanvasGradient GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
369dd42d67 LibWeb: Make ImageData GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
4452b5ca09 LibWeb: Make 2D and 3D canvas rendering contexts GC-allocated 2022-09-06 00:27:09 +02:00
Andreas Kling
b8d485e6f0 LibWeb: Make AbortController GC-allocated 2022-09-06 00:27:09 +02:00