Commit graph

35354 commits

Author SHA1 Message Date
Daniel Bertalan aed2e214b6 Ports: Use sed -i for run_replace_in_file on Serenity hosts
We don't have a perl port, so let's use GNU sed's in-place option for
doing substitutions when running inside Serenity.

Note that we can't do this unconditionally, as `sed -i` is not portable
and works differently on BSD systems.
2022-03-08 23:30:47 +01:00
Daniel Bertalan ea52ba9fdc LibC: Set saved_str to null in strtok_r if no tokens were found
If we do not do this, the next call to strtok_r will start tokenizing
(and possibly modifying!) the memory pointed to by `saved_ptr`.
2022-03-08 23:30:47 +01:00
Daniel Bertalan 4b4177f39c LibDiff: Generate hunks for new/deleted files
Previously we would fail to generate any hunks if the old or the new
file was empty. We now do, with the original/target line index set to 0,
as specified by POSIX.
2022-03-08 23:30:47 +01:00
Daniel Bertalan 7bd68c86d3 date: Allow using a custom format string
This commit adds an optional string positional argument which is used a
custom format string for the date.
2022-03-08 23:30:47 +01:00
Daniel Bertalan 01dc718f07 LibCore: Do not skip dotfiles when copying directories recursively 2022-03-08 23:30:47 +01:00
Daniel Bertalan a285e651f1 LibArchive: Accept space characters as terminators of tar numeric fields
POSIX specifies that each numeric field is terminated with one or more
space or NUL characters.
2022-03-08 23:30:47 +01:00
Tim Schumacher 35e5024b7d DynamicLinker: Replace $ORIGIN with the executable path 2022-03-08 23:21:35 +01:00
Tim Schumacher e7f861f34c DynamicLinker: Implement support for RPATH and RUNPATH 2022-03-08 23:21:35 +01:00
Tim Schumacher 7bd0a3e9ba DynamicLoader: Make the cached DynamicObject publicly accessible 2022-03-08 23:21:35 +01:00
Linus Groh 03c46a261f LibWeb: Implement the WindowProxy exotic object
A couple steps requiring working relationships between browsing contexts
are currently FIXME'd - see #12917.
2022-03-08 23:13:54 +01:00
Linus Groh 6f941433d6 LibWeb: Stub out 'check if access between two BCs should be reported'
I put this is a CrossOrigin/ subdirectory in anticipation of a lot more
cross-origin related ground to cover. :^)
2022-03-08 23:13:54 +01:00
Linus Groh ae96eae4f9 LibWeb: Implement 'cross-origin accessible window property name' concept 2022-03-08 23:13:54 +01:00
Tom d124889698 LibC: Add IPv6 support to inet_ntop and inet_pton 2022-03-08 23:05:44 +01:00
Tom 2f0e3da142 AK: Add IPv6Address class
This is the IPv6 counter part to the IPv4Address class and implements
parsing strings into a in6_addr and formatting one as a string. It
supports the address compression scheme as well as IPv4 mapped
addresses.
2022-03-08 23:05:44 +01:00
Timothy Flynn f235f08e6d LibJS: Use known binding indices when creating new for-loop environments
When the initialization statement of a for-loop uses 'let', we must
create a new environment for each iteration of the for loop. The
bindings of the initialization statement are copied over to the new
environment. Since the bindings are created in the same order each time,
we can use that order to directly initialize the bindings and avoid any
O(n) lookups in this hot loop.
2022-03-08 23:02:12 +01:00
Timothy Flynn f56bf610c4 LibJS: Allow pre-allocating DeclarativeEnvironment's bindings list 2022-03-08 23:02:12 +01:00
Timothy Flynn 435f49d98e LibJS: Allow direct index-based initialization of a declarative binding
Similar to the direct getter and setter in DeclarativeEnvironment, there
are cases where we already know the index of a binding and can avoid a
O(n) lookup to re-find that index.
2022-03-08 23:02:12 +01:00
Timothy Flynn 533170fbfa LibJS: Combine DeclarativeEnvironment's bindings and names into one list
This reduces the size of the DeclarativeEnvironment from 72 bytes to 48
bytes. This savings helps in the context of nested for-loops which use
'let' to bind the initial variable declarations. In this case, the spec
dicates we create a new environment for each loop iteration by way of
the CreatePerIterationEnvironment AO.

