Commit graph

46494 commits

Author SHA1 Message Date
Andrew Kaster 8f70e365f0 Meta+CI: Disable Ladybird for fuzzer, compiler explorer and Android
And move it after the declaration of headless-browser, since WebDriver
depends on headless-browser.
2023-02-02 05:35:44 -07:00
Andrew Kaster ae9dc95b1f LibSQL+Ladybird: Accept a list of paths for spawning SQLServer in Lagom
Use the new get_paths_for_helper_process method in Ladybird to query
Qt for the runtime path of the current executable as well as the build
directory paths.
2023-02-02 05:35:44 -07:00
Andrew Kaster 3e6d790cf0 Ladybird: Abstract spawning helper processes into separate methods
This will let us use the same path discovery methods for WebContent,
SQLServer, and any other helper processes we need to launch.
2023-02-02 05:35:44 -07:00
Timothy Flynn 792258afe8 LibWeb: Restore handling of the serenity:ladybird/headless capability
This was refactored a bit incorrectly in d8fde14.
2023-02-02 12:21:44 +00:00
Andreas Kling 9347db6f91 LibGUI: Make Tray item height honor the current font size 2023-02-02 13:15:03 +01:00
Andreas Kling be3a9048be LibGUI: Relayout Breadcrumbbar on font change 2023-02-02 13:15:03 +01:00
Andreas Kling dd607fc619 LibGUI: Invalidate IconView cache on font change
Changing the font means we have to recalculate all the item rects etc.
2023-02-02 13:15:03 +01:00
Andreas Kling ff0766056b LibGUI: Don't hard-code TreeView row height
Instead of overriding AbstractTableView::row_height() and returning a
hard-coded height for some reason, just remove the override.

This makes tree view row heights honor the current font size.
2023-02-02 13:15:03 +01:00
Timothy Flynn bb4fda3b97 LibJS: Format the era of ISO year 0 as BC
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/2034315
2023-02-02 12:12:26 +00:00
martinfalisse f0312de7eb Ladybird: Left-align long url in address bar
Previously when there was a very long url that spanned outside of the
address bar, the text shown would be the one starting from the very end
of the url instead of from the beginning, so you would be seeing the
query parameters for example, instead of the domain.
2023-02-02 12:10:31 +00:00
Marcus Nilsson feef83359d DisplaySettings: Made select wallpaper use allowed file types 2023-02-02 04:05:42 -07:00
Marcus Nilsson be464c357a LibGUI: Add allowed file types to FilePicker
This patch adds a ComboBox to `FilePicker` where the user can select
which file types to show, all files that doesn't have an
extension that's in the selected file type will be hidden.

When creating a FilePicker with `FilePicker::construct` or
`FilePicker::get_open_filepath`, allowed file types can be
specified as the last argument.

If no file types are provided then there will be no visual change in the
GUI.

'All Files' and 'Image Files' have shorthands with
`GUI::FileTypeFilter::all_files()` and
`GUI::FileTypeFilter::image_files()`, respectively.
2023-02-02 04:05:42 -07:00
Marcus Nilsson fe5dfe4cd5 LibGUI: Add allowed file extensions to FileSystemModel
This allows FileSystemModel to take an optional list of allowed file
extensions which it will use to filter out all files that don't end
with that file extension.

The file extensions are set via `set_allowed_file_extensions` which has
a coresponding `get_allowed_file_extensions`.
2023-02-02 04:05:42 -07:00
MacDue c3bd841d50 SQLServer: Unveil /etc/passwd
This is now required to launch the SQLServer for Browser (without
this it now fails to launch).
2023-02-02 02:17:06 -07:00
Liav A cd3c51f29b Kernel/Graphics: Export DDC I2C address definition to global header file 2023-02-02 02:10:33 -07:00
Liav A 0c64abb5e3 Kernel: Split I2C functionality from IntelNativeDisplayConnector code
Splitting the I2C-related code lets the DisplayConnector code to utilize
I2C operations without caring about the specific details of the hardware
and allow future expansion of the driver to other newer generations
sharing the same GMBus code.

