Commit Graph

60484 Commits

Author SHA1 Message Date
Timothy Flynn
6eb2052d40 LibWebView: Remove now-unused history object 2024-04-14 18:53:58 -07:00
Timothy Flynn
e5c5dcca6a Ladybird/AppKit: Use LibWeb's history state for history navigation 2024-04-14 18:53:58 -07:00
Timothy Flynn
7cf8eabb82 Browser: Use LibWeb's history state for history navigation 2024-04-14 18:53:58 -07:00
Timothy Flynn
8e2b1a8a1d LibWebView: Update the stored URL when WebContent's URL changes 2024-04-14 18:53:58 -07:00
Timothy Flynn
7c54b15d6d Ladybird/Qt: Remove unused history-related includes 2024-04-14 18:53:58 -07:00
Andreas Kling
7f0920b0e9 LibWeb: Implement HTMLScriptElement.async 2024-04-14 22:08:22 +02:00
Andreas Kling
4cc972a8ae LibWeb: Stub out HTMLElement.outerText 2024-04-14 22:08:22 +02:00
Andreas Kling
e610346fab LibWeb: Minimally implement HTMLElement.inert and HTMLElement.accessKey
This commit adds attribute reflection but nothing else.
2024-04-14 22:08:22 +02:00
Andreas Kling
afea8ccd43 LibWeb: Stub out HTMLElement.accessKeyLabel 2024-04-14 22:08:22 +02:00
Andreas Kling
0b28a310b1 LibWeb: Stub out Element.scrollBy() 2024-04-14 22:08:22 +02:00
Andreas Kling
82f8b64017 LibWeb: Stub out Element.currentCSSZoom 2024-04-14 22:08:22 +02:00
Andreas Kling
20bdda7f02 LibWeb: Implement Element.removeAttributeNode() 2024-04-14 22:08:22 +02:00
Andreas Kling
f13bda60ba LibWeb: Tidy up Element.idl
- Reorder all the entries so their order match the corresponding specs.
- Add spec links for partial interfaces and mixins.
- Add FIXMEs for unimplemented APIs.
2024-04-14 22:08:22 +02:00
Andreas Kling
cf315338ec LibWeb: Don't draw image alt text frames with "rough" rect
This was an accident in 3645b676fb
2024-04-14 18:05:48 +02:00
Andreas Kling
217cb01708 LibGfx: Clip out-of-bounds pixel accesses in Painter::draw_rect() 2024-04-14 18:05:48 +02:00
Kenneth Myhra
d5c7959c45 LibWeb: Let queue_a_microtask() take a JS::HeapFunction
This changes the signature of queue_a_microtask() from AK:Function to
JS::HeapFunction to be more clear to the user of the functions that this
is what is used internally.
2024-04-14 17:22:26 +02:00
Nico Weber
76ba374aef LibPDF: Move CFF to use AK::Error instead of PDF::Error
Similar to the previous commit. No real behavior change.
2024-04-14 17:22:00 +02:00
Nico Weber
102ac331c6 LibPDF: Move Type1FontProgram to use AK::Error instead of PDF::Error
Makes some of the errors a bit less descriptive. But this is pretty
stable by now and the errors fire basically never, so that seems ok.

Needing the explicit `AK::` prefix is a bit awkward, but that'll go
away once this class moves out of LibPDF.

Move error() into the two subclasses. I'll remove it from CFF in
a follow-up.

No real behavior change.
2024-04-14 17:22:00 +02:00
Tim Ledbetter
c6f070d29e LibWeb/Fetch: Don't crash when a fetch request times out
Previously, calling fetch with a signal object provided by
`AbortSignal.timeout()` would cause a crash when the signal timed out.

We now push a `TemporaryExecutionContext` to the stack when we invoke
the signal's abort steps, as an execution context is required when
calling native functions.
2024-04-14 13:36:25 +02:00
Aliaksandr Kalenik
78af6ca971 Ladybird/Qt: Add icon for "Dump Session History Tree" action 2024-04-14 02:42:53 -07:00
Aliaksandr Kalenik
882904b4bf Ladybird/Qt: Stop using history to drive navigation
Before this change we had to keep session history on browser side to
calculate a url for back/forward/reload action.
Now, with a mature enough implementation of navigation algorithms from
the specification, there is no need to use
history on the browser side to calculate navigation URLs because:
- Traversable navigable owns session history that is aware of all
  navigations, including those initiated by History API and Navigation
  API
