Commit graph

47119 commits

Author SHA1 Message Date
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
Peter Elliott 3481e44d01 Ports: Port wayland-client 2023-02-19 00:37:37 +01:00
Peter Elliott 3440292e73 Ports: Port the Expat XML parser 2023-02-19 00:37:37 +01:00
Peter Elliott f20902deb3 Kernel: Support sending filedescriptors with sendmsg(2) and SCM_RIGHTS
This is necessary to support the wayland protocol.
I also moved the CMSG_* macros to the kernel API since they are used in
both kernel and userspace.
this does not break ntpquery/SCM_TIMESTAMP.
2023-02-19 00:37:37 +01:00
Peter Elliott ae5d7f542c Kernel: Change polarity of weak ownership between Inode and LocalSocket
There was a bug in which bound Inodes would lose all their references
(because localsocket does not reference them), and they would be
deallocated, and clients would get ECONNREFUSED as a result. now
LocalSocket has a strong reference to inode so that the inode will live
as long as the socket, and Inode has a weak reference to the socket,
because if the socket stops being referenced anywhere it should not be
bound.

This still prevents the reference loop that
220b7dd779 was trying to fix.
2023-02-19 00:37:37 +01:00
Peter Elliott 2808b03764 Kernel: Support F_DUPFD_CLOEXEC command to fcntl(2)
Specified by POSIX:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
2023-02-19 00:37:37 +01:00
Nico Weber 22c0e6b60e LibGfx: Implement serialization of MeasurementTagData 2023-02-19 00:01:44 +01:00
Nico Weber 8e5392f9c0 LibGfx: Move ICC MeasurementHeader to BinaryFormat.h 2023-02-19 00:01:44 +01:00
Nico Weber a1de65c34f LibGfx: Implement serialization of TextTagData 2023-02-19 00:01:44 +01:00
Nico Weber eaa0e3484b LibGfx: Make TextTagData verify input is 7-bit ASCII
TextTagData::from_bytes() errors out if that isn't the case, but
let's make sure other potential future callers get it right too.
2023-02-19 00:01:44 +01:00
Nico Weber df5dbc180f LibGfx: Implement serialization of SignatureTagData 2023-02-19 00:01:44 +01:00
Nico Weber 3690305794 LibGfx: Implement serialization of CurveTagData 2023-02-19 00:01:44 +01:00
Nico Weber 1ca7f109a1 LibGfx: Implement serialization of CicpTagData 2023-02-19 00:01:44 +01:00
Nico Weber fd590fe55d LibGfx: Implement serialization of ChromaticityTagData 2023-02-19 00:01:44 +01:00
Nico Weber ececea9a1c LibGfx: Implement serialization of ParametricCurveTagData
With this, simple v4 matrix profiles using parametric curves, such as
Compact-ICC-Profiles/profiles/sRGB-v4.icc, can be completely serialized
and the serialized file can be read again by `icc` :^)
2023-02-19 00:01:44 +01:00
Nico Weber 685e2da302 LibGfx: Implement serialization of S15Fixed16ArrayTagData 2023-02-19 00:01:44 +01:00
Nico Weber 931594fce3 LibGfx: Implement serialization of XYZTagData 2023-02-19 00:01:44 +01:00
Nico Weber eb6dccb675 LibGfx: Implement serialization of MultiLocalizedUnicodeTagData 2023-02-19 00:01:44 +01:00
Nico Weber 4a62cf35fc LibGfx: Move MultiLocalizedUnicodeRawRecord to BinaryFormat.h 2023-02-19 00:01:44 +01:00
Nico Weber 4e72a35398 LibGfx: Add scaffolding for writing tag data
This doesn't deduplicate identical TagDatas yet.

It also doesn't implement actual serialization of TagData yet.
2023-02-19 00:01:44 +01:00
Nico Weber 1457e36b79 LibGfx: Write ICC tag table
All offsets and sizes are set to 0 for now, so this still doesn't
produce a valid icc file. It gets closer, though.
2023-02-19 00:01:44 +01:00
Nico Weber 9bd7048519 LibGfx: Move ICC TagTableEntry to BinaryFormat.h 2023-02-19 00:01:44 +01:00
Nico Weber 026d9ceaf9 LibGfx: Extract encode_header() function in ICC writing code 2023-02-19 00:01:44 +01:00
Lucas CHOLLET 743b6e8781 LibGfx: Rename format name from jpg to jpeg 2023-02-18 23:56:24 +01:00
Lucas CHOLLET 9c1dbf1ac5 SpiceAgent: Rename ClipboardType::JPG to ClipboardType::JPEG 2023-02-18 23:56:24 +01:00
Lucas CHOLLET 856d0202f2 LibGfx: Rename JPGLoader to JPEGLoader
The patch also contains modifications on several classes, functions or
files that are related to the `JPGLoader`.

