Commit Graph

62272 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
7181c3f2ea Everywhere: Limit layout text fragments to use one font for all glyphs
The ChunkIterator now limits a chunk to using only one font (before, it
was possible to have a chunk with >1 font, when `unicode-range` CSS
property is used).

This change allows us to reduce some complexity in the text shaping and
painting code and makes us compatible with the APIs in Skia and
HarfBuzz.
2024-06-30 19:23:24 +02:00
Tim Ledbetter
b95c05b611 UI/Qt: Ignore tab bar middle clicks if the user didn't click on a tab
This avoids a segfault that would previously occur when middle clicking
to close a tab if only 1 tab was open.
2024-06-30 13:09:39 +02:00
Aliaksandr Kalenik
d5926a3231 LibGfx+LibWeb: Rename Gfx::VectorFont to Gfx::Typeface
Typeface is a more widely used name for the data represented by
class previously named VectorFont.

Now:
- Typeface represents decoded font that is not ready for rendering
- ScaledFont represents the combination of typeface and size for
  rendering
2024-06-30 13:09:23 +02:00
Aliaksandr Kalenik
e2726ce8e4 LibGfx+LibWeb: Remove Gfx::Typeface
...and use VectorFont directly in FontDatabase.
2024-06-30 13:09:23 +02:00
Tim Ledbetter
bdaa7f0e8e LibWeb: Implement the HTMLTrackElement.kind attribute
This reflects the HTML `kind` attribute.
2024-06-30 13:08:42 +02:00
Tim Schumacher
0c4f257021 Meta: Remove myself from CODEOWNERS
I don't expect Ladybird to be the upstream of any of these, so it's not
much use to be notified on any unrelated changes.
2024-06-29 20:26:20 -06:00
luozhiya
8c09b9a2e9 Meta: Handle LAGOM_EXECUTABLE in gdb command properly 2024-06-28 22:21:54 -06:00
Aliaksandr Kalenik
4cdc5d2ce9 LibWeb: Add text shadows support in Skia painter 2024-06-28 20:53:39 +02:00
Aliaksandr Kalenik
b27cf1be49 LibWeb: Remove fragment_baseline from PaintTextShadow
Translate text_rect instead, so the struct doesn't have to carry
additional member.
2024-06-28 20:53:39 +02:00
Aliaksandr Kalenik
ebc282207b LibWeb: Save unscaled glyph run in PaintTextShadow command
Implements the same optimization we already have for DrawGlyphRun by
saving unscaled glyph run and scale factor in a painting command, which
allows to avoid copying of glyphs vector to apply scaling during
recording.
2024-06-28 20:53:39 +02:00
Timothy Flynn
6369737676 LibWeb: Ensure SkiaSurface is fully defined before it is allocated
LLVM 18 on macOS correctly errs when we try to allocate an incomplete
SkiaSurface object.
2024-06-28 12:59:10 -04:00
Timothy Flynn
d9470d6a93 Meta: Add a debug build CMake preset
Since the default mode now only builds release vcpkg libraries, having
an easy-to-create debug build will be convenient.
2024-06-28 12:10:59 -04:00
Timothy Flynn
1c2aef9255 Meta: Only build vcpkg dependencies in release mode by default
We currently build debug and release versions of vcpkg dependencies. We
will most commonly only need the release version, so let's default to
that to approximately halve our dependency build time.
2024-06-28 12:10:59 -04:00
Andreas Kling
cf0912c700 LibIPC: Remove unused AK::Formatter for IPC::Connection 2024-06-28 17:11:24 +02:00
Andreas Kling
4fe21e6d87 LibIPC: Move stuff from Connection.h to .cpp and reduce #include count 2024-06-28 17:11:24 +02:00
Andreas Kling
6d9c4d852d LibIPC: Move more of Connection::try_parse_messages() to ConnectionBase
By moving this up to ConnectionBase, we have less custom code for each
templated subclass, and it gets a little easier to edit the code since
you don't have to rebuild as much when making changes.
2024-06-28 17:11:24 +02:00
Andreas Kling
f4d40c292b LibIPC: Remove no-longer-used DeferredInvoker abstraction 2024-06-28 17:11:24 +02:00
Andreas Kling
4db05ecf69 LibWeb: Set the correct prototype for SVGAElement instances 2024-06-28 17:10:52 +02:00
Andreas Kling
a84261ee7a Tests/LibWeb: Add test that dumps all global JS constructors 2024-06-28 17:10:52 +02:00
Aliaksandr Kalenik
79acb998e1 LibCore+LibWeb: Use Metal backend for Skia painter on macOS
If Metal context and IOSurface are available, Skia painter will use
Ganesh GPU backend on macOS, which is noticeably faster than the default
CPU backend.

