Age | Commit message (Collapse) | Author |
|
This patchset drops the write notifier, and schedules writes only when
necessary.
As a result, the CPU utilisation no longer spikes to the skies :^)
|
|
|
|
|
|
|
|
Core::Object derived objects should always have private constructors
and use construct() for construction. This prevents accidentally
keeping them in non-reference-counting containers.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
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. :^)
|
|
Introduces the following syntax:
'\x55'
'\u26a0'
'\u{1f41e}'
|
|
|
|
|
|
|
|
|
|
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.
|
|
This adds a little bit of needed air around the text.
|
|
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.
|
|
This makes things like the Browser location bar look way nicer. :^)
|
|
This patch reworks metric and coordinate computation to iterate over
text content instead of making assumptions about fixed glyph widths.
|
|
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.
|
|
|
|
We need to call as_double() on the freshly converted number, not the
value itself.
|
|
This commit also fixes a problem with us throwing out data that was
inserted while a command was running.
|
|
Now we can pick which application gets opened in the context menu for
URLs in the Terminal \o/
|
|
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 :)
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
We can just give put_native_property() a nullptr for the setter.
|
|
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. :^)
|
|
|
|
|
|
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! :^)
|
|
TerminalWidget can now handle keydown events that contain multi-byte
UTF-8 sequences. :^)
|
|
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.
|
|
There's a large amount of code duplication here right now, which will
need to be reduced.
|
|
|
|
|
|
|
|
This allows you to measure the width of a UTF-32 sequence.
|
|
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.
|
|
This also sets Content-Type to whatever 'meta' contains on success, to
allow the browser to pick up what the document contains.
|
|
|
|
|