summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-12-29LibJS: Ensure get_new_target() never returns an empty valueLinus Groh
Also add spec comments and remove a redundant exception check while we're here :^)
2021-12-29LibJS: Remove unused MemberExpression::computed_property_name()Linus Groh
2021-12-29less: Handle tabs in line wrappingPeter Elliott
Before tabs were treated as a width of 1, which would cause issues with man page headers.
2021-12-29Userland: Port less(1) to LibMainPeter Elliott
2021-12-29less: Remove all formatting before printing status linePeter Elliott
2021-12-29less: Dynamically re-wrap lines on resizePeter Elliott
This change moves from wrapping lines at the start to operating on whole lines and wrapping them as needed. This has a few added benefits: - line numbers are now always accurate. - going to a line actually works
2021-12-28Magnifier: Add colorblind preview optionsTheGrizzlyDev
Add the same preview options as the theme editor so you can test the accessibility of anything on your desktop. Both tools share the same shortcuts.
2021-12-28LibCore+chown: Return ErrorOr<Optional<...>> for getgrnam and getpwnamKenneth Myhra
This patch returns an empty Optional<...> instead of an Error for Core::System::getgrname and Core::System::getpwnam if we can't find a matching group or user entry. It also updates the 'chown' utility to support this new behavior.
2021-12-28ImageViewer: Change how scaling worksMaciej
- Store scale as a (float) factor (not as %) - Make scaling exponential so that matches PixelPaint and another image viewers/editors/etc
2021-12-28Profiler: Extract percentage gradient calculation into its own fileStephan Unverwerth
2021-12-28Profiler: Make everything east-const :^)Stephan Unverwerth
2021-12-28Profiler: Add source code viewStephan Unverwerth
This adds a new view mode to profiler which displays source lines and samples that occured at those lines. This view can be opened via the menu or by pressing CTRL-S. It does this by mapping file names from DWARF to "/usr/src/serenity/..." i.e. source code should be copied to /usr/src/serenity/Userland and /usr/src/serenity/Kernel to be visible in this mode. Currently *all* files contributing to the selected function are loaded completely which could be a lot of data when dealing with lots of inlined code.
2021-12-28pls: Stop on first non option when parsing argumentsIdan Horowitz
This allows using pls on a program with arguments more ergonomically, e.g. `pls -- echo "hello friends"` can now simply be done as: `pls echo "hello friends"`.
2021-12-28Kernel: Remove the kmalloc_eternal heap :^)Andreas Kling
This was a premature optimization from the early days of SerenityOS. The eternal heap was a simple bump pointer allocator over a static byte array. My original idea was to avoid heap fragmentation and improve data locality, but both ideas were rooted in cargo culting, not data. We would reserve 4 MiB at boot and only ended up using ~256 KiB, wasting the rest. This patch replaces all kmalloc_eternal() usage by regular kmalloc().
2021-12-28UserspaceEmulator: Exclude special ranges from RangeAllocatorDaniel Bertalan
If we do not mark these ranges as reserved, RangeAllocator might later give us addresses that overlap these, which then causes an assertion failure in the SoftMMU. This behavior led to recurring CI failures, and sometimes made programs as simple as `/bin/true` fail. Fixes "Crash 1" reported in #9104
2021-12-28LibVT: Handle window resize after history overflowryanb-dev
Addresses an issue in which a window resize event after history overflow would cause the Terminal to crash due to a failed assertion. The problematic assertion was removed and the logic updated to support inserting lines even when the start of the history is at an offset (due to an overflow). Resolves #10987
2021-12-28ThemeEditor: Implement a way to simulate color blindness in previewTheGrizzlyDev
Implement a mechanism that allows us to alter colors so that they mimic those a colorblind person would see. From the color we can then alter the colors for the whole preview so we can simulate everything in the theme including icons/decorations. This filter is also available as a Filter in LibGfx so it can be reused in multiple other places. The color simulation algorithm is based on this one https://github.com/MaPePeR/jsColorblindSimulator publicly available.
2021-12-28LibJS: Also throw exception when returning throw completion from awaitLinus Groh
...for now - the reason being that the AST breaks 'completion bubbling' and returns a plain Value, and code at the call site relies on the VM having an exception set when converting the plain value back into a completion. Fixes #11301.
2021-12-28HackStudio: Highlight AF files as INIMaciej
2021-12-28TextEditor: Highlight AF files as INIMaciej
2021-12-28LibC: Add in6addr_loopback and IN6ADDR_LOOPBACK_INIT constantBrian Gianforcaro
Much like the existing in6addr_any global and the IN6ADDR_ANY_INIT macro, our LibC is also expected to export the in6addr_loopback global and the IN6ADDR_LOOPBACK_INIT constant. These were found by the stress-ng port.
2021-12-28LibC: Add rindex() and index() APIsBrian Gianforcaro
These POSIX APIs are defined as mapping directly to `strrchr` and `strchr` respectively. These are needed for the latest version of the stress-ng port, and also give us better POSIX compliance.
2021-12-28LibC: Add alphasort() implementationBrian Gianforcaro
This is a POSIX API required for the latest stress-ng port.
2021-12-28LibC: Add POSIX spec comments for dirent APIsBrian Gianforcaro
2021-12-28Taskbar: Add context menu to remove quicklaunch itemsfaxe1008
This change adds a context menu for each app button to remove items from the quicklaunch section of the Taskbar.
2021-12-28Taskbar: Add dropping of AppFiles to QuickLaunchfaxe1008
This change adds the capability to drop AppFiles to the quick launch section of the Taskbar. All logic was moved to a new QuickLaunchWidget.
2021-12-28Help: Fix crash when trying to load libunicodedata.soRummskartoffel
2021-12-28FileManager: Add "Create Archive" actionJulian Offenhäuser
This option will appear when you select one or more files or directories. It will then ask the user to enter a name for the new archive (or use the current directories' name if left empty) and create it under that name in the currently opened directory. Note that only .zip files are currently supported.
2021-12-27HackStudio: Ask to create a non-existent directory when making a projectConor Byrne
Previously, if the parent directory didn't exist when making a project, it would say that the creation directory was 'invalid' which isn't necessarily true. This patch prompts the user to ask if they would like to create the parent directory when creating a project, instead of treating it as an 'invalid' directory.
2021-12-27LibWeb: Use start_of_input_stream_twin() for is_valid_escape_sequence()Sam Atkins
This means we can get rid of the hacks where we were peeking a code point instead of getting the next one so that we could peek_twin() later. Now, we follow the spec more closely. :^)
2021-12-27LibWeb: Pass correct values to would_start_an_identifier()Sam Atkins
Same as with would_start_a_number(), we were skipping a code point.
2021-12-27LibWeb: Pass correct values to would_start_a_number()Sam Atkins
This fixes the crash that Luke found using Domato: ```css . foo { mso-border-alt: solid .-1pt; } ``` The spec distinguishes between "If the next 3 code points would start..." and "If the input stream starts with..." but we were treating them the same way, skipping the first code point in the process.
2021-12-27LibWeb: Add CSS::Tokenizer::start_of_input_stream_[twin|triplet]()Sam Atkins
These correspond to "If the input stream starts with..." in the spec, which up until now we were not handling correctly, which led to some fun bugs. As noted, reconsuming the input code point in order to read its value is hacky, but works. Keeping track of the current code point in Tokenizer would be nicer, when I'm feeling brave enough to mess with it!
2021-12-27LibCore+Services: Make TCPServer propagate errorsSam Atkins
2021-12-27TelnetServer: Port to LibMainSam Atkins
This is only a very basic change, since the fallible function calls are all inside the `on_ready_to_accept` callback.
2021-12-27EchoServer: Port to LibMainSam Atkins
2021-12-27LibCore: Add ErrorOr wrappers to socket syscallsSam Atkins
These are all pretty simple so I thought I would add them all in one go: - socket() - bind() - listen() - accept() - accept4() - connect() - shutdown() - send() - sendmsg() - sendto() - recv() - recvmsg() - recvfrom() - getsockopt() - setsockopt() - getsockname() - getpeername() - socketpair()
2021-12-27LibJS: Implement console.time/timeLog/timeEnd() methodsSam Atkins
2021-12-27LibWeb: Add rudimentary styling to `<details>` and `<summary>`Sam Atkins
2021-12-27LibJS+WebContent+Browser+js: Implement console.group() methodsSam Atkins
This implements: - console.group() - console.groupCollapsed() - console.groupEnd() In the Browser, we use `<details>` for the groups, which is not actually implemented yet, so groups are always open. In the REPL, groups are non-interactive, but still indent any output. This looks weird since the console prompt and return values remain on the far left, but this matches what Node does so it's probably fine. :^) I expect `console.group()` is not used much outside of browsers.
2021-12-27LibJS+WebContent+js: Bring console.trace() to specSam Atkins
The spec very kindly defines `Printer` as accepting "Implementation-specific representations of printable things such as a stack trace or group." for the `args`. We make use of that here by passing the `Trace` itself to `Printer`, instead of having to produce a representation of the stack trace in advance and then pass that to `Printer`. That both avoids the hassle of tracking whether the data has been html-encoded or not, and means clients don't have to implement the whole `trace()` algorithm, but only the code needed to output the trace.
2021-12-27LibJS+WebContent+js: Bring console.assert() to specSam Atkins
2021-12-27LibJS+WebContent+js: Bring console.clear() to specSam Atkins
This is identical to before, since we don't have "group stacks" yet, but clear() now uses ThrowCompletionOr.
2021-12-27LibJS+WebContent+js: Bring console.count[Reset]() to specSam Atkins
The `CountReset` log level is displayed as a warning, since the message is always to warn that the counter doesn't exist. This is also in line with the table at https://console.spec.whatwg.org/#loglevel-severity
2021-12-27LibJS+WebContent+js: Reimplement console.log() and friends to specSam Atkins
This implements the Logger and Printer abstract operations defined in the console spec, and stubs out the Formatter AO. These are then used for the "output a categorized log message" functions.
2021-12-27WindowServer: Stop trying to close windows that are already destroyedSam Atkins
2021-12-27WindowServer: Use is_internal() instead of checking if the client existsSam Atkins
2021-12-27LibWeb: Implement CanvasRenderingContext2D.isContextLost()Linus Groh
Note that we don't implement the "context lost steps" yet, so this will always return the initial value (false).
2021-12-27LibWeb: Implement CanvasRenderingContext2D.reset()Linus Groh
2021-12-27LibWeb: Implement CanvasRenderingContext2D.restore()Linus Groh