We should require a timeout for GMBus operations always, because faulty
hardware could let us just spin forever. Also, if nothing is listening
to the bus (which should result in a NAK), we could also spin forever.
2023-02-02 02:10:33 -07:00
Liav A ddc5c41253 Kernel: Fix a long-standing problem with GMBus in Intel Grahpics code
Thanks to Andrew Kaster, which gave a review back in October, about a
big PR I opened (#15502), I managed to figure out why we always had a
problem with the first byte being read into the EDID buffer with the
GMBus code. It turns out that this simple invalid cast was making the
entire problem and using the correct AK::Array::data() method fixed this
notorious long standing problem for good.
2023-02-02 02:10:33 -07:00
Simon Haegler 5220afcf73 Documentation: Add troubleshooting note regarding KVM GDB 2023-02-02 02:02:23 -07:00
Agustin Gianni bfbb4bcd9b Kernel: Remove trap based syscall handling
This patch removes the x86 mechanism for calling syscalls, favoring
the more modern syscall instruction. It also moves architecture
dependent code from functions that are meant to be architecture
agnostic therefore paving the way for adding more architectures.
2023-02-02 01:52:52 -07:00
Agustin Gianni e71c320154 Kernel: Change the way we call a syscall in signal_trampoline_dummy
The function signal_trampoline_dummy was using int 0x82 to call
SC_sigreturn. Since x86 is no longer supported, the correct way
to call a syscall is using the syscall instruction.

This paves the way to remove the syscall trap handling mechanism.
2023-02-02 01:52:52 -07:00
Kemal Zebari 5d7331b4ed Browser: Disallow empty URLs in the bookmark editor
When an empty URL is given to `BookmarkEditor`, it will now
disable the button that saves the bookmark change since an empty
URL is an invalid URL.
2023-02-02 01:18:33 +01:00
martinfalisse 24ab91f4d3 Ladybird: Go to homepage on init
If a url wasn't passed in as a parameter to Ladybird, go to the homepage
as defined in the settings on init.
2023-02-01 19:14:20 +00:00
martinfalisse abf8dd96de Ladybird: Refactor navigating to url on startup
These changes will prevent duplication of code later when there will
also be the possibility to navigate to the homepage url as defined in
the settings on startup.
2023-02-01 19:14:20 +00:00
martinfalisse 65cf562a71 Ladybird: Add ak_string_from_qstring function
This will be used later when doing the conversion from the QString in
QSettings for the homepage URL.
2023-02-01 19:14:20 +00:00
Tim Ledbetter 4be6ee85e0 PixelPaint: Ensure layers are positioned correctly when painting
Previously, layer bitmaps could move slightly relative to their
boundary and the image background when panning and zooming.
2023-02-01 19:36:39 +01:00
Tim Ledbetter 607c8045dc PixelPaint: Allow dragging when color picking using the Alt key 2023-02-01 19:21:58 +01:00
Tim Ledbetter 06e09cf415 PixelPaint: Disable current tool when color picking using the Alt key 2023-02-01 19:21:58 +01:00
Tim Ledbetter 2f5bbc68ed PixelPaint: Use eyedropper cursor when color picking using Alt key 2023-02-01 19:21:58 +01:00
Tim Ledbetter 45e60a416b PixelPaint: Use layer coordinates when color picking using Alt key
Previously, raw coordinates were being used, which meant that color
was being sampled from the wrong position.
2023-02-01 19:21:58 +01:00
Lucas CHOLLET 81bd91c1c3 SystemServer: Propagate errors
This patch also includes some changes in the way that the environment
and arguments are passed to `exec`. It was needed to fit the signature
of `Core::System::exec`. That's beneficial though, as we are now doing
`String` manipulation in a fallible environment, so we can propagate
more errors.
2023-02-01 19:21:10 +01:00
Lucas CHOLLET cd0b7656fa ConfigServer: Unveil "/etc/passwd"
This is needed to use functions like `getpwuid()`.
2023-02-01 19:21:10 +01:00
Nico Weber fb79fc0ba6 Tests: Add a basic ICC profile test
icc-v4.jpg is Meta/Websites/serenityos.org/happy/3rd/bgianf.jpg.
There are a whole bunch of jpgs with v4 color profiles and I just picked
one fairly arbitrarily. It looks like a fairly standard v4 matrix
profile that in this form is also present in many jpgs taken by mobile
phone cameras. It uses parametric curves.

icc-v2.png is based on ./Documentation/WebServer_localhost.jpg since
that is the only image in the repo with a v2 color profile. It also has
all kinds of interesting and somewhat exotic tags, such as an 'dscm' (an
Apple extension to have a description of type 'mluc', since normal
'desc' is required ot have type 'desc' in v2 files -- in v4, 'desc' has
type 'mluc') tag of type 'mluc' that actually contains data in several
languages and that exercises the non-BMP UTF-16BE decoder. It's however
still also a fairly standard v2 matrix profile, which uses 'curv'
instead of 'para' for its curves ('para' is v4-only).

I converted that jpeg file to png, and cropped most of the image
data to save on file size by running:

    sips -s format png --cropToHeightWidth 21 42 in.jpg --out out.png
2023-02-01 19:19:30 +01:00
Nico Weber d43b306814 LibGfx: Give ICC::TagType a virtual destructor
ICC::Profile deletes these objects via base class pointers, so this
is needed that destructors in the subclasses get called.

(Found by asan on CI when adding test coverage.)
2023-02-01 19:19:30 +01:00
Cubic Love 0cfce93e51 Base+Presenter: Add icons for Presenter
Add application and filetype icons for Presenter in 32px and 16px
2023-02-01 19:17:48 +01:00
Timothy Flynn 38b0b32bb4 Meta: Set LD_LIBRARY_PATH to Build/lagom for Lagom test targets
Some tests, such as those under LibGL, try to load shared libraries at
runtime which are stored in Build/lagom. Because all tests' working
directory is that of their CMakeLists.txt file, they fail to find those
shared libraries at runtime.

Set LD_LIBRARY_PATH to Build/lagom so the tests may find the shared
libraries. This fixes, for example, both of these commands:

    ./Meta/serenity.sh test lagom TestAPI
    ./Meta/serenity.sh run lagom TestAPI
2023-02-01 12:28:02 -05:00
Timothy Flynn 1bbd889f67 Meta: Set the Lagom test working directory for run-lagom-target
When we call add_test() from each test's CMakeLists.txt, we specify the
working directory to be that of the CMakeList.txt file itself. Create a
property to store that directory and reference it when run-lagom-target
is invoked by serenity.sh.

Note that for non-test Lagom targets which do not set this property, the
working directory will be Build/lagom (because the property will be the
empty string, which CMake resolves relative to the current build path).
2023-02-01 12:28:02 -05:00
Nico Weber 0a97206a25 Meta: Derust fuzzer build docs
The document wasn't updated in 9c2211f246.
2023-02-01 14:44:58 +00:00
Sam Atkins ced59fb3a0 Spider: Make double-click skip the new-game animation 2023-02-01 14:19:15 +00:00
Sam Atkins 8744e8b561 Spider: Use a single State enum instead of a series of booleans 2023-02-01 14:19:15 +00:00
Sam Atkins 5de8b38783 Solitaire: Make double-click skip the new-game animation 2023-02-01 14:19:15 +00:00
Sam Atkins e8d83b1ae1 Solitaire: Use a single State enum instead of a series of booleans
We had 4 different bools before, but the only valid states were either
that only one of them was true, or than none of them are true. An enum
is a better fit here, by enforcing that we can only be in one state at
a time.
2023-02-01 14:19:15 +00:00
Timothy Flynn 9f9b8e7273 CI: Move running LibWeb layout tests to Azure
The current config on GitHub Actions does not use ccache, so it takes
quite a while to build. Instead, let's just run these tests on Azure
where we already build Ladybird and have ccache enabled. This also lets
us sanitize LibWeb on both Linux and macOS.

The script changes here are to A) handle differences between Azure and
GitHub Actions and B) to support running on macOS.
2023-02-01 14:04:44 +00:00
Timothy Flynn 093e7e2a86 Ladybird: Exit Ladybird normally during dump-layout-tree mode
Don't use _exit() - this is a forceful exit that will bypass all exit
handlers. This includes AddressSanitizer, and will prevent ASan from
exiting the app with a fatal error code.
2023-02-01 14:04:44 +00:00
Timothy Flynn 9fd54e1f90 Ladybird: Store the WebContent QSocketNotifier on the stack
This was being heap allocated with naked-new and never freed. Caught by
AddressSanitizer.
2023-02-01 14:04:44 +00:00
Timothy Flynn ac80475a1f Ladybird: Initialize boolean command line argument
This being uninitialized was caught by AddressSanitizer.
2023-02-01 14:04:44 +00:00
Timothy Flynn 96f409ec1e LibWeb+WebContent: Do not reference-count file request objects
There is currently a memory leak with these file request objects due to
the callback on_file_request_finish referencing itself in its capture
list. This object does not need to be reference counted or allocated on
the heap. It is only ever stored in a HashMap until a response is
received from the browser, and it is not shared.
2023-02-01 14:04:44 +00:00
Nico Weber 9bb469f324 Meta: Build and run Tests/LibGfx in lagom builds
They can be run using

    Meta/serenity.sh test lagom TestFontHandling

