Age | Commit message (Collapse) | Author |
|
|
|
Each one of `[PBM, PGM, PPM]Loader` used yet another stream-like relic.
This patch ports all of them to `AK::Stream`.
|
|
The `read_image_data` function of each one of[PBM, PGM, PPM]Loader use
the same structure to read an image. This patch harmonizes the three
functions and use finite loops instead of reading until EOF. It allows
to quit early on bloated file, but it's mainly done for refactoring
purpose.
|
|
Reading the two magic bytes are always done in `decode()` by calling
`read_magic_number()`. So no need to read it twice.
|
|
|
|
These functions are:
- read_width
- read_height
- read_max_val
|
|
|
|
|
|
|
|
The function signature goes from:
`bool read_number(Streamer& streamer, TValue* value)`
to
`ErrorOr<u16> read_number(Streamer& streamer)`
It allows us to, on one hand use `ErrorOr` for error propagation,
removing an out parameter in the meantime, and on the other hand remove
the useless template.
|
|
|
|
This commit also starts the adoption of ErrorOr<T> and the String class
in ImageViewer. However, there is still a few more changes that could
be made.
Since the actions of using LibFSAC and using String in more places are
tightly coupled, I decided to put them in one commit.
|
|
A 1px drop shadow from the track was peeking out behind the knob when
at rightmost or lowest position. That made it look like it was possible
to drag the knob even further right or down. Painting the track 1px
shorter seems like a good compromise to avoid the problem.
|
|
When clicking the value slider bar, the knob was not positioned as
close to the mouse as expected. When moving the mouse right, the knob
would lag a bit behind, and the cursor would eventually be outside the
knob.
The bug was due to knob_rect() taking knob_thickness into account to
prevent the knob from protruding outside the bar. The value_at(pos)
calculated the relative position based on the entire width of the bar.
This discrepancy is fixed by taking knob_thickness into account in
value_at(position).
|
|
When dragging value slider left, the handle would snap to lower value
with the slightest move of the mouse. When dragging to the right
however, it would take a lot more movement to cause a change in value.
This asymmetry made it feel awkward to drag the mouse around. It was
caused by always rounding down using a cast to int. By rounding to the
nearest integer first, we ensure symmetric behavior.
|
|
When dragging the slider handle left/down, the handle would
snap to lower value with the slightest move of the mouse. When dragging
to the right/up however, it would take a lot more movement to cause
a change in value. This asymmetry made it feel really awkward to drag
the slider. It was caused by always rounding down using a cast to int.
By rounding to the nearest integer first, we ensure symmetric behavior.
|
|
This fixes the SDL2 port build which expects this path to exist in
`/usr/include`.
|
|
|
|
Required for the PerformanceMark constructor, which doesn't allow any
mark names that have the same name as an attribute in the
PerformanceTiming interface in a Window context.
|
|
|
|
|
|
|
|
This change ensures that a reference to the BackgroundAction is held
until after the error callback has executed on the event loop.
This fixes an intermittent crash in Assistant :^)
|
|
Aborts and network errors were accidentally creating TimeoutError
exceptions instead of AbortError and NetworkError respectively.
|
|
Seems like a thing which slipped through the cracks... We shouldn't try
to scale the image to the window's size if the bitmap doesn't exist.
|
|
Previously, the create_server function would fail with an "Address
already in use" error if a file that used for socket address is
already exists.
|
|
Otherwise this will fail in non UTC timezones.
|
|
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/50eb413
Note that this canonicalization already occurred. As the above commit
alludes to, we parse the rearguard format of the TZDB, so GMT is already
an alias to Etc/GMT. But it doesn't hurt to be explicit here.
|
|
This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/f6c0c41
|
|
This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/8f9080e
|
|
This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/13895c8
|
|
Required by a UK news website for loading a Piano configuration.
This is presumably configuration for piano.io Analytics.
|
|
|
|
|
|
This reworks checkboxes to use a tiny 16x16 SDF for the tick icon along
with an antialiased background/border.
The checkbox now works well at any scale, shows the various checkbox
state (enabled, disabled, being pressed), and supports using the colors
from the active system theme and/or the accent-color property.
|
|
This is mostly a simple grayscale bilinear scale, with an extra step
of computing the distance and alpha with a little smoothing. This
can be used to paint more scalable UI elements/icons from rather
small distance fields. A tiny 16x16 SDF seems to do a decent job
for simple icons.
|
|
This is very similar to the existing CharacterBitmap class but instead
intended for small static grayscale bitmaps (such as signed distance
fields).
|
|
|
|
This builds on the existing ad-hoc ResourceLoader code for HTTP fetches
which works for files as well.
This also includes a test that checks that stylesheets loaded with the
"file" URL scheme actually work.
|
|
We make a guess using the MIME type guessing API in LibCore. This frees
clients of this code from having to do the guessing.
|
|
This is the same functionality as in FilePicker. It allows the
specification of what file types are allowed.
|
|
Allows the use of GUI::FileTypeFilter in IPC.
|
|
CORS cross-origin responses in the No CORS request mode provide an
opaque filtered response, which is the original response with certain
attributes removed/changed.
The relevant effect it has is setting the body to `null`, which means
`body_bytes` has `Empty` in the process_response_consume_body callback.
This effectively disables cross-origin linked resources
(e.g. stylesheets).
However, the web actually depends on this, especially for stylesheets
retrieved from a cross-origin CDN. For example, Shopify websites
request stylesheets from `cdn.shopify.com` and Substack websites
request stylesheets from `substackcdn.com`.
This makes this a specification bug, as this code was written from it.
The workaround is to read the actual body from the unfiltered response
and then call `process_linked_resource` from there.
This _should_ be safe to do, as linked resource fetches do not include
credentials (i.e. cookies and the Authorization header), so it cannot
provide personalized responses.
|
|
|
|
We used to do the opposite, meaning that a huge images make the window
bigger than the screen. We now define a range for the window size and
scale the image if it doesn't fit un the current scope.
|
|
|
|
|
|
|
|
This fixes a bug where we would construct a ModelIndex with a pointer to
NonnullRefPtr<OutlineItem>, instead of a pointer to the underlying
OutlineItem, which caused a crash later on when we would try to
dereference that pointer.
|
|
nasty_hacks--; // :^)
|