Commit Graph

481 Commits

Author SHA1 Message Date
Jamie Mansfield
67e3ac8916 LibWeb/HTML: Stub TextTrack IDL interface 2024-07-05 07:15:04 +02:00
Luke Warlow
6623177265 LibWeb: Implement support for scrollbar-gutter
This property is now correctly parsed.

Ladybird always uses overlay scrollbars so this property does nothing.
2024-07-04 13:22:40 +02:00
Aliaksandr Kalenik
c62cc915df Everywhere: Pass backing store into Navigable::paint()
...instead of Gfx::Bitmap, which makes it possible to access and
directly paint into IOSurface on macOS.
2024-06-28 14:25:34 +02:00
Luke Warlow
a65f1ecc37 LibWeb: Implement stub for ElementInternals
This implements a stub ElementInternals object which implements the
shadowRoot getter only.

Also implement attachInternals function.
2024-06-26 06:30:40 +02:00
Aliaksandr Kalenik
854b269338 LibWeb: Rename RecordingPainter to DisplayListRecorder
Use more widely recognized name among browser engine developers.
2024-06-24 13:22:59 +02:00
Luke Warlow
b216046234 LibWeb: Implement CloseWatcher API
This implements most of the CloseWatcher API from the html spec.

AbortSignal support is unimplemented.

Integration with dialogs and popovers is also unimplemented.
2024-06-22 17:39:53 +02:00
Aliaksandr Kalenik
7a04a95c8a LibWeb+LibGfx: Replace usage of Gfx::PaintStyle in fill{stoke}_commands
...with a struct defined in LibWeb. This is a step towards uncoupling
LibWeb from LibGfx, so we can try third-party libraries for painting.
2024-06-13 20:17:10 +03:00
Shannon Booth
e0bbbc729b LibWeb: Add stub for ValidityState
This fixes https://html5test.com/ as previously an exception was being
thrown after trying to access this attribute which would then result in
a popup about the test failing (and none of the test results being
shown).
2024-06-09 10:13:32 +02:00
Jamie Mansfield
01bd179eef LibWeb: Implement UserActivation 2024-05-29 09:32:59 -06:00
Shannon Booth
1fa7235fec LibWeb: Add Implement GainNode interface
As with all other current audio nodes we still need to wire up the
inputs and outputs so it can be properly used in an audio context - but
this is enough to implement the public IDL interface.
2024-05-28 08:06:09 +02:00
Timothy Flynn
eb3b8f8ee4 LibWeb: Implement EventSource for server-sent events
EventSource allows opening a persistent HTTP connection to a server over
which events are continuously streamed.

Unfortunately, our test infrastructure does not allow for automating any
tests of this feature yet. It only works with HTTP connections.
2024-05-26 18:29:24 +02:00
MacDue
5f17d9b34a LibWeb: Add BasicShapeStyleValue to represent CSS basic shapes
See: https://www.w3.org/TR/css-shapes-1/#basic-shape-functions

