Commit Graph

431 Commits

Author SHA1 Message Date
Shannon Booth
04c094343f LibWeb+Meta: Add wrapper for the BufferSource/ArrayBufferView IDL types
These wrappers will make it much easier to do various operations on the
different ArrayBuffer-related classes in LibWeb compared to the current
solution, which is to just accept a Handle<Object> everywhere (and use
"any" in the *.idl files).

Co-Authored-By: Matthew Olsson <mattco@serenityos.org>
2023-11-24 08:43:35 +01:00
Timothy Flynn
ffdc2d8add LibWeb+LibWebView+WebContent: Add an Inspector IDL object to the Window
This is an internal object that must be explicitly enabled by the chrome
before it is added to the Window. The Inspector object will be used by a
special WebView that will replace all chrome-specific inspector windows.
The IDL defines methods that this WebView will need to inform the chrome
of various events, such as the user clicking a DOM node.
2023-11-24 08:37:19 +01:00
Shannon Booth
746526ca29 LibWeb: Add ReadIntoRequest to forwarding header 2023-11-19 18:53:17 +01:00
Matthew Olsson
5824916f8c LibWeb: Add KeyframeEffect IDL objects 2023-11-14 10:12:02 +01:00
Matthew Olsson
43dc9dfb69 LibWeb: Add the AnimationPlaybackEvent IDL object 2023-11-11 22:45:16 +01:00
Timothy Flynn
4b94b0b561 LibWeb: Begin implementing the Clipboard API
https://w3c.github.io/clipboard-apis/

This implements enough for navigator.clipboard.writeText(String).
2023-11-11 08:54:37 +01:00
Matthew Olsson
1ca46afa2f LibWeb: Add the Animation IDL object 2023-11-08 09:58:18 +01:00
Matthew Olsson
0df06ce273 LibWeb: Add the AnimationEffect IDL object 2023-11-08 09:58:18 +01:00
Matthew Olsson
734076946b LibWeb: Add DocumentTimeline IDL object 2023-11-07 15:17:09 +01:00
Matthew Olsson
521f8bd5f2 LibWeb: Add AnimationTimeline IDL object 2023-11-07 15:17:09 +01:00
Shannon Booth
4821d284c6 LibWeb: Add support for inline SVG element scripts 2023-11-05 11:16:16 +00:00
Bastiaan van der Plaat
0104225d9b LibWeb: Add TextEncoder encodeInto 2023-10-29 21:44:53 +01:00
Bastiaan van der Plaat
f1ead552ce LibWeb: Add constructor options to TextDecoder 2023-10-29 21:44:53 +01:00
Sam Atkins
596773f12f LibWeb: Stop forward-declaring NavigationParams twice 2023-10-28 13:15:51 -04:00
Aliaksandr Kalenik
063e66cae9 LibWeb: Introduce RecordingPainter to serialize painting commands
This modification introduces a new layer to the painting process. The
stacking context traversal no longer immediately calls the
Gfx::Painter methods. Instead, it writes serialized painting commands
into newly introduced RecordingPainter. Created list of commands is
executed later to produce resulting bitmap.

Producing painting command list will make it easier to add new
optimizations:
- It's simpler to check if the painting result is not visible in the
  viewport at the command level rather than during stacking context
  traversal.
- Run painting in a separate thread. The painting thread can process
  serialized painting commands, while the main thread can work on the
  next paintable tree and safely invalidate the previous one.
- As we consider GPU-accelerated painting support, it would be easier
  to back each painting command rather than constructing an alternative
  for the entire Gfx::Painter API.
2023-10-18 10:58:42 +02:00
Sam Atkins
642ad80960 LibWeb: Make CSS Transformation struct a proper class
Move it out of ComputedValues.h into its own files, and take the
transformation-to-matrix code from StackingContext.
2023-10-15 07:14:39 +02:00
Karol Kosek
426b7ffa41 LibWeb: Don't include Window.h in Element.h and Document.h
Window.h is a rather heavy file, so let's try not to include it in
header files when we can!

Element.h now also includes LibWeb/Bindings/Intrinsics.h, but that's
just out of my laziness. Most if not all objects call
`Bindings::ensure_web_prototype<>()` anyway, so I don't think we would
gain much by sticking the header to source files instead.
2023-10-09 07:29:27 +02:00
Sam Atkins
b0317bb3a1 LibWeb: Implement Flex and FlexStyleValue types 2023-09-28 20:33:20 +01:00
Sam Atkins
aea112da71 LibWeb: Replace OverflowStyleValue with ShorthandStyleValue 2023-09-25 00:46:21 +01:00
Sam Atkins
e905072e47 LibWeb: Replace GridTrackPlacementShorthandStyleValue with ShorthandSV 2023-09-25 00:46:21 +01:00
Sam Atkins
8efac89a16 LibWeb: Replace TextDecorationStyleValue with ShorthandStyleValue 2023-09-25 00:46:21 +01:00
Sam Atkins
6e311902de LibWeb: Replace PlaceItemsStyleValue with ShorthandStyleValue 2023-09-25 00:46:21 +01:00
Sam Atkins
8143d48161 LibWeb: Replace PlaceSelfStyleValue with ShorthandStyleValue
Turns out we were parsing `place-self` as a PlaceItemsStyleValue
sometimes, whoops.
2023-09-25 00:46:21 +01:00
Sam Atkins
1b0939b418 LibWeb: Replace PlaceContentStyleValue with ShorthandStyleValue 2023-09-25 00:46:21 +01:00
Sam Atkins
6758decc74 LibWeb: Replace ListStyleStyleValue with ShorthandStyleValue 2023-09-25 00:46:21 +01:00
Sam Atkins
f5cb2e8dc2 LibWeb: Replace GridTrackSizeListShorthandStyleValue with ShorthandSV 2023-09-25 00:46:21 +01:00
Sam Atkins
48f3603119 LibWeb: Replace GridAreaShorthandStyleValue with ShorthandStyleValue 2023-09-25 00:46:21 +01:00
Sam Atkins
23d59a6caf LibWeb: Replace BorderStyleValue with ShorthandStyleValue
And also expand builtin values to the longhands, which we weren't doing
before.
2023-09-25 00:46:21 +01:00
Andrew Kaster
247f12d7b0 LibWeb: Insert WindowProperties object into Window's prototype chain
And implement WindowProperties, the "named properties object" for Window
according to the spec.

