Commit graph

35490 commits

Author SHA1 Message Date
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
Liav A
f8df21c7e7 Kernel: Expose PCI BAR addresses in sysfs
Regardless of whether we use those BARs or not, expose them so userland
can use these values for its usage.
2022-03-08 21:52:10 +01:00
Liav A
a91da67216 Utilities/lspci: Iterate over /sys/bus/pci instead of reading /proc/pci
This opens many opportunities to add more data printed in lspci in a
flexible manner - so instead of reading an ever-expanding JSON encoded
file, we can add more features and let the utility read the directory
entries from sysfs.

This also allows not only filtering data on devices but to easily filter
non-wanted devices when printing the output.
2022-03-08 21:52:10 +01:00
Lady Gegga
2a898a7e4a LibWeb: Add explicit color to mark element 2022-03-08 18:52:16 +01:00
Lady Gegga
2c1f5cd310 LibWeb: Add default styling to abbr, acronym, mark, strike and tt 2022-03-08 18:52:16 +01:00
Paulo Henrique Silva
0b3c1b4c79 Mandelbrot: Add Help menu with standard About action
Noticed that Mandelbrot didn't use the standard About action in the Help
menu. As a first patch to Serenity, this patch fixes it.
2022-03-08 18:34:14 +01:00
davidot
6dd8ef485a Meta: Fix that the processor count was output to stderr and ignored
Because of ninja's default behavior of using all processors this gave
the correct behaviour because MAKEJOBS was empty. However this meant
that the processor count was printed to stderr when building.
2022-03-08 17:56:20 +01:00
davidot
3192cabc0e Meta: Read MAKEJOBS to limit jobs for ninja in serenity.sh
The default behavior of using all cores will still apply if no
MAKEJOBS variable is supplied.
2022-03-08 17:12:35 +01:00
Lady Gegga
7036f8c89c Base: Remove metadata from emojis to decrease filesize 2022-03-08 16:44:51 +01:00
networkException
3e7869d57d LibWeb: Remove outdated FIXME comment in Namespaces validate_and_extract
As step "2. Validate qualifiedName" got implemented in
bfa7aad0f6, parts is known to have a
length of 2.
2022-03-08 16:23:35 +01:00
Jelle Raaijmakers
3ece3f3ed1 LibSoftGPU: Remove a lot of [ui]32x4 casts in Sampler 2022-03-08 15:32:35 +01:00
Jelle Raaijmakers
c21a3b3029 LibGL: Better handling of texture targets and default textures
We were lacking support for default textures (i.e. calling
`glBindTexture` with a `texture` argument of `0`) which caused our
Quake2 port to render red screens whenever a video was playing. Every
texture unit is now initialized with a default 2D texture.

Additionally, we had this concept of a "currently bound target" on our
texture units which is not how OpenGL wants us to handle targets.
Calling `glBindTexture` should set the texture for the provided target
only, making it sort of an alias for future operations on the same
target.

Finally, `glDeleteTextures` should not remove the bound texture from
the target in the texture unit, but it should reset it to the default
texture.
2022-03-08 15:32:35 +01:00
Jelle Raaijmakers
c87d3521e4 LibGL: East-const glTex* methods 2022-03-08 15:32:35 +01:00
Jelle Raaijmakers
5d21d1d105 LibGL: Remove duplicate public: from Texture2D.h 2022-03-08 15:32:35 +01:00
Jelle Raaijmakers
f8bdb36f4c Ports: Add OpenGL include dir to quake2 build 2022-03-08 15:32:23 +01:00