summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2020-05-30LibMarkdown: Change internal MD API to return OwnPtrsFalseHonesty
Previously, all Markdown blocks had a virtual parse method which has been swapped out for a static parse method returning an OwnPtr of that block's type. The Text class also now has a static parse method that will return an Optional<Text>.
2020-05-30LibMarkdown: Change MD Document parse API to return a RefPtrFalseHonesty
Markdown documents are now obtained via the static Document::parse method, which returns a RefPtr<Document>, or nullptr on failure.
2020-05-29LibCrypto: Fix some issues preventing compilation w/ clang 10AnotherTest
2020-05-29Kernel+Userland: Support remounting filesystems :^)Sergey Bugaev
This makes it possible to change flags of a mount after the fact, with the caveats outlined in the man page.
2020-05-29Userland+SystemMonitor: Recognize the MS_RDONLY mount flagSergey Bugaev
2020-05-29Userland: Fix displaying mount sourceSergey Bugaev
The key is now called "source" instead of "device".
2020-05-28LibWeb: Rename Web::HtmlView => Web::PageViewAndreas Kling
This widget doesn't just view HTML, it views a web page. :^)
2020-05-28LibJS: Add strict modeMatthew Olsson
Adds the ability for a scope (either a function or the entire program) to be in strict mode. Scopes default to non-strict mode. There are two ways to determine the strict-ness of the JS engine: 1. In the parser, this can be accessed with the parser_state variable m_is_strict_mode boolean. If true, the Parser is currently parsing in strict mode. This is done so that the Parser can generate syntax errors at parse time, which is required in some cases. 2. With Interpreter.is_strict_mode(). This allows strict mode checking at runtime as opposed to compile time. Additionally, in order to test this, a global isStrictMode() function has been added to the JS ReplObject under the test-mode flag.
2020-05-28LibJS: Object index properties have descriptors; Handle sparse indicesMatthew Olsson
This patch adds an IndexedProperties object for storing indexed properties within an Object. This accomplishes two goals: indexed properties now have an associated descriptor, and objects now gracefully handle sparse properties. The IndexedProperties class is a wrapper around two other classes, one for simple indexed properties storage, and one for general indexed property storage. Simple indexed property storage is the common-case, and is simply a vector of properties which all have attributes of default_attributes (writable, enumerable, and configurable). General indexed property storage is for a collection of indexed properties where EITHER one or more properties have attributes other than default_attributes OR there is a property with a large index (in particular, large is '200' or higher). Indexed properties are now treated relatively the same as storage within the various Object methods. Additionally, there is a custom iterator class for IndexedProperties which makes iteration easy. The iterator skips empty values by default, but can be configured otherwise. Likewise, it evaluates getters by default, but can be set not to.
2020-05-28LibWeb: Plumb content encoding into the new HTML parserAndreas Kling
We still don't handle non-ASCII input correctly, but at least now we'll convert e.g ISO-8859-1 to UTF-8 before starting to tokenize. This patch also makes "view source" work with the new parser. :^)
2020-05-28Userland: Add a basic xargsAnotherTest
This adds a basic implementation of xargs. The implemenation is missing quite a few options, and is not entirely POSIX-compliant, but it gets the job done :^)
2020-05-27LibJS: Simplify and normalize publicly-exposed Object functionsMatthew Olsson
Previously, the Object class had many different types of functions for each action. For example: get_by_index, get(PropertyName), get(FlyString). This is a bit verbose, so these methods have been shortened to simply use the PropertyName structure. The methods then internally call _by_index if necessary. Note that the _by_index have been made private to enforce this change. Secondly, a clear distinction has been made between "putting" and "defining" an object property. "Putting" should mean modifying a (potentially) already existing property. This is akin to doing "a.b = 'foo'". This implies two things about put operations: - They will search the prototype chain for setters and call them, if necessary. - If no property exists with a particular key, the put operation should create a new property with the default attributes (configurable, writable, and enumerable). In contrast, "defining" a property should completely overwrite any existing value without calling setters (if that property is configurable, of course). Thus, all of the many JS objects have had any "put" calls changed to "define_property" calls. Additionally, "put_native_function" and "put_native_property" have had their "put" replaced with "define". Finally, "put_own_property" has been made private, as all necessary functionality should be exposed with the put and define_property methods.
2020-05-27test-crypto: Tweaks to make this build properly in LagomAndreas Kling
2020-05-27LibLine: Use Core::EventLoop for outer read loopAnotherTest
This commit changes LibLine's internal structure to work in an event loop, and as a result, also switches it to being a Core::Object.
2020-05-26LibJS: Fix incorrect token column values (#2401)Paul Redmond
- initializing m_line_column to 1 in the lexer results in incorrect column values in tokens on the first line of input. - not incrementing m_line_column when EOF is reached results in an incorrect column value on the last token.
2020-05-26js: Show a "source location hint" for syntax errors :^)Linus Groh
2020-05-26AK: Rename FileSystemPath -> LexicalPathSergey Bugaev
And move canonicalized_path() to a static method on LexicalPath. This is to make it clear that FileSystemPath/canonicalized_path() only perform *lexical* canonicalization.
2020-05-26Userland et al: Pledge sigaction when neededSergey Bugaev
* In some cases, we can first call sigaction()/signal(), then *not* pledge sigaction. * In other cases, we pledge sigaction at first, call sigaction()/signal() second, then pledge again, this time without sigaction. * In yet other cases, we keep the sigaction pledge. I suppose these could all be migrated to drop it or not pledge it at all, if somebody is interested in doing that.
2020-05-26Userland: Port sleep(1) to Core::ArgsParserSergey Bugaev
2020-05-25LibLine: Change get_line to return a Result<String, Error>AnotherTest
This fixes a bunch of FIXME's in LibLine. Also handles the case where read() would read zero bytes in vt_dsr() and effectively block forever by erroring out. Fixes #2370
2020-05-24LibWeb: A whole bunch of work towards spec-compliant <script> elementsAndreas Kling
This is still very unfinished, but there's at least a skeleton of code.
2020-05-24LibWeb: More work on the HTML parser and tokenizerAndreas Kling
The parser can now switch the state of the tokenizer! Very webby. :^)
2020-05-24functrace: use Core::ArgsParserItamar
2020-05-24LibWeb: Start building the tree building part of the new HTML parserAndreas Kling
This patch adds a new HTMLDocumentParser class. It keeps a tokenizer object internally and feeds itself with one token at a time from it. The names and idioms in this class are expressed as closely to the actual HTML parsing spec as possible, to make development as easy and bug free as possible. :^) This is going to become pretty large, but it's pretty cool!
2020-05-23Userland: Allow passing a specific HTML file to the "ht" test programAndreas Kling
2020-05-23Kernel+LibC: Fix various build issues introduced by ssize_tAndreas Kling
Now that ssize_t is derived from size_t, we have to
2020-05-23Userland/js: Do not construct a full CompletionSuggestion just to compare ↵AnotherTest
against
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 :^)