Commit Graph

34269 Commits

Author SHA1 Message Date
Lady Gegga
b11c22e564 Base: Add Lycian characters to font Katica Regular 10
10280-1029C https://www.unicode.org/charts/PDF/U10280.pdf
2022-02-10 08:48:43 +00:00
Lady Gegga
ce0df575a3 Base: Add Carian characters to font Katica Regular 10
102A0-102D0 https://www.unicode.org/charts/PDF/U102A0.pdf
2022-02-10 08:48:43 +00:00
Luke Wilde
1bfbc0b6af LibJS: Don't coerce this value to an object in Function.prototype.call 2022-02-10 08:45:03 +00:00
Luke Wilde
12231068bd LibJS: Don't coerce this value to an object in Function.prototype.apply 2022-02-10 08:45:03 +00:00
Linus Groh
898ad7c682 LibJS: Implement Function.prototype.bind() according to the spec :^) 2022-02-09 23:31:34 +00:00
Linus Groh
87b9fa2636 LibJS: Add FunctionObject constructor allowing null prototype
This just calls through to the Object constructor added in the previous
commit.
2022-02-09 23:31:34 +00:00
Linus Groh
368af9ad6e LibJS: Add Object constructor allowing null prototype 2022-02-09 23:31:34 +00:00
Linus Groh
f663c7d6da LibJS: Remove unused BoundFunction::m_constructor_prototype
This was not being used anywhere, and the way we determined it was not
matching the spec at all, so let's remove it and do it properly.
2022-02-09 23:31:34 +00:00
Liav A
c6c3e2a7fd Kernel: Instantiate a TextModeConsole early on if there's no framebuffer
If the bootloader that loaded us is providing a framebuffer details from
the Multiboot protocol then we can instantiate a framebuffer console.
Otherwise, we should use a text mode console, assuming that the BIOS and
the bootloader didn't try to modeset the screen resolution so we have is
a VGA 80x25 text mode being displayed on screen.

Since "boot_framebuffer_console" is no longer a good representative as a
global variable name, it's changed to g_boot_console to match the fact
that it can be assigned with a text mode console and not framebuffer
console if needed.
2022-02-09 21:05:48 +00:00
Liav A
278b0aa629 Kernel/Graphics: Don't assert when disabling TextModeConsole
Not sure how it's useful to do so, let's not assert if something tries
to disable it. If we will use TextModeConsole as a boot console, that
console will be disabled after loading an appropriate console to replace
it.
2022-02-09 21:05:48 +00:00
Liav A
90a194377c Kernel/Graphics: Untie Text mode console from VGACompatibleAdapter class
Instead, we can construct this type of object without having to
instantiate a VGACompatibleAdapter object first.
This can help instantiate such console very early on boot to aid debug
issues on bare metal hardware.
2022-02-09 21:05:48 +00:00
Lenny Maiorani
c6acf64558 Kernel: Change static constexpr variables to constexpr where possible
Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.

These changes result in a stripped x86_64 kernel binary size reduction
of 592 bytes.
2022-02-09 21:04:51 +00:00
Ali Mohammad Pur
6a4c8a66ae LibRegex: Only skip full instructions when optimizing alternations
It makes no sense to skip half of an instruction, so make sure to skip
only full instructions!
2022-02-09 21:02:24 +00:00
Lenny Maiorani
f0d2489254 Applications: Port Assistant to LibMain 2022-02-09 21:01:52 +00:00
electrikmilk
133a30c8b7 Base+Browser: Add browser icons
Add local storage and style sheet icons. I also noticed the name of the
DOM tree icon needed updated (tree => dom_tree).
2022-02-09 21:00:37 +00:00
Ali Mohammad Pur
3bfcd7b52d LibJS: Implement Sets using Maps
This implements ordered sets using Maps with a sentinel value, and
includes some extra set tests.
Fixes #11004.

