summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-23LibJS: Add some overloads for JS::call() and JS::call_impl()mjz19910
Overloads added: - JS::call for FunctionObject& - JS::call_impl for FunctionObject&
2022-01-23Kernel: Use ErrorOr in BlockBased and Ext2 filesystem raw read and writeDavid Briggs
These functions used to return booleans which withheld useful error information for callers. Internally they would suppress and convert Error objects. We now log or propagate these errors up the stack.
2022-01-23LibCore+LibC: Enforce the global event loop ban in codekleines Filmröllchen
It's a bad idea to have a global event loop in a client application as that will cause an initialization-order fiasco in ASAN. Therefore, LibC now has a flag "s_global_initializers_ran" which is false until _entry in crt0 runs, which in turn only gets called after all the global initializers were actually executed. The EventLoop constructor checks the flag and crashes the program if it is being called as a global constructor. A note next to the VERIFY_NOT_REACHED() informs the developer of these things and how we usually instantiate event loops. The upshot of this is that global event loops will cause a crash before any undefined behavior is hit.
2022-01-23LibCore: Fix signal handling race condition in EventLoopkleines Filmröllchen
The event loop is responsible for handling POSIX signals while it's running. The signal handler adds the signals to a wake pipe which is then read after the select'ing code in wait_for_event. Problems happen, however, when another signal comes in after the select wake: the signal will interrupt the next syscall, the `read` from the wake pipe, and the resulting EINTR in wait_for_event causes the program to crash. This is undesirable. Instead, we want to retry reading as long as we're interrupted.
2022-01-23LibCore: Create wake pipe on each threadkleines Filmröllchen
After the previous change, the wake pipe was only being created on the main thread by the main event loop. This change utilizes a flag to always initialize the wake pipe on other threads. Because the pipe is quite expensive (it will count towards the file descriptor limit, for instance), we do the initialization "lazily": Only when an event loop is constructed and it notices that there hasn't been a wake pipe created on its thread, it will create the pipe. Conversely, this means that there are no pipes on threads that never use an event loop.
2022-01-23LibCore: Allow EventLoops to run on multiple threads safelykleines Filmröllchen
The event loop system was previously very singletony to the point that there's only a single event loop stack per process and only one event loop (the topmost) can run at a time. This commit simply makes the event loop stack and related structures thread-local so that each thread has an isolated event loop system. Some things are kept at a global level and synchronized with the new MutexProtected: The main event loop needs to still be obtainable from anywhere, as it closes down the application when it exits. The ID allocator is global as IDs should not be shared even between threads. And for the inspector server connection, the same as for the main loop holds. Note that currently, the wake pipe is only created by the main thread, so notifications don't work on other threads. This removes the temporary mutex fix for notifiers, introduced in 0631d3fed5623c1f2b0d6085ab24e4dd69c6ce99 .
2022-01-23LibThreading: Introduce MutexProtected generic synchronization primitivekleines Filmröllchen
MutexProtected mirrors the identically-named Kernel primitive and can be used to synchronize access to any object that might not be thread safe on its own. Synchronization is done with a simple mutex, so access to a MutexProtected object is potentially blocking. Mutex now has an internal nesting variable which is there to harden it against lock-unlock ordering issues (e.g. double unlocking).
2022-01-23Kernel: Add missing #include <AK/Badge.h> to MemoryManager.hMarco Cutecchia
This missing header broke the aarch64 build
2022-01-23ClockSettings: Add a GUI application to set the system time zoneTimothy Flynn
This application can be expanded with other clock-related options. For an initial iteration, it has just an option to change the time zone.
2022-01-23timezone: Add a command line utility to set the system time zoneTimothy Flynn
2022-01-23LibC: Use LibTimeZone to offset localtime() for the system time zoneTimothy Flynn
2022-01-23LibTimeZone: Use /etc/timezone as the basis for the system time zoneTimothy Flynn
This changes LibTimeZone to read the current time zone from the file /etc/timezone rather than using tzset/tzname. Instead, in a subsequent commit, LibC's time methods will be changed to used LibTimeZone to retrieve the system time zone. Also add an API to set the system time zone. This method is only allowed when running within Serenity.
2022-01-23Userland: Add promises to programs that will read /etc/timezoneTimothy Flynn
This will require unveiling /etc/timezone itself for reading, as well as the rpath pledge promise.
2022-01-23LibTimeZone: Add an API to retrieve a list of all known IANA time zonesTimothy Flynn
2022-01-23LibJS+LibTimeZone+LibUnicode: Remove direct linkage to LibTimeZoneTimothy Flynn
This is no longer needed now that LibTimeZone is included within LibC. Remove the direct linkage so that others do not mistakenly copy-paste the CMakeLists text elsewhere.
2022-01-23DynamicLoader+LibC+LibTimeZone: Include LibTimeZone sources in LibCTimothy Flynn
LibTimeZone will be needed directly within LibC for functions such as localtime(). This change adds LibTimeZone directly within LibC, so that LibTimeZone isn't its own .so library anymore. LibTimeZone itself is compiled as an object library to make it easier to give it generator-specific compilation flags.
2022-01-23AK: Implement AK::Time's seconds_since_epoch_to_year without LibMTimothy Flynn
In order for this method to be used within LibC itself, avoid using the floor() method from LibM, which is not available from within LibC. This header similarly avoids other standard headers as well.
2022-01-23AK: Avoid impl initialization before assignment in `String`constructorMichel Hermier
2022-01-23LibWeb: Consider TextDecorationStyle when rendering textTobias Christiansen
For now only Wavy is additionally supported, but the infrastructure is there.
2022-01-23LibWeb: Add new property 'text-decoration-style'Tobias Christiansen
This patch makes the property 'text-decoration-style' known throughout all the places in LibWeb that care.
2022-01-23LibGUI: Expand underline support for Spans in TextEditorTobias Christiansen
To achieve this, some of the lambdas got shifted around and the new attributes are respected.
2022-01-23LibGfx: Expand TextAttributes with more information about underliningTobias Christiansen
This adds a seperate Color to be used for underlines as well as support for different underline styles.
2022-01-23LibGfx: Add Painter::draw_triangle_wave()Tobias Christiansen
This patch adds support for drawing triangular waves. For now those can only be horizontal, but as they are intended for underlining text, it's an okay way to handle this.
2022-01-23Base: Add a <pre> test pageNico Weber
2022-01-23Keymaps: Add Greek keymapΣτέφανος
2022-01-23LibHTTP+AK: Rename CNETWORKJOB_DEBUG to NETWORKJOB_DEBUGNico Weber
2022-01-23LibHTTP+AK: Rename CHTTPJOB_DEBUG to HTTPJOB_DEBUGNico Weber
2022-01-23Base: Add a note on the possibility of failure with the beep utilityLiav A
2022-01-23LibCore: Print the actual errno if sysbeep failedLiav A
2022-01-23Kernel: Add CommandLine option to disable or enable the PC speakerLiav A
By default, we disable the PC speaker as it's quite annoying when using the text mode console.
2022-01-23Kernel: Implement beep functionality in virtual consolesLiav A
2022-01-23SystemServer: Create /dev/devctl and create devices based on its eventsLiav A
We first create the /dev/devctl based on the information from the SysFS. Then, we create block devices and character devices based on the events we read from that device.
2022-01-23SystemServer: Rename devfs => devtmpfsLiav A
We used to have a static devfs, but now it's called devtmpfs which is completely dynamic.
2022-01-23Kernel/Devices: Introduce the Device Control DeviceLiav A
This device will assist userspace to manage hotplug events. A userspace application reads a DeviceEvent entry until the return value is zero which indicates no events that are queued and waiting for processing. Trying to read with a buffer smaller than sizeof(DeviceEvent) results in EOVERFLOW. For now, there's no ioctl mechanism for this device but in the future an acknowledgement mechanism can be implemented via ioctl(2) interface.
2022-01-23LibWeb: Make LineBuilder assign height to empty line boxesAndreas Kling
This ensures that <br> produces empty line boxes with the line-height property as their height.
2022-01-23Kernel/Graphics: Send correct parameters to text console clear methodLiav A
Apparently there was a wrong calculation result when we sent parameters from TextModeConsole::clear_vga_row method - and we should stick to the x, y mechanism of the clear method instead of doing the same calculation which made it to happen twice actually.
2022-01-23WindowServer: Paint menu checkboxes as such instead of as framesthankyouverycool
Fixes disabled checkboxes appearing enabled in menus.
2022-01-23TextEditor: Fix crash on startup when file specified cannot be openedRummskartoffel
Due to a bug introduced in f674102, TE would attempt to access the value of an ErrorOr that didn't hold one, hitting an assertion.
2022-01-23LibWeb: Allow CSS floating objects to flow across multiple linesAndreas Kling
If we run out of horizontal space when placing floating objects, we now perform a "break" and continue with a new line of floats below the bottommost margin edge of the current line. This is definitely not 100% to-spec yet, but a huge improvement on ACID1 already. :^)
2022-01-23LibWeb: Put BFC floating object state into a structAndreas Kling
This patch adds a BFC::FloatSideData struct so we can contain left and right floating object layout state in a struct. This is preparation for adding more per-side state.
2022-01-23LibWeb: Don't do horizontal inline line layout twice for last lineAndreas Kling
After pruning empty last line boxes, we now avoid re-running the horizontal fragment positioning step, since that would be wasted work.
2022-01-23LibWeb: Pass correct state to TextNode::compute_text_for_rendering()Andreas Kling
This is poorly factored. TextNode needs to know whether the most recently inserted fragment on the current line was empty or ended in whitespace. This is used when deciding what to do with leading whitespace in text nodes. Let's keep this working for now, but we should eventually sort this out and make text chunk iteration not depend on this information.
2022-01-23LibWeb: Make InlineLevelIterator::m_container a Layout::BlockContainer&Andreas Kling
This is always a block container (the IFC's containing block.)
2022-01-23LibWeb: Ignore some collapsible whitespace when building linesAndreas Kling
When collapsing whitespace, we can skip over all-whitespace chunks at the start of each line, and immediately following fragments that themselves end in whitespace.
2022-01-23LibWeb: Remove old Layout::Node::split_into_lines() APIAndreas Kling
Now that we build lines incrementally, we no longer need the atomic line splitting API. The new InlineLevelIterator and LineBuilder setup does have some regressions from the old behavior, but we can deal with them as we go.
2022-01-23LibWeb: Align inline-level boxes to the baseline of the line boxAndreas Kling
Vertical inline alignment is still very unsophisticated, but let's at least put everything within each line on the same baseline.
2022-01-23LibWeb: Avoid creating an empty first line box in block containersAndreas Kling
2022-01-23LibWeb: Make LineBuilder respect LayoutMode::OnlyRequiredLineBreaksAndreas Kling
In this layout mode, we should only break when forced (e.g by an explicit <br> tag.) This is used when determining intrinsic sizes.)
2022-01-23LibWeb: Make InlineLevelIterator ignore list item marker boxesAndreas Kling
Marker boxes are managed explicitly by the corresponding list item box.
2022-01-23LibWeb: Dimension inline-block boxes before deciding about line breaksAndreas Kling
We won't know if we need to break before the inline-block box until after we've dimensioned it.