Commit Graph

44971 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
fe8304d5de LibWeb: Introduce structure that maintains collapsible margins in BFC
Previously y position of boxes in block formatting context
was calculated by looking at y position of previous in-flow
sibling and adding collapsed margin of "collapse through"
boxes lying between box currently being laid out and it's
previous in-flow sibling.

Here introduced BlockMarginState structure that maintains
array of currently collapsible margins hence we no longer
need to look at previous sibling to calculate y position
of a box.
2022-12-30 14:21:19 +01:00
Timothy Flynn
e3d5b67eaf SQLStudio: Remove (unimplemented) ability to open database storage files
It may be handy to have some sort of storage inspector at some point but
for now, it doesn't make sense to open a database file. So only allow
opening script files, and don't make assumptions on their extension.
2022-12-30 14:17:18 +01:00
Timothy Flynn
690389ae81 SQLStudio: Display error message boxes when connections/executions fail
In a GUI application, this is vastly more useful than logging to the
terminal or ignoring the error completely.
2022-12-30 14:17:18 +01:00
Timothy Flynn
5822520e6d SQLStudio: Add an option to select or specify the database to connect to
This adds a combo box to the action toolbar to allow for entering a
database name manually or selecting from the list of existing databases.
The action to run a script is now disabled while we are not connected to
a database.
2022-12-30 14:17:18 +01:00
Timothy Flynn
640e22bbdb SQLStudio: Only display the character/word count of selected text
It's not particularly useful to see the word count of a SQL script,
except for when displaying the number of selected words. This changes
SQLStudio to behave exactly like HackStudio in this regard. We will use
segment 0 to display the selected text stats (if any) and segment 2 for
the cursor position. Segment 1 will be used in an upcoming commit for
the current SQL connection status. We also now handle displaying action
text the same way as HackStudio.
2022-12-30 14:17:18 +01:00
Timothy Flynn
a4d2b366b6 SQLStudio: Close the current SQL connection before opening a new one 2022-12-30 14:17:18 +01:00
Timothy Flynn
74cd0a0c82 SQLStudio: Simplify action handling a bit
Most actions do not need to care about whether there is an open editor
tab, as we can (and should) disable those actions when there isn't an
open tab. We can also hide the verify_cast handling inside a helper
function.
2022-12-30 14:17:18 +01:00
Timothy Flynn
b8e4ca3b0f SQLStudio: Protect against possible crash when saving an empty file
The underlying Core::Stream methods require the bytes passed in to be
non-empty. Simply opening the file is enough to ensure the file is
created with empty contents if the editor's text is empty.
2022-12-30 14:17:18 +01:00
Timothy Flynn
9b1e754d56 SQLStudio: Convert SQLStudio to GML 2022-12-30 14:17:18 +01:00
Timothy Flynn
82363aa1c4 sql+SQLStudio: Recover from errors preparing SQL statements
In both applications, display the SQL statement that failed to parse.
For the REPL, ensure the REPL prompts the user for another statement.
For SQLStudio, we don't continue executing the script as it likely does
not make sense to run statements that come after a failed statement.
2022-12-30 14:17:18 +01:00
Timothy Flynn
c08956028a SQLServer: Mark a deferred invocation lambda as mutable
Otherwise the `move(result)` statement inside the lambda does not
actually move anything, because `result` is constant without the mutable
attribute. Caught by clangd.
2022-12-30 14:17:18 +01:00
Timothy Flynn
21255cb2b8 SQLServer: Explicitly return empty optionals over IPC upon errors
These are currently hitting the `decltype(nullptr)` constructor, which
marks the response as invalid, resulting in no response being sent to
the waiting client.
2022-12-30 14:17:18 +01:00
Timon Kruiper
51b69be970 Kernel/aarch64: Move ifdef in StorageManagement.cpp
The recent changes of removing i386 broke the aarch64 build, and moving
the ifdef fixes the aarch64 build.
2022-12-29 19:32:20 -07:00
Timon Kruiper
e9b4e07b0a Kernel/aarch64: Start and initialize Scheduler and run multiple threads
This commit changes the init.cpp file to start and initialize the
Scheduler, and actually runs init_stage2. To show that it actually
works, another thread is spawned and executed simultaneously, by context
switching between the two!
2022-12-29 19:32:20 -07:00
Timon Kruiper
a5e98d3644 Kernel/aarch64: Add implementation of Processor::switch_context
This initial implementation makes it possible to actually context switch
between different kernel threads! :^)
2022-12-29 19:32:20 -07:00
Timon Kruiper
0b95d8cd24 Kernel/aarch64: Implement thread_context_first_enter
This requires two new functions, context_first_init and
restore_context_and_eret. With this code in place, we are now running
the first idle thread! :^)
2022-12-29 19:32:20 -07:00
Timon Kruiper
262309d9bf Kernel/aarch64: Implement Processor::initialize_context_switching
This changes the stack pointer to the initial_thread stack pointer, and
pushes two pointers onto the stack that point to the initial_thread. The
function then jumps to the ip of the initial_thread, which will be
thread_context_first_enter, and hangs there because that function is not
yet implemented.
2022-12-29 19:32:20 -07:00
Timon Kruiper
892f81b01a Kernel/aarch64: Add initial implementation of Processor::init_context
This does not handle everything correctly yet, such as setting the
correct state for running userspace applications, however this should be
enough to get kernel scheduling to work.
2022-12-29 19:32:20 -07:00
Timon Kruiper
9554e5ca48 Kernel/aarch64: Add Saved Program Status Register EL1 (SPSR_EL1) 2022-12-29 19:32:20 -07:00
Timon Kruiper
fb803e8025 Kernel/aarch64: Stub Processor::smp_wake_n_idle_processors 2022-12-29 19:32:20 -07:00
Timon Kruiper
1da84c2a2c Kernel: Factor out setting Thread entry function
This adds ThreadRegisters::set_entry_function, and also implements it
for aarch64.
2022-12-29 19:32:20 -07:00
Timon Kruiper
a6f78b895f Kernel/aarch64: Stub Processor::clean_fpu_state() instead of crashing
Also print a message to the debug output, such that developers know that
the current implementation is not actually correct.
2022-12-29 19:32:20 -07:00
Timon Kruiper
a3cbaa3449 Kernel: Move ThreadRegisters into arch-specific directory
These are architecture-specific anyway, so they belong in the Arch
directory. This commit also adds ThreadRegisters::set_initial_state to
factor out the logic in Thread.cpp.
2022-12-29 19:32:20 -07:00
Timon Kruiper
0d2dffb95b Kernel: Put x86_64 specific VERIFY in PageDirectory.cpp behind ifdef
This makes it possible to run this code on aarch64.
2022-12-29 19:32:20 -07:00
Timon Kruiper
5a5fa10046 Kernel/aarch64: Add FIXME debug messages to PageDirectory
These are added to make clear that the current memory situation in the
aarch64 kernel is not complete yet.
2022-12-29 19:32:20 -07:00
Timon Kruiper
21deb603de Kernel/aarch64: Implement stub for asm_signal_trampoline
This get us further into the boot process, since Process::initialize
does not crash anymore.
2022-12-29 19:32:20 -07:00
Timon Kruiper
1cc06b9985 Kernel/aarch64: Correctly implement Processor::is_initialized() 2022-12-29 19:32:20 -07:00
Timon Kruiper
27b384e073 Kernel/aarch64: Remove copy constructor from Processor
I can't think of a reason why copying the Processor class makes sense,
so lets make sure it's not possible to do it by accident by declaring
the copy constructor as deleted.
2022-12-29 19:32:20 -07:00
Timon Kruiper
fbfe669f6d Kernel/aarch64: Implement Processor::{clear,restore}_critical() 2022-12-29 19:32:20 -07:00
Timon Kruiper
993b7495ba Kernel/aarch64: Implement Processor::check_invoke_scheduler() 2022-12-29 19:32:20 -07:00
Timon Kruiper
f6f43fd65e Kernel: Add Processor::wait_for_interrupt and use it in Scheduler
This removes the x86 specific hlt instruction from the scheduler, and
allows us to run the scheduler code for aarch64 by implementing
Processor::wait_for_interrupt for aarch64.
2022-12-29 19:32:20 -07:00
Timon Kruiper
f232133f65 Kernel/aarch64: Implement Processor::{enter,exit}_trap
And use them in interrupt handling.
2022-12-29 19:32:20 -07:00
Timon Kruiper
ee883b839c Kernel/aarch64: Implement dbgput{str,char} in kprintf.cpp
Also changes the implementation of kernelearlyputstr to call
kernelputstr, to deduplicate some logic.
2022-12-29 19:32:20 -07:00
Timon Kruiper
b991cff60f Kernel/aarch64: Add function to convert DFSC to StringView
This is useful for debugging, when hitting a data abort.
2022-12-29 19:32:20 -07:00
Timon Kruiper
5b06925b8a Kernel: Remove debug printing of code segment
This allows us to use the same code for aarch64.
2022-12-29 19:32:20 -07:00
Timon Kruiper
ac788a2c8e Kernel: Remove duplicate Processor::restore_in_critical
There is already Processor::restore_critical, which does exactly the
same thing.
2022-12-29 19:32:20 -07:00
Timon Kruiper
b18a7297c5 Kernel: Move ScopedCritical.cpp to Kernel base directory
This file does not contain any architecture specific implementations,
so we can move it to the Kernel base directory. Also update the relevant
include paths.
2022-12-29 19:32:20 -07:00
Timon Kruiper
496a3cdcd3 Kernel/aarch64: Fix typo in RegisterState.h
We are actually storing tpidr_el0, as can be seen in vector_table.S, but
the RegisterState.h incorrectly had tpidr_el1. This will probably save
some annoying debugging later on.
2022-12-29 19:32:20 -07:00
Xexxa
ec53d86534 Base: Add more emoji
🕵️ - U+1F575 DETECTIVE
🫂 - U+1FAC2 PEOPLE HUGGING
🦝 - U+1F99D RACCOON
🧄 - U+1F9C4 GARLIC
 - U+26F2 FOUNTAIN
