Commit graph

47359 commits

Author SHA1 Message Date
Sam Atkins
3c5090e172 LibTextCodec: Return Optional<Decoder&> from bom_sniff_to_decoder() 2023-02-19 17:15:47 +01:00
Sam Atkins
f2a9426885 LibTextCodec+Everywhere: Return Optional<Decoder&> from decoder_for() 2023-02-19 17:15:47 +01:00
Jonah
2f4c463920 LibWebView: Display Accessible Name and Description
The accessibility tab now displays elements' names and descriptions
along with the role.
2023-02-19 15:58:20 +01:00
Jonah
29d724d95c LibWeb: Serialize Accessible Name and Description for Accessibility Tree
These will get displayed in the DOM inspector.
2023-02-19 15:58:20 +01:00
Jonah
da5c9189b2 LibWeb: Implement Accessible Name and Description Calculation
This is an initial implementation of the accname standard. There is
still some of the algorithm left unimplemented that we will need
to implement in the future. However, as is, this implementation is
sufficient for basic pages.
2023-02-19 15:58:20 +01:00
Jonah
fc3ee471ed LibWeb: Add ARIA::allows_name_from_content
This is required to implement accessible name and description
calculation.
2023-02-19 15:58:20 +01:00
Andrew Kaster
613cfb31b1 LibDeviceTree: Add a slow, allocation-free property fetch API
Using the walk_device_tree helper, we can walk the device tree from the
beginning looking for a specific property node. It's still missing the
ability to get property lists, string lists, and property-specific data.
2023-02-19 13:49:07 +01:00
Andrew Kaster
e9e279bb77 LibDeviceTree: Add walk_device_tree and use it to dump structured data
We can use this simple parser and its callbacks to implement more
complex parsing in later commits.
2023-02-19 13:49:07 +01:00
Andrew Kaster
895f54f487 LibDeviceTree: Refactor dump() to return ErrorOr, and use ReadonlyBytes
ReadonlyBytes is much nicer to use than a u8 const* + size_t.
2023-02-19 13:49:07 +01:00
Andrew Kaster
01f32a22b4 LibDeviceTree: Print the StringsBlock size properly when bounds checking 2023-02-19 13:49:07 +01:00
Andrew Kaster
a2ef168d75 AK: Allow zero-valued signed size types in format strings 2023-02-19 13:49:07 +01:00
Liav A
61f4914d6e Kernel+Userland: Add constants subdirectory at /sys/kernel directory
This subdirectory is meant to hold all constant data related to the
kernel. This means that this data is never meant to updated and is
relevant from system boot to system shutdown.
Move the inodes of "load_base", "cmdline" and "system_mode" to that
directory. All nodes under this new subdirectory are generated during
boot, and therefore don't require calling kmalloc each time we need to
read them. Locking is also not necessary, because these nodes and their
data are completely static once being generated.
2023-02-19 13:47:11 +01:00
Ryan Liptak
52f156be01 Base: Add and update a few body part/hand emojis
👂 - U+1F442 Ear
Improve + bring colors in line with other body part emojis
👃 - U+1F443 Nose
Improve + bring colors in line with other body part emojis
👅 - U+1F445 Tongue
🤌 - U+1F90C Pinched Fingers
🤘 - U+1F918 Sign of the Horns
2023-02-19 13:22:05 +01:00
Andreas Kling
df235d2c9f LibWeb: Relax unnecessarily narrow cast in Node::containing_block() 2023-02-19 12:28:50 +01:00
nipos
c42e949f5b AK/StackInfo: Add support for OpenBSD pthreads 2023-02-19 11:44:45 +01:00
Lucas CHOLLET
85287fcc1e LibGfx: Rename all JPG_* macros to JPEG_* in JPEGLoader 2023-02-19 11:31:45 +01:00
Liav A
1acd679775 Kernel: Remove unnecessary include from SysFS PowerStateSwitch code
I added that include in 2e55956784 by a
mistake, so we should get rid of it as soon as possible.
2023-02-19 08:13:04 +00:00
Nico Weber
2c8b3fed71 Tests: Add a test for Gfx::ICC::encode()
The test verifies that loading an icc file and serializing it
again produces exactly the same output as the input. That's not
always the case, but often. It requires the input file either
not having any padding or using null bytes as padding, it
requires the input file putting tag data in the order the
tag data is referenced in in the tag table, and it requires the
input file only using known tag types (which at the moment
means it only works for v4 profiles, but that part will change
in the future).

