Since SQLServer is inherently asynchronous, database statements can run
in parallel. Our `CookieJar` did not require synchronous actions on the
database for its cookies, resulting in cookies not being set
immediately. This resulted in a bug that could be exposed by setting
`document.cookie` and immediately querying its value, revealing that the
cookie was not yet persisted.
Solve this by requiring all database statements to be executed
synchronously. Ideally SQLServer has a mechanism to determine interquery
dependencies and blocks until dependent queries are fully executed, but
until we have that, this works around that limitation.
The user can now save, load, and view calendars. A calendar is made up
of an array of events which are saved in a JSON file. In the future we
should implement the iCalendar standard instead of using a custom
format.
This loosens the connection to the AST interpreter and will allow us to
generate SourceRanges for the Bytecode interpreter in the future as well
Moves UnrealizedSourceRanges from TracebackFrame to the JS namespace for
this
And don't try to do it every time the Help button is clicked.
This fixes a crash when clicking the Help button twice (setting window
mode on an already visible window is not supported).
This also fixes a situation where when opening the Help window with an
action, we didn't set its mode to "Modeless".
The Track itself caches the Samples after each processing step which
allows it to be queried without the need to process it every time.
This result is queried by the WaveWidget which then caches the result to
prevent unnecessary heap allocations every paint event.
Removes the Sample struct inside Piano and replaces it with the struct
from LibDSP.
It automatically scales the height of the wave depending on the maximum
amplitude, as the Samples now contain floats and not integers.
This patch adds the ability to refine a editing mask by a color-range
based on the pixels of the content image. This is useful for image
editing where mask restirction via luminosity might not fit or just
certain color ranges should be edited.
With this change the image modifications of a filter is only applied to
regions of the image where a editing mask is defined. If no editing
mask is defined the filter modifications are applied to the whole
image.
This adds a function where editing masks can be refined by selecting
a luminosity range that is applied to the content image and mapped to
the editing mask. This function allows the editing of image regions
that match only certain luminosity values.
This patch adds a function to make the editing-eask visible while
beeing in mask-mode so that the user can see which parts are covered
by the masks and can therefore be modified by other tools that support
editing masks.
Parsing 'data:' URLs took it's own route. It never set standard URL
fields like path, query or fragment (except for scheme) and instead
gave us separate methods called `data_payload()`, `data_mime_type()`,
and `data_payload_is_base64()`.
Because parsing 'data:' didn't use standard fields, running the
following JS code:
new URL('#a', 'data:text/plain,hello').toString()
not only cleared the path as URLParser doesn't check for data from
data_payload() function (making the result be 'data:#a'), but it also
crashes the program because we forbid having an empty MIME type when we
serialize to string.
With this change, 'data:' URLs will be parsed like every other URLs.
To decode the 'data:' URL contents, one needs to call process_data_url()
on a URL, which will return a struct containing MIME type with already
decoded data! :^)
In order to follow spec text to achieve this, we need to change the
underlying representation of a host in AK::URL to deserialized format.
Before this, we were parsing the host and then immediately serializing
it again.
Making that change resulted in a whole bunch of fallout.
After this change, callers can access the serialized data through
this concept-host-serializer. The functional end result of this
change is that IPv6 hosts are now correctly serialized to be
surrounded with '[' and ']'.
DisplaySettings uses the optional `screen_dpi` value before checking
if it is set, causing an assertion failure. This change moves the
usage into the block where it is known to be set.
One situation where this is known to occur is on real hardware when
using the MULTIBOOT_VIDEO_MODE multiboot flag to enable graphical
display output.
NetworkSettings normally filters out `loop` when populating its list of
adapters. However, when checking if there aren't any adapters it did
not take this into account. This causes it to crash later when trying
to set the selected index of an empty combo box.
This moves the check for no adapters to after filtering the list, so
that shows the error message and exits.
This commit addresses an issue when 'Zombie' threads are
included in CPU % calculation. This caused negative
time_scheduled_diff, resulting in a data type overflow.
Use this handy AK function instead of reimplementing the formatting code
several times. The one minor difference is that now, hours are only
shown if the duration is at least an hour long, but that seems like an
improvement to me. :^)
With this, you can scale, flip, and rotate vector graphics in the image
viewer like any other image, but with no pixelation :^)
With this change, vector graphics are decoded in-process (since there's
no standard way to encode them over IPC, a new encoding would be needed
for each format, which would be pretty much just be recreating that
format).
Raster images are still decoded out of process, so the surface area for
attack is still kept to a minimum.
The window by default showed port 993 with TLS unchecked, which was
slightly misleading as port 993 uses implicit TLS connections and
cleartext is on port 143.
This change also makes it consistent with the Mail app, as its fallback
value is also set to true.
This function now takes an optional out parameter for callers who would
like to what kind of property we ended up getting.
This will be used to implement inline caching for property lookups.
Also, to prepare for adding more forms of caching, the out parameter
is a struct CacheablePropertyMetadata rather than just an offset. :^)
The previous iteration of this API was somewhat odd and rough in random
places, which degraded usability and made less than perfect sense.
This commit reworks the API to be a little closer to more
conventional promise APIs (a la javascript promises).
Also adds a test to ensure the class even works.
The inspector widget now has a new ARIA tab which displays an
individual element's ARIA properties and state. The view itself
is pretty basic for now, just being a table- there is definitely room
for some better UX here but it's enough for a first cut.
Process command line reading took up 50% (!) of all of SystemMonitor's
work. However, a process's command line per definition never changes, so
we can read it once and carry it over. Also, if we couldn't read a
process's command line once, it is close to impossible that we'll ever
be able to read it in the future. Therefore, skip reading such command
lines again as well.
This commit also converts the command line itself to use String, while
we're at it.
- Replace C with C++
- Use Core::System, Core::Account and Core::Process wrappers
- Remove DeprecatedString
- Remove invalid close() call to the pts file descriptor in the shell
child (the fd cannot be valid there anymore since it's an
automatically-closing fd, we just previously ignored this error)
When we moved from NonnullRefPtrVector<T> to Vector<NonnullRefPtr<T>>
in commit 8a48246ed1, the `at()` function
started returning a NonnullRefPtr<T>& instead of T&.
The code calling create_index() was not then updated and ended up taking
a pointer to a temporary NonnullRefPtr<>, instead of an actual object,
leading to a crash after logging in.
Print the correct error from Core::System::chdir() instead of errno, and
display the error in the DirectoryView instead of continuing to show the
previous location's contents.
This regressed in 1dc3ba6ed5.
This patch fixes an issue where the preview for an filter was always
based on the content bitmap even if the edit mode was set to Mask.
Now the preview is using the content or mask bitmap based on the
current edit mode and therefore generates the correct preview of
what is going to be changed.
This patch removes a todo where the revert for any changes could be
optimized. Previously every single pixel was copied back from the
reference bitmap to the content bitmap. Now the editors content
bitmap is just replaced with the reference bitmap that is a copy
of the unchanged content bitmap.
This patch adds a new Editing-Mask type to layers. This kind of mask
is used to restrict changes on the content bitmap only to areas where
the mask is drawn. The intensity of a pixel change is controlled by the
alpha-value of the mask.
Furthermore a function to invert and clear masks has been introduced.
When a new mask is created for a layer the edit mode of the layer is
also changed to Mask so that the user can immediately start to draw the
mask.
This change was a long time in the making ever since we obtained sample
rate awareness in the system. Now, each client has its own sample rate,
accessible via new IPC APIs, and the device sample rate is only
accessible via the management interface. AudioServer takes care of
resampling client streams into the device sample rate. Therefore, the
main improvement introduced with this commit is full responsiveness to
sample rate changes; all open audio programs will continue to play at
correct speed with the audio resampled to the new device rate.
The immediate benefits are manifold:
- Gets rid of the legacy hardware sample rate IPC message in the
non-managing client
- Removes duplicate resampling and sample index rescaling code
everywhere
- Avoids potential sample index scaling bugs in SoundPlayer (which have
happened many times before) and fixes a sample index scaling bug in
aplay
- Removes several FIXMEs
- Reduces amount of sample copying in all applications (especially
Piano, where this is critical), improving performance
- Reduces number of resampling users, making future API changes (which
will need to happen for correct resampling to be implemented) easier
I also threw in a simple race condition fix for Piano's audio player
loop.
The immutability of the string is not relevant here, since the string
we're given was allocated in the IPC serialization layer and will be
destroyed shortly afterwards. Additionally, noone relies on
DeprecatedString-specific functionality. This will make it easier to
convert the IPC layer itself to String later on.
This commit changes the variables used to represent the size and
progress of downloads from u32 to u64. This allows `pro` and
`Browser` to report the total size and progress of a download
correctly for downloads larger than 4GiB.
The data we want to send out of the WebContent process is identical for
audio and video elements. Rather than just duplicating all of this for
audio, generalize the names used for this IPC for all media elements.
This also encapsulates that data into a struct. This makes adding new
fields to be sent much easier (such as an upcoming field for muting the
element).
Since these are stored as numbers, and "1,2,3,5,6" is a bit meaningless
to anyone who looks at this code, the default set of visible columns is
provided as it was before, by them all being visible except a couple
that are specifically hidden.
The callback is wrapped in a debounce() so that if set_visible_columns
() is called, we'll just save the value once instead of doing so for
each column changed.
We need to add another pair of parenthesizes when propagating an
initialization of ItemListModel, because a comma in a template argument
would work as a separator of macro arguments, leading to a compile
error.
The minimal build configuration doesn't include HackStudio and
SystemMonitor refused to run after trying to unveil a not exiting file.
This change will just ignore this specific error for this specific file
as if nothing really happened.
The ability to quickly debug a process in HackStudio is not the main
feature of the application and HackStudio itself is rather heavy to be
put in the minimal configuration.
Additionally, I find it unnecessary to disable/hide the 'Debug in
HackStudio' action because build configurations are mostly for testing
purposes anyway. You will get a 'No such file or directory' error in the
console after activating the action though. :^)
Note that this fixes contradictory default values for group
"Preferences", key "Home". This is exactly the kind of errors I want to
prevent with this new style.
The hope is that this can later be used to:
- verify that all accesses to the same key use the same default value,
- and extract the default values more easily.
The implemented cloning mechanism should be sound:
- If a PartitionTable is passed a File with
ShouldCloseFileDescriptor::Yes, then it will keep it alive until the
PartitionTable is destroyed.
- If a PartitionTable is passed a File with
ShouldCloseFileDescriptor::No, then the caller has to ensure that the
file descriptor remains alive.
If the caller is EBRPartitionTable, the same consideration holds.
If the caller is PartitionEditor::PartitionModel, this is satisfied by
keeping an OwnPtr<Core::File> around which is the originally opened
file.
Therefore, we never leak any fds, and never access a Core::File or fd
after destroying it.
The "Crop Image to Selection" action will now crop all layers within
the current selection.
Any layers outside of the current selection are deleted.
If there are no layers within the current selection, a new layer the
same size as the selection is created, which has the same name as the
current active layer.
When the `FilteringOptions::SortByScore` flag is set, filtered indices
are sorted by match score in descending order, meaning the most
relevant results should appear first.
The default behavior of FilteringProxyModel is unchanged.
The server cannot use these values anywhere, because this method always
sets 'prompt = ShouldPrompt::No'. This saves a bunch of roundtrips for
all clients that use FSAS to read abritrary files.
Instead of eagerly populating the stack trace with a textual
representation of every call frame, just store the raw source code range
(code, start offset, end offset). From that, we can generate the full
rich backtrace when requested, and save ourselves the trouble otherwise.
This makes test-wasm take ~7 seconds on my machine instead of ~60. :^)
fixes#18678
This is because the "From:" URL regularly overflows the line, leading
to an unreadable mess. Make sure that the labels for the widget
don't wrap as well, as the widget is fixed height and width.
This is a clear sign that they want to use a UnixDateTime instead.
This also adds support for placing durations and date times into SQL
databases via their millisecond offset to UTC.
That's what this class really is; in fact that's what the first line of
the comment says it is.
This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
This fixes a plethora of rounding problems on many websites.
In the future, we may want to replace this with fixed-point arithmetic
(bug #18566) for performance (and consistency with other engines),
but in the meantime this makes the web look a bit better. :^)
There's a lot more things that could be converted to doubles, which
would reduce the amount of casting necessary in this patch.
We can do that incrementally, however.
Previously, calling `.right()` on a `Gfx::Rect` would return the last
column's coordinate still inside the rectangle, or `left + width - 1`.
This is called 'endpoint inclusive' and does not make a lot of sense for
`Gfx::Rect<float>` where a rectangle of width 5 at position (0, 0) would
return 4 as its right side. This same problem exists for `.bottom()`.
This changes `Gfx::Rect` to be endpoint exclusive, which gives us the
nice property that `width = right - left` and `height = bottom - top`.
It enables us to treat `Gfx::Rect<int>` and `Gfx::Rect<float>` exactly
the same.
All users of `Gfx::Rect` have been updated accordingly.
Currently, an error message box appears when a user tries to cancel
the editor dialog while editing or adding a bookmark.
This snapshot resolves this by having `add_bookmark()` and
`BookmarksBarWidget::edit_bookmark()` perform an if check on the
result of `BookmarkEditor::edit_bookmark()` to see if the dialog
was canceled.
Corrects a slew of titles, buttons, labels, menu items and status bars
for capitalization, ellipses and punctuation.
Rewords a few actions and dialogs to use uniform language and
punctuation.
Previously, we would get a line of junk pixels to the right or bottom of
the captured bitmap.
Two aspects to this:
- Use Painter's clip-rect functionality instead of trying to implement
it ourselves.
- Switch from ScalingMode::NearestFractional to ::NearestNeighbor.
Somehow, `draw_scaled_bitmap(NearestFractional)` draws outside of the
Painter's clip-rect. I can't discern any difference in behavior
between these two otherwise.
We also now use the same bitmap for drawing the grid as we used for the
bitmap, since this had issues where it wasn't drawn to the edge of the
bitmap.
Because MemoryStatsWidget::refresh is run nearly directly by the
EventLoop, the only real alternative to crashing would be to cancel the
update, and keep the old data. That doesn't sound sufficiently better to
warrant being implemented.
Fixes apps showing redundant error messages and terminating
unnecessarily on failed file requests. It's nicer to drop the
user off at the equivalent of a default document on failure if
possible.
Also fixes TextEditor not showing response errors for missing files
in the recently opened list.