👢 - U+1F462 WOMAN’S BOOT
🖲️ - U+1F5B2 TRACKBALL
📚 - U+1F4DA BOOKS
📇 - U+1F4C7 CARD INDEX
🗃️ - U+1F5C3 CARD FILE BOX
🧹 - U+1F9F9 BROOM
🚸 - U+1F6B8 CHILDREN CROSSING
👩‍❤️‍👩 - U+1F469 U+200D U+2764 U+200D U+1F469
COUPLE WITH HEART: WOMAN, WOMAN
2022-12-29 16:17:53 -05:00
Karol Kosek
780d46c424 Presenter: Accept file drops 2022-12-29 10:22:49 -05:00
Sam Atkins
feb0eb9309 AK: Fix constructing ErrorOr from ErrorOr of a related type
Mark other ErrorOr types as friends, and fix a typo in the &&
constructor, so that we can create an ErrorOr<Core::Object> from an
ErrorOr<GUI::Widget>. Also, add some requires() clauses to these
constructors so the error messages are clearer.
2022-12-28 22:34:00 -05:00
Jelle Raaijmakers
7b0adee487 LibGfx+Overall: Remove is_null from Point, Rect and Size
Having a `Point`, `Rect` or `Size` claim it's `null` is silly. We have
`Optional<T>` for that. For `Point`, rename `is_null` to `is_zero` to
better reflect what we're testing. For `Rect` and `Size`, `is_null` is
removed outright.