Co-Authored-By: davidot <davidot@serenityos.org>
2022-02-09 20:57:41 +00:00
Ali Mohammad Pur
4a73ec07c5 LibJS: Make Map iterators independent of the underlying hashmap
This implements ordered maps as a pair of an RBTree for key order, and
an underlying unordered hash map for storage.
Fixes (part of) #11004.
2022-02-09 20:57:41 +00:00
Ali Mohammad Pur
e7dea10381 AK: Add RBTree::find_smallest_above_iterator(Key) 2022-02-09 20:57:41 +00:00
Ali Mohammad Pur
9ff22ac7e0 LibHTTP: Skip the body when response code is 204
...even if the headers claim that there's some data in the form of
Content-Length.
This finally fixes loading Discord with RequestServer ConnectionCache
on :^)
2022-02-09 21:23:25 +01:00
Ali Mohammad Pur
cb7becb067 LibTLS+RequestServer: Add an option to dump TLS keys to a log file
This file allows us to decrypt TLS messages in wireshark, which can help
immensely in debugging network stuff :^)
2022-02-09 21:23:25 +01:00
Sam Atkins
a796207b9f LibWeb: Paint box-shadows more efficiently
Our previous code roughly did this:

1. Generate a bitmap as large as the shadow would end up.
2. Paint a rectangle onto it.
3. Blur the whole bitmap.
4. Split it up and render each section.

This patch takes advantage of the fact that (aside from corners) each
horizontal or vertical strip of a box-shadow is identical to the
others, to generate and blur a much smaller bitmap - only large enough
for the four corners and 1px of central "side" in each direction. This
greatly reduces the memory footprint, and should also speed things up,
since there is much less to blur.
2022-02-09 19:36:26 +01:00
Andreas Kling
3ec71e1400 LibC: Remove debug spam in getaddrinfo() 2022-02-09 19:36:15 +01:00
Daste
a22323ecce Browser: Make underlined shortcuts in "Debug" menu unique 2022-02-09 19:33:51 +01:00
electrikmilk
1d8b213b5b Base+Browser: Add browser icons folder
Move browser specific icons to their own folder in /res/icons/
2022-02-09 19:33:28 +01:00
Lenny Maiorani
138d54e595 AK+Kernel: Alphabetize debug macros
This is not ASCII-betical because `_` comes after all the uppercase
characters. Treating `_` as a ` ` (space character), these lists are
now alphabetical.
2022-02-09 17:59:19 +00:00
Andrew Kaster
820e99f97d LibWeb: Add initial implementation for WorkerGlobalScope
This initial implementation stubs out the WorkerGlobalScope,
WorkerLocation and WorkerNavigator classes. It doesn't take into account
all the things that actually need passed into the constructors for these
objects, nor the extra abstract operations that need to be performed on
them by the rest of the Browser infrastructure. However, it does create
bindings that compile and link :^)
2022-02-09 17:21:05 +01:00
Daniel van Gerpen
8b38df72a3 LibSQL: Update list of expected statements
Add an entry for the DESCRIBE TABLE statement and add an Oxford comma.
2022-02-09 15:35:37 +00:00
Brian Gianforcaro
2e81990a3c LibWeb: Do not set Content-Length headers twice for POST requests
While trying to get http://lite.duckduckgo.com to work in the Browser I
noticed that we kept on getting 400 (Bad Request) errors when you click
the "Search" button for a request.

After turning on `JOB_DEBUG` to see what headers we were sending it
turned out that we were actually setting `Content-Length` twice once
in LibWeb, and again when the request is handled by LibHTTP.

Since LibHTTP transparently handles this now, we can avoid it in LibWeb.
2022-02-09 14:05:07 +00:00
electrikmilk
72e0d3d20b Base: Enlarge globe in CSS file icon
Make globe in CSS file icon more visible.
2022-02-09 13:54:14 +00:00
Andreas Kling
0ba2a3ff30 LibWeb: Don't fill or stroke SVG <path> with transparent color
Before this, we were filling and stroking every <path>, whether they had
a fill/stroke color or not. We can avoid a bunch of unnecessary work by
checking if the color is transparent (also the case if unset) before
doing the painting work.

