summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-06-05LibWeb: Fix off-by-one error in SyntaxHighlighterMax Wipfli
This changes the HTML SyntaxHighlighter to conform to the now-fixed rendering of syntax highlighting spans in GUI::TextEditor. It also avoids emitting tokens if they have a zero or negative length. This fixes a bug where single-character tokens were not highlighted properly.
2021-06-05LibWeb: Be more forgiving when adding source positions in HTMLTokenizerMax Wipfli
This patch changes HTMLTokenizer::nth_last_position to not fail if the requested position is not available. Rather, it will just return (0-0). While this is not the correct solution, it prevents the tokenizer from crashing just because it cannot find a source position. This should only affect SyntaxHighlighter.
2021-06-05LibWeb: Add debugging statements in SyntaxHighlighterMax Wipfli
This also changes SyntaxHighlighter.{h,cpp} to use east const style.
2021-06-05LibSQL: Fix off-by-one error in SyntaxHighlighterMax Wipfli
This changes the SQL SyntaxHighlighter to conform to the now-fixed rendering of syntax highlighting spans in GUI::TextEditor.
2021-06-05LibSQL: Clean up SyntaxHighlighter codeMax Wipfli
This changes SyntaxHighlighter.{cpp,h} to use east const style. It also removes two unused headers and simplifies a loop.
2021-06-05Shell: Fix off-by-one error in SyntaxHighlighterMax Wipfli
This changes the Shell syntax highlighter to conform to the now-fixed rendering of syntax highlighting spans in GUI::TextEditor. This also adds some debug output to make debugging easier.
2021-06-05LibGUI: Fix off-by-one error in Lexer tokensMax Wipfli
This changes the INI and GML lexers to conform to the now-fixed rendering of syntax highlighting spans in GUI::TextEditor. The other user of GMLToken::m_end, GMLAutocompleteProvider, has been modified to take into account that end position columns have been incremented by one.
2021-06-05LibGUI: Use CharacterTypes.h and constexpr functions in {INI,GML}LexerMax Wipfli
2021-06-05LibGUI: Use east const style in {INI,GML}Lexer.{cpp,h}Max Wipfli
2021-06-05LibJS: Fix off-by-one error in SyntaxHighlighterMax Wipfli
This changes the JS syntax highlighter to conform to the now-fixed rendering of syntax highlighting spans in GUI::TextEditor.
2021-06-05LibGUI: Fix off-by-one error in rendering of highlighted textMax Wipfli
This fixes an off-by-one error in TextEditor's rendering of the syntax highlighting as generated by Syntax::Highlighter and its subclasses. Before, a single character span was e.g. (0-3) to (0-3), but this was considered invalid by GUI::TextRange. Now, a single character span would be e.g. (0-3) to (0-4). This fix requires all Syntax::Highlighter subclasses to be adjusted, as they all relied on the previous implementation. This will then also fix a bug where single-character HTML tags wouldn't be highlighted.
2021-06-04Hearts: Don't destroy the animation handler while running itGunnar Beutner
2021-06-04HackStudio: Add comment about lexicographical insertion to ClassViewItamar
2021-06-04HackStudio: Use Node's name when inserting to the ClassView treeItamar
Previously, when traversing the ClassView tree to find the parent of a new node, we used the name of the node's declaration to find the path to the parent in the tree. However, some nodes in the tree do not have a matching declaration, which caused a VERIFY failure. To fix this, we now use the node's name when walking the tree. We can do this because the node's name should be identical to the name of its declaration. Closes #7702.
2021-06-04Solitaire+LibCards: Draw card stacks with rounded cornersTimothy Flynn
Now that the cards have rounded corners, draw the stack box behind the cards with rounded corners as well. This way, the corner of the stack box doesn't peek out from behind the cards. The caveat here is that the "play" card stack now needs to hold a reference to the "waste" stack beneath it so it knows when not to draw its background on top of the waste stack. To faciliate that, the array of card stacks is now a NonnullRefPtrVector so the play stack can store a smart pointer to the waste stack (instead of a raw pointer or reference).
2021-06-04LibGfx: Add helper for painting a rounded rect with equal corner radiiTimothy Flynn
2021-06-04hostname: Handle 'sethostname' errorsMaciej Zygmanowski
2021-06-04Taskbar: Make sure LibGUI/Desktop.h is usable in portsGunnar Beutner
Now that Desktop.h includes Services/Taskbar/TaskbarWindow.h we have to install Taskbar's header files so that Desktop.h can be used in ports or when building software in-target.
2021-06-04LibJS: Fix functions binding this to global object in strict modeRyan Chandler
This fixes an issue where this would be bound to the global object by default when operating in strict mode. According to the specification, the expected value for |this| when no binding is provided is undefined.
2021-06-04LibWasm+wasm: Switch to east-const to comply with project styleAli Mohammad Pur
Against my better judgement, this change is mandated by the project code style rules, even if it's not actually enforced.
2021-06-04Userland/wasm: Replace manual noop export with an automatic oneAli Mohammad Pur
Instead of manually specifying the types and names of imports to stub out, `--export-noop` can be used to export stub functions for any unresolved function import. This makes running and debugging random wasm files much easier.
2021-06-04LibWasm: Load and instantiate tablesAli Mohammad Pur
This commit is a fairly large refactor, mainly because it unified the two different ways that existed to represent references. Now Reference values are also a kind of value. It also implements a printer for values/references instead of copying the implementation everywhere.
2021-06-04LibWasm: Implement the br.table instructionAli Mohammad Pur
Unlike its name, this instruction has nothing to do with tables, it's just a very simple switch-case instruction.
2021-06-04LibWasm: Read from and write to memory as little-endianAli Mohammad Pur
The spec says so, we must do so.
2021-06-04LibJS/Tests: Catch exceptions in describe() itselfAli Mohammad Pur
Otherwise exceptions thrown in that state would simply terminate the test.
2021-06-04LibC: Define `MSG_OOB`Jelle Raaijmakers
2021-06-04LibC: Implement `execle()`Jelle Raaijmakers
2021-06-04LibC: Implement `mblen()`Jelle Raaijmakers
2021-06-04LibC: Add POSIX timer constantsJelle Raaijmakers
2021-06-04LibVT: Fix underlines incorrectly rendering in redDaniel Bertalan
Previously, `href` attributes weren't checked for not being empty when drawing their underlines. This caused any underline to be treated as an active `href`, hence the red color.
2021-06-04LibVT: Implement bright color supportDaniel Bertalan
Previously, we only used bright colors when the bold attribute was set. We now have the option to set it via escape sequences. We also needed to make the bold text behavior optional, as some color schemes do weird things with it. For example, Solarized uses it for various shades of gray, so bold green would turn into a light shade of gray. The following new escape sequences are supported: - `CSI 90;m` to `CSI 97;m`: set bright foreground color - `CSI 100;m` to `CSI 107;m`: set bright background color
2021-06-04LibVT+Terminal: Add color scheme supportDaniel Bertalan
This commit introduces color scheme support to Terminal. These are found in `/res/terminal_colors` and the default color scheme can be set in `~/.config/Terminal.ini`. Furthermore, a combo box is added for setting the color scheme at runtime. The previously used default color scheme has been added to `/res/terminal-colors/Default.ini`. To make the implementation more compatible with other color schemes, `TerminalWidget` now supports overriding the default foreground and background colors.
2021-06-04LibVT+Kernel: Create `Color` classDaniel Bertalan
Previously, we converted colors to their RGB values immediately when they were set. This meant that their semantic meaning was lost, we could not tell a precise RGB value apart from a named/indexed color. The new way of storing colors will allow us to retain this information, so we can change a color scheme on the fly, and previously emitted text will also be affected.
2021-06-04LibWeb: Remove Utf8View usage and try avoiding StringBuilder in TextNodeMax Wipfli
This patch completely reworks TextNode::compute_text_for_rendering(). It removes the unnecessary usage of Utf8View to find spaces in a String. Furthermore, it adds a couple fast return paths for common but trivial cases such as empty, single-character and whitespace-less strings. For the HTML spec bookmarks, around two thirds of all function calls (which amounts to around 10'000) use the fast paths and thus avoid allocating a StringBuilder just to build a copy of the already present String.
2021-06-04Taskbar: Allow creating menus for sub-categoriesGunnar Beutner
This change allows creating sub-categories in app files, e.g. with Category=Games/Puzzles.
2021-06-04LibTest: Add --json flag to JS test runnerLinus Groh
This will not show the colorful human-readable file results and final test results summary but instead output a JSON blob containing all test information, which can then be processed by other programs easily.
2021-06-04Profiler: Show the duration of the time interval chosenDhruvMaroo
2021-06-04LibCards: Don't draw the first card smaller than the othersGunnar Beutner
2021-06-04LibLine: Actually cancel the search editor on Ctl-Cbrapru
When the search editor calls on really_quit_event_loop to cancel the search, the command loaded in m_buffer would actually execute because really_quit_event_loop sends a new line character and then afterwards clears the buffer. By using end_search prior to exiting the event loop, this patch will appropriately clear the buffer, not execute any commands, and preserve the original loaded buffer after returning from a canceled search.
2021-06-04Solitaire: Fixes undo feature from incorrect merge conflict resolutionMatthew Jones
2021-06-04LibCpp: Revert change to strace.cpp AST test from bf8fd4cAndreas Kling
Since the purpose of this file is just to verify the AST generated, we can leave it alone.
2021-06-03LibCards: Draw cards with rounded card cornersDavid Isaksson
closes #7412
2021-06-03Everywhere: Remove accidental '\n' from various outln() invocationsAndreas Kling
Also convert outln(stderr, ...) to warnln(...)
2021-06-03LibGUI/FileIconProvider: Return s_file_icon when stat() failsMarcus Nilsson
Previously when using icon_for_path(), without specifying t_mode, on an anonymous file it would return an empty Icon causing problems down the line. Instead return the s_file_icon when stat fails.
2021-06-03Utilities: Make sure columns for ps are properly alignedGunnar Beutner
This updates ps so that it calculates the ideal column width instead of relying on hard-coded values. Previously the STATE column was too small to fit the state for "FinalizerTask".
2021-06-03KeyboardMapper: Fix crash upon loading an invalid JSON fileNonStandardModel
This fixes #7699. It would be nice to also show a GUI alert informing about the failure, but I will leave that for the future.
2021-06-03AK: Do not VERIFY on invalid code point bytes in UTF8ViewDexesTTP
The previous behavior was to always VERIFY that the UTF-8 bytes were valid when iterating over the code points of an UTF8View. This change makes it so we instead output the 0xFFFD 'REPLACEMENT CHARACTER' code point when encountering invalid bytes, and keep iterating the view after skipping one byte. Leaving the decision to the consumer would break symmetry with the UTF32View API, which would in turn require heavy refactoring and/or code duplication in generic code such as the one found in Gfx::Painter and the Shell. To make it easier for the consumers to detect the original bytes, we provide a new method on the iterator that returns a Span over the data that has been decoded. This method is immediately used in the TextNode::compute_text_for_rendering method, which previously did this in a ad-hoc waay. This also add tests for the new behavior in TestUtf8.cpp, as well as reinforcements to the existing tests to check if the underlying bytes match up with their expected values.
2021-06-03LibJS: Avoid allocations in the Exception constructorGunnar Beutner
2021-06-03LibJS: Optimize insertion order in the Exception constructorGunnar Beutner
By inserting the stack frames in the correct order we can improve the runtime for the test-js test suite by about 20%.
2021-06-03Everywhere: Replace ctype.h to avoid narrowing conversionsMax Wipfli
This replaces ctype.h with CharacterType.h everywhere I could find issues with narrowing conversions. While using it will probably make sense almost everywhere in the future, the most critical places should have been addressed.