Commit graph

39380 commits

Author SHA1 Message Date
Tim Schumacher
0057b24b9e Ports/freedink: Don't extract freedink-data a second time
Our implicit extraction already takes care of this.
2022-07-13 21:22:52 +01:00
Tim Schumacher
b3f9d2a24e Ports/git: Store default gitconfig as heredoc 2022-07-13 21:22:52 +01:00
Tim Schumacher
9cbf65761d Ports/libicu: Evaluate the host build folder later
We need this to be the build directory, not the tarball directory.
2022-07-13 21:22:52 +01:00
Tim Schumacher
eaee7e9d5b Ports/cfunge: Remove workdir weirdness 2022-07-13 21:22:52 +01:00
Timothy Flynn
cff2d631da LibJS: Implement Intl.NumberFormat V3's [[SignDisplay]] changes
Intl.NumberFormat V3 adds a "negative" option for [[SignDisplay]] to
only use the locale's signed pattern for negative numbers.
2022-07-13 19:22:26 +01:00
Timothy Flynn
733192089f LibJS: Implement Intl.NumberFormat V3's [[UseGrouping]] changes
In the main spec, [[UseGrouping]] can be true or false. In V3, it may be
one of:

    auto: Respect the per-locale preference for grouping.

    always: Ignore per-locale preference for grouping and always insert
    the grouping separator (note: true is now an alias for always).

    min2: Ignore per-locale preference for grouping and only insert the
    grouping separator if the primary group has at least 2 digits.

    false: Ignore per-locale preference for grouping and never insert
    the grouping separator.
2022-07-13 19:22:26 +01:00
Timothy Flynn
cd4ee46b70 LibJS: Populate roundingPriority in Intl.PluralRules.resolvedOptions
This is inherited from Intl.NumberFormat.
2022-07-13 19:22:26 +01:00
Timothy Flynn
33698b9615 LibJS+js: Parse new constructor options from Intl.NumberFormat V3
This contains minimal changes to parse newly added and modified options
from the Intl.NumberFormat V3 proposal, while maintaining main spec
behavior in Intl.NumberFormat.prototype.format. The parsed options are
reflected only in Intl.NumberFormat.prototype.resolvedOptions and the js
REPL.
2022-07-13 19:22:26 +01:00
Liav A
cd8bcd06c6 Kernel/Graphics: Allocate VGA window region according to the usual rules
We should not allocate a kernel region inside the constructor of the
VGATextModeConsole class. We do use MUST() because allocation cannot
fail at this point, but that happens in the static factory method
instead.
2022-07-13 19:15:17 +01:00
Liav A
f052b9574c Kernel/Graphics: Rename m_vga_region => m_vga_window_region 2022-07-13 19:15:17 +01:00
Liav A
00dbd667d5 Kernel/Graphics: Rename TextModeConsole => VGATextModeConsole
This change represents well the fact that the text mode console is based
on VGA text mode.
2022-07-13 19:15:17 +01:00
Liav A
97a769d2a9 Kernel/Graphics: Remove unnecessary VGAConsole class abstraction
The original intention was to support other types of consoles based on
standard VGA modes, but it never came to an implementation, nor we need
such feature at all.
Therefore, this class is not needed and can be removed.
2022-07-13 19:15:17 +01:00
Atharva Kulkarni
3f93aec720 NotificationServer: Move notifications down if hovered
Currently in case of multiple notifications, the notifications are
drawn on top of each other when expanded.
The change moves the notificaiton below other notifications
2022-07-13 17:03:44 +01:00
Andreas Kling
d2b887a793 LibWeb: Only create one wrapper for inline content inside flex container
Due to a missing `return` statement, we were creating two anonymous
wrapper blocks around each piece of inline content inside a flex
container.

This had no visual impact, since they ended up with 0x0 dimensions,
but we were wasting a fair bit of time running layout on them.
2022-07-13 01:26:29 +02:00
Filiph Sandström
a1ddc44c07 WorkspacePicker: Hide applet if size == 0 2022-07-13 00:51:48 +02:00
Andreas Kling
3ee5bdcfb7 LibWeb: Traverse shadow-including subtree when adopting DOM nodes
This takes care of two FIXMEs and fixes an issue on Google Docs where
we'd mix boxes from different documents in the same layout tree.
(This happened because shadow trees remained attached to their old
document when their host was adopted.)
2022-07-12 23:17:17 +02:00
Andreas Kling
7d7d5f0b1b LibWeb: Use fit-content size for flex items with indefinite cross size 2022-07-12 23:12:11 +02:00
Andreas Kling
04cc837db9 LibWeb: Stub out two functions on SVGGeometryElement
These two were called by Discord while loading:

