Commit graph

43526 commits

Author SHA1 Message Date
MacDue 458ca83d8c PixelPaint: Fix lasso tool preview when zoomed in
Previously only part of the preview would be visible when zoomed in,
with less visible the more you zoomed. This also now doesn't scale
the preview line thickness, similar to other image editing programs.
2022-11-27 20:35:22 +01:00
MacDue fccda26ef9 PixelPaint: Don't scale preview thickness for polygonal select tool
This is consistent with other editors and makes it a little easier
to precisely select things when zoomed in.
2022-11-27 20:35:22 +01:00
MacDue 0482190bc8 PixelPaint: Make antialiasing the default for tools
Our AA painting works with opacity and generally has a nicer look
so lets make it the default.
2022-11-27 20:35:22 +01:00
MacDue 13beed1722 LibGfx: Preseve original alpha when applying tint filter 2022-11-27 20:35:22 +01:00
MacDue db235a87bf LibGfx: Allow float thickness lines and fix fill path glitches
The main fix is stopping fill_path() scanlines being rounded to the
wrong pixel. The y-value is now floored to ensure it always snaps
in the same direction.
2022-11-27 20:34:17 +01:00
Andreas Oppebøen 93f85f1a09 Base: Set transparent rubber band for all themes
The rubber band is the rectangle indicating the selection region on the
desktop, the file manager, and other icon views. If this region is
painted opaque with alpha=ff, the rectangle obscures the icons
underneath, harming the user experience. We set it to 3c like the other
themes.
2022-11-27 11:02:04 -05:00
davidot 2c26ee89ac LibJS: Remove m_first_invalid_property_range from ObjectExpression
This was state only used by the parser to output an error with
appropriate location. This shrinks the size of ObjectExpression from
120 bytes down to just 56. This saves roughly 2.5 MiB when loading
twitter.
2022-11-27 12:31:37 +01:00
davidot 3acbd96851 LibJS: Remove is_use_strict_directive for all StringLiterals
This value was only used in the parser so no need to have this in every
string literal in the ast.
2022-11-27 12:31:37 +01:00
Zaggy1024 3c68a6684e LibVideo: Don't crash when a decoder error is encountered while seeking
When errors are encountered by PlaybackManager, it attempts to switch
states to either Stopped or Corrupted. However, that causes it to set
the last presentation media time to the current playback time while the
last presentation time is unexpectedly negative because the seek never
ended.

Ending the seek before the state changes to Stopped or Corrupted
prevents this situation from happening.
2022-11-27 10:45:52 +01:00
Aliaksandr Kalenik 1c1b750bff LibWeb: Support box-sizing in flex formatting context
Makes pass 8/10 tests in https://wpt.live/css/css-flexbox/box-sizing-001.html
2022-11-27 10:25:17 +01:00
davidot 0c4befd811 LibJS: Use the source offset to sort imports in module
Using source offsets directly means we don't have to synthesize any
SourceRanges and circumvents that SourceRange returns invalid values for
the last range of a file.
2022-11-27 00:51:36 +00:00
davidot 1dc9769f7d LibJS: No longer assume there is a cycle root when module failed before
This issue could be triggered by evaluating a module twice. If it failed
during evaluation the cycle root was never set but that status is
evaluated. This failed in step 3 of Evaluate which assumes it has a
cycle root. This is a spec issue see:
https://github.com/tc39/ecma262/issues/2823

To fix this we check if the module itself has a top level capability
first before going to the cycle root.

