Commit Graph

46902 Commits

Author SHA1 Message Date
Timothy Flynn
32a01a60e7 LibUnicode: Remove non-iterative text segmentation algorithms
They are now unused.
2023-02-16 11:18:53 +01:00
Timothy Flynn
6ce7ec2eb3 LibUnicode: Use iterative text segmentation algorithms for titlecasing 2023-02-16 11:18:53 +01:00
Timothy Flynn
7cb956d17b LibJS: Use iterative text segmentation algorithms for Intl.Segmenter
This uses the find-next and find-previous APIs instead of storing all
indices as a vector.
2023-02-16 11:18:53 +01:00
Ben Wiederhake
9a7b3c145f Everywhere: Change all XXX into FIXME or remove as appropriate 2023-02-15 23:33:25 +01:00
Timon Kruiper
00c21c5424 LibELF: Implement _invoke_entry for aarch64 2023-02-15 22:53:19 +01:00
Timon Kruiper
ed3be5b7f5 LibELF+LibC: Add support for aarch64 relocations
This commit adds the used relocation types to elf.h, and handles the
types in DynamicLoader and DynamicObject. No new functionalitty has to
be added, as the same code can be reused between aarch64 and x86_64.
2023-02-15 22:53:19 +01:00
Timon Kruiper
cfd73e5d9f Kernel/aarch64: Implement Thread Local Storage
This commit adds Processor::set_thread_specific_data, and this function
is used to factor out architecture specific implementation of setting
the thread specific data. This function is implemented for
aarch64 and x86_64, and the callsites are changed to use this function
instead.
2023-02-15 22:53:19 +01:00
Timon Kruiper
7d0917f50b Kernel/aarch64: Remove tpidr_el0 from RegisterState
In the next commit, this register will be populated by directly writing
to it, instead of using the RegisterState mechanism.
2023-02-15 22:53:19 +01:00
Timon Kruiper
cff6af9f75 LibC: Add general implementation for memcpy and memset 2023-02-15 22:53:19 +01:00
Timon Kruiper
a98c0c3e51 Kernel/aarch64: Add implementations for safe_memset and safe_strnlen
They currently do not actually implement a safe memset or safe strnlen,
but this initial implementation works fine for now.
2023-02-15 22:53:19 +01:00
Timon Kruiper
d1eec20773 Kernel/aarch64: Implement storing and restoring floating-point registers 2023-02-15 22:53:19 +01:00
Timon Kruiper
e57d35ff53 Kernel/aarch64: Do not trap floating-point instructions
This requires setting the FPEN field of the Architectural Feature Access
Control Register (CPACR_EL1) to 0b11.
2023-02-15 22:53:19 +01:00
Timon Kruiper
dfc6555fec CMake: Add -mstrict-align flag to compile options for aarch64 build
The aarch64 processor is set up to trap on unaligned memory accesses, so
to enforce that the compiler correctly generates aligned accesses, the
-mstrict-align flag is needed. We also need the -Wno-cast-align as there
are some files in AK that don't build without the flag.
2023-02-15 22:53:19 +01:00
Timon Kruiper
d5262a540c Kernel/aarch64: Handle SVC exception by calling syscall_handler
The SVC (supervisor call) instruction is used in userland to do
syscalls, and this commit adds the handling of syscalls to
Interrupts.cpp.
2023-02-15 22:53:19 +01:00
Timon Kruiper
4b0f8e9a20 LibELF+LibC: Add support for relative relocations in aarch64 binaries
This commit adds R_AARCH64_RELATIVE to elf.h and uses it in
ELF::perform_relative_relocations to correctly verify the relocation
type. This is the only change needed to support relative relocations for
aarch64.
2023-02-15 22:53:19 +01:00
Timon Kruiper
b2e223d2bc DynamicLoader: Disable stack protector in some files for aarch64 build
The code would access the __stack_chk_guard variable in main.cpp and
LibELF/Relocation.cpp before the loader was able to relocate itself, so
this commit disable the stack protector for the aarch64 build to make
sure that no accesses to __stack_chk_guard are inserted.
2023-02-15 22:53:19 +01:00
Nico Weber
ecc321e099 LibGfx: Move QOIWriter implementation-only things into cpp file
No behavior change.
2023-02-15 20:32:08 +01:00
Sam Atkins
85f3de6331 LibWeb: Port CSS/Serialize.{h,cpp} to new Strings, and propagate errors 2023-02-15 12:48:26 -05:00
Sam Atkins
a0b1eddc56 LibWeb: Port CSS::MediaQuery to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
a381ce9519 LibWeb: Port CSS::Supports to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
fc3540c4b1 LibWeb: Port CSS::UnicodeRange to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
316092d185 LibWeb: Use StringView in CSS::PreferredColorScheme
This doesn't need to hold the string data.
2023-02-15 12:48:26 -05:00
Sam Atkins
dca19b764b LibWeb: Port CSS::Display to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
41c4cc95e4 LibWeb: Port CSS::Parser::Rule to new Strings
`Rule::to_deprecated_string()` and
`DeclarationOrAtRule::to_deprecated_string()` are not used anywhere, so
we can just delete them.
2023-02-15 12:48:26 -05:00
Sam Atkins
bee32b6cd2 LibWeb: Port CSS::Parser::Declaration to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
a168cda4a7 LibWeb: Port CSS::Parser::ComponentValue to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
05c1b09621 LibWeb: Port CSS::Parser::Function to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
86d23c63a4 LibWeb: Port CSS::Parser::Block to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
e338ef4914 LibWeb: Port ComputedValues to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
9e735cc02e LibWeb: Remove unused includes for DeprecatedString
Missed these before, oops.
2023-02-15 12:48:26 -05:00
Sam Atkins
3685a8813a LibWeb: Port CSS Tokenizer to new Strings
Specifically, this uses FlyString, because the data gets held long-term
as a FlyString anyway.
2023-02-15 12:48:26 -05:00
Sam Atkins
a419039bb2 LibWeb: Implement ASCII case-insensitive matching
While DeprecatedString and StringView use ASCII case-insensitivity when
matching, String uses the Unicode rules, so in order to match the spec,
we need to *not* use `String::equals_ignoring_case()`.

