Commit Graph

9436 Commits

Author SHA1 Message Date
Kenneth Myhra
01a8b5ee54 LibWeb: Implement AO readable_stream_from_iterable 2024-06-09 10:12:46 +02:00
Kenneth Myhra
ce521a196d LibWeb: Add non-standard AO set_up_readable_stream
This AO can be used instead of CreateReadableStream in cases where we
need to set up a newly allocated ReadableStream before initialization of
said ReadableStream, i.e. ReadableStream is captured by lambdas in an
uninitialized state.
2024-06-09 10:12:46 +02:00
Shannon Booth
7a77130923 LibWeb: Do not release_value twice parsing a referrer policy
This fixes a bug introduced in ab6b687d4c which was causing many live
sites (such as chat.openai.com and github.com/serenityos/serenity) to
crash.
2024-06-09 07:02:59 +01:00
Matthew Olsson
7925efda5f LibWeb: Do not clamp the output of the cubic bezier timing function
It is fine for timing function to be outside of the range [0, 1]
2024-06-08 07:58:58 +02:00
Matthew Olsson
7f902fa2dc LibWeb: Prevent overrunning loop bounds in cubic bezier calculation 2024-06-08 07:58:58 +02:00
Matthew Olsson
31618abf15 LibWeb: Correct observable property access order in KeyframeEffect
Apparently these are supposed to be accessed in alphabetical order
2024-06-08 07:58:58 +02:00
Matthew Olsson
c85f00e373 LibWeb: Only read enumerable keyframe properties 2024-06-08 07:58:58 +02:00
Andreas Kling
b118c99c27 LibWeb: Add null check in Document::ancestor_navigables()
The spec doesn't explicitly forbid calling this when the document
doesn't have a node navigable, so let's handle that situation gracefully
by just returning an empty list of ancestors.

I hit this VERIFY somewhere on the web, but I don't know how to
reproduce it.
2024-06-07 19:39:45 +02:00
Jamie Mansfield
bbd82265e1 LibWeb/CSS: Implement FontFaceSet.onloadingerror 2024-06-07 19:30:35 +02:00
Jamie Mansfield
e56e09b820 LibWeb/CSS: Implement FontFaceSet.onloadingdone 2024-06-07 19:30:35 +02:00
Jamie Mansfield
4210586730 LibWeb/CSS: Implement FontFaceSet.onloading 2024-06-07 19:30:35 +02:00
Jamie Mansfield
c6a6a7c4f0 LibWeb/CSS: FontFaceSet extends EventTarget 2024-06-07 19:30:35 +02:00
Jamie Mansfield
839dc01280 LibWeb/CSS: Stub FontFaceSet.check 2024-06-07 19:30:35 +02:00
Aliaksandr Kalenik
9be5867eb2 LibWeb: Implement rejection by bounding box for PaintInnerBoxShadow
Before this change we were painting inner shadows lying outside of
viewport.

Improves painting performance on Github and Twitter where this command
is used a lot.
2024-06-07 18:41:57 +02:00
Aliaksandr Kalenik
1c8d37d528 LibWeb: Rename PaintOuterBoxShadowParams to PaintBoxShadowParams
Drop "outer" from the name because this struct is used for both inner
and outer shadows.
2024-06-07 18:41:57 +02:00
Aliaksandr Kalenik
22bb476b6f LibWeb: Use ints instead of DevicePixels in PaintOuterBoxShadowParams
DevicePixels concept should not leak from painting recording phase.
2024-06-07 15:42:38 +02:00
Aliaksandr Kalenik
2dd3b6fcff LibWeb: Remove unused members in PaintOuterBoxShadowParams
This struct had all members in CSSPixels and DevicePixels, but only the
latter are needed for painting.