This patch only implements the `polygon()` basic shape (with the rest
left as FIXMEs).
2024-05-26 07:55:50 +02:00
Shannon Booth
71ccd8ad25 LibWeb: Implement BaseAudioContext.createBuffer
This is a simple factory function which effectively just calls the
AudioBuffer constructor.
2024-05-26 07:49:49 +02:00
Kenneth Myhra
76418f3ffa LibWeb: Implement the concept incrementally read a body 2024-05-20 16:57:52 -04:00
Shannon Booth
3aa36caa52 LibWeb: Add stub interface for IDBOpenDBRequest 2024-05-19 16:24:11 +02:00
Shannon Booth
bfa330914d LibWeb: Add stub interface for IDBRequest 2024-05-19 16:24:11 +02:00
Shannon Booth
8d5665ebe1 LibWeb: Add stub for IDBFactory 2024-05-19 16:24:11 +02:00
Shannon Booth
2a56df8ecd LibWeb: Add scaffolding for DynamicsCompressorNode 2024-05-14 13:45:43 -04:00
Andrew Kaster
e10721f1b5 LibWeb: Add stub implementation of FontFaceSet and Document.fonts
This is now enough for duolingo to load and use its fallback fonts.
2024-05-08 10:39:16 +02:00
Andrew Kaster
2c31d7dddc LibWeb: Add stub implementation of CSS FontFace Web API 2024-05-08 10:39:16 +02:00
Andrew Kaster
3a5eabc43b LibWeb: Rename CSS::FontFace to CSS::ParsedFontFace
This implementation detail of CSSFontFaceRule is hogging the name of a
Web API from CSS Font Loading Module Level 3.
2024-05-08 10:39:16 +02:00
Jamie Mansfield
74d90338b1 LibWeb/Fetch: Support setting request priority from JS 2024-05-07 17:27:37 -06:00
Tim Ledbetter
398bf10b92 LibWeb: Use TraversalDecision for multi level Node traversal methods
This adds the `SkipChildrenAndContinue` option, where traversal
continues but child nodes are not included.
2024-05-07 16:45:28 -06:00
Shannon Booth
a83f4216a5 LibWeb: Add stub IDL interface for OscillatorNode
This source node generates a periodic wave form.
2024-05-02 07:49:23 +02:00
Shannon Booth
c9b2c1c747 LibWeb: Add stub IDL interface for AudioScheduledSourceNode
This is a base class of a few different audio nodes, most notably for
our immediate needs - OscillatorNode.
2024-05-02 07:49:23 +02:00
Shannon Booth
6661c68b28 LibWeb: Add stub IDL interface for AudioNode
An AudioNode is the fundamental building block used in 'Audio
Contexts'. In our immediate case, the audio node we are working towards
implementing is an oscillating source node.
2024-05-02 07:49:23 +02:00
Shannon Booth
5ae0ac7b73 LibWeb: Add stub IDL interface for AudioParam
An AudioParam is a fundamental building block in WebAudio as it controls
the value of an individual parameter of an AudioNode, such as volume.
2024-05-02 07:49:23 +02:00
Shannon Booth
b1b7e2324a LibWeb: Add stub IDL interface for PeriodicWave
PeriodicWave represents an arbitrary periodic waveform to be used
with an OscillatorNode.
2024-05-02 07:49:23 +02:00
Shannon Booth
bad44f8fc9 LibWeb: Remove Bindings/Forward.h from LibWeb/Forward.h
This was resulting in a whole lot of rebuilding whenever a new IDL
interface was added.

Instead, just directly include the prototype in every C++ file which
needs it. While we only really need a forward declaration in each cpp
file; including the full prototype header (which itself only includes
LibJS/Object.h, which is already transitively brought in by
PlatformObject) - it seems like a small price to pay compared to what
feels like a full rebuild of LibWeb whenever a new IDL file is added.

Given all of these includes are only needed for the ::initialize
method, there is probably a smart way of avoiding this problem
altogether. I've considered both using some macro trickery or generating
these functions somehow instead.
2024-04-27 18:29:35 -04:00
Jamie Mansfield
2d90317c20 LibWeb: Implement <desc> SVG element 2024-04-17 07:17:27 +02:00
Lucas CHOLLET
676fc5e8c6 LibWeb: Implement HTML::ImageBitmap
And the two methods of `WindowOrWorkerGlobalScope` that are used as
constructors for it.
2024-04-08 14:25:36 +02:00
Shannon Booth
b873e5bc1d LibWeb: Implement the PointerEvent interface
As defined in: https://w3c.github.io/pointerevents

With the exception of the getCoalescedEvents and getPredictedEvents
APIs.

There are still many other parts of that spec (such as the event
handlers) left to implement, but this does get us at least some of the
way.
2024-04-08 14:25:08 +02:00
Shannon Booth
ccebc7a905 LibWeb: Add stubs for the Screen Orientation API
As defined in: https://w3c.github.io/screen-orientation
2024-04-03 10:09:58 +01:00
Shannon Booth
1f59e21829 LibWeb: Implement HTMLAllCollection
This collection has some pretty strange behaviour, particularly with the
IsHTMLDDA slot which is defined in the javascript spec specifically for
this object.

This commit implements pretty much all of this interface, besides from
the custom [[Call]].

There is also no caching over this collection. Since it is a live
collection over the entire document, the performance is never going to
be great, and I am not convinced any speedup for this legacy interface
is worth a massive cache.
2024-04-01 14:41:00 +02:00
Matthew Olsson
5dce559ed8 LibWeb: Parse transition style values 2024-03-29 21:58:12 +01:00
Aliaksandr Kalenik
b590d1b48b LibWeb: Transform SessionHistoryEntry from a struct to a class
No behaviour change intended.
2024-03-27 18:07:07 +01:00
Timothy Flynn
108521a566 LibWeb+LibWebView+WebContent: Implement more <input type=file> behavior
We had previous implemented some plumbing for file input elements in
commit 636602a54e.

