Commit graph

63415 commits

Author SHA1 Message Date
Timothy Flynn
7c6bb5bd77 LibJS: Update spec link to the hashbang comment syntax
The proposal reached stage 4 and was merged into the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/2006dea

(cherry picked from commit 9f1517492cc85c5f12cb52436dc72ec21e594b7a)
2024-11-08 07:44:45 -05:00
Timothy Flynn
74186d8135 LibJS: Mark a call to DetachArrayBuffer as infallible
Noticed while looking at the merged ArrayBuffer transfer proposal.

(cherry picked from commit caf1606c9f1b76a9e3a67f381e4d364d0ae14a74)
2024-11-08 07:44:45 -05:00
Timothy Flynn
259a321d66 LibJS: Update spec steps/links for the ArrayBuffer transfer proposal
The proposal reached stage 4 and was merged into the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/44bb0e0

(cherry picked from commit bf3e7d3ac43a16a8183b03c299b88702f493af82)
2024-11-08 07:44:45 -05:00
Timothy Flynn
335b527f19 LibWeb+LibWebView: Add a button to the Inspector to export its contents
When working on the Inspector's HTML, it's often kind of tricky to debug
when an element is styled / positioned incorrectly. We don't have a way
to inspect the Inspector itself.

This adds a button to the Inspector to export its HTML/CSS/JS contents
to the downloads directory. This allows for more easily testing changes,
especially by opening the exported HTML in another browser's dev tools.

We will ultimately likely remove this button (or make it hidden) by the
time we are production-ready. But it's quite useful for now.

(cherry picked from commit 3ec5c1941f25041c6bf073f2940f6035e084a4e2)
2024-11-08 07:44:45 -05:00
Timothy Flynn
78f2209723 LibWebView: De-duplicate some Inspector CSS rule blocks
After the refactor to use CSS variables for dark-mode colors in commit
ae25146b898ce8900d04c4911f1f0835681aac4e, we had duplicated blocks for
some CSS rules. This patch just unites them into one block.

(cherry picked from commit cde7c91c54574a97ec73a441669cd6dfd07e6f8f)
2024-11-08 07:44:45 -05:00
Tobias Christiansen
61848ff6c2 Inspector: Add "Fonts" tab
This adds another tab to the bottom tabs providing information
regarding the fonts computed for the currently selected DOM node.

(cherry picked from commit c3e69f2fc6ced035f59f3c78f54556a372d2fd14)
2024-11-08 07:44:45 -05:00
Tobias Christiansen
ce0b0c43ed LibWebView + WebContent: Add fonts to be transferable to inspector
This patch adds all the needed plumbing to transfer information
regarding fonts of the selected DOM node to the inspector.

(cherry picked from commit 5621f34062f744086b9dc378212af35efe597c74)
2024-11-08 07:44:45 -05:00
Tobias Christiansen
7d51732a71 LibGfx: Add for_each_font_entry to FontCascadeList
This way there is a way to iterate over all the fonts in the object.

(cherry picked from commit 049a26178261145903be090736b5ff66b1ff8eae)
2024-11-08 07:44:45 -05:00
Tobias Christiansen
d7993d08dc Inspector: Clean up theming CSS with variables
The media queries for the different themes were all over the place,
they got consolidated in one place specifying all the colors. :^)

(cherry picked from commit ae25146b898ce8900d04c4911f1f0835681aac4e)
2024-11-08 07:44:45 -05:00
Jamie Mansfield
77847cbb0e LibWeb/SVG: Add missing SVGGElement IDL file
(cherry picked from commit ea61e189eb31b185bfd7ccf381258d5ab5023072)
2024-11-07 23:07:20 -05:00
Jamie Mansfield
df05fe55c7 LibWeb/SVG: Implement <metadata> element
(cherry picked from commit e2f599ebee67ee1bf1509685b98abcef7a5d4ca9)
2024-11-07 23:07:20 -05:00
Jamie Mansfield
d1e17efefe LibWeb/HTML: MathML's <ms> is a special tag
This is an omission I noticed while browsing some code :^)

(cherry picked from commit b3fa8f0ce2b8594c7439bf3c9408456d3b9c5dc6)
2024-11-07 23:07:20 -05:00
Shannon Booth
fd427b4efe LibWeb: Handle cases with <template> on the HTML parsing stack
This appears to have been a bug in the spec which was later corrected -
so to fix the crash we can simply remove this assertion.