- TraversableNavigable::traverse_the_history_by_delta() uses
  traversable's history to calculate the next URL based on delta, so
  there is no need for UI to keep sesion history.

In the future, we will likely want to add a way to pull session history
from WebContent to make it browsable from the UI.
2024-04-14 02:42:53 -07:00
Aliaksandr Kalenik
c96fc902ff LibWeb+LibWebView+WebContent: Add did_change_url() IPC call 2024-04-14 02:42:53 -07:00
Aliaksandr Kalenik
a8cf1aca7c LibWeb: Rename did_update_url() to did_history_api_push_or_replace()
The previous name was extremely misleading, because the call is used for
pushing or replacing new session history entry on chrome side instead of
only changing URL.
2024-04-14 02:42:53 -07:00
Aliaksandr Kalenik
461184d964 LibWeb+LibWebView+WebContent: Add did_update_navigation_buttons_state()
It is going to be used to communicate whether it is possible to navigate
back or forward after session history stored on browser side will no
longer be used to driver navigation.
2024-04-14 02:42:53 -07:00
Aliaksandr Kalenik
0c839f0421 LibWeb+LibWebView+WebContent: Add traverse_history_by_delta() IPC call 2024-04-14 02:42:53 -07:00
Aliaksandr Kalenik
a71b2e5fd9 Ladybird/Qt: Use reload() IPC call for reload button
Instead of treating reloading as a regular navigation by using
load_url(), now we invoke a navigable reloading algorithm implemented
from the spec.

Now both reloading triggered from UI and location.reload() will use the
same code path.
2024-04-14 02:42:53 -07:00
Aliaksandr Kalenik
bfef08177e LibWeb+LibWebView+WebContent: Add an IPC call for Navigable::reload() 2024-04-14 02:42:53 -07:00
Tim Ledbetter
88f3145f8a LibWeb: Add methods to Window that must do nothing
This change adds the `captureEvents()` and `releaseEvents()` methods to
the window object. These methods are obsolete, but are still included
in the HTML specification, which says they must do nothing.
2024-04-14 10:45:43 +02:00
Tim Ledbetter
0564e06f10 LibWeb: Add methods to Document that must do nothing
This change adds the `clear()`, `captureEvents()` and `releaseEvents()`
methods to the document object. These methods are obsolete, but are
still included in the HTML specification, which says they must do
nothing.
2024-04-14 10:45:43 +02:00
Nico Weber
2b905cc482 LibPDF: Move rest of CFF from Reader to Stream
parse_index_data() wants to take ReadonlyByte views of the stream
data, so we need FixedMemoryStream::read_in_place(size_t). All
other remaining code indirectly calls parse_index_data(), so that
all operates on FixedMemoryStreams too.

No behavior change.
2024-04-14 10:45:11 +02:00
Nico Weber
cc3d4b6adb LibPDF: Convert CFF::parse_dict & co to Stream
No behavior change.
2024-04-14 10:45:11 +02:00
Nico Weber
1f7924e14c LibPDF: Convert CFF::parse_charset to Stream
No behavior change.
2024-04-14 10:45:11 +02:00
Nico Weber
4995dfe8f1 LibPDF: Convert CFF::parse_fdselect to Stream
No behavior change.
2024-04-14 10:45:11 +02:00
Nico Weber
16c22885eb LibPDF: Convert CFF::parse_encoding to Stream
No behavior change.
2024-04-14 10:45:11 +02:00
Arthur Grillo
3645b676fb LibWeb: Remove RecordingPainter::paint_frame()
PaintFrame is not primitive painting command, we inherited from OS, that
is hard to replicate in GPU-painter or alternative CPU-painter API. We
should remove it as a part of refactoring towards simplifying recording
painter commands set.

Fixes: #23796
2024-04-13 20:25:48 -07:00
Nico Weber
3b89a187ac Meta/gn: Port #23933 2024-04-13 19:30:53 -06:00
Aliaksandr Kalenik
91377f3ab9 LibWeb: Fix always hanging Navigable::reload()
See spec issue https://github.com/whatwg/html/issues/9869