This implements the return path for chromes to inform WebContent of the
file(s) the user selected. This patch includes a dummy implementation
for headless-browser to enable testing.
2024-02-26 14:18:49 +01:00
Shannon Booth
f9e5b43b7a LibWeb: Rename URL platform object to DOMURL
Along with putting functions in the URL namespace into a DOMURL
namespace.

This is done as LibWeb is in an awkward situation where it needs
two URL classes. AK::URL is the general purpose URL class which
is all that is needed in 95% of cases. URL in the Web namespace
is needed predominantly for interfacing with the javascript
interfaces.

Because of two URLs in the same namespace, AK::URL has had to be
used throughout LibWeb. If we move AK::URL into a URL namespace,
this becomes more painful - where ::URL::URL is required to
specify the constructor (and something like
::URL::create_with_url_or_path in other places).

To fix this problem - rename the class in LibWeb implementing the
URL IDL interface to DOMURL, along with moving the other Web URL
related classes into this DOMURL folder.

One could argue that this name also makes the situation a little
more clear in LibWeb for why these two URL classes need be used
in the first place.
2024-02-25 08:54:31 +01:00
Tim Ledbetter
b0f57a2785 LibWeb: Add CSSStyleSheet constructor binding 2024-02-24 21:59:28 +01:00
Timothy Flynn
c4295edc81 LibWeb: Add ImageBox to forwarding header 2024-02-19 11:07:30 +01:00
Matthew Olsson
3a87c000c4 LibWeb: Add the CSSAnimation IDL object 2024-02-16 12:02:11 -07:00
Matthew Olsson
daaaaec2d0 LibWeb: Add the Animatable IDL object 2024-02-15 12:34:19 +01:00
Timothy Flynn
23fb1209af LibWeb: Add FormAssociatedElement to the forwarding header 2024-02-03 15:30:16 -07:00
Andreas Kling
b12541b286 LibWeb: Add SVGSVGElement.viewBox attribute
This attribute has some compatbility issues...
- The spec says it should be an SVGAnimatedRect which contains
  a DOMRect and a DOMReadOnlyRect.
- Blink gives you an SVGAnimatedRect with 2x SVGRect
- Gecko gives you an SVGAnimatedRect with 2x SVGRect? (nullable)

I ended up with something similar to Gecko, an SVGAnimatedRect
with 2x DOMRect? (nullable)

With this fixed, we can now load https://polar.sh/ :^)
2024-01-25 08:23:41 +01:00
Andrew Kaster
02edd240ae LibWeb+WebContent: Spawn Worker processes from the chrome
Instead of spawning these processes from the WebContent process, we now
create them in the Browser chrome.

Part 1/N of "all processes are owned by the chrome".
2024-01-12 15:53:11 -07:00
Andrew Kaster
521ed0e911 LibWeb: Delete LegacyPlatformObject and move behavior to PlatformObject
We have two known PlatformObjects that need to implement some of the
behavior of LegacyPlatformObjects to date: Window, and HTMLFormElement.

To make this not require double (or virtual) inheritance of
PlatformObject, move the behavior of LegacyPlatformObject into
PlatformObject. The selection of LegacyPlatformObject behavior is done
with a new bitfield of feature flags instead of a dozen virtual
functions that return bool. This change simplifies every class involved
in the diff with the notable exception of Window, which now needs some
ugly const casts to implement named property access.
2024-01-12 09:11:18 +01:00
Sam Atkins
30dcbc306c LibWeb: Make resolution calculable
No tests unfortunately, because no CSS property we currently support
accepts `<resolution>`.
2023-12-30 20:11:24 +01:00
Sam Atkins
e907ad44c3 LibWeb: Fill in some missing FooOrCalculated types 2023-12-30 20:11:24 +01:00
Andrew Kaster
b10fee00eb LibWeb+WebWorker: Convert Workers to use MessagePorts for postMessage
This aligns Workers and Window and MessagePorts to all use the same
mechanism for transferring serialized messages across realms.

It also allows transferring more message ports into a worker.

Re-enable the Worker-echo test, as none of the MessagePort tests have
themselves been flaky, and those are now using the same underlying
implementation.
2023-12-25 12:09:11 +01:00
Aliaksandr Kalenik
f50bf00814 LibWeb+LibGfx: Move UnicodeRange from LibWeb to LibGfx
In upcoming changes UnicodeRange is going to be used in LibGfx in
a class that represents font cascade list.
2023-12-10 17:32:04 +01:00