If there is no fill color, we also avoid making a copy of the path to
ensure that it's closed.
2022-02-09 13:44:00 +01:00
Linus Groh
7676b1b925 LibJS: Remove MarkedValueList in favor of MarkedVector<Value> :^) 2022-02-09 12:25:27 +00:00
Linus Groh
6508ff5bbd LibWeb: Stop using MVL for sequence storage in WrapperGenerator
Use MarkedVector<Value> instead.
2022-02-09 12:25:27 +00:00
Linus Groh
bc183dbbcb LibJS: Replace uses of MarkedValueList with MarkedVector<Value>
This is effectively a drop-in replacement.
2022-02-09 12:25:27 +00:00
Linus Groh
1d32ac7b8b LibJS: Convert get_iana_time_zone_epoch_value() to MarkedVector<BigInt*> 2022-02-09 12:25:27 +00:00
Linus Groh
af7003ebd2 LibJS: Convert 'possible instants' AOs to MarkedVector<Instant*>
Resolve TODOs suggesting the use of a strongly typed MarkedValueList
(a.k.a. MarkedVector<T>) in the following AOs:

- get_possible_instants_for()
- disambiguate_possible_instants()
2022-02-09 12:25:27 +00:00
Linus Groh
a863363b06 LibJS: Let MarkedVector<T> inherit from Vector and handle Cell* + Value
Note: MarkedVector is still relatively new and has zero users right now,
so these changes don't affect any code other than the class itself.

Reasons for this are the rather limited API:

- Despite the name and unlike MarkedValueList, MarkedVector isn't
  actually a Vector, it *wraps* a Vector. This means that plenty of
  convenient APIs are unavailable and have to be exported on the class
  separately and forwarded to the internal Vector, or need to go through
  the exposed Span - both not great options.
- Exposing append(Cell*) and prepend(Cell*) on the base class means that
  it was possible to append any Cell type, not just T! All the strong
  typing guarantees are basically gone, and MarkedVector doesn't do much
  more than casting Cells to the appropriate type through the exposed
  Span.

All of this combined means that MarkedVector - in its current form -
doesn't provide much value over MarkedValueList, and that we have to
maintain two separate, yet almost identical classes.

Let's fix this!

The updated MarkedVector steals various concepts from the existing
MarkedValueList, especially the ability to copy. On the other hand, it
remains generic enough to handle both Cell* and Value for T, making
MarkedValueList effectively redundant :^)

Additionally, by inheriting from Vector we get all the current and
future APIs without having to select and expose them separately.

MarkedVectorBase remains and takes care of communicating creation and
destruction of the class to the heap. Visiting the contained values is
handled via a pure virtual method gather_roots(), which is being called
by the Heap's function of the same name; much like the VM has one.
From there, values are added to the roots HashTable if they are cells
for T = Value, and unconditionally for any other T.