The new file p3-v4.icc was extracted from a jpeg taken by an
iPhone Mini.
2023-02-19 08:12:04 +00:00
Nico Weber
19e91e5211 LibGfx: Dedupe identical tag data objects when writing ICC data
With this, common v4 profiles, such as embedded into jpgs by iPhones
(when configured to write jpegs) or Pixel phones, are identical to
the input when reexported :^)
2023-02-19 08:12:04 +00:00
Nico Weber
2504f2035c LibGfx: Implement serialization of ViewingConditionsTagData 2023-02-19 08:12:04 +00:00
Nico Weber
933002ae5a LibGfx: Move ICC ViewingConditionsHeader to BinaryFormat.h 2023-02-19 08:12:04 +00:00
Lucas CHOLLET
841e359341 LibGfx: Correctly handle JPEG image with restart markers
Restart markers are supposed to be applied every restart interval.
However, in these loops macroblocks are counted taking the luma sampling
factor into consideration. Meaning that we need to correct this factor
when testing if we should reset the DC.

Also, the decoder was discarding the first byte of every scan with a set
restart interval, as `0 % n == 0` is always true.
2023-02-19 07:59:58 +00:00
Tim Ledbetter
3d9ba87077 PixelPaint: Enable more text tool keyboard shortcuts
This commit allows the text tool's internal TextEditor component to
handle keyboard shortcuts that would normally be handled by menu
actions.

The shortcuts that can now be used are: cut, copy, paste, undo, redo
and select all.
2023-02-19 01:48:14 +01:00
Tim Ledbetter
c63f70d0fd LibGUI: Allow clipboard items to have no associated data 2023-02-19 01:35:29 +01:00
Evan Smal
76891ae45d js: Save REPL history when exiting interpreter with exit()
Previously, we only saved the REPL history when the interpreter was
shutdown with a signal. This change ensures that we save the history
when a user uses `exit()`.
2023-02-19 01:21:24 +01:00
Liav A
8266e40b35 Kernel/FileSystem: Don't assume flags for root filesystem mount flags
This is considered somewhat an abstraction layer violation, because we
should always let userspace to decide on the root filesystem mount flags
because it allows the user to configure the mount table to preferences
that they desire.
Now that SystemServer is modified to re-mount the root mount with the
desired flags, we can just mount the root filesystem without assuming
special flags.
2023-02-19 01:20:10 +01:00
Liav A
73bc856c16 SystemServer: Re-mount / as non-writable, nosuid and nodev
This is a preparation before we remove the default root mount flags from
the kernel code.
2023-02-19 01:20:10 +01:00
Tom
328a64fbdc WindowServer: Fix drawing wallpaper on additional screens
We need to translate the source rectangle relative to the screen
location when blitting from the wallpaper bitmap.
2023-02-19 01:15:26 +01:00
Tom
15d4903efb WindowServer: Fix caching stretched wallpaper for multiple screens
This creates a cached bitmap for each unique screen resolution, which
allows us to share it between displays with the same resolution. If
the resolution is the same as the wallpaper, we can just use the
wallpaper as-is.
2023-02-19 01:15:26 +01:00
Sam Atkins
5b77346f53 LibGUI: Allow double-clicking PathBreadcrumbbar buttons to edit path
When viewing a deeply nested path, there may be very little of the
PathBreadcrumbbar itself visible to double-click on. This solves that
by allowing double-clicks on its segment buttons to behave the same.
(With the caveat that it first selects the double-clicked segment.)

In order to make this work, `on_double_click` now takes the modifiers
instead of the MouseEvent. In this case we don't use it so that's fine,
but maybe we should make all mouse callbacks consistently take the
MouseEvent& as a parameter.
2023-02-19 01:09:09 +01:00
Sam Atkins
8f717927f2 LibGUI: Add Button double-click callback 2023-02-19 01:09:09 +01:00
Sam Atkins
af03cf9e80 FileManager: Use PathBreadcrumbbar instead of Breadcrumbbar :^) 2023-02-19 01:09:09 +01:00
Sam Atkins
f0c2dcdbac LibGUI: Add PathBreadcrumbbar
This Widget wraps both a Breadcrumbbar and a TextBox for editing the
path manually, based heavily on the existing code in FileManager.