Co-authored-by: Jamie Mansfield <jmansfield@cadixdev.org>
2022-11-27 00:51:36 +00:00
davidot d87676de8a LibJS: Remove already resolved FIXME
We wouldn't want someone to be disappointed when trying to fix this :^).
2022-11-27 00:51:36 +00:00
Baitinq 02a2018ec4 WebDriver: Implement stub for /session/{id}/print 2022-11-27 00:37:28 +00:00
Luke Wilde a1c1ab5f8d LibJS: Switch to bytecode interpreter to run generator functions for AST
The bytecode interpreter can execute generator functions while the AST
interpreter cannot. This simply makes it create a new bytecode
interpreter when one doesn't exist when executing a generator function.
Doing so makes it automatically switch to the bytecode interpreter to
execute any future code until it exits the generator.
2022-11-26 21:04:17 +00:00
Baitinq f3763a5275 Browser: Remove previous history entry in History::replace_current()
The lack of this action caused a bug in my original patch
(https://github.com/SerenityOS/serenity/pull/16004) that appeared when
accessing a site that redirected the client and it was the first site
the client loaded.
2022-11-26 20:54:55 +01:00
Liav A 8e16588757 Utilities+Base: Add unveil utility
This utility essentially creates a filesystem sandbox for a specified
command, so it can be tested with only the unveiled paths the user
specifies beforehand.
2022-11-26 12:42:15 -07:00
Liav A 7d7127b463 LibCore: Add add_option aggregating the same option multiple times
This could be used in a scenario when it is expected that a user program
will be invoked with a specific option multiple times, for example:
"program --a-option=example --a-option=anotherexample ..."
2022-11-26 12:42:15 -07:00
Liav A 718ae68621 Kernel+LibCore+LibC: Implement support for forcing unveil on exec
To accomplish this, we add another VeilState which is called
LockedInherited. The idea is to apply exec unveil data, similar to
execpromises of the pledge syscall, on the current exec'ed program
during the execve sequence. When applying the forced unveil data, the
veil state is set to be locked but the special state of LockedInherited
ensures that if the new program tries to unveil paths, the request will
silently be ignored, so the program will continue running without
receiving an error, but is still can only use the paths that were
unveiled before the exec syscall. This in turn, allows us to use the
unveil syscall with a special utility to sandbox other userland programs
in terms of what is visible to them on the filesystem, and is usable on
both programs that use or don't use the unveil syscall in their code.
2022-11-26 12:42:15 -07:00
Liav A 35efdb17f9 Userland: Add the BuggieBox program
This will be our alternative to what is known as BusyBox for Linux
distributions.

Co-Authored-By: Tim Schumacher <timschumi@gmx.de>
2022-11-26 12:41:47 -07:00
thankyouverycool bc0d56fa74 Assistant: Add a context menu for search results
Right-clicking now reveals menu options for copying text and
showing results in the File Manager
2022-11-26 18:11:51 +01:00
thankyouverycool 65c5901e7c Assistant: Automatically compute Assistant's window dimensions
Disregarding minimum widget size was originally set as a quick fix
when converting Assistant to a Popup window, but it's really much
easier to let layout manage dynamic resizing instead of trying to
add up pixels piecemeal.
2022-11-26 18:11:51 +01:00
thankyouverycool 518964e7c7 Assistant: Convert ResultRows to Coolbar Buttons
This gives search results a more tactile look and feel, consistent
with other iconified widgets across the system. Custom provider
subtitles now appear as tooltips.
2022-11-26 18:11:51 +01:00
Andreas Kling ae3ffdd521 AK: Make it possible to not using AK classes into the global namespace
This patch adds the `USING_AK_GLOBALLY` macro which is enabled by
default, but can be overridden by build flags.

This is a step towards integrating Jakt and AK types.
2022-11-26 15:51:34 +01:00
thankyouverycool e50a43652e Base: Add icon for Office application category
A trusty briefcase for the salt mine.
2022-11-26 12:58:33 +01:00
Luke Wilde 5bc3371226 LibJS: Perform received abrupt generator completions in the generator
Previously, throw and return completions would not be executed inside
the generator. This is incorrect, as throw and return need to perform
unwinds which can potentially execute more code inside the generator,
such as finally blocks.

This is done by also passing the completion type alongside the passed
in value. The continuation block will immediately extract and type and
value and perform the appropriate operation for the given type.

For normal completions, this is continuing as normal.
For throw completions, it will perform `throw <value>`.
For return completions, it will perform `return <value>`, which is a
`Yield return` in this case due to being inside a generator.

This also refactors GeneratorObject to properly send across the
completion type and value to the generator inside of trying to operate
on the completions itself.

This is a prerequisite for yield*, as it performs special iterator
operations when receiving a throw/return completion and does not
complete the generator like the regular yield would.

There's still more work to be done to make GeneratorObject::execute
be closer to the spec. It's mostly a restructuring of the existing
GeneratorObject::next_impl.
2022-11-26 12:55:59 +01:00
Luke Wilde 277132f70d LibJS/Bytecode: Store unwind contexts inside RegisterWindow
Unwind contexts need to be preserved as we exit and re-enter a
generator.

For example, this would previously crash when returning from the try
statement after yielding as we lost the unwind context when yielding,
but still have a LeaveUnwindContext instruction from running
`perform_needed_unwinds` when generating the return statement.
```js
function* a() {
    try {
        return (yield 1);
    } catch {}
}

iter = a();
iter.next();
iter.next();
```
2022-11-26 12:55:59 +01:00
Luke Wilde b914680f0c LibJS/Bytecode: Make yield by itself yield undefined 2022-11-26 12:55:59 +01:00
Simon Wanner 0c8da1478a LibX86: Use '+' format parameter to include signs for displacements 2022-11-26 12:50:38 +01:00
Simon Wanner 2ae228dac7 LibX86: Add basic x86-64 support
Most of the 64-bit instructions default to 32-bit operands and select
64-bit using REX.W prefixes. Because of that instead of defining new
instruction formats, this reuses the 32-bit formats and changes them
to take the REX prefixes into account when necessary.

Additionally this removes, adds or modifies the instruction
descriptors in the 64-bit table, where they are different from 32-bit.

Using 'disasm' these changes seem to cover pretty much all of our
64-bit binaries (except for AVX) :^)