Renaming include:
 - JPGLoader{.h, .cpp}
 - JPGImageDecoderPlugin
 - JPGLoadingContext
 - JPG_DEBUG
 - decode_jpg
 - FuzzJPGLoader.cpp
 - Few string literals or texts
2023-02-18 23:56:24 +01:00
Undefine ab298ca106 Kernel: Dont crash if power states gets set to an invalid value 2023-02-18 23:52:20 +01:00
Timothy Flynn b4113536ef LibJS: Use substrings-with-superstrings in Intl.NumberFormat's grouping
To add grouping to a number, we take a string such as "123456.123" and
break it into integer and fraction parts. Then we take the integer part
and break it into locale-specific sized groups to inject the locale's
group separator (e.g. a comma in en-US). We currently create new strings
for each of these groups. Instead, we can use the shared superstring
method to avoid all of that string copying.
2023-02-18 20:00:15 +01:00
Nico Weber a30e364f1a AK: Fix printing of negative FixedPoint values
Fixes #17514 by comparing to 0 before truncating the fractional part.
2023-02-18 19:34:10 +01:00
Timon Kruiper 13f5aa81e3 Kernel/aarch64: Disable memory access alignment check
Even though we currently build all of Userland and the Kernel with the
-mstrict-align flag, the compiler will still emit unaligned memory
accesses. To work around this, we disable the check for now. See
https://github.com/SerenityOS/serenity/issues/17516 for the relevant
issue.
2023-02-18 19:17:21 +01:00
Timon Kruiper 5d587ea562 Kernel/aarch64: Call handle_crash on unknown exceptions
This is useful for debugging, as it will now print out a userspace
backtrace, and optionally also dump the memory regions of the process.
2023-02-18 19:17:21 +01:00
Sam Atkins 6b66e39df4 LibGUI+Userland: Stop returning Layout from Widget::(try_)set_layout()
Nobody uses this return value any more. It also lets us remove a whole
bunch of `(void)` casts. :^)
2023-02-18 16:56:56 +00:00
Sam Atkins 77ad0fdb07 Userland: Specify margins and spacing in the GUI::Layout constructor 2023-02-18 16:56:56 +00:00
Sam Atkins 9561ec15f4 Userland: Use Widget::add_spacer() everywhere 2023-02-18 16:56:56 +00:00
Sam Atkins 43dddafd16 LibGUI: Allow specifying Layout margins and spacing in the constructor
This is comfier than `my_widget->layout()->set_margins(...)`.
2023-02-18 16:56:56 +00:00
Sam Atkins ab6ef53247 LibGUI: Add Widget::add_spacer() wrapper
This just calls Layout::try_add_spacer(), but saves you having to access
the Widget's Layout directly.

We verify that the Widget has a Layout, since it would be a programming
error if we tried to do so without one.
2023-02-18 16:56:56 +00:00
MacDue 6ceb185865 LibGfx: Add ALWAYS_INLINE to Color::mixed_with()/interpolate()
I can see small speedup of about 6-7% with this for some gradient
painting, though Tim has been able to see an ~30% speedup in some
resizing cases so this seems like a worthwhile change.

Co-authored-by: Tim Ledbetter <timledbetter@gmail.com>
2023-02-18 17:10:04 +01:00
MacDue 3cc074c1b0 LibGfx: De-duplicate color interpolation code 2023-02-18 17:10:04 +01:00
MacDue e5a39d134b LibGfx: Move Color::mixed_with() inline
This seems to give a small speedup to gradient painting and removes
Color::mixed_with() (which was 10% of the time) from the profile.
2023-02-18 17:10:04 +01:00
Timothy Flynn 8a94c7a7f7 LibGUI: Skip over grapheme clusters on left/right arrow key presses
Currently, if you use the left/right arrow keys to move over a multi-
code point glyph, we will move through that glyph one code point at a
time. This means you can "pause" your movement in the middle of a glyph
and delete a subsection of a grapheme cluster. This now moves the cursor
across the entire cluster.

Visually, we will need to separately track physical and virtual cursor
positions. That is, when you move across a multi-code point glyph, the
visual cursor should only move one position at a time, while a physical
cursor stores the "real" position in terms of number of code points.

This also converts a couple of ints to auto - these are actually size_t,
and are being passed to functions that expect size_t, so let's not cast
them to ints.
2023-02-18 16:54:46 +01:00
Andreas Kling d0697d350d AK: Fix 64-bit alignment issue in shared-superstring substrings
Thanks to Timothy Flynn for the test!

Fixes #17141
2023-02-18 09:12:46 -05:00