- float getTotalLength();
- DOMPoint getPointAtLength(float distance);
2022-07-12 23:12:11 +02:00
Andreas Kling
e883777a18 LibWeb: Add barebones implementation of DOMPoint and DOMPointReadOnly 2022-07-12 23:12:11 +02:00
sin-ack
5744211001 AK: Remove StringView(char const*) :^)
This constructor relied on running strlen implicitly on its argument,
thereby potentially causing out-of-bound reads (some of which were
caught a few days ago). The removal of this constructor ensures that the
caller must explicitly pass the size of the string by either:

1) Using operator""sv on literal strings; or
2) Calling strlen explicitly, making it clear that the size of the view
   is being calculated at runtime.
2022-07-12 23:11:35 +02:00
sin-ack
d16544100f Tests: Remove StringView char const* initialization test
We now explicitly disallow this.
2022-07-12 23:11:35 +02:00
sin-ack
604aac531c AK+Userland+Tests: Remove URL(char const*) constructor
The StringView(char const*) constructor is being removed, and there was
only a few users of this left, which are also cleaned up in this commit.
2022-07-12 23:11:35 +02:00
sin-ack
3f8060d859 AK: Remove String <-> char const* comparison operators
During the removal of StringView(char const*), all users of these
functions were removed, and they are of dubious value (relying on
implicit StringView conversion).
2022-07-12 23:11:35 +02:00
sin-ack
5422691f07 LibRegex: Remove RegexStringView(char const*) constructor
This allowed passing in a nullptr for the StringView which will not be
possible once StringView(char const*) is removed.
2022-07-12 23:11:35 +02:00
sin-ack
87f5e0bcda LibCore: Add FIXME note about converting Core::Account to use StringView
This prevents a bunch of utilities from using StringView for their
arguments.
2022-07-12 23:11:35 +02:00
sin-ack
fbc771efe9 Everywhere: Use default StringView constructor over nullptr
While null StringViews are just as bad, these prevent the removal of
StringView(char const*) as that constructor accepts a nullptr.

No functional changes.
2022-07-12 23:11:35 +02:00
sin-ack
c8585b77d2 Everywhere: Replace single-char StringView op. arguments with chars
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).

No functional changes.
2022-07-12 23:11:35 +02:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
sin-ack
e5f09ea170 Everywhere: Split Error::from_string_literal and Error::from_string_view
Error::from_string_literal now takes direct char const*s, while
Error::from_string_view does what Error::from_string_literal used to do:
taking StringViews. This change will remove the need to insert `sv`
after error strings when returning string literal errors once
StringView(char const*) is removed.

No functional changes.
2022-07-12 23:11:35 +02:00
sin-ack
c70f45ff44 Everywhere: Explicitly specify the size in StringView constructors
This commit moves the length calculations out to be directly on the
StringView users. This is an important step towards the goal of removing
StringView(char const*), as it moves the responsibility of calculating
the size of the string to the user of the StringView (which will prevent
naive uses causing OOB access).
2022-07-12 23:11:35 +02:00
sin-ack
e3da0adfe6 LibC: Convert getopt and getopt_long to new StringView usage 2022-07-12 23:11:35 +02:00
sin-ack
828060e631 LibCore: Add convenience templates for System::{unveil,pledge}
These convenience templates allow the following to be written as before:

    TRY(Core::System::pledge("promises..."));
    TRY(Core::System::pledge("promises...", "execpromises..."));
    TRY(Core::System::unveil("path", "permissions"));
    TRY(Core::System::unveil(nullptr, nullptr));