As a small additional improvement the template now also takes an
inline_capacity parameter, defaulting to 32, and forwards it to the
Vector template; allowing for possible future optimizations of current
uses of MarkedValueList, which hard-codes it to 32.
2022-02-09 12:25:27 +00:00
Timothy Flynn
3c88749800 CI: Bundle and upload a js(1) release package
To include Serenity's LibJS on test262.report, we will need to integrate
with esvu. Create a .tar.gz with js(1) binary and the Lagom libraries it
it needs to run, and upload that package as a build artifact.
2022-02-09 12:19:56 +03:30
Timothy Flynn
636a6a2fb8 Meta: Add a CPack installation target for js(1)
This adds a CPack configuration to generate a release package for js(1).
Our current CMake requirement is 3.16, which doesn't have a great story
for automatically installing a binary target's library dependencies. If
we eventually require CMake 3.21 or above, we can remove the helper
.cmake file added here in lieu of RUNTIME_DEPENDENCIES.
2022-02-09 12:19:56 +03:30
Rodolfo Olivieri
a05d25d4e5 CI: Add statement to ensure workflow runs only on serenity
Ensure that the `cmake.yml` workflow runs only on SerenityOS repository.
2022-02-09 11:27:06 +03:30
Andrew Kaster
353e72ac9b LibC+Kernel: Remove global variable use from snprintf and fprintf
The global variable use in these functions is super thread-unsafe and
means that any concurrent calls to sprintf or fprintf in a process
could race with each other and end up writing unexpected results.
We can just replace the function + global variable with a lambda that
captures the relevant argument when calling printf_internal instead.
2022-02-09 06:22:33 +00:00
Itamar
8ec4328fcb HackStudio: Allow toggling between simple and semantic highlighting
Until it becomes enough stable and performant, semantic highlighting is
disabled by default.

It can be toggled on via the "Project" menu in HackStudio.
2022-02-09 00:51:31 +01:00
Itamar
81dcf6c58b Base: Add more syntax highlighting color roles to the Default theme 2022-02-09 00:51:31 +01:00
Itamar
aba2e03b71 HackStudio: Use the C++ semantic syntax highlighter
HackStudio::Editor will now send a request to get semantic token
information to the language server whenever there's a short pause in
editing.

The result is used by the semantic c++ syntax highlighter to provide
better highlighting information.
2022-02-09 00:51:31 +01:00
Itamar
10d75d7f21 LibGUI: Add TextEditor::force_rehighlight() method 2022-02-09 00:51:31 +01:00
Itamar
22f835332a LibGfx: Add more syntax-related ColorRoles 2022-02-09 00:51:31 +01:00
Itamar
4646bf4b92 LibCpp: Add SemanticSyntaxHighlighter
The SemanticSyntaxHighlighter uses TokenInfo results from the
language server to provide 'semantic' syntax highlighting, which
provides more fin-grained text spans results.

For example, the SemanticSyntaxHighlighter can color function calls,
member fields references and user-defined types in different colors.

With the simple lexer-only syntax highlighter, all of these tokens were
given the same text highlighting span type.

Since we have to provide immediate highlighting feedback to the user
after each edit and before we get the result for the language server,
we use a heuristic which computes the diff between the current tokens
and the last known tokens with compete semantic information
(We use LibDiff for this).

This heuristic is not very performant, and starts feeling sluggish with
bigger (~200 LOC) files.
A possible future improvement would be only computing the diff for
tokens in text ranges that have changes since the last commit.
2022-02-09 00:51:31 +01:00
Itamar
4737fc2485 LibDiff: Flush leftover hunks at the end
This change makes sure that we arrive at the end of the "DP-matrix" and
flush any leftover hunks to get a complete diff result.
2022-02-09 00:51:31 +01:00
Itamar
33043f269d HackStudio: Add tokens_info_result() and tokens_info_result() IPC calls
These IPC calls are used in the communication with the language server
to fetch semantic information about the tokens in a code document.
2022-02-09 00:51:31 +01:00
Itamar
76000e9137 LanguageServers/Cpp: Make find_declaration_of() more flexible
Previously, find_declaration_of() only worked for AST nodes of type
Identifier. It now also works for declaration node, member variables
and function parameters.
2022-02-09 00:51:31 +01:00
Itamar
a54d0cc805 LibGUI+HackStudio: Add TokenInfo struct for language-server IPC
The TokenInfo struct contains the token's position and a
"semantic type". The semantic type is a more fine-grained token type
than what's in Cpp::Token::Type.
For example, the semantic token type differentiates between a reference
to a variable and to a function parameter. In the normal Token::Type,
both would be Token::Type::Identifier.
2022-02-09 00:51:31 +01:00