This function needs to be used everywhere that the spec refers to
an "ASCII case-insensitive match".
2023-02-15 12:48:26 -05:00
Sam Atkins
1453ac79e7 AK: Add StringBuilder::to_fly_string() 2023-02-15 12:48:26 -05:00
Sam Atkins
a35fa553dd AK: Let FlyStrings be assigned from Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
abc01cc9fe AK+Tests+LibWeb: Make URL::complete_url() take a StringView
All it does is pass this to `URLParser::parse()` which takes a
StringView, so we might as well take one here too.
2023-02-15 12:48:26 -05:00
Sam Atkins
8af65108e4 LibWeb: Construct CSS Tokenizer and Parser with a StringView encoding
This doesn't need to be a full (Deprecated)String, so let's not force it
to be.
2023-02-15 12:48:26 -05:00
Sam Atkins
d6075ef5b5 LibTextCodec+Everywhere: Make TextCodec::decoder_for() take a StringView
We don't need a full String/DeprecatedString inside this function, so we
might as well not force users to create one.
2023-02-15 12:48:26 -05:00
Nico Weber
3c8bfa4662 LibJS: Keep escaping forward slashes
Reverts 5dce916a50.

Now:

    > new RegExp('/').source
    "\/"

This matches spec (and v8).
2023-02-15 16:41:56 +01:00
MetallicSquid
eb27b397b8 HexEditor: Add selection strings to the value inspector
Strings include ASCII, UTF-8, and UTF-16

Co-authored-by: Andreas Krohn <hamburger1984@gmail.com>
2023-02-15 12:13:31 +00:00
Florian Kaiser
815442b2b5 Piano: Fix insertion and deletion of notes
On mouse move the pressed button is not present in the event argument
which causes the corresponding code to never fire. Instead it now stores
the original mouse down event and acts according to that on mouse move.
2023-02-15 12:58:25 +01:00
Timothy Flynn
4ab7216827 LibGUI: Use Unicode's text segmentation for traversing word breaks
Note that for traversing words with ctrl+(left or right arrow) on the
keyboard, we want to "skip" some boundaries. Consider the text:

    The ("quick") fox can't jump 32.3 feet, right?

Using "|" to denote word break boundaries, we will have:

    |The| |(|"|quick|"|)| |fox| |can't| |jump| |32.3| |feet|,| |right|?|

When starting at "The" and using ctrl+right to move rightward in this
text, it is unlikely that users will want to break at every single one
of those boundaries. Most text editors, for example, will skip from the
end of "The" to the end of "quick", not breaking at the parentheses or
opening quotation marks.

We try to mimic such desired behavior here. It likely isn't perfect, but
we can improve upon it as we find edge cases.
2023-02-15 12:36:47 +01:00
Timothy Flynn
5cbf054651 LibUnicode: Fix typos causing text segmentation on mid-word punctuation
For example the words "can't" and "32.3" should not have boundaries
detected on the "'" and "." code points, respectively.

The String test cases fixed here are because "b'ar" is now considered
one word.
2023-02-15 12:36:47 +01:00
Timothy Flynn
6e7a6e2d02 LibUnicode: Support finding the next/previous text segmentation boundary 2023-02-15 12:36:47 +01:00
Timothy Flynn
abe7786a81 LibUnicode: Allow iterating over text segmentation boundaries
This will be useful for e.g. finding the next boundary after a specific
index - we can just stop iterating once a condition is satisfied.
2023-02-15 12:36:47 +01:00
Timothy Flynn
dd4c47456e LibUnicode: Implement text segmentation algorithms for all UTF encodings
Similar to commit 6d710eeb43. Rather than
pick-and-chosing what to support, let's just support all encodings now,
as it is trivial. For example, LibGUI will want the UTF-32 overloads.
2023-02-15 12:36:47 +01:00
Timothy Flynn
2d487e4e4c LibUnicode+LibJS: Move text segmentation algorithms to their own files
These algorithms are quite chonky, and more APIs around them are to be
added, so let's move them to their own files for a bit of organization.
2023-02-15 12:36:47 +01:00
Nico Weber
9ba3c8e36d LibGfx: Move ICC::Profile towards "Fallible Constructors" pattern
Not quite there yet due to check_required_tags() / check_tag_types(),
but getting closer :^)
2023-02-15 10:15:24 +01:00
Nico Weber
db614b47dd LibGfx: Move ICC::Profile::read_header() out of class
This one is slightly more involved: To make it nice, extract
all the Profile fields that belong to the header into a separate
struct.
2023-02-15 10:15:24 +01:00
Nico Weber
272e5321e3 LibGfx: Move ICC::Profile::read_tag_table() out of class 2023-02-15 10:15:24 +01:00
Nico Weber
006dff6878 LibGfx: Move ICC::Profile::read_tag() out of class 2023-02-15 10:15:24 +01:00