summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-12LibWeb: Use fit-content size for flex items with indefinite cross sizeAndreas Kling
2022-07-12LibWeb: Stub out two functions on SVGGeometryElementAndreas Kling
These two were called by Discord while loading: - float getTotalLength(); - DOMPoint getPointAtLength(float distance);
2022-07-12LibWeb: Add barebones implementation of DOMPoint and DOMPointReadOnlyAndreas Kling
2022-07-12AK: Remove StringView(char const*) :^)sin-ack
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-12Tests: Remove StringView char const* initialization testsin-ack
We now explicitly disallow this.
2022-07-12AK+Userland+Tests: Remove URL(char const*) constructorsin-ack
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-12AK: Remove String <-> char const* comparison operatorssin-ack
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-12LibRegex: Remove RegexStringView(char const*) constructorsin-ack
This allowed passing in a nullptr for the StringView which will not be possible once StringView(char const*) is removed.
2022-07-12LibCore: Add FIXME note about converting Core::Account to use StringViewsin-ack
This prevents a bunch of utilities from using StringView for their arguments.
2022-07-12Everywhere: Use default StringView constructor over nullptrsin-ack
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-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
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-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
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-12Everywhere: Split Error::from_string_literal and Error::from_string_viewsin-ack
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-12Everywhere: Explicitly specify the size in StringView constructorssin-ack
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-12LibC: Convert getopt and getopt_long to new StringView usagesin-ack
2022-07-12LibCore: Add convenience templates for System::{unveil,pledge}sin-ack
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-12LibX86: Convert register names to StringViewssin-ack
2022-07-12Userland: Remove erroneous String -> char* -> StringView conversionssin-ack
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-12Userland: Convert command line arguments to String/StringViewsin-ack
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-12Tests: Convert TestQuotedPrintable decode test to use StringViewssin-ack
2022-07-12Tests: Convert TestBase64 decode test to use StringViews directlysin-ack
Previously it would rely on the implicit StringView conversions. Now the decode_equal function will directly use StringViews.
2022-07-12Tests: Make TestSourceLocation basic_scenario specify StringView lengthsin-ack
2022-07-12LibJS: Emit StringViews for ErrorType instancessin-ack
This removes the need for calculating each string's length during ErrorType use at the cost of storing it within the binary.
2022-07-12LibChess: Add convenience constructor for Chess::Squaresin-ack
It didn't feel right to add sv suffixes to 2-character strings, so I added this convenience constructor.
2022-07-12Meta+Userland: Simplify some formatterssin-ack
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-12AK: Add string literal helpers to AK::SourceGeneratorsin-ack
Since all uses of SourceGenerator are with literal strings, there is no need to burden generators with the sv suffix.
2022-07-12AK: Explicitly calculate length of char* when printingsin-ack
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-12AK: Make CheckedFormatString pass the char array size to StringViewsin-ack
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-12Kernel/Graphics: Simplify initialization flow explanation commentLiav A
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-12Kernel/Graphics: Fix comparison of framebuffer type in initializationLiav A
2022-07-12Kernel/Graphics: Remove VGA folder and its contentLiav A
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-12LibWeb: Add missing break to avoid fallthrough in FlexFormattingContextIdan Horowitz
This silences a Clang warning.
2022-07-12LibWeb: Remove unused variable in FlexFormattingContextIdan Horowitz
2022-07-12LibWeb: Express flex item cross axis alignment as offsets-from-centerAndreas Kling
This allows us to perform cross axis alignment without knowing the final cross size of the flex container.
2022-07-12LibWeb: Actually clamp flex line cross size to min/max-sizeAndreas Kling
We were dropping the result of css_clamp() on the floor, oops! Let's also mark it [[nodiscard]] so it won't happen again.
2022-07-12LibWeb: Don't crash when failing to create WebGL context on non-SerenityAndreas Kling
This makes Ladybird stop panicking on websites that try to use WebGL.
2022-07-12DevTools/HackStudio: Fix 'enabled' property of 'build' and 'run' buttonsferhatgec
2022-07-12DevTools/HackStudio: Add verify_make_is_installed()ferhatgec
2022-07-12LibWeb: Set up both containing block sizes before intrinsic sizingAndreas Kling
When calculating e.g the min-content height of some box, we would only set its containing block's height to 0 in the temporary formatting state. The containing block width was not touched at all. This patch aims to do a bit better by resolving indefinite containing block sizes to INFINITY before performing intrinsic sizing. We should probably also find a way to resolve definite containing block sizes, but I'll leave that for our future selves.
2022-07-12LibWeb: Floor scaled flex shrink factor at 1 when spec asks us toAndreas Kling
2022-07-12LibWeb: Take margin box into account when justifying flex itemsAndreas Kling
Before this patch, we were justifying based on the content box only, which led to misalignments along the main axis when items had non-zero padding, borders or margins.
2022-07-12LibWeb: Add safety mechanism to guard against non-finite layout sizesAndreas Kling
Due to some yet-to-be-found bug(s) in intrinsic sizing, we can sometimes end up deciding that some box has a non-finite intrinsic size. This will create unpleasant results, and may lead to some layout algorithms looping infinitely, so this patch adds a safeguard where we simply turn non-finite intrinsic sizes into zero (and complain a little bit in the debug log.)
2022-07-12LibWeb: Honor `align-self` over `align-items` when non-auto on flex itemAndreas Kling
2022-07-12Kernel: Annotate all `KBuffer` and `DoubleBuffer` with a custom nameTim Schumacher
2022-07-12LibJS: Add test case for %TypedArray%.prototype.toSplicedObinna Ikeh
2022-07-12LibJS: Add %TypedArray%.prototype.toSplicedObinna Ikeh
2022-07-12LibJS: Implement Intl.PluralRules.prototype.selectRangeTimothy Flynn
2022-07-12LibUnicode: Parse and generate per-locale plural rangesTimothy Flynn
2022-07-11LibWeb: Implement all "attributes" mutation records for MutationObserverLuke Wilde
2022-07-11LibWeb: Implement "characterData" mutation record for MutationObserverLuke Wilde