summaryrefslogtreecommitdiff
path: root/Libraries
AgeCommit message (Collapse)Author
2020-05-19LibTLS: Only try to flush data when neededAnotherTest
This patchset drops the write notifier, and schedules writes only when necessary. As a result, the CPU utilisation no longer spikes to the skies :^)
2020-05-19LibWeb: Fix duplicated public access modifier in StyleDeclarationLinus Groh
2020-05-19LibGUI: Use dbg() instead of dbgprintf() in GUI::DialogAndreas Kling
2020-05-19LibGUI: Remove some ancient unused debug logging in AbstractButtonAndreas Kling
2020-05-19LibProtocol: Make Protocol::Client constructor privateAndreas Kling
Core::Object derived objects should always have private constructors and use construct() for construction. This prevents accidentally keeping them in non-reference-counting containers.
2020-05-19LibGUI: Add ability to hide GUI::TabWidget's tab barLinus Groh
2020-05-19LibLine: Handle <return>s in incomplete data correctlyAnotherTest
Previously, we would concatenate all the commands together: ``` > sleep 5 echo well echo hello echo friends > echo wellecho helloecho friends ``` Also renames some variables to be more descriptive.
2020-05-18LibWeb: Allow reloading the current page with location.reload()Andreas Kling
2020-05-18LibWeb: Add location.protocol and location.hostAndreas Kling
2020-05-18LibWeb: Allow navigating to a new URL by setting window.location.hrefAndreas Kling
2020-05-18LibWeb: Add a simple window.location object with some getters :^)Andreas Kling
2020-05-18LibCore+LibTLS: Don't keep a "ready to write" notifier on all SocketsAndreas Kling
The "ready to write" notifier we set up in generic socket connection is really only meant to detect a successful connection. Once we have a TCP connection, for example, it will fire on every event loop iteration. This was causing IRC Client to max out the CPU by getting this no-op notifier callback over and over. Since this was only used by TLSv12, I changed that code to create its own notifier instead. It might be possible to improve TLS performance by only processing writes when actually needed, but I didn't look very closely at that for this patch. :^)
2020-05-18LibJS: Handle hex and unicode escape sequences in string literalsMatthew Olsson
Introduces the following syntax: '\x55' '\u26a0' '\u{1f41e}'
2020-05-18LibJS: Add Math.clz32()Linus Groh
2020-05-18LibJS: Add Math.expm1()Linus Groh
2020-05-18LibJS: Add Math.exp()Linus Groh
2020-05-18LibJS: Add Math.sign()Linus Groh
2020-05-18LibGUI: Make text selection feel better in single-line editorsAndreas Kling
We should always stay on the only line when selecting in a single-line editor, instead of requiring the user to keep the cursor inside the text when selecting. This broke with the variable-width font changes.
2020-05-18LibGUI: Add 1px of horizontal content padding to TextEditorAndreas Kling
This adds a little bit of needed air around the text.
2020-05-18LibGUI: Grow the "line content rect" slightly in single line text boxesAndreas Kling
Previously we would sometimes leave some pixels from an old selection rect on screen after clearing the selection. It was because the line content rect was smaller than the visual selection rect, and we were using the line content rect for invalidations.
2020-05-18LibGUI: Use a variable-width font by default in single-line TextEditorsAndreas Kling
This makes things like the Browser location bar look way nicer. :^)
2020-05-18LibGUI: Support variable-width fonts in TextEditorAndreas Kling
This patch reworks metric and coordinate computation to iterate over text content instead of making assumptions about fixed glyph widths.
2020-05-18LibJS: Return early from parseFloat() if argument is a numberLinus Groh
This saves us both a bit of time and accuracy, as Serenity's strtod() still is a little bit off sometimes - and stringifying the result and parsing it again just increases that offset.
2020-05-18LibGUI: Remove outdated FIXME in TextEditorAndreas Kling
2020-05-18LibJS: Remove is_nan() check in as_size_t() and fix to_size_t()Linus Groh
We need to call as_double() on the freshly converted number, not the value itself.
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-18LibVT: Pass the handler name to Launcher::open_url to control what gets launchedNicholas Hollett
Now we can pick which application gets opened in the context menu for URLs in the Terminal \o/
2020-05-18LaunchServer: Discover handlers from *.af files, allow launching based on a ↵Nicholas Hollett
known handler Adds metadata about apps for what file types and protocols they can handle, then consumes that in the LaunchServer. The LaunchServer can then use that to offer multiple options for what apps can open a given URL. Callers can then pass back the handler name to the LaunchServer to use an alternate app :)
2020-05-18LibJS: Rename to_{i32,size_t}() to as_{i32,size_t}() for clarityLinus Groh
As these parameter-less overloads don't change the value's type and just assume Type::Number, naming them as_i32() and as_size_t() is more appropriate.
2020-05-18LibGUI: Tweak EmojiInputDialog layout :^)Andreas Kling
2020-05-18LibJS: Check for exception after converting object to string primitiveLinus Groh
2020-05-18LibJS: Throw TypeError when coercing symbol to numberLinus Groh
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-18LibJS: Remove no-op SymbolPrototype::description_setter()Linus Groh
We can just give put_native_property() a nullptr for the setter.
2020-05-17LibGUI: Fix crash in TextDocument::remove(TextRange)Andreas Kling
Oops, we can't be appending substrings of a string we just deleted! Fix this by building up the new line instead of trying to clear and append in place. This works out nicely as we now do fewer document view updates when removing a range. :^)
2020-05-17LibVT: TerminalWidget now opts into emoji input by default :^)Andreas Kling
2020-05-17LibGUI: TextEditor now opts in to emoji input by default :^)Andreas Kling
2020-05-17LibGUI: Add a simple emoji input dialog activated by Ctrl+Alt+Space :^)Andreas Kling
Widgets can now opt in to emoji input via set_accepts_emoji_input(). If the focused widget accepts emoji input, we'll pop up a simple dialog with all the available emojis as clickable buttons. You can press escape if you change your mind and don't want an emoji. This UI layout definitely will not scale as we add more emojis, but it works for the moment, and we can adapt it as we go. Pretty cool! :^)
2020-05-17LibVT: Handle keydown events with multi-byte text correctlyAndreas Kling
TerminalWidget can now handle keydown events that contain multi-byte UTF-8 sequences. :^)
2020-05-17LibGUI: Make the TextEditor widget store UTF-32 codepointsAndreas Kling
A TextDocumentLine is now backed by a non-null-terminated sequence of Unicode codepoints encoded as UTF-32 (one u32 per codepoint.) This makes it possible to view and edit arbitrary Unicode text without strange cursor and selection behavior. You can freely copy and paste emojis between TextEditor and Terminal now. :^) Storing UTF-32 is quite space-inefficient, but we should be able to use the same optimization techniques as LibVT does to reduce it in the typical case where most text is ASCII. There are a lot of things that can be cleaned up around this code, but this works well enough that I'm pretty happy with it.
2020-05-17LibGfx: Add UTF-32 version of the text painting code pathsAndreas Kling
There's a large amount of code duplication here right now, which will need to be reduced.
2020-05-17LibVT: Make TerminalWidget::selected_text() produce UTF-8 strings :^)Andreas Kling
2020-05-17LibGfx: Let's make it Font::width(Utf32View)Andreas Kling
2020-05-17LibC: Don't let ctype isfoo() helpers access array out of boundsAndreas Kling
2020-05-17LibGfx: Add Font::width(u32* codepoints, size_t)Andreas Kling
This allows you to measure the width of a UTF-32 sequence.
2020-05-17LibJS: Add symbol objectsmattco98
This commit adds the following classes: SymbolObject, SymbolConstructor, SymbolPrototype, and Symbol. This commit does not introduce any new functionality to the Object class, so they cannot be used as property keys in objects.
2020-05-17LibGemini: Implement rendering text/gemini documents to HTMLAnotherTest
This also sets Content-Type to whatever 'meta' contains on success, to allow the browser to pick up what the document contains.
2020-05-17LibJS: Simplify various StringPrototype functionsLinus Groh
2020-05-17LibJS: Add Number.parseFloat()Linus Groh