Painting pipeline:
1. (WebContent) Allocate IOSurface for backing store
2. (WebContent) Allocate MTLTexture that wraps IOSurface
3. (WebContent) Paint into MTLTexture using Skia
4. (Browser) Wrap IOSurface into Gfx::Painter and use
   QPainter/CoreGraphics to blit backing store into viewport.

Things we should improve in the future:
1. Upload textures for images in advance instead of doing that before
   every repaint.
2. Teach AppKit client to read directly from IOSurface instead of
   copying.
2024-06-28 14:25:34 +02:00
Aliaksandr Kalenik
8de9516272 Ladybird: Account for backing store bitmap pitch
In the upcoming changes, Skia painter will be switched to Metal backend,
so we can no longer assume `pitch = width * 4` while reading Gfx::Bitmap
that wraps IOSurface populated by writing into MTLTexture that has
padded scanlines.
2024-06-28 14:25:34 +02:00
Aliaksandr Kalenik
c62cc915df Everywhere: Pass backing store into Navigable::paint()
...instead of Gfx::Bitmap, which makes it possible to access and
directly paint into IOSurface on macOS.
2024-06-28 14:25:34 +02:00
Nico Weber
c4e935aa97 Ladybird/AppKit: Send mouse event on middle click 2024-06-27 18:38:06 -04:00
Nico Weber
450b9ffcfd Ladybird/AppKit: Send correct mouse event on right click 2024-06-27 18:38:06 -04:00
Ali Mohammad Pur
3214f2c5bf LibCore: Handle destroyed owner when unregistering timers and notifiers
Cherry-picked from 9f4f319277
2024-06-27 14:32:48 -06:00
Tim Ledbetter
944dbfdc97 UI/Qt: Limit number of autocomplete results to 6 2024-06-27 18:24:28 +02:00
Tim Ledbetter
c36a49b61e UI/Qt: Reduce flicker when populating autocomplete
Previously, autocomplete was cleared before the results for the current
query were retrieved. The new results would then be added when the
network request completed. This resulted in a noticable flicker. The
results are now updated when the request for the current query is
completed.

There is a small behavior change in that the query itself is no longer
included in the autocomplete dropdown unless the list would otherwise
be empty.
2024-06-27 18:24:28 +02:00
Tim Ledbetter
c4d5ae28ea LibWeb: Implement a minimal version of Window.find()
This is a non-standard API that other browsers implement, which
highlights matching text in the current window.

This is just a thin wrapper around our find in page functionality, the
main motivation for adding this API is that it allows us to write tests
for our find in page implementation.
2024-06-27 10:09:39 +02:00
Tim Ledbetter
cda31615da LibWeb: Add WrapAround option to find in page
This allows `Page::find_in_page()` to optionally not return a result if
the start or end of the document has been reached.
2024-06-27 10:09:39 +02:00
Tim Ledbetter
fee7b4147c LibWeb: Ensure layout is up to date before performing find in page query 2024-06-27 10:09:39 +02:00
Tim Ledbetter
9585da37ad Tests: Skip css-keyframe-fill-forwards.html ref test
This test is currently causing intermittent CI failures.

(cherry picked from commit 24c75922d8476b5096657acb5a1b4c71454ca616)
2024-06-26 18:56:33 -06:00
Andrew Kaster
ba4e6dc52b Ladybird: Remove unnecessary RegisterWithProcessManager enum
This was only put in place because on SerenityOS, we wanted to use the
pid of the WebContent process, rather than the peer pid for the socket.

