summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2023-04-19LibWeb: Stop creating `auto` LengthStyleValue for resolved styleSam Atkins
2023-04-19LibWeb: Stop parsing `auto` as a LengthSam Atkins
Previously, whether trying to parse a `<length>` or `<dimension>`, we would accept `auto` and produce a `LengthStyleValue` from it. This would fool the `property_accepts_value()` into allowing `auto` where it does not belong, if the property did accept lengths. Of the few places in the parser that called `parse_dimension_value()` or `parse_length()`, none of them were expecting it to accept `auto`, so this fixes those too. :^)
2023-04-19LibWeb: Check flex longhands first when parsing flex shorthandSam Atkins
Currently, `property_accepts_value()` always returns `true` if the property is a shorthand. (This is a bug, and should actually be fixed properly at some point...) This means that all identifiers are caught here, including `auto`, which should be handled by the `flex-basis` branch instead. This works currently because `auto` is a LengthStyleValue, but that's about to change!
2023-04-19LibWeb: Properly handle `auto` in StyleProperties::length_percentage()Sam Atkins
This relied on `auto` being a LengthStyleValue, which soon will not be true. :^)
2023-04-19LibWeb: Properly handle `auto` when parsing `background-size`Sam Atkins
This code assumed that `auto` was always stored as a LengthStyleValue, which will not be true in the next commit. (And was not a safe assumption to make anyway.)
2023-04-19LibWeb: Fix broken handling of `flex: <flex-grow>` shorthandAndreas Kling
This is a tiny bit messy because: - The spec says we should expand this to `flex: <flex-grow> 1 0` - All major engines expand it to `flex: <flex-grow> 1 0%` Spec bug: https://github.com/w3c/csswg-drafts/issues/5742
2023-04-19LibWeb: Implement the HTMLMediaElement crossOrigin attributeTimothy Flynn
2023-04-19LibWeb: Stub out the HTMLMediaElement buffered attributeTimothy Flynn
This is needed by https://store.steampowered.com. For now, we return an empty TimeRanges object.
2023-04-19LibWeb: Stub out the HTML TimeRanges IDL interfaceTimothy Flynn
This is used by media elements. Provide a stub for websites which depend on the interface existing.
2023-04-19LibWeb: Layout <svg> nested inside <svg>Andreas Kling
This is far from perfect, but let's at least make an attempt at laying out <svg> when encountering it inside another <svg>. This makes https://awesomekling.substack.com actually load and render instead of asserting. :^)
2023-04-19LibWeb: Make SVG <g> elements generate a SVGGraphicsPaintableAndreas Kling
...instead of defaulting to a PaintableBox. This way it gets the same behavior as other SVG boxes during paint.
2023-04-18LibWeb: Implement HTMLMediaElement's autoplay attributeTimothy Flynn
2023-04-18LibWeb+LibWebView+WebContent: Add APIs to manage an autoplay allowlistTimothy Flynn
The spec defines a Permissions Policy to control some browser behaviors on a per-origin basis. Management of these permissions live in their own spec: https://w3c.github.io/webappsec-permissions-policy/ This implements a somewhat ad-hoc Permissions Policy for autoplaying media elements. We will need to implement the entire policy spec for this to be more general.
2023-04-18LibWeb: Render HTMLVideoElement controls when scripting is disabledTimothy Flynn
The spec recommends exposing the user agent interface when scripting is disabled on the media element.
2023-04-18LibWeb: Organize LibWeb forwarding headerTimothy Flynn
Alphabetically sort everything (namespaces and forward declarations within namespaces), and de-duplicate repeated namespaces (namely the Web namespace appeared twice).
2023-04-18LibWeb: Treat unresolvable percentage flex-basis values as 'content'Andreas Kling
Per CSS-FLEXBOX-1, we should treat percentage values of flex-basis as 'content' if they resolve against an indefinite size of the flex container.
2023-04-17LibWeb: Honor box-sizing in flex item "specified size suggestion"Andreas Kling
Although the spec doesn't mention it, if a flex item has box-sizing: border-box, and the specified size suggestion is a definite size, we have to subtract the borders and padding from the size before using it. This fixes an issue seen in "This Week in Ladybird #4" where the screenshots ended up in one long vertical stack instead of paired up 2 by 2.
2023-04-17LibWeb: Support implicit lineto commands after moveto in SVG pathsAndreas Kling
Per SVG2, any coordinate pairs following a moveto command should be treated as implicit lineto commands with the same absoluteness as the moveto command.
2023-04-17LibWeb: Fix inverted condition in WritableStream's constructorMatthew Olsson
2023-04-17LibWeb: Make StartAlgorithm return a Value instead of a PromiseMatthew Olsson
2023-04-17LibWeb: Remove outdated FIXMEs around WebIDL::invoke_callback usagesMatthew Olsson
2023-04-17LibWeb: Properly reject abrupt completion in clean_up_on_returnMatthew Olsson
2023-04-17LibWeb: Implement SVG `preserveAspectRatio` attributeMacDue
This attribute is used to define how the viewBox should be scaled. Previously the behaviour implemented was that of "xMidYMid meet", now all of them work (expect none :P). With this the Discord login backend is now correctly scaled/positioned. This also brings our SVG code a little closer to the spec! With spec comments and all :^) (Minor non-visible update to layout tests)
2023-04-17LibWeb: Clip SVG content to parent <svg> element bounding boxMacDue
2023-04-17LibWeb: Update the media playback time for clicks on the media timelineTimothy Flynn
When clicking on the media timeline, compute the percentage along the timeline's width the user clicked, and set the playback time to the same percentage of the video's duration.
2023-04-17LibWeb: Restrict toggling video playback to certain areas in a videoTimothy Flynn
When the control bar is shown, do not toggle playback when clicking on the control bar, unless the click target is the playback button. This will let us implement clicking on the timeline to seek. Note that this requires caching some layout rects on the video element. We need to remember where the corresponding layout boxes are, and we can't cache them on the layout box, as that may be destroyed any time.
2023-04-17LibWeb: Implement converting a DevicePixelRect to a CSSPixelRectTimothy Flynn
Which also requires converting a DevicePixelSize to a CSSPixelSize.
2023-04-17LibWeb: Begin implementing media resource seekingTimothy Flynn
2023-04-17LibWeb: Change the callback used to detect the end of a video streamTimothy Flynn
The on_end_of_stream callback was added to notify clients that video playback has stopped when we didn't have a way to retrieve the playback state from Video::PlaybackManager. Now that we do, we should consolidate on using the on_playback_state_change callback to detect such changes.
2023-04-17LibWeb: Fix a couple of HTMLMediaElement spec linksTimothy Flynn
2023-04-16LibWeb: Fix multi-line flex column layouts with auto height on containerAndreas Kling
When sizing a flex container with flex-direction:column under a max-content height constraint, we were incorrectly truncating the infinite available height to 0 when collecting flex items into lines. This caused us to put every flex item in its own flex line, which is the complete opposite of what we want during max-content intrinsic sizing, as the layout would grow wide but not tall.
2023-04-16LibWeb: Honor gap between flex lines when using align-content: stretchAndreas Kling
We have to take the cross gap into account when calculating the "sum of flex line cross sizes" in "Handle 'align-content: stretch'".
2023-04-15LibWeb: Scale SVG stroke-width based on viewboxMacDue
This fixes the clipping of strokes in quite a few cases and now fixes the Gartic Phone logo :^) (Layout test updated but no visible changes there)
2023-04-15LibWeb/Fetch: Fix build error in HeadersIterator::next()Linus Groh
Regressed in d4eaaf9.
2023-04-15LibJS: Port create_iterator_result_object() to NonnullGCPtrLinus Groh
2023-04-15LibJS: Port iterator_step() to GCPtrLinus Groh
2023-04-15LibWeb: Add missing properties from latest spec in SessionHistoryEntryAliaksandr Kalenik
Adds step and document_state properties. Both will be required for further navigables spec implementation. Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-04-15LibWeb: Add HTML::DocumentStateAndreas Kling
This represents the new "document state" concept from the HTML spec. Document states are primarily used in session history entries. Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-04-15LibWeb: Make SessionHistoryEntry GC-allocatedAndreas Kling
These will need to float around more than they're currently able to. Put them on the GC heap to prepare for that. Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-04-15AK+Everywhere: Change URL::path() to serialize_path()MacDue
This now defaults to serializing the path with percent decoded segments (which is what all callers expect), but has an option not to. This fixes `file://` URLs with spaces in their paths. The name has been changed to serialize_path() path to make it more clear that this method will generate a new string each call (except for the cannot_be_a_base_url() case). A few callers have then been updated to avoid repeatedly calling this function.
2023-04-15AK+Everywhere: Add ApplyPercentDecoding option to URL gettersMacDue
The defaults selected for this are based on the behaviour of URL when it applied percent decoding during parsing. This does mean now in some cases the getters will allocate, but percent_decode() checks if there's anything to decode first, so in many cases still won't.
2023-04-14LibWeb: Do not dereference empty Optional in ReadableStream::visit_edgesTimothy Flynn
There are quite a few steps between a ReadableStream being created and its controller being set. If GC occurs between those points, we will have an empty Optional in ReadableStream::visit_edges. Seen on YouTube.
2023-04-14LibWeb/Streams: Rename one instance of 'e' to 'exception'Linus Groh
This is what we call it everywhere else.
2023-04-14LibWeb/Streams: Add FIXMEs to incorrect invoke_callback() invocationsLinus Groh
2023-04-14LibWeb/Streams: Use MUST_OR_THROW_OOM() when creating JS exceptionsLinus Groh
This cannot throw unless we OOM.
2023-04-14LibWeb/Streams: Make most algorithms return a NonnullGCPtrLinus Groh
Only the 'start algorithm' ever returns undefined (as a null GCPtr), so let's type the others more strictly.
2023-04-14LibWeb: Resolve more background-related propertiesKarol Kosek
This change adds rules for background-attachment, background-clip, background-image, background-origin, and background-repeat. As a result, Window.getComputedStyle() will no longer return empty strings on these properties after a page is loaded, and the background shorthand will show the resolved values instead of the default ones for these values. :^)
2023-04-14LibWeb: Honor column-gap and row-gap CSS properties in flex layoutAndreas Kling
This isn't actually part of CSS-FLEXBOX-1, but all major engines honor these properties in flex layout, and it's widely used on the web. There's a bug open against the flexbox spec where fantasai says the algorithm will be updated in CSS-FLEXBOX-2: https://github.com/w3c/csswg-drafts/issues/2336 I've added comments to all the places where we adjust calculations for gaps with "CSS-FLEXBOX-2" so we can find them easily. When that spec becomes available, we can add proper spec links.
2023-04-14LibWeb: Propogate OOM errors from readable_stream_reader_generic_cancelMatthew Olsson
2023-04-14LibWeb: Add ByteStreamController to ReadableStreamController typeMatthew Olsson