Shrinks PaintOuterBoxShadowParams from 144 bytes to 72 bytes.
2024-06-07 15:42:38 +02:00
Jamie Mansfield
ab6b687d4c LibWeb: Implement "Set request’s referrer policy on redirect" AO 2024-06-07 09:54:19 +02:00
Jamie Mansfield
5a40a00d9e LibWeb/ReferrerPolicy: Add spec link for strip URL AO 2024-06-07 09:54:19 +02:00
Jamie Mansfield
8542a8b458 LibWeb/Fetch: Update "HTTP-redirect fetch" algorithm to latest spec
The spec and implementation's comments had diverged a little, this
brings them in line :)
2024-06-07 09:54:19 +02:00
Jamie Mansfield
8f2cb6755b LibWeb: Implement HTMLAreaElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
64eadab181 LibWeb: Implement HTMLIFrameElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
1aa58b6d8c LibWeb: Implement HTMLImageElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
f82c727071 LibWeb: Implement HTMLLinkElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
469cbe78de LibWeb: Use Reflect for HTMLAnchorElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
53d7aa53a2 LibWeb: Use Enumerated for HTMLScriptElement.referrerPolicy 2024-06-07 09:54:19 +02:00
Jamie Mansfield
7ce35b75aa LibWeb: Implement should block mixed content response to request 2024-06-07 09:50:30 +02:00
Jamie Mansfield
2159377296 LibWeb: Upgrade mixed requests to potentially trustworthy URLs
(if appropriate)
2024-06-07 09:50:30 +02:00
Jamie Mansfield
8f0d035145 LibWeb: Implement should block mixed content request 2024-06-07 09:50:30 +02:00
Andrew Kaster
d90a9ab70c LibWeb: Add Web::UIEvents::KeyCode and KeyModifier enums, drop Kernel
This was the last Kernel header we had. Move the definitions we need
into a UIEvents header similar to MouseButton.
2024-06-07 09:44:41 +02:00
Enver Balalic
862fc91b2c LibWeb: Implement HTMLImageElement::decode with a few FIXMEs
Implements enough of HTMLImageElement::decode for it to not break
websites and actually load an image :)
2024-06-06 08:20:02 +02:00
Andrew Kaster
7b67fa706f DOM: Check for navigable destruction in declarative refresh timer
If the Document's navigable has been destroyed since we started this
timer, or it's no longer the active document of its navigable, we
shouldn't navigate to it.
2024-06-06 08:13:34 +02:00
Tim Ledbetter
c79041344d LibWeb: Ensure anchor node is not null when extending selection
Previously, clicking while holding shift without having previously made
any text selection would cause a crash.
2024-06-05 13:57:01 -04:00
Tim Ledbetter
f721230456 LibWeb: Extend text selection when left clicking and holding shift 2024-06-05 11:51:41 -04:00
Andreas Kling
f42c18bc4c LibGfx: Make Painter::target() return a Bitmap&
Painter always has a target bitmap, so let's return a reference.
2024-06-05 15:37:05 +02:00
Andreas Kling
fe4cc32380 Everywhere: Include <LibGfx/Painter.h> in fewer places
Touching Painter.h now rebuilds ~40 files instead of ~300.
2024-06-05 15:37:05 +02:00
Andreas Kling
0e47e5e265 LibGfx: Move Gfx::Painter::LineStyle => Gfx::LineStyle 2024-06-05 15:37:05 +02:00
Andreas Kling
57906a4e1b LibGfx: Move Gfx::Painter::WindingRule => Gfx::WindingRule 2024-06-05 15:37:05 +02:00
Andreas Kling
254d040ff4 LibGfx: Move Gfx::Painter::ScalingMode => Gfx::ScalingMode
This will allow users to avoid including Painter.h
2024-06-05 15:37:05 +02:00
Andreas Kling
6a96920dbc LibGfx: Remove Bitmap and Painter "scale" concept
We don't need intrinsic scale factors for Gfx::Bitmap in Ladybird,
as everything flows through the CSS / device pixel ratio mechanism.

This patch also removes various unused functions instead of adapting
them to the change.
2024-06-05 15:37:05 +02:00
Aliaksandr Kalenik
881e970846 LibWeb: Implement scrollbars dragging 2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
94eacf6da7 LibWeb: Remove did_request_scroll_to IPC call
No longer used after moving scrollbar painting into WebContent.
2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
cc3d95a356 LibWeb: Remove did_request_scroll IPC call
No longer used after moving scrollbar painting into WebContent.
2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
5285e22f2a LibWeb+WebContent: Move scrollbar painting into WebContent
The main intention of this change is to have a consistent look and
behavior across all scrollbars, including elements with
`overflow: scroll` and `overflow: auto`, iframes, and a page.

Before:
- Page's scrollbar is painted by Browser (Qt/AppKit) using the
  corresponding UI framework style,
- Both WebContent and Browser know the scroll position offset.
- WebContent uses did_request_scroll_to() IPC call to send updates.
- Browser uses set_viewport_rect() to send updates.

After:
- Page's scrollbar is painted on WebContent side using the same style as
  currently used for elements with `overflow: scroll` and
  `overflow: auto`. A nice side effects: scrollbars are now painted for
  iframes, and page's scrollbar respects scrollbar-width CSS property.
- Only WebContent knows scroll position offset.
- did_request_scroll_to() is no longer used.
- set_viewport_rect() is changed to set_viewport_size().
2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
eb909118bf LibWeb: Propagate scrollbar-width property from root element to viewport 2024-06-05 07:03:42 +02:00
Aliaksandr Kalenik
50920b0595 LibWeb: Scroll into viewport from a task in set_focused_element()
This is a hack needed to preserve current behaviour after making set
viewport_rect() being not async in upcoming changes.

For example both handle_mousedown and handle_mouseup should use the same
viewport scroll offset even though handle_mousedown runs focusing steps
that might cause scrolling to focused element:
- handle_mousedown({ 0, 0 })
  - run_focusing_steps()
  - set_focused_element()
  - scroll_into_viewport() changes viewport scroll offset
- handle_mouseup({ 0, 0 })
2024-06-05 07:03:42 +02:00
Jamie Mansfield
8e062a52a3 LibWeb: Move NetworkPartitionKey into a header
This is used elsewhere, such as the HTMLLinkElement.
2024-06-05 05:42:47 +01:00
Jamie Mansfield
2ffda00347 LibWeb: Implement HTMLImageElement.crossOrigin 2024-06-05 05:42:47 +01:00
Jamie Mansfield
d7d60268ec LibWeb: Implement HTMLLinkElement.crossOrigin 2024-06-05 05:42:47 +01:00
Jamie Mansfield
735859bc10 LibWeb: Implement HTMLLinkElement.fetchPriority 2024-06-05 05:42:47 +01:00