Commit graph

2820 commits

Author SHA1 Message Date
AnotherTest
88f542dc30 LibLine: Support applying styles to suggestions
This commit also adds the concept of "anchored" styles, which are
applied to a specific part of the line, and are tracked to always stay
applied to that specific part.

Inserting text in the middle of an anchored style extends it, and
removing the styled substring causes the style to be removed as well.
2020-05-21 01:37:19 +02:00
Linus Groh
a0f3e3c50e LibWeb: Add CanvasRenderingContext2D.canvas 2020-05-21 01:24:36 +02:00
Linus Groh
abb33d425e LibWeb: Let HTMLCanvasElement.getContext() return null for unknown types
Currently we would assert. Also make it case sensitive.
2020-05-21 01:24:36 +02:00
AnotherTest
50c0944767 LibHTTP: Handle chunk sizes that start with zeros correctly
Apparently that's allowed and the RFC is just unclear about it.
Some servers seem to zero-pad the chunk size for whatever reason, and
previously, we interpreted that as the last chunk.
2020-05-21 01:21:39 +02:00
AnotherTest
7d76299ca9 LibTLS: Do not call on_tls_finished until the client has read app data 2020-05-21 01:21:39 +02:00
Hüseyin ASLITÜRK
8b3bd1a54b LibGfx: Font, extend fonts to 384 character to support LatinExtendedA 2020-05-21 01:19:42 +02:00
Hüseyin ASLITÜRK
840a64e2f9 LibGfx: Painter, extend fonts to 384 character to support LatinExtendedA
Replace codepoint variable type from char to u32.
2020-05-21 01:19:42 +02:00
Hüseyin ASLITÜRK
241df7206e LibWeb: HTML Parser, handle html escaped characters
Convert HTML escaped (&#XXX;)  characters to string.
2020-05-21 01:19:42 +02:00
Hüseyin ASLITÜRK
9300a8cfe5 LibGUI: FileSystemModel, markdown file icon for .md files. 2020-05-21 01:19:13 +02:00
Andreas Kling
bded472ec4 Revert "AK+LibC: Move non-placement new/delete into LibC"
This reverts commit 2c82347393.
2020-05-20 16:24:26 +02:00
Andreas Kling
ef776c1e68 Revert "LibC: Implement Itanium C++ ABI for static variable guards"
This reverts commit cdbbe14062.
2020-05-20 16:24:26 +02:00
Andreas Kling
250c3b363d Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem"
This reverts commit c1eb744ff0.
2020-05-20 16:24:26 +02:00
Sergey Bugaev
36dcbce161 LibC: Claim some copyright for stdio
I've written a large part of the new stdio, so I'm (partly) to blame for it now.
2020-05-20 14:11:13 +02:00
Sergey Bugaev
776275a747 LibC: Handle fgets(size = 0)
I accidentally broke this in the recent rewrite. This reinstantiates the
behavior implemented in 6571468525.
2020-05-20 14:11:13 +02:00
Hüseyin ASLITÜRK
25227ee284 LibGUI: Add MessageBox question icon 2020-05-20 13:54:10 +02:00
AnotherTest
7fba21aefc LibLine: Unify completion hooks and adapt its users
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-20 13:41:37 +02:00
Hüseyin ASLITÜRK
d18f6e82eb LibGUI: Replace up and down arrows with emoji 2020-05-20 13:40:24 +02:00
Hüseyin ASLITÜRK
80699a0824 LibGUI: Update copyright character in about dialog 2020-05-20 13:40:24 +02:00
Andrew Kaster
c1eb744ff0 Build: Include headers from LibC, LibM, and LibPthread with -isystem
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-20 08:37:50 +02:00
Andrew Kaster
cdbbe14062 LibC: Implement Itanium C++ ABI for static variable guards
This is __cxa_guard_acquire, __cxa_guard_release, and __cxa_guard_abort.

We put these symbols in a 'fake' libstdc++ to trick gcc into thinking it
has libstdc++. These symbols are necessary for C++ programs and not C
programs, so, seems file. There's no way to tell gcc that, for example,
the standard lib it should use is libc++ or libc. So, this is what we
have for now.

When threaded code enters a block that is trying to call the constructor
for a block-scope static, the compiler will emit calls to these methods
to handle the "call_once" nature of block-scope statics.

The compiler creates a 64-bit guard variable, which it checks the first
byte of to determine if the variable should be intialized or not.

If the compiler-generated code reads that byte as a 0, it will call
__cxa_guard_acquire to try and be the thread to call the constructor for
the static variable. If the first byte is 1, it will assume that the
variable's constructor was called, and go on to access it.

__cxa_guard_acquire uses one of the 7 implementation defined bytes of
the guard variable as an atomic 8 bit variable. To control a state
machine that lets each entering thread know if they gained
'initialization rights', someone is working on the varaible, someone is
working on the varaible and there's at least one thread waiting for it
to be intialized, or if the variable was initialized and it's time to
access it. We only store a 1 to the byte the compiler looks at in
__cxa_guard_release, and use a futex to handle waiting.
2020-05-20 08:37:50 +02:00
Andrew Kaster
2c82347393 AK+LibC: Move non-placement new/delete into LibC
This allows operator new and operator delete to be available to anyone
that links -lc (everyone) rather than just people that include
kmalloc.h (almost no one).
2020-05-20 08:37:50 +02:00
Sergey Bugaev
db30a2549e LibC: Rewrite stdio
The new version uses buffering much more prominently, and hopefully performs
better. It also uses something resembling C++ rather than plain C.
2020-05-20 08:31:31 +02:00
Sergey Bugaev
7541122206 Kernel+LibC: Switch isatty() to use a fcntl()
We would want it to work with only stdio pledged.
2020-05-20 08:31:31 +02:00
AnotherTest
f9cffda0e0 LibTLS: Flush some packets as soon as more packets are written
This seems like a better compromise between throughput and latency, and
it doesn't _really_ affect the performance, so let's just compromise.
2020-05-20 08:30:51 +02:00
Linus Groh
b69abb3626 LibWeb: Make window.location.reload() enumerable only 2020-05-20 08:30:22 +02:00
Linus Groh
eb0810bf1a LibWeb: Make window.location properties non-configurable
Technically the property descriptors for these should not have
"writable: true" but "get" and "set" instead - but we don't support that
yet.
2020-05-20 08:30:22 +02:00
Linus Groh
6caacfec85 LibWeb: Add leading "?" to window.location.search if not empty 2020-05-20 08:30:22 +02:00
Linus Groh
8a913f336a LibWeb: Add leading "#" to window.location.hash if not empty 2020-05-20 08:30:22 +02:00
AnotherTest
c38c2668da LibLine: Default to resolving Spans as byte offsets
This allows all the unicode processing to be internal to the line
editor.
2020-05-19 20:02:28 +02:00
AnotherTest
379cb061d7 LibTLS: Only try to flush data when needed
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-19 20:00:43 +02:00
Linus Groh
41da1a4336 LibWeb: Fix duplicated public access modifier in StyleDeclaration 2020-05-19 19:25:41 +02:00
Andreas Kling
6d078a9ec3 LibGUI: Use dbg() instead of dbgprintf() in GUI::Dialog 2020-05-19 17:46:28 +02:00
Andreas Kling
ff8d250cbc LibGUI: Remove some ancient unused debug logging in AbstractButton 2020-05-19 17:46:28 +02:00
Andreas Kling
d2ae37f88f LibProtocol: Make Protocol::Client constructor private
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-19 17:46:28 +02:00
Linus Groh
4ab4de7810 LibGUI: Add ability to hide GUI::TabWidget's tab bar 2020-05-19 17:42:48 +02:00
AnotherTest
082cd7048e LibLine: Handle <return>s in incomplete data correctly
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-19 11:59:28 +02:00
Andreas Kling
3b11e471bd LibWeb: Allow reloading the current page with location.reload() 2020-05-18 22:05:13 +02:00
Andreas Kling
71007f6ebb LibWeb: Add location.protocol and location.host 2020-05-18 21:59:16 +02:00
Andreas Kling
efdfdbabdb LibWeb: Allow navigating to a new URL by setting window.location.href 2020-05-18 21:52:50 +02:00
Andreas Kling
1ec4db04cd LibWeb: Add a simple window.location object with some getters :^) 2020-05-18 21:42:40 +02:00
Andreas Kling
4b202a3c79 LibCore+LibTLS: Don't keep a "ready to write" notifier on all Sockets
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-18 20:16:52 +02:00
Matthew Olsson
e415dd4e9c LibJS: Handle hex and unicode escape sequences in string literals
Introduces the following syntax:

'\x55'
'\u26a0'
'\u{1f41e}'
2020-05-18 17:58:17 +02:00
Linus Groh
b3090678a9 LibJS: Add Math.clz32() 2020-05-18 17:57:28 +02:00
Linus Groh
452dbbc463 LibJS: Add Math.expm1() 2020-05-18 17:57:28 +02:00
Linus Groh
e375766f98 LibJS: Add Math.exp() 2020-05-18 17:57:28 +02:00
Linus Groh
b27834cf16 LibJS: Add Math.sign() 2020-05-18 17:57:28 +02:00
Andreas Kling
bdfd1f1545 LibGUI: Make text selection feel better in single-line editors
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-18 17:55:21 +02:00
Andreas Kling
62b7418376 LibGUI: Add 1px of horizontal content padding to TextEditor
This adds a little bit of needed air around the text.
2020-05-18 17:47:01 +02:00
Andreas Kling
558ca65ca5 LibGUI: Grow the "line content rect" slightly in single line text boxes
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-18 16:48:54 +02:00
Andreas Kling
a6e2125727 LibGUI: Use a variable-width font by default in single-line TextEditors
This makes things like the Browser location bar look way nicer. :^)
2020-05-18 16:48:54 +02:00