Breadcrumbbar itself requires outside code to micro-manage what it does.
This class provides a simpler interface for it: Users don't have to
worry about segments, they just give/receive a string for the current
path.
2023-02-19 01:09:09 +01:00
Sam Atkins
f5cf41eb5d LibGUI+FileManager: Move has_{parent,child}_segment logic into BCB 2023-02-19 01:09:09 +01:00
kleines Filmröllchen
fcb5259796 Base: Improve BrickGame documentation 2023-02-19 01:05:08 +01:00
Liav A
4a14138230 Kernel/FileSystem: Fix check of read offset for the RAMFSInode code
The check of ensuring we are not trying to read beyond the end of the
inode data buffer is already there, it's just that we need to disallow
further reading if the read offset equals to the inode data size.
2023-02-19 01:01:45 +01:00
Liav A
9790b81959 Kernel/FileSystem: Add check of read offset for the FATInode code
Apparently we lacked this important check from the beginning of this
piece of code. This check is crucial to ensure we only give back data
being related to the FATInode data buffer and nothing beyond it.
2023-02-19 01:01:45 +01:00
Sam Atkins
6cc5e09c71 LibWeb: Port StyleComputer to new Strings 2023-02-19 00:51:16 +01:00
Sam Atkins
1c77867c78 LibWeb: Port FontCache to new Strings 2023-02-19 00:51:16 +01:00
Sam Atkins
faab2fe101 LibWeb: Store stylesheet sources as StringViews 2023-02-19 00:51:16 +01:00
Sam Atkins
13d2111b74 LibWeb: Port Selector to new Strings
Also use `Infra::is_ascii_case_insensitive_match()` in some appropriate
places, after checking the specs.
2023-02-19 00:51:16 +01:00
Sam Atkins
c2f0b20d6b LibWeb: Port FontFace to new Strings 2023-02-19 00:51:16 +01:00
Sam Atkins
33e9c4e1b2 LibWeb: Port GeneralEnclosed to new Strings 2023-02-19 00:51:16 +01:00
Sam Atkins
b5eb2ee478 AK: Make FlyString(String) constructor implicit
This stops us needing a lot of ugly `FlyString { ... }` wrappers. THis
is the behavior that `DeprecatedFlyString(DeprecatedString)` has so it
should be fine.
2023-02-19 00:51:16 +01:00
Sam Atkins
2026ea557e LibWeb: Use is_ascii_case_insensitive_match() where the spec says to 2023-02-19 00:46:47 +01:00
Sam Atkins
f0b72b819e LibWeb: Make property/media-feature name matching ASCII case-insensitive
https://www.w3.org/TR/css-conditional-3/#dom-css-supports specifically
asks for this when calling `CSS::property_id_from_string()`, but in
general, CSS property and media-feature names can only contain ASCII.
2023-02-19 00:46:47 +01:00
Aliaksandr Kalenik
05b5a3bfba LibWeb: Transform translate() values to device pixels before painting 2023-02-19 00:43:40 +01:00
Linus Groh
10575fea9f LibGfx: Fix sign-compare compile error in TGALoader
I'm not sure why this isn't caught on other people's setups or CI, but
when building on NixOS it fails with:

    error: comparison of integer expressions of different signedness:
    ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
2023-02-19 00:37:51 +01:00
Linus Groh
533f2a4980 Ladybird: Add qtwayland to QT_PLUGIN_PATH in nix-shell script
Otherwise Qt would not find the wayland plugin it is instructed to use
via QT_QPA_PLATFORM, and would fall back to the second option, xcb,
which looks rather sad in a modern Wayland environment :^)

This feels like something that should be addressed upstream in nixpkgs
eventually.
2023-02-19 00:37:51 +01:00
Linus Groh
5468e363fa Ladybird: Add libxcrypt to nativeBuildInputs in nix-shell script
This makes <crypt.h> available.
2023-02-19 00:37:51 +01:00