Fixes: #868
(cherry picked from commit 07940a89cad5ecfa21c2d1d8e055941bdb097ef9)
2024-11-07 23:07:20 -05:00
Colin Reeder
f86e2d61af LibWeb: Add support for SVG display attribute
(cherry picked from commit 97d5cf4eefaf3ef7dd68f68701435c05da1cffb1)
2024-11-07 23:07:20 -05:00
Bastiaan van der Plaat
3f1147bb7e LibWeb: Add autocomplete property
(cherry picked from commit 517b1a26905667a1dca5ddb61958e0197f9b158a)
2024-11-07 23:07:20 -05:00
Colin Reeder
145c218c8d LibWeb: Use base URL for link loading
(cherry picked from commit c6975a16806a6e7d203a178bd5821941f8a9e4fa)
2024-11-07 23:07:20 -05:00
Jelle Raaijmakers
154af3da1c LibWeb: Implement HTMLMediaElement.preload attribute
This implements the `preload` reflected attribute. No actual preloading
is going on yet.

(cherry picked from commit fe933b2057eee8eb65d6e43a97b934bbe85d03bb)
2024-11-07 23:07:20 -05:00
Gasim Gasimzada
7d4fd29673 LibJS: Set empty prototype for console object
(cherry picked from commit 4a42c97f4d369e24c1cba9b554fdb243b6c8692b)
2024-11-07 23:07:20 -05:00
bbb651
3e710465ca HTML: BrowsingContext: Remove m_parent and fix is_ancestor_of
`BrowsingContext::m_parent` has been removed from the spec,
and previously `m_parent` was always null.

`BrowsingContext::is_top_level` was already always returning
true before because of that, and the updated spec algorithm
causes assertions to fail.

This fixes the following example:
```html
<a href="about:blank" target="test">a
<iframe name="test">
```
clicking the link twice no longer causes it to open in a new tab.

(cherry picked from commit e6a668ad913f0755840954c188c255fc5fc66606)
2024-11-07 22:42:20 -05:00
bbb651
bb691c5537 HTML: Update coop-check-access-report to match spec
(cherry picked from commit f82e3345f2244e6150102fd0c99fb49cdf3af224)
2024-11-07 22:42:20 -05:00
Jamie Mansfield
79dc22661b LibWeb/WebGL: Stub missing includes for WebGLRenderingContext
(cherry picked from commit bb95a48035ef35f9d040fb63ff991f17ed2aafc7)
2024-11-07 22:42:20 -05:00
Jamie Mansfield
334d2e0764 LibWeb/Canvas: Stub missing includes for CanvasRenderingContext2D
(cherry picked from commit b0fd4aff1a9a5d1f02f2a36b63812a63728eceea)
2024-11-07 22:42:20 -05:00
Aliaksandr Kalenik
a709098576 LibWeb: Remove set_needs_display() from PageClient::ready_to_paint()
There is no need to force repaint when client is ready for the next
frame. We simply need to make sure HTML event loop processing is
scheduled.

(cherry picked from commit 3edd22143d7ed96ca979604828ec9059d8700fc4)
2024-11-07 22:42:20 -05:00
Aliaksandr Kalenik
8e3b7e3680 LibWeb: Skip documents of decoded SVGs while processing HTML event loop
None of HTML event loop processing steps are relevant for decoded SVGs,
so we can simply skip them while collecting documents for processing.

(cherry picked from commit c87214d79cf834ee9b7b4da65e902e5233c0a5cc)
2024-11-07 22:42:20 -05:00
Tim Ledbetter
30e505a630 LibWeb: Match attribute selectors case insensitively in XML documents
The values of attribute selectors are now compared case insensitively
by default if the attribute's document is not a HTML document, or the
element is not in the HTML namespace.

(cherry picked from commit 00f03f3e900d6f5c0196db9a9d7eb352ec516b44)
2024-11-07 22:42:20 -05:00
Tim Ledbetter
1ca34ff710 LibWeb: Add the scope attribute
(cherry picked from commit c4225187927f12d444612a8bc4e5d0f6bd21aa83)
2024-11-07 22:42:20 -05:00
Tim Ledbetter
8537cd76f3 LibWeb: Limit HTMLProgressElement.max to positive values
Previously, 0 was returned if `HTMLProgressElement.max` was set to a
negative value.