which will build _all_ test binaries and then run TestFontHandling.

There's also

    Meta/serenity.sh run lagom TestFontHandling

which will build just TestFontHandling and run it, but currently
in a way that it doesn't pass.

Finally, manually doing

    Meta/serenity.sh build lagom TestFontHandling

followed by

    (cd Tests/LibGfx; ../../Build/lagom/Tests/LibGfx/TestFontHandling)

will build and then run just that one test in a way that makes the test
pass.
2023-02-01 08:56:56 -05:00
Nico Weber c8832807d6 LibGfx+Tests: Remove code unnecessary after 9e7c16d0a4 2023-02-01 08:56:56 -05:00
Nico Weber bea3f3fc46 LibGfx: Move TestImageDecoder over to input file approach in 8cfabbcd93
Rather than reading files out of /res, put them in a subfolder of
Tests/LibGfx/ and pick the path based on AK_OS_SERENITY.

That way, the tests can also pass when run under lagom.

(I just `cp`d all the files that the test previously read from
random places into Tests/LibGfx/test-inputs.)
2023-02-01 08:56:56 -05:00
Nico Weber b8b5e0f680 LibGfx: Move TestFontHandling over to input file approach in 8cfabbcd93
Rather than reading files out of /res, put them in a subfolder of
Tests/LibGfx/ and pick the path based on AK_OS_SERENITY.

That way, the tests can also pass when run under lagom.
2023-02-01 08:56:56 -05:00