summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-12-06AK: Ignore -Wshadow in TRY() and MUST()Linus Groh
This makes the warning in CLion disappear when nesting them.
2022-12-06AK: Add a helper macro to temporarily ignore diagnostics with _Pragma()Linus Groh
2022-12-063DFileViewer: Properly propagate errors from WavefrontOBJLoaderMaciej
Fixes 3 FIXMEs.
2022-12-06AK: Introduce the new String, replacement for DeprecatedStringAndreas Kling
DeprecatedString (formerly String) has been with us since the start, and it has served us well. However, it has a number of shortcomings that I'd like to address. Some of these issues are hard if not impossible to solve incrementally inside of DeprecatedString, so instead of doing that, let's build a new String class and then incrementally move over to it instead. Problems in DeprecatedString: - It assumes string allocation never fails. This makes it impossible to use in allocation-sensitive contexts, and is the reason we had to ban DeprecatedString from the kernel entirely. - The awkward null state. DeprecatedString can be null. It's different from the empty state, although null strings are considered empty. All code is immediately nicer when using Optional<DeprecatedString> but DeprecatedString came before Optional, which is how we ended up like this. - The encoding of the underlying data is ambiguous. For the most part, we use it as if it's always UTF-8, but there have been cases where we pass around strings in other encodings (e.g ISO8859-1) - operator[] and length() are used to iterate over DeprecatedString one byte at a time. This is done all over the codebase, and will *not* give the right results unless the string is all ASCII. How we solve these issues in the new String: - Functions that may allocate now return ErrorOr<String> so that ENOMEM errors can be passed to the caller. - String has no null state. Use Optional<String> when needed. - String is always UTF-8. This is validated when constructing a String. We may need to add a bypass for this in the future, for cases where you have a known-good string, but for now: validate all the things! - There is no operator[] or length(). You can get the underlying data with bytes(), but for iterating over code points, you should be using an UTF-8 iterator. Furthermore, it has two nifty new features: - String implements a small string optimization (SSO) for strings that can fit entirely within a pointer. This means up to 3 bytes on 32-bit platforms, and 7 bytes on 64-bit platforms. Such small strings will not be heap-allocated. - String can create substrings without making a deep copy of the substring. Instead, the superstring gets +1 refcount from the substring, and it acts like a view into the superstring. To make substrings like this, use the substring_with_shared_superstring() API. One caveat: - String does not guarantee that the underlying data is null-terminated like DeprecatedString does today. While this was nifty in a handful of places where we were calling C functions, it did stand in the way of shared-superstring substrings.
2022-12-06Meta: Manually compute the length of the WASM JS REPL source stringTimothy Flynn
The REPL does not have a reliable way to tell us the UTF-8 byte count of the source string, so we must use strlen() ourselves.
2022-12-06LibJS: Intercept returns through finally blocks in BytecodeHendiadyoin1
This is still not perfect, as we now actually crash in the `try-finally-continue` tests, while we now succeed all `try-catch-finally-*` tests. Note that we do not yet go through the finally block when exiting the unwind context through a break or continue.
2022-12-06LibJS: Don't try to manage unwind contexts in the execution loop in BCHendiadyoin1
We are already doing this in a good manner via the generated code, doing so in the execution loop as well will cause us to pop contexts multiple times, which is not very good.
2022-12-06LibJS: Remove FinishUnwind instructionHendiadyoin1
This is essentially a LeaveUnwind+Jump, so lets just do that, that will make it easier to optimize it, or see unwind state transitions
2022-12-06LibJS: Leave unwind contexts on enter of finally blocks in BytecodeHendiadyoin1
Before we were doing so while exiting the catch-block, but not when exiting the try-block. This now centralizes the responsibility to exit the unwind context to the finalizer, ignoring return/break/continue. This makes it easier to handle the return case in a future commit.
2022-12-06AK: Take the bump-allocated chunk header into account in destroy_all()Ali Mohammad Pur
Previously we allowed the end_offset to be larger than the chunk itself, which made it so that certain input sizes would make the logic attempt to delete a nonexistent object. Fixes #16308.
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-12-06LibWeb: Do not try to place out-of-flow blocks in anonymous nodesAliaksandr Kalenik
Currently placing floating blocks in anonymous nodes makes https://stackoverflow.com/ hang so let's leave it to try to place only absolute blocks in anonymous nodes for now. Also it breaks flex formatting when element with floating is flex child.
2022-12-05Meta: Initialize the WASM JS REPL with a known time zoneTimothy Flynn
The runtime environment of the WASM REPL does not have time zone information; the file system is virtual (does not have /etc/localtime), and the TZ environment variable is not set. This causes LibTimeZone to always fall back to UTC. Instead, we can get the time zone from the user's browser before we enter this limited environment. The REPL website will pass the time zone into the WASM REPL.
2022-12-05Meta: Explicitly link generated compile-time data into the WASM JS REPLTimothy Flynn
Without this, we were in a weird state where LibTimeZone believed it had TZDB data, but that data wasn't actually available to it. This caused functions like JS::get_named_time_zone_offset_nanoseconds() to trip an assertion when entering "new Date();" into the REPL.
2022-12-05LibAudio: Use `NonnullOwnPtr` to keep track of LoaderPlugin streamsTim Schumacher
This doesn't have any immediate uses, but this adapts the code a bit more to `Core::Stream` conventions (as most functions there use NonnullOwnPtr to handle streams) and it makes it a bit clearer that this pointer isn't actually supposed to be null. In fact, MP3LoaderPlugin and FlacLoaderPlugin apparently forgot to check for that completely before starting to decode data.
2022-12-05LibAudio: Switch LoaderPlugin to a more traditional constructor patternTim Schumacher
This now prepares all the needed (fallible) components before actually constructing a LoaderPlugin object, so we are no longer filling them in at an arbitrary later point in time.
2022-12-05LibAudio: Stop passing `Bytes` by referenceTim Schumacher
`Bytes` is very slim, so the memory and/or performance gains from passing it by reference isn't that big, and it passing it by value is more compatible with xvalues, which is handy for things like `::try_create(buffer.bytes())`.
2022-12-05LibWeb: Fix box-shadows where the border-radius is < the blur-radiusMacDue
This fixes a rendering issue where box-shadows would not appear or render completely broken if the blur radius was larger than the border radius (border-radius < 2 * blur-radius to be exact).
2022-12-05LibWeb: Inherit TableFormattingContext from FC instead of BFCAliaksandr Kalenik
2022-12-05LibWeb: Add vertical-align support for table cellsAliaksandr Kalenik
2022-12-05LibWeb: Move box_baseline from LineBuilder.cpp to LayoutState.cppAliaksandr Kalenik
2022-12-05LibWeb: Implement intrinsic width calculation for TFCAliaksandr Kalenik
2022-12-05LibWeb: Take rowspan into account while table formattingAliaksandr Kalenik
2022-12-05LibWeb: Start implementation of CSS Table 3 specAliaksandr Kalenik
Here I try to address bug where content of table overflows it's width (hacker news is an example of such site) by reimplementing some parts of table formatting context. Now TFC implements first steps of: https://www.w3.org/TR/css-tables-3/#table-layout-algorithm but column width and row height distribution steps are still very incomplete.
2022-12-05LibGUI: Fix a typoCameron Youell
2022-12-05Documentation: Fix typo in AdvancedBuildInstructions.mdAgustin Gianni
Fixes a small typo where the word `are` was missing.
2022-12-05Kernel: Don't memset() allocated memory twice in kcalloc()Andreas Kling
This patch adds a way to ask the allocator to skip its internal scrubbing memset operation. Before this change, kcalloc() would scrub twice: once internally in kmalloc() and then again in kcalloc(). The same mechanism already existed in LibC malloc, and this patch brings it over to the kernel heap allocator as well. This solves one FIXME in kcalloc(). :^)
2022-12-04Ports: Update serenity-theming app use latest commitdjwisdom
Add fonts Hantschrift and Schwedische Schreibschrift
2022-12-04MouseSettings: Add "Natural scrolling" toggleFiliph Sandström
2022-12-04WindowServer: Add "Natural scrolling" supportFiliph Sandström
Also commonly referred to as "reverse scrolling" or "inverted scrolling".
2022-12-04Meta: Update all references of clang-format-14 to clang-format-15Liav A
Also, we add a section that describes how to get an updated clang-format with multiple possible options to do that.
2022-12-04WebContent+WebDriver: Implement `POST /session/{id}/window` endpointVictor Song
2022-12-04WebContent: Unveil /usr/lib as readableMacDue
This is required to load libsoftgpu for the WebGL demos.
2022-12-04DisplaySettings: Remove unnecessary check for an overridden themeOsamu-kj
Issue discussed in #16290
2022-12-04Utilities: Add stringsAlec Murphy
2022-12-04LibGUI: Swap Next and Previous button on IncrementalSearchBannerŠtěpán Balážik
This order seems more natural as it is used in basically all apps on other systems (e.g. Firefox, CLion,...).
2022-12-03Documentation: Recommend CLion code style settings over manual stepsAndreas Oppebøen
Changing the naming conventions one-by-one was tedious and error-prone. A settings file is likely to be more forward compatible than a screenshot. The settings file was made by repeating the manual steps provided in the documentation, and exporting the file in CLion.
2022-12-03Everywhere: Remove 'clang-format off' comments that are no longer neededLinus Groh
https://github.com/SerenityOS/serenity/pull/15654#issuecomment-1322554496
2022-12-03Everywhere: Run clang-formatLinus Groh
2022-12-03Meta: Switch to clang-format-15 as the standard formatterLinus Groh
The two major changes noticeable on the SerenityOS codebase are: - Much improved support for const placement, clang-format-14 ignored our east-const configuration in various places - Different formatting for requires clauses, now breaking them onto their own line, which helps with readability a bit Current versions of CLion also ship LLVM 15, so the built-in formatting now matches CI formatting again :^)
2022-12-03LibCodeComprehension: Add .clang-format to disable formatting for testsLinus Groh
Same as 42865b8975818116b922aa2411eb167618fc532c.
2022-12-03Ports: Update qt6-qt5compat to 6.4.0Andrew Kaster
2022-12-03Ports: Clean up host path detection in qt6-serenityAndrew Kaster
Follow the same pattern as the other Qt ports to use qmake to determine the location of host binaries and libraries.
2022-12-03Ports: Update Qt6 port to 6.4.0Andrew Kaster
While we're here, make the host path detection more portable.
2022-12-03LibC: Add definitions for missing ELF constantsAndrew Kaster
Qt 6.4.0 relies on the definitions of ELFOSABI_GNU, ELFOSABI_AIX, and EM_S390 existing.
2022-12-03Ports: Use CMake to build the zstd portAndrew Kaster
This makes the port install drop the CMake install files into the sysroot, which is friendlier to macOS users. Homebrew CMake really likes to pick homebrew zstd, even for cross-builds.
2022-12-03Ports: Add port for double-conversion 3.2.1Andrew Kaster
This IEEE floating point conversion library is required by Qt
2022-12-03Kernel: Implement PIT::set_periodic() and PIT::set_non_periodic()Vitriol1744
2022-12-03Documentation: Update WSL QEMU Installation Requirementssno2
As Evil stated in the Discord, WSL users must install the DLL libraries with their QEMU Installation or else they will receive obscure errors about the syntax of the Meta/run.sh file as shown in SerenityOS#14033.