When launching with SystemServer, this got annoying. However, now that
we only have the case that the UI process spawns processes, we can
get rid of this hack. This restores the ability to see WebContent
processes' statistics in the task manager widget.
2024-06-26 16:09:33 -06:00
Andrew Kaster
e7ece774a2 ImageDecoder: Register with mach server on macOS
This allows viewing the resource usage in the task manager widget
2024-06-26 16:09:33 -06:00
Andrew Kaster
4b5541e1b7 Everywhere: Transition ImageDecoder to be single-instance, owned by UI
This is the same behavior as RequestServer, with the added benefit that
we know how to gracefully reconnect ImageDecoder to all WebContent
processes on restart.
2024-06-26 16:09:33 -06:00
Andrew Kaster
343a3a0d7e Ladybird+LibIPC: Move clearing FD_CLOEXEC helper logic to IPC::File 2024-06-26 16:09:33 -06:00
Andrew Kaster
54f66c574c LibWebView: Allow querying and iterating all extant WebContentClients
This is mostly useful when some application-level logic needs to
iterate over all child processes. A more robust Process abstraction
would make this easier.
2024-06-26 16:09:33 -06:00
Andrew Kaster
7c607a4749 WebContent: Remove stale on_webcontent_connection hook 2024-06-26 16:09:33 -06:00
circl
1f3285eb04 LibWeb: Restrict fetching file: and resource: URLs to internal pages
They are now blocked on pages which:
- Don't have an opaque origin (should be only user-initiated or about:)
- Aren't other file: pages
- Aren't other resource: pages
2024-06-26 12:15:33 -06:00
circl
d14888f31a LibWeb: Consider resource: URLs to be trustworthy and non-opaque
This makes icons once again load in the directory listings
2024-06-26 12:15:33 -06:00
Daniel La Rocque
cb629e18bb 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.
2024-06-26 12:13:08 -06:00
Tim Ledbetter
e9e195418e LibWeb: Fire a change event on mouseup of number input buttons
This matches the behavior of other browsers.
2024-06-26 10:15:07 +02:00
Tim Ledbetter
b4b947c607 LibWeb: Update number input on mousedown of number input buttons
This matches the behavior of other browsers. Previously, a click event
was used, so the value was only updated when the mouse was released.
2024-06-26 10:15:07 +02:00
Tim Ledbetter
2a980816e7 LibWeb: Fire input event on user interaction with input element buttons
An input event is now fired when the step up or step down button of an
input element of type number is clicked.

This ensures that any associated <output> element is updated when these
buttons are clicked.
2024-06-26 10:15:07 +02:00
Tim Ledbetter
a3d12e569c LibWeb: Deduplicate the firing of input events in HTMLInputElement
Input elements without a defined user-interaction behavior need to fire
an input event when the user changes the element's value in some way.
This change moves the code to do this into its own function and adds
some spec text to explain what is being done.
2024-06-26 10:15:07 +02:00
Timothy Flynn
bd73dd316d LibTimeZone: Remove LibTimeZone and TZDB data
All users have been ported to the ICU implementation.
2024-06-26 10:14:02 +02:00
Timothy Flynn
672a555f98 LibCore+LibJS+LibUnicode: Port retrieving time zone offsets to ICU
The changes to tests are due to LibTimeZone incorrectly interpreting
time stamps in the TZDB. The TZDB will list zone transitions in either
UTC or the zone's local time (which is then subject to DST offsets).
LibTimeZone did not handle the latter at all.

For example:

The following rule is in effect until November 18, 6PM UTC.

    America/Chicago -5:50:36 - LMT 1883 Nov 18 18:00u

The following rule is in effect until March 1, 2AM in Chicago time. But
at that time, a DST transition occurs, so the local time is actually
3AM.

    America/Chicago -6:00 Chicago C%sT 1936 Mar 1 2:00
2024-06-26 10:14:02 +02:00
Timothy Flynn
1b2d47e6bb LibJS+LibUnicode: Port retrieving available regional time zones to ICU 2024-06-26 10:14:02 +02:00
Timothy Flynn
4fc0fba646 LibCore+LibJS+LibUnicode: Port retrieving available time zones to ICU
This required updating some LibJS spec steps to their latest versions,
as the data expected by the old steps does not quite match the APIs that
are available with the ICU. The new spec steps are much more aligned.
2024-06-26 10:14:02 +02:00
Timothy Flynn
d3e809bcd4 LibJS+LibUnicode: Port retrieving the system time zone to ICU 2024-06-26 10:14:02 +02:00
Timothy Flynn
89aa9a3af0 LibJS: Update Intl AO spec numbers
Otherwise, upcoming AO implementations will conflict with these.
2024-06-26 10:14:02 +02:00