summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2020-05-22Userland: Add a missing license headerAndreas Kling
2020-05-22LibWeb: Begin work on a spec-compliant HTML parserAndreas Kling
In order to actually view the web as it is, we're gonna need a proper HTML parser. So let's build one! This patch introduces the Web::HTMLTokenizer class, which currently operates on a StringView input stream where it fetches (ASCII only atm) codepoints and tokenizes acccording to the HTML spec tokenization algo. The tokenizer state machine looks a bit weird but is written in a way that tries to mimic the spec as closely as possible, in order to make development easier and bugs less likely. This initial version is far from finished, but it can parse a trivial document with a DOCTYPE and open/close tags. :^)
2020-05-20Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem"Andreas Kling
This reverts commit c1eb744ff0a82cf6c8e3470ac10e2f417c7d9de2.
2020-05-20LibLine: Unify completion hooks and adapt its usersAnotherTest
LibLine should ultimately not care about what a "token" means in the context of its user, so force the user to split the buffer itself. This also allows the users to pick up contextual clues as well, since they have to lex the line themselves. This commit pacthes Shell and the JS repl to better handle completions, so certain wrong behaviours are now corrected as well: - JS repl can now complete "Object . getOw<tab>" - Shell can now complete "echo | ca<tab>" and paths inside strings
2020-05-20Build: Include headers from LibC, LibM, and LibPthread with -isystemAndrew Kaster
Make sure that userspace is always referencing "system" headers in a way that would build on target :). This means removing the explicit include_directories of Libraries/LibC in favor of having it export its headers as SYSTEM. Also remove a redundant include_directories of Libraries in the 'serenity build' part of the build script. It's already set at the top. This causes issues for the Kernel, and for crt0.o. These special cases are handled individually.
2020-05-20df: Don't include c++ standard <cstring>Andrew Kaster
Use string.h instead, since that's part of serenity :)
2020-05-18test-crypto: Don't put TLSv12 in an OwnPtr as it's ref-counted :)Andreas Kling
2020-05-18LibLine: Handle unicode correctlyAnotherTest
This commit also fixes a problem with us throwing out data that was inserted while a command was running.
2020-05-18LibJS: Pass Interpreter& to Value::to_number() et al.Linus Groh
This patch is unfortunately rather large and might make some things feel bloated, but it is necessary to fix a few flaws in LibJS, primarily blindly coercing values to numbers without exception checks - i.e. interpreter.argument(0).to_i32(); // can fail!!! Some examples where the interpreter would actually crash: var o = { toString: () => { throw Error() } }; +o; o - 1; "foo".charAt(o); "bar".repeat(o); To fix this, we now have the following... to_double(Interpreter&) to_i32() to_i32(Interpreter&) to_size_t() to_size_t(Interpreter&) ...and a whole lot of exception checking. There's intentionally no to_double(), use as_double() directly instead. This way we still can use these convenient utility functions but don't need to check for exceptions if we are sure the value already is a number. Fixes #2267.
2020-05-18LibJS: Change Value::to_object(Heap& -> Interpreter&)Linus Groh
Passing a Heap& to it only to then call interpreter() on that is weird. Let's just give it the Interpreter& directly, like some of the other to_something() functions.
2020-05-17ls: Make column alignment Unicode-aware :^)Andreas Kling
You can now have emojis in file names and they will line up correctly in "ls" output.
2020-05-16Kernel: Absorb LibBareMetal back into the kernelAndreas Kling
This was supposed to be the foundation for some kind of pre-kernel environment, but nobody is working on it right now, so let's move everything back into the kernel and remove all the confusion.
2020-05-16FileManager+LibGUI+Userland: Switch clipboard to MIME typesSergey Bugaev
We will now actually use MIME types for clipboard. The default type is now "text/plain" (instead of just "text"). This also fixes some issues in copy(1) and paste(1).
2020-05-15LibJS: Add side-effect-free version of Value::to_string()Andreas Kling
There are now two API's on Value: - Value::to_string(Interpreter&) -- may throw. - Value::to_string_without_side_effects() -- will never throw. These are some pretty big sweeping changes, so it's possible that I did some part the wrong way. We'll work it out as we go. :^) Fixes #2123.
2020-05-15js: Throw a regular SyntaxError for errors from the parserLinus Groh
2020-05-15LibJS: Remove syntax errors from lexerLinus Groh
Giving the lexer the ability to generate errors adds unnecessary complexity - also it only calls its syntax_error() function in one place anyway ("unterminated string literal"). But since the lexer *also* emits tokens like Eof or UnterminatedStringLiteral, it should be up to the consumer of these tokens to decide what to do. Also remove the option to not print errors to stderr as that's not relevant anymore.
2020-05-15ps: Widen the username column slightlyAndreas Kling
2020-05-14open: Create a Core::EventLoop before using Desktop::LauncherAndreas Kling
We can't talk to IPC servers without having an event loop.
2020-05-14Build: Switch to CMake :^)Sergey Bugaev
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-10ls: Emit hyperlinks for files outside the current directoryAndreas Kling
2020-05-10LibLine: Support RGB colorsAnotherTest
This also patches Userland/js.
2020-05-10Userland: Send absolute paths to LaunchServer and show what failedAnotherTest
2020-05-09Userland: Add unzip commandAndres Vieira
The unzip command will unzip a zip file passed as an argument into the current pwd, with the syntax: unzip file.zip This implementation is pretty barebones as it does not support things like file access times, compression or even compression detection, so if the user tries to unzip a compressed zip most probably he would find wrong data inside the files. However it's an starting point :^)
2020-05-09Userland: Add missing copyright header to test-crypto.cppLinus Groh
2020-05-09Userland: Add missing copyright header to disasm.cppLinus Groh
2020-05-09ls: Make filenames in the output hyperlinkedAndreas Kling
This allows you to Ctrl+Click in Terminal to open files in "ls" output.
2020-05-09LibDesktop: Switch to LaunchServer for DesktopServices::openNicholas Hollett
Moves DirectoryServices out of LibCore (because we need to link with LibIPC), renames it Desktop::Launcher (because Desktop::DesktopServices doesn't scan right) and ports it to use the LaunchServer which is now responsible for starting programs for a file.
2020-05-09Userland: Remove double-'#include' in date.cppBen Wiederhake
2020-05-08Kernel+Userland: Add "settime" pledge promise for setting system timeAndreas Kling
We now require the "settime" promise from pledged processes who want to change the system time.
2020-05-06Misc: Replace "String(string_view)" with "string_view.to_string()"Linus Groh
StringView::to_string() was added in 917ccb1 but not actually used anywhere yet.
2020-05-05js: Tighten up ReplConsoleClient::trace() a little bitAndreas Kling
Remove a bunch of unnecessary String copying.
2020-05-05LibJS: Implement exponentiation assignment operator (**=)Linus Groh
2020-05-05LibJS: Implement bitwise assignment operators (&=, |=, ^=)Linus Groh
2020-05-05js: Customise the behaviour of JS::Console with ReplConsoleClientEmanuele Torre
This also makes our JavaScript tests not fail.
2020-05-05LibJS: Remove ConsoleMessage from LibJSEmanuele Torre
We don't need to store the past messages in LibJS. We'll implement a way to let LibJS users expand the vanilla Console.
2020-05-05keymap: Fix crash introduced by 637ecdbAndreas Kling
Just because a Vector has some inline capacity doesn't mean we can put data at offsets < Vector::size(). Fixes #2104.
2020-05-04LibJS: Add template literalsmattco98
Adds fully functioning template literals. Because template literals contain expressions, most of the work has to be done in the Lexer rather than the Parser. And because of the complexity of template literals (expressions, nesting, escapes, etc), the Lexer needs to have some template-related state. When entering a new template literal, a TemplateLiteralStart token is emitted. When inside a literal, all text will be parsed up until a '${' or '`' (or EOF, but that's a syntax error) is seen, and then a TemplateLiteralExprStart token is emitted. At this point, the Lexer proceeds as normal, however it keeps track of the number of opening and closing curly braces it has seen in order to determine the close of the expression. Once it finds a matching curly brace for the '${', a TemplateLiteralExprEnd token is emitted and the state is updated accordingly. When the Lexer is inside of a template literal, but not an expression, and sees a '`', this must be the closing grave: a TemplateLiteralEnd token is emitted. The state required to correctly parse template strings consists of a vector (for nesting) of two pieces of information: whether or not we are in a template expression (as opposed to a template string); and the count of the number of unmatched open curly braces we have seen (only applicable if the Lexer is currently in a template expression). TODO: Add support for template literal newlines in the JS REPL (this will cause a syntax error currently): > `foo > bar` 'foo bar'
2020-05-04sysctl: Permit 'sysctl -a' invocationBen Wiederhake
The point of '-a' is to list all keys. It is counter-intuitive to require the user to then supply a specific key additionally.
2020-05-04sysctl: Fix newlines in error messagesBen Wiederhake
2020-05-03LibTextCodec: Start fleshing out a simple text codec libraryAndreas Kling
We're starting with a very basic decoding API and only ISO-8859-1 and UTF-8 decoding (and UTF-8 decoding is really a no-op since String is expected to be UTF-8.)
2020-05-03ProtocolServer: Pass HTTP response headers to the clientAndreas Kling
We now store the response headers in a download object on the protocol server side and pass it to the client when finishing up a download. Response headers are passed as an IPC::Dictionary. :^)
2020-05-03LibCrypto: Small fixes in BigInteger & test-cryptoDexesTTP
2020-05-03test-crypto: Display execution time for passing testsDexesTTP
2020-05-03ProtocolServer: Implement and handle download progressAnotherTest
Also updates `pro` to display download progress and speed on stderr
2020-05-03Userland: Fix leak in keymapShannon Booth
Pretty harmless here, but eh
2020-05-02js: Ignore property attributes for completionLinus Groh
Only being able to complete enumerable properties is annoying, especially since we updated everything to use the correct attributes. Most standard built-in objects are *not* enumerable.
2020-05-02Userland: Tweak the tests in test-cryptoAnotherTest
- Clarify the purpose of "AES | Specialised Encrypt" - Decouple the TLS test from the host machine - Add a "test" mode to run all available tests
2020-05-02LibCrypto: Rename UnsignedBigInteger APIs to match their actionsAnotherTest
2020-05-02Userland test-crypto: Add interactive mode for the tls 'mode'AnotherTest
For all your raw TLS testing needs :^)
2020-05-02LibTLS: Switch to Hash::Manager for hashing and add SHA1AnotherTest
Now we can talk to google.com