Also, remove `is_empty` from `Point`. Points can't be empty.
2022-12-28 22:32:21 -05:00
Jelle Raaijmakers
d5630bd20e NotificationServer: Use Optional for last rect in NotificationWindow
We were calling `Gfx::Rect<T>::is_null` which checked if the width and
height were 0. What we want to do instead, is check if the rect value
was set at all. `Optional<Rect>` is the right way to do this.
2022-12-28 22:32:21 -05:00
Jelle Raaijmakers
d83f1eaeb2 LibWeb: Use Optional for previous SVG path control point
Previously, a control point at `(0, 0)` would have been considered
absent. USe `Optional<Gfx::FloatPoint>` instead.
2022-12-28 22:32:21 -05:00
Nico Weber
c051532c82 AK: Add tests for LittleEndian<enum class>
This should've been in 57126a0d3c.
2022-12-28 22:27:19 -05:00
Timothy Flynn
0a7d0362ea CI: Remove extraneous toolchain job from Azure CI
This was useful when building both i686 and x86_64 SerenityOS targets as
we could use a single toolchain build for both targets. But now all this
extra job does is create the opportunity for the toolchain to need to be
built twice (i.e. if the pipelines are backed up and the toolchain cache
is busted between these jobs while the x86_64 step is waiting for a VM).
2022-12-28 15:26:12 -05:00
Arda Cinar
598fcfca26 LibWeb: Make the atob JS function compliant with the spec
It is specified to use the "forgiving-base64" decoder instead of the
regular base64 decoder, which is slightly different
2022-12-28 21:15:02 +01:00
Arda Cinar
bbaf86fb46 AK: Add a forgiving_base64_decode helper
According to the specification at
https://infra.spec.whatwg.org/#forgiving-base64
2022-12-28 21:15:02 +01:00
Nico Weber
50c6d133a9 LibGfx: Remove now-unneeded casts 2022-12-28 20:13:12 +00:00
Nico Weber
57126a0d3c AK: Make BigEndian<> and LittleEndian<> work with enum classes 2022-12-28 20:13:12 +00:00