Other uses must now append sv to any literal string passed to pledge and
unveil.
2022-07-12 23:11:35 +02:00
sin-ack
a4c251f858 LibX86: Convert register names to StringViews 2022-07-12 23:11:35 +02:00
sin-ack
a3eeeaa6a1 Userland: Remove erroneous String -> char* -> StringView conversions
These were accidental (or leftover) uses of String::characters() to
construct StringViews through its StringView(char const*) constructor.
Since this constructor is due to be removed, this will no longer work.
Plus this prevents strlen from being run on these strings unnecessarily.
2022-07-12 23:11:35 +02:00
sin-ack
60f6bc902b Userland: Convert command line arguments to String/StringView
StringView was used where possible. Some utilities still use libc
functions which expect null-terminated strings, so String objects were
used there instead.
2022-07-12 23:11:35 +02:00
sin-ack
fded8f861d Tests: Convert TestQuotedPrintable decode test to use StringViews 2022-07-12 23:11:35 +02:00
sin-ack
f6b1db37fc Tests: Convert TestBase64 decode test to use StringViews directly
Previously it would rely on the implicit StringView conversions. Now the
decode_equal function will directly use StringViews.
2022-07-12 23:11:35 +02:00
sin-ack
3e1d0d9425 Tests: Make TestSourceLocation basic_scenario specify StringView length 2022-07-12 23:11:35 +02:00
sin-ack
3d656ba600 LibJS: Emit StringViews for ErrorType instances
This removes the need for calculating each string's length during
ErrorType use at the cost of storing it within the binary.
2022-07-12 23:11:35 +02:00
sin-ack
6c46383e23 LibChess: Add convenience constructor for Chess::Square
It didn't feel right to add sv suffixes to 2-character strings, so I
added this convenience constructor.
2022-07-12 23:11:35 +02:00
sin-ack
7456904a39 Meta+Userland: Simplify some formatters
These are mostly minor mistakes I've encountered while working on the
removal of StringView(char const*). The usage of builder.put_string over
Format<FormatString>::format is preferrable as it will avoid the
indirection altogether when there's no formatting to be done. Similarly,
there is no need to do format(builder, "{}", number) when
builder.put_u64(number) works equally well.

Additionally a few Strings where only constant strings were used are
replaced with StringViews.
2022-07-12 23:11:35 +02:00
sin-ack
7da00bfa8d AK: Add string literal helpers to AK::SourceGenerator
Since all uses of SourceGenerator are with literal strings, there is no
need to burden generators with the sv suffix.
2022-07-12 23:11:35 +02:00
sin-ack
6eecc65787 AK: Explicitly calculate length of char* when printing
This moves out the calculation of the char* out to the formatter.
Additionally, we now print (null) when a null pointer is passed.
2022-07-12 23:11:35 +02:00
sin-ack
52d017c611 AK: Make CheckedFormatString pass the char array size to StringView
This makes the assumption that we never pass a stack-allocated char
array to CheckedFormatString arguments (dbgln, outln, warnln). This
assumption seems to hold true for the current state of Serenity code, at
least. :^)
2022-07-12 23:11:35 +02:00
Liav A
4771917184 Kernel/Graphics: Simplify initialization flow explanation comment
Most of it was not relevant anymore to what we do in the initialization
method anyway, and now it represents it quite well and "to the point".
2022-07-12 19:54:48 +01:00
Liav A
5824f30752 Kernel/Graphics: Fix comparison of framebuffer type in initialization 2022-07-12 19:54:48 +01:00
Liav A
3bd0106755 Kernel/Graphics: Remove VGA folder and its content
We never supported VGA framebuffers and that folder was a big misleading
part of the graphics subsystem.

We do support bare-bones VGA text console (80x25), but that only happens
to be supported because we can't be 100% sure we can always initialize
framebuffer so in the worst scenario we default to plain old VGA console
so the user can still use its own machine.

Therefore, the only remaining parts of VGA is in the GraphicsManagement
code to help driving the VGA text console if needed.
2022-07-12 19:54:48 +01:00
Idan Horowitz
e39514721e LibWeb: Add missing break to avoid fallthrough in FlexFormattingContext
This silences a Clang warning.
2022-07-12 18:11:21 +03:00
Idan Horowitz
c70359ac04 LibWeb: Remove unused variable in FlexFormattingContext 2022-07-12 17:54:55 +03:00
Andreas Kling
dc13ced1a7 LibWeb: Express flex item cross axis alignment as offsets-from-center
This allows us to perform cross axis alignment without knowing the final
cross size of the flex container.
2022-07-12 15:55:43 +02:00