Commit Graph

407 Commits

Author SHA1 Message Date
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
Andreas Kling
703c2bb06e LibWeb: Add support for parsing grid-auto-flow CSS property
Co-Authored-By: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-08-20 15:36:18 +02: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
Andreas Kling
25375bf1d5 LibWeb: Make Document::paintable() return a ViewportPaintable 2023-08-20 05:02:59 +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
Aliaksandr Kalenik
da2cd73bcf LibWeb: Add place-self css property support 2023-08-06 08:26:36 +02:00
Bastiaan van der Plaat
220e34b69d LibWeb: Add Canvas Context2D basic text align and text baseline support
Add the CanvasTextDrawingStyles mixin with the textAlign and
textBaseline attributes. Update fill_text in CanvasRenderingContext2D
to move the text rect by the text align and text baseline attributes.
Wrote a simple HTML example to showcase the new features.
2023-08-05 17:17:08 +02:00
Aliaksandr Kalenik
a8587fe54e LibWeb: Add support for "place-items" CSS property
Adds support for place-items property which allows to specify both
align-items and justify-items in a single declaration.
2023-07-17 18:58:05 +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
Kenneth Myhra
12ff48047f LibWeb: Add Transformer API
This adds the Transformer API which the TransformStream() constructor
accepts as its first argument.
2023-07-15 11:59:39 +02:00
Ali Mohammad Pur
dd073b2711 Meta/CodeGenerators+LibWeb: Implement parsing CSS easing functions
This only implements the parser bits, no functionality is implemented,
and no properties are parsed because of this.
2023-07-13 05:10:41 +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
Jonah
57a6d577ad LibWeb: Add AriaData object to parse ARIAMixin data
This provides an easily serializeable interface for us to use in IPC.
2023-07-06 11:21:36 +01:00
Shannon Booth
0f040456a7 LibWeb: Add ReadableStreamGetReaderOptions to ReadableStream.getReader
Co-Authored-By: Matthew Olsson <mattco@serenityos.org>
2023-07-05 23:33:20 +01:00
Daniel Adams
49e6414c58 LibWeb: Start filling out BaseAudioContext/AudioContext interfaces
- Fills out both IDLs and implements some basic attributes/methods.
- No actual audio processing yet though :^)
2023-06-28 05:22:51 +02:00
Shannon Booth
42c102ecb6 LibWeb: Add IDL definition for Web::Streams::QueuingStrategy 2023-06-22 06:58:23 +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
Shannon Booth
0d714ad165 LibWeb: Add IDL definition for Web::Streams::QueuingStrategyInit
This is used in the constructor for ByteLengthQueuingStrategy and
CountQueuingStrategy.
2023-06-21 12:27:04 +02:00
Luke Wilde
c9c1ddd0bb LibWeb: Fix up constructing the form entry list
In particular:
- Don't include none submitter buttons.
- Use type_state() instead type() to avoid direct string comparisons
- Support the hidden _charset_ input
- Get form associated element's value directly instead of via the value
  attribute
- Split line break normalization into a separate function so that it
  can also be used by form submission.
2023-06-19 06:12:26 +02:00
Andreas Kling
34591ff3d9 LibWeb: Use a separate class for shared image requests
As it turns out, making everyone piggyback on HTML::ImageRequest had
some major flaws, as HTMLImageElement may decide to abort an ongoing
fetch or wipe out image data, even when someone else is using the same
image request.

To avoid this issue, this patch introduces SharedImageRequest, and then
implements ImageRequest on top of that.

Other clients of the ImageRequest API are moved to SharedImageRequest
as well, and ImageRequest is now only used by HTMLImageElement.

This fixes an issue with image data disappearing and leading to asserts
and/or visually absent images.
2023-06-14 14:23:17 +02:00