In particular, test262's generated RegExp tests contains many loops of
the form:

    for (let i = 0; i < a_number_on_the_order_of_10; ++i)
        for (let j = 0; j < a_number_on_the_order_of_10_thousand; ++j)

This results in creating hundreds of thousands of environments.
2022-03-08 23:02:12 +01:00
Luke Wilde 8d784310e0 LibJS: Implement the Error.prototype.stack setter
This implements the setter based on the Error Stacks proposal.
https://tc39.es/proposal-error-stacks/#sec-set-error.prototype-stack

Required by Twitch.
2022-03-08 22:59:09 +01:00
electrikmilk ad71008d6f HackStudio: Add more files to new file menu
Add Python, Java, C, PHP, Wasm, INI, JSON, and Markdown files to new
file menu.
2022-03-08 22:42:40 +01:00
electrikmilk cd4b732acd HackStudio: Add missing key triggers
Add key triggers that are missing, primarily from the 'New..' menu.
2022-03-08 22:42:40 +01:00
electrikmilk 7fe0e7b46b HackStudio: Move 'New' Menu to 'File'
Currently we have a 'Project' menu with a 'New' menu in it, this tries
to organize things by just having one 'New...' sub-menu in the 'File'
menu that creates new files, projects and directories.

To solve conflicts, move 'Semantic Highlighting' to the 'View' menu.

As a result of both of these changes, remove 'Project' menu.
2022-03-08 22:42:40 +01:00
kimlintu 89c846a31c LibCore: Add support for application/zip mime-type
The local file header signature of a ZIP entry is normally 0x04034B50
and stored in little-endian byte order. Therefore, if the archive
starts with an entry we can identify a ZIP file by checking if the
first two bytes are 0x504B (PK).

Also checks for the .zip file extension, which is is also used by file
if no byte signature was detected.
2022-03-08 22:38:53 +01:00
javabird25 67d10a50ee Spreadsheet: Fix overridden max length related crash
NumericCell::display() attempted to take a substring of cell contents
according to the "Override max length" parameter,
but it did not account for the actual string length.
2022-03-09 01:05:12 +03:30
Ali Mohammad Pur ce9f355b12 Ports: Add a bdwgc (aka libgc) port
For all your ports' garbage collection needs :^)
2022-03-08 22:29:53 +01:00
Ali Mohammad Pur 5d51e26caf LibPthread: Partially implement pthread_cleanup_(push pop)
These are also supposed to run on cancellation, but we don't support
cancellation.
2022-03-08 22:29:53 +01:00
Andrew Smith 31a2ac94c7 LibGUI: Fix crash in GML Playground auto-completing SpinBox props
Crash was caused by deferred invocation of a lambda on the SpinBox's
TextEditor widget's on_change. The lambda referenced the SpinBox ptr,
but in GML Playground the SpinBox was free'd before the deferred
lambda could run, causing a use-after-free error. Fixed by using
a weak ptr to detect if the SpinBox was free'd.
2022-03-08 22:18:59 +01:00
javabird25 9246ad96b3 LoginServer: Add a label for login fail messages 2022-03-08 22:12:21 +01:00
Vrins 39a5076f40 Browser+LibWeb: Add an Element size preview widget to inspector
This Adds an element size preview widget to the inspector widget
in a new tab. This functions similar to chrome and firefox and
shows the margin, border, padding, and content size of the selected
element in the inspector.