Previous attempt on fixing reload had to be reverted because it broke
Soundcloud and GitHub, but this change does not seem to introduce new
crashes.
2024-04-13 09:19:00 -07:00
Andreas Kling
f7e57881ad LibWeb: Don't limit available space during early height for inline-flex
There was no need to set an available height constraint when doing early
height calculation for inline-flex boxes. It created a situation where
the flex containers could wrongly get zero height early, and then
resolve percentages against zero instead of the real intrinsic size.

Fixes #23942
2024-04-13 14:10:10 +02:00
Aliaksandr Kalenik
69d6abc60f LibWeb: Add test when networking task is interrupted by networking task
It does fetching and uses parseFromString() DOMParser API in the fetch
callback. Following steps end up hanging before reverting
664611bae4:
1. Do fetching initiated by fetch() js call.
2. Invoke fetch callback on networking task source
3. Fetch callback does parseFromString()
4. parseFromString() invokes HTMLParser
5. HTMLLinkElement inserted into new document initiates fetching
6. Fetching callback cannot run because networking source was blocked on
   step 2.
7. HTMLParser::the_end() spins waiting for HTMLLinkElement to unblock
   load event, which will never happen because fetching callback cannot
   proceed.
2024-04-13 12:07:33 +02:00
Aliaksandr Kalenik
9d69563da4 LibWeb: Revert blocking of task by source in EventLoop
This reverts commit 664611bae4.

It seems like the HTML spec has been misinterpreted and this text:
"... Note that in this setup, the processing model still enforces that
the user agent would never process events from any one task source out
of order."

does not mean we can't interrupt execution of task by a task with the
same task source. It just says they should be processed in the order
they were added.

Fixes hanging while navigating from PR list to PR page on GitHub.
2024-04-13 12:07:33 +02:00
Shannon Booth
ccd16c847e LibWeb: Set timestamp for DOM Events 2024-04-12 09:08:46 +02:00
Shannon Booth
51a52a867c LibWeb: Use "current high resolution time" AO where relevant
And updating some spec comments to latest spec where it is not relevant.
2024-04-12 09:08:46 +02:00
Shannon Booth
33bd6cfc2a LibWeb: Implement "current high resolution time" AO 2024-04-12 09:08:46 +02:00
Shannon Booth
144e53a209 LibWeb: Stub out Navigator.maxTouchPoints 2024-04-12 09:08:46 +02:00
Timothy Flynn
3ab5ecb671 Ladybird/AppKit: Implement a simple TaskManager window
Unlike the Inspector window, this is owned by the ApplicationDelegate as
there should be only a single task manager for the entire application.
2024-04-12 09:08:16 +02:00
Andreas Kling
40a914ce1a LibWeb: Use static position for abspos box axes with auto insets
When both insets in a given axis are auto, we should use the static
position for absolutely positioned elements.

By doing this correctly, we exposed a bunch of other small bugs which
had to be fixed to compensate for new test failures. Those fixes are
included here as well:
- Don't apply margins twice.
- Compute the static position containing block chain correctly.

This makes https://brave.com/ look much better. :^)
2024-04-12 09:08:07 +02:00
Aliaksandr Kalenik
ee3dd7977d LibWeb: Add popstate event support
It is going to be useful in writing tests for History API.
2024-04-11 21:25:06 +02:00
Timothy Flynn
0ffc338406 LibWeb: Support dimension attributes on HTMLVideoElement 2024-04-11 18:41:57 +02:00
Timothy Flynn
4b1abcf61d LibWeb: Generalize support for dimension attributes
Rather than each element which supports dimension attributes needing to
implement parsing the attributes and setting the appropriate style, we
can generalize this functionality. This will also make each element more
closely resemble the spec text, as we will be effectively declaring, for
example, "The img element supports dimension attributes" in code.
2024-04-11 18:41:57 +02:00
Timothy Flynn
058dd225dd Meta: Port recent changes to the GN build
f3d3454976
8fa636d8d5
2024-04-11 18:41:57 +02:00