(cherry picked from commit 353e3e75dcff05f05a65cfc3c70d1cff8db5d50c)
2024-11-07 22:42:20 -05:00
sideshowbarker
7959c42f78 LibWeb/Fetch: Set HTTP status code on cached responses
This change causes HTTP status codes to be set on cached HTTP responses.

Otherwise, without this change, no status codes at all are set on cached
HTTP responses — which causes all cached responses to default to being
loaded/served with a 200 status code. And as a result of that, if the
cached response is from a 30x redirect, then without this change, when
that cached 30x response is loaded, we don’t follow the redirect —
because we see a 200 status, rather than the expected/original 30x.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/863

Note that this change also reverts the temporary workaround added in
https://github.com/LadybirdBrowser/ladybird/commit/f735c464d3f
(https://github.com/LadybirdBrowser/ladybird/pull/899).

(cherry picked from commit 23da1752b50568f2c49b1c63c2777ddffddaf6f5)
2024-11-07 22:17:03 -05:00
Jelle Raaijmakers
6264698077 LibWeb: Check presence of WWW-Authenticate header in fetch response
If a HTTP 401 response we get does not contain a `WWW-Authenticate`
header, we should not trigger the logic to ask the user for credentials
and retry the request.

This part is hinted at in a TODO / 'Needs testing' remark in the spec
but needs to be fleshed out. Raised an upstream issue to do so:

  https://github.com/whatwg/fetch/issues/1766

This fixes login forms triggering an infinite fetch loop when providing
incorrect credentials.

Co-Authored-By: Victor Tran <vicr12345@gmail.com>
(cherry picked from commit e7984a77116d47fde150f81f6e18cae6aaa147ad)
2024-11-07 22:17:03 -05:00
Jamie Mansfield
01919367d8 LibWeb: Use keepalive maximum size in NavigatorBeacon
This is defined as 64 KiB in the fetch spec.

See:
 - https://wpt.live/beacon/beacon-basic.https.window.html
(cherry picked from commit 17c1e99ce4b3a05d5f71e15513b2f1e4251047e2)
2024-11-07 22:17:03 -05:00
Jamie Mansfield
a10ae0a1e4 LibWeb/Fetch: Add a constant for the keepalive maximum size
(cherry picked from commit 35047de1d8ce57bdab12d47044abff36145fca30)
2024-11-07 22:17:03 -05:00
Jamie Mansfield
d51f03809b LibWeb/Fetch: Correct check for X-Method-Override
Previously the code was checking for X-Method.

See:
 - http://wpt.live/fetch/api/basic/request-forbidden-headers.any.html
(cherry picked from commit 5151f94d393ca6e30a2ca7a34665e2cf6e1f5af9)
2024-11-07 22:17:03 -05:00
Jamie Mansfield
c896b8bf3d LibWeb/Fetch: Add Set-Cookie as a forbidden header name
See:
 - https://github.com/whatwg/fetch/commit/50d77e6
 - http://wpt.live/fetch/api/request/request-headers.any.html
(cherry picked from commit f88e7bc5ee5577c260b1ea263a02b2d5f68e532b)
2024-11-07 22:17:03 -05:00
sideshowbarker
7b2a1208b0 LibWeb/Fetch: Don’t cache redirects
This change disables caching for 301, 302, 303, 307, and 308 responses.
This is just for now, ad-hoc — not adhering to any particular spec.
Fixes https://github.com/LadybirdBrowser/ladybird/issues/863

(cherry picked from commit f735c464d3fe02ac43a1fa46c82ae9a3bb5de8b1)
2024-11-07 22:17:03 -05:00
Timothy Flynn
67166d4642 LibWebView: Insert line numbers before each line in about:srcdoc
The behavior chosen here (fixed-width counters, alignment, etc.) matches
Firefox.

(cherry picked from commit c1b0e180ba64d2ea7e815e2c2e93087ae9a26500)
2024-11-07 22:15:54 -05:00
simonkrauter
3a44f30734 LibWebView: Remove early exit in InspectorClient::inspect()
This early exit prevents to show the current DOM in the inspector, when
the inspector was already opened.

Fixes #990

(cherry picked from commit dd5550dde39f177d44cd776ebca033ea99ce5749)
2024-11-07 21:52:13 -05:00
Alec Murphy
57317484b1 LibWeb: Skip trim trailing whitespace if user is typing
This PR stops the cursor from disappearing while typing trailing spaces
in a text input box.

(cherry picked from commit b3a67ee088d5bd2fb8d76d3e6f9adeff2cb8a6b6)
2024-11-07 21:52:13 -05:00
Gasim Gasimzada
186c66bab9 LibJS: Treat passing undefined as no argument for console labels
- Affects time, timeLog, timeEnd, count, and countReset functions

(cherry picked from commit 8545756d17799aaf3dec9b3b46caa3b9b74c0d9f)
2024-11-07 21:52:13 -05:00
Shannon Booth
51b710bce1 LibWeb: Actually perform "update the href steps"
We completely missed this step, which made setters not actually do
anything!

Fixes 336 test failures on:

https://wpt.live/url/url-setters-a-area.window.html
(cherry picked from commit deff8df2c79af718f08f16bc47f5a22ac6add553)
2024-11-07 21:52:13 -05:00
Aliaksandr Kalenik
db01e39913 LibWeb: Call set_needs_display() if navigable is scrolled or resized
`m_needs_repaint = true` is not enough because it doesn't schedule
repaint of a parent navigable.

Fixes the bug when an iframe is not repainted after scrolling.

(cherry picked from commit 40742d95e66c98857fa43ea1c6632dbe75ecb3b3)
2024-11-07 21:52:13 -05:00
circl
e744abc3ce LibWeb+UI: Add tooltip overriding and use it for <video> tags
This call is used to inform the chrome that it should display a tooltip
now and avoid any hovering timers. This is used by <video> tags to
display the volume percentage when it is changed.

(cherry picked from commit ceb9c3b79746e5499dce781e1fc81a9107c86f84;
amended to add a FIXME: to OutOfProcessWebView for these new hooks)
2024-11-07 20:52:11 -05:00
circl
206642afb1 LibWeb+UI/Qt: Display 'title' tooltips only when the mouse stops moving
Now instead of sending the position in which the user entered the
tooltip area, send just the text, and let the chrome figure out how to
display it.

In the case of Qt, wait for 600 milliseconds of no mouse movement, then
display it under the mouse cursor.

(cherry picked from commit 0f7623dd8322f0fd5ef6ee0e27e1295e11f276e6;
amended to update OutOfProcessWebView.cpp for on_enter_tooltip_area
API change)
2024-11-07 20:52:11 -05:00
sideshowbarker
ed9843b592 LibWeb: Fix handling of find-in-page with pseudo-element content
This change makes find-in-page ignore content that’s been added to the
document using CSS ::after or ::before pseudo-elements. Ignoring such
pseudo-element content for find-in-page matches the behavior in Chrome
and Safari (though not in Firefox).

Otherwise, without this change, find-in-page doesn’t ignore the
pseudo-element content, and we instead crash in
DOM::Range::common_ancestor_container after hitting an assert, due to
the start container and end container for the matched range not having a
common ancestor.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/514

(cherry picked from commit 0a55e36403416dbf2ec3c3ce4ede9d241eed20ef)
2024-11-07 20:29:07 -05:00
Daniel La Rocque
7af4d382da LibJS: Improve deep equals algorithm in tests
The `deepEquals` algorithm used for testing was naive, and incorrectly
evaluated equality of objects in some cases. The new algorithm considers
that the second object could have more keys than the first, and compares
the prototypes of the objects.

(cherry picked from commit cb629e18bbcb8f5a6c6fd535e290a34da7a5cfb6)
2024-11-07 20:29:07 -05:00
Nico Weber
6f9b4b8129 LibWeb: Implement canvas setLineDash(), getLineDash(), lineDashOffset
Also add coverage for that to canvas-stroke-styles.html.
2024-11-07 19:06:56 -05:00
Nico Weber
e9d2b7ab9e Meta: Add Sönke Holz to the maintainers list :^) 2024-11-07 22:15:27 +01:00
Sönke Holz
7c710805ec Kernel: VERIFY that the SafeMem sections are not empty on all arches 2024-11-07 09:32:54 -05:00
Sönke Holz
9e9148dead Kernel/aarch64: Add .{ro,unmap}_after_init sections to linker script 2024-11-07 09:32:54 -05:00
Sönke Holz
859fceeb07 Kernel/aarch64: Correctly set {start,end}_of_kernel_{data,text}
MemoryManager::protect_kernel_image uses these symbols.
2024-11-07 09:32:54 -05:00
Sönke Holz
93cc7d213f Kernel/x86: Fix indentation in linker script 2024-11-07 09:32:54 -05:00