The colors for the size preview widget are taken from the chrome
browser.
2022-03-08 22:09:52 +01:00
Vrins 3b22fd9a9f LibGfx: Add support for TextAlignment::TopCenter / BottomCenter
Now supports TextAlignment::TopCenter and TextAlignment::BottomCenter
for the Painter::draw_text.

Also patched this in Spreadsheet/CellTypeDialog.cpp
2022-03-08 22:09:52 +01:00
Vrins 73ade62d4f AK: Add float support for JsonValue and JsonObjectSerializer 2022-03-08 22:09:52 +01:00
Vrins ae1cd4b448 AK: Add to_double() to JsonValue 2022-03-08 22:09:52 +01:00
Liav A df5fa20bee LibEDID: Fix DetailedTiming::pixel_clock_khz result
The stored value is in units of 10 kHz, which means that to get the
value in kHz, we need to multiply it by 10 and not 10000.
2022-03-08 22:07:59 +01:00
Tobias Christiansen ebbf977be5 PixelPaint: Draw a colored border around the appropriate thumbnail
According to the edited Bitmap of a Layer, give visual feedback by
drawing a fancy border around the Bitmap in question.
2022-03-08 22:07:12 +01:00
Tobias Christiansen 8b0bd665ec PixelPaint: Add "Add Mask" to Layer context menu 2022-03-08 22:07:12 +01:00
Tobias Christiansen 4b1c31bb36 PixelPaint: Change EditMode of Layer when double clicking on thumbnail 2022-03-08 22:07:12 +01:00
Tobias Christiansen 57772f9708 PixelPaint: Add a mask thumbnail to the LayerListWidget 2022-03-08 22:07:12 +01:00
Tobias Christiansen f972f8e7a8 PixelPaint: Use the currently_edited_bitmap in the Tools
This way, you can actually edit the mask of a Layer!
2022-03-08 22:07:12 +01:00
Tobias Christiansen 96829565d8 PixelPaint: Keep track of and expose the type of the edited bitmap
This can be either the content bitmap or the mask bitmap.
2022-03-08 22:07:12 +01:00
Tobias Christiansen a180b5f442 PixelPaint: Respect Mask when generating the display bitmap 2022-03-08 22:07:12 +01:00
Tobias Christiansen 82bfdec790 PixelPaint: Add mask Bitmap to Layer and expose it 2022-03-08 22:07:12 +01:00
Tobias Christiansen 31a9196bfe PixelPaint: Split bitmap() of Layer into {content, display}_bitmap
This is in preparation to support masking of Layers. We now distinguish
between the "display_bitmap" which will be the whole Layer with every
effect applied and the "content_bitmap" which contains the actual
unmodified pixels in the Layer.
2022-03-08 22:07:12 +01:00
Karol Kosek b6510f8e76 KeyboardMapper: Ask for unsaved changes on window close and file open 2022-03-08 22:05:48 +01:00
Karol Kosek ae9e4c6f26 KeyboardMapper: Reset modified flag after loading a file 2022-03-08 22:05:48 +01:00
Karol Kosek 2fd7506212 KeyboardMapper: Display dirty close icon when the file is changed 2022-03-08 22:05:48 +01:00
Tim Schumacher 8ebc749191 Tests: Include limits.h for PATH_MAX in realpath tests 2022-03-08 22:00:28 +01:00
Tim Schumacher f748586393 Tests: Include limits.h for MB_LEN_MAX in wchar tests 2022-03-08 22:00:28 +01:00
Liav A ed5623f40f Kernel/Graphics: Override first byte of the EDID in Intel Native driver 2022-03-08 21:56:14 +01:00
Liav A 7aa63ddd00 Kernel/Graphics: Print contents of offending EDID in Intel Native driver 2022-03-08 21:56:14 +01:00
Liav A bd48e73851 Utilities/lspci: Add verbose flag to show data about PCI BARs
Use the exposed sysfs interface and print the addresses to the user if
requested to.
2022-03-08 21:52:10 +01:00