Note that UserspaceEmulator will need to account for these prefixed
versions in its 32-bit instruction handlers before being usable on
x86-64.
2022-11-26 12:50:38 +01:00
Simon Wanner 735fd5f5db LibX86: Split up the ModRM and SIB bytes into multiple members
This will allow adding extra bits with REX prefixes
2022-11-26 12:50:38 +01:00
Simon Wanner 4041ea835c LibX86: Add OP_regW_immW
This is a variation of OP_reg32_imm32 that turns into
"OP_reg64_imm64" with a REX.W prefix.
2022-11-26 12:50:38 +01:00
Simon Wanner bf768ed215 Profiler: Don't stop disassembly on invalid instructions 2022-11-26 12:50:38 +01:00
Simon Wanner 6b5e4cdfbc disasm: Demangle symbols 2022-11-26 12:50:38 +01:00
Simon Wanner 4076619655 disasm: Print virtual offsets with pointer semantics
Instead of assuming the virtual offset will be 8 hex digits (which is OK
for 32 bit values), just use the ":p" modifier to ensure it prints the
virtual offset as a pointer, so if the code is compiled for 64 bit CPUs,
it will use 16 hex digits accordingly.
2022-11-26 12:50:38 +01:00
Simon Wanner c5681e06c6 LibX86: Make Instruction::length work for invalid instructions 2022-11-26 12:50:38 +01:00
Simon Wanner ab1f28d566 LibX86: Templatize the opcode table builders 2022-11-26 12:50:38 +01:00
Simon Wanner 06ece474e9 LibX86: Add {Address,Operand}Size::Size64
For now the opcode tables for OperandSize::Size64 are empty
2022-11-26 12:50:38 +01:00
Simon Wanner a7268c3c74 LibX86+UserspaceEmulator: Introduce AddressSize and OperandSize enums
These replace the bools a32 and o32, which will make implementing
64-bit sizes possible. :^)
2022-11-26 12:50:38 +01:00
Eli Youngs 7cd43deb28 hexdump: Replace Core::File with Core::Stream::File
Previously, hexdump used Core::File to read input into a fixed buffer.
This PR rewrites the file handling to use the more modern
Core::Stream::File, which reads data into spans. By using spans, we
can also simplify the rest of the code, which previously used memcpy
for array manipulation and relied on manual bookkeeping to keep track of
offsets.
2022-11-26 11:07:00 +01:00
Baitinq f1205b608f Browser: Replace history entry if loading URL because of a redirect
We now replace the current history entry if the page-load has been
caused because of a redirect. This makes it able to traverse the
history if one of the entries redirects you, which previously
caused an infinite history traversion loop.
2022-11-26 11:03:24 +01:00
Baitinq b447e486b5 Browser: Add History::replace_current() function
This function replaces the current history entry with a new history
entry.
2022-11-26 11:03:24 +01:00
Baitinq 45214fdb1a LibWeb+WebContent: Label redirects with new FrameLoader::Type::Redirect
Previously we labeled redirects as normal FrameLoader::Type::Navigation,
now we introduce a new FrameLoader::Type::Redirect and label redirects
with it. This will allow us to handle redirects in the browser
differently (such as for overwritting the latest history entry when a
redirect happens) :^)
2022-11-26 11:03:24 +01:00
Jelle Raaijmakers 45a59b4d7e Taskbar: Unbreak SDL2 port by changing include path
Ports would not be able to find `QuickLaunchWidget.h` this way.
2022-11-26 10:34:19 +01:00
Ali Mohammad Pur 4285b6ac4d Meta: Build the wasm libs with -DBUILD_SHARED_LIBS=OFF
CMake already does this, but it also emits a warning about it, do that
to make the CMake gods happier.
2022-11-26 10:23:39 +01:00
Ali Mohammad Pur b5301a3ea9 Meta: Use the correct cache paths in the wasm workflow
Previously we were caching unicode data for the lagom tools, but we
should've been caching them for the actual build instead.
2022-11-26 10:23:39 +01:00
davidot 617d29d2fb Meta: Update actions/libjs-test262 action to newer version
This should get rid of the non node 16 and outdated command warnings.
2022-11-26 09:53:14 +01:00
Arda Cinar 7f20e7324c Taskbar: Removed the awkward window reference struct 2022-11-26 09:51:11 +01:00
Arda Cinar 7afb7e65d5 Taskbar: Made it possible to add a system menu to taskbar later
This makes it possible to construct the taskbar before the system
menu and remove the awkward reference in Taskbar/main.cpp
2022-11-26 09:51:11 +01:00
Arda Cinar 7456a84e68 Taskbar: Rename start_menu to system_menu
The main menu in GUI (the one in the lower left side of screen by
default) was called start_menu in some parts of the code and system_menu
in others. In the documentation, it was referred to as "system menu".
So, in order to be consistent, these variables are all renamed to
system_menu
2022-11-26 09:51:11 +01:00