This involves moving an AO out of LegacyPlatformObject and into a common
place that the WindowProperties class can access.

This doesn't implement the AOs on Window that actually name lookup for
the unenumerable named properties on the window yet, just the
scaffolding.
2023-09-22 19:55:59 -06:00
Andreas Kling
51caa14381 LibWeb: Remove FrameLoader
This class is no longer used, now that we've moved to navigables.
2023-09-20 18:29:17 +02:00
Sam Atkins
9b4ddff6a9 LibWeb: Replace FontStyleValue with ShorthandStyleValue
Also, actually include font-variant since we were already parsing it but
throwing it away.
2023-09-20 12:17:16 +01:00
Sam Atkins
34591549b1 LibWeb: Replace BorderRadiusShorthandStyleValue with ShorthandStyleValue 2023-09-20 12:17:16 +01:00
Sam Atkins
34e0899ab0 LibWeb: Replace BackgroundStyleValue with ShorthandStyleValue
The `to_string()` for this is modified a little from the original,
because we have to calculate what the layer-count is then, instead of
having it already calculated.
2023-09-20 12:17:16 +01:00
Sam Atkins
1ae515c0b7 LibWeb: Replace FlexFlowStyleValue with ShorthandStyleValue 2023-09-20 12:17:16 +01:00
Sam Atkins
aa45b3dfe3 LibWeb: Replace FlexStyleValue with ShorthandStyleValue
We still need the custom parsing and to_string() logic, but nothing
else. :^)
2023-09-20 12:17:16 +01:00
Sam Atkins
d20254f1bc LibWeb: Rename CompositeStyleValue -> ShorthandStyleValue
It's a shorthand, so let's call it that. :^)
2023-09-20 12:17:16 +01:00
Andreas Kling
0a133ccba4 LibWeb: Remove the HTML blink element
Support for this element has been removed from all major engines years
ago already, and it's currently the only reason we have a weird
"visible" flag on Layout::Node (which we toggle on a timer here..)
2023-09-18 14:45:20 +02:00
Timothy Flynn
8bb5652835 LibWeb: Implement HTMLDetailsElement's open attribute closer to the spec
The spec now has a "toggle task tracker" to coalesce rapid changes to
this attribute. It also now has an explicit ToggleEvent to encapsulate
the old and new state of the element.

This further handles the attribute being added/removed using a override
of Element::attribute_changed(), rather than being the only element to
instead override Element::set/remove__attribute().
2023-09-13 13:45:47 +02:00
Timothy Flynn
153ae93f9c LibWeb: Implement ToggleEvent for HTMLDetailsElement 2023-09-13 13:45:47 +02:00
Sam Atkins
6476dea898 LibWeb: Implement the math-depth CSS property
This one is a bit fun because it can be `add(<integer>)` or `auto-add`,
but children have to inherit the computed value not the specified one.
We also have to compute it before computing the font-size, because of
`font-size: math` which will be implemented later.
2023-09-11 17:03:22 +01:00
Bastiaan van der Plaat
b4ae719664 LibWeb: Add DOMPoint matrixTransform and DOMMatrix transformPoint 2023-09-01 20:58:13 +02:00
Andrew Kaster
d97b09693e LibWeb: Convert SandboxingFlagSet into a enum class
Instead of having a nested enum within a struct, use the macro
AK_ENUM_BITWISE_OPERATORS to add all the convienent has_flag free
functions and such for ease of use.
2023-08-29 09:39:57 +02:00
Luke Wilde
af2886449a LibWeb: Implement PerformanceObserver 2023-08-27 23:27:44 +02:00
Andrew Kaster
d1aea87889 LibWeb: Add NavigateEvent, the main event of the Navigation API
This event is the star of the show, and the main way that web content
can react to either programmatic or user-initiated navigation.

All of the fun algorithms will have to come later though.
2023-08-24 11:03:57 -06:00
Andrew Kaster
3dd3b2019d LibWeb: Add NavigationTransition, a transient property of Navigation
This property is useful for web content to determine whether an ongoing
navigation has settled or not.
2023-08-24 11:03:57 -06:00
Andrew Kaster
0c2f758067 LibWeb: Implement the start of the Navigation API
This API is how JavaScript can manipulate the new Navigable concepts
directly. We are still missing most of the interesting algorithms on
Navigation that do the actual navigation steps, and call into the
currently WIP navigable AOs.
2023-08-24 11:03:57 -06:00
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
Sam Atkins
f7f7ab9775 LibWeb: Forward-declare RevertStyleValue 2023-08-20 17:59:36 +02:00