summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2023-03-24LibGfx: Remove unused class `Streamer`Lucas CHOLLET
2023-03-24LibGfx/PortableFormat: Port to StreamLucas CHOLLET
Each one of `[PBM, PGM, PPM]Loader` used yet another stream-like relic. This patch ports all of them to `AK::Stream`.
2023-03-24LibGfx/PortableFormat: Use finite loops in `read_image_data`Lucas CHOLLET
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.
2023-03-24LibGfx: Return true from `PortableImageDecoderPlugin::initialize()`Lucas CHOLLET
Reading the two magic bytes are always done in `decode()` by calling `read_magic_number()`. So no need to read it twice.
2023-03-24LibGfx: Remove unused functions `load_from_memory` and `load_impl`Lucas CHOLLET
2023-03-24LibGfx/PortableFormat: Propagate errors from some `read_*` functionsLucas CHOLLET
These functions are: - read_width - read_height - read_max_val
2023-03-24LibGfx/PortableFormat: Make `read_whitespace` return an `ErrorOr`Lucas CHOLLET
2023-03-24LibGfx/PortableFormat: Make `read_comment` return an `ErrorOr`Lucas CHOLLET
2023-03-24LibGfx/PortableFormat: Don't accept comments that don't start with `#`Lucas CHOLLET
2023-03-24LibGfx/PortableFormat: Simplify `read_number` signatureLucas CHOLLET
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.
2023-03-24LibGfx: Make `PortableImageDecoderPlugin` constructor privateLucas CHOLLET
2023-03-24ImageViewer: Use `LibFileSystemAccessClient`Caoimhe
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.
2023-03-24LibGUI: Paint slider track shorter to ensure the knob covers itAndreas Oppebøen
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.
2023-03-24LibGUI: Fix slightly wrong value slider knob positionAndreas Oppebøen
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).
2023-03-24LibGUI: Fix value slider so dragging left and right feels similarAndreas Oppebøen
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.
2023-03-24LibGUI: Fix slider so dragging handle left and right feels similarAndreas Oppebøen
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.
2023-03-24LibConfig: Use full include path for endpointsJelle Raaijmakers
This fixes the SDL2 port build which expects this path to exist in `/usr/include`.
2023-03-23LibWeb: Implement performance.mark and performance.clearMarksLuke Wilde
2023-03-23LibWeb: Add a list of the entry names in the PerformanceTiming interfaceLuke Wilde
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.
2023-03-23LibWeb: Introduce Performance Timeline and its Performance functionsLuke Wilde
2023-03-23LibWeb: Remove FIXME for existing `[Default] object toJSON()`functionsLuke Wilde
2023-03-23LibIDL: Add Type::is_json which says if the type is convertible to JSONLuke Wilde
2023-03-23LibThreading: Resolve BackgroundAction error callback use-after-freeTim Ledbetter
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 :^)
2023-03-23LibWeb: Create the correct error objects in XHR::handle_errorsLuke Wilde
Aborts and network errors were accidentally creating TimeoutError exceptions instead of AbortError and NetworkError respectively.
2023-03-23ImageViewer: Fix crash when opening ImageViewer without an imageCaoimhe
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.
2023-03-23WebDriver: Unlink server socket before binding to itAliaksandr Kalenik
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.
2023-03-23LibJS: Make `yy{/,-}mm{/,-}dd hh:mm` test timezone independentHendiadyoin1
Otherwise this will fail in non UTC timezones.
2023-03-23LibJS+LibTimeZone: Explicitly canonicalize "GMT" to "UTC"Timothy Flynn
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.
2023-03-23LibJS: Add missing internal slots to creation of Intl.DateTimeFormatTimothy Flynn
This is an editorial change in the ECMA-402 spec. See: https://github.com/tc39/ecma402/commit/f6c0c41
2023-03-23LibJS: Remove ! from AO calls that can't throw from Intl.DateTimeFormatTimothy Flynn
This is an editorial change in the ECMA-402 spec. See: https://github.com/tc39/ecma402/commit/8f9080e
2023-03-23LibJS: Explicitly provide all GetIterator arguments from Intl.ListFormatTimothy Flynn
This is an editorial change in the ECMA-402 spec. See: https://github.com/tc39/ecma402/commit/13895c8
2023-03-23LibJS: Support the yy{/,-}mm{/,-}dd hh:mm format for DateLuke Wilde
Required by a UK news website for loading a Piano configuration. This is presumably configuration for piano.io Analytics.
2023-03-23LibWeb: Add missing constructors to HTMLElement IDLsSrikavin Ramkumar
2023-03-23LibIDL: Parse extended attributes for constructorsSrikavin Ramkumar
2023-03-23LibWeb: Add scaleable checkboxes (with theme/accent-color support)MacDue
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.
2023-03-23LibGfx: Implement simple signed distance field renderingMacDue
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.
2023-03-23LibGfx: Add a simple GrayscaleBitmap classMacDue
This is very similar to the existing CharacterBitmap class but instead intended for small static grayscale bitmaps (such as signed distance fields).
2023-03-23LibWeb: Parse and plumb the `accent-color` CSS propertyMacDue
2023-03-22LibWeb: Support loading file:// URLs via fetch (through ResourceLoader)Andreas Kling
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.
2023-03-22LibWeb: Make ResourceLoader insert a Content-Type header for file://Andreas Kling
We make a guess using the MIME type guessing API in LibCore. This frees clients of this code from having to do the guessing.
2023-03-22FileSystemAccessServer: Implement FileTypeFilter to open_file()huttongrabiel
This is the same functionality as in FilePicker. It allows the specification of what file types are allowed.
2023-03-22LibGUI: Add IPC encode and decode for FileTypeFilterhuttongrabiel
Allows the use of GUI::FileTypeFilter in IPC.
2023-03-22LibWeb: Add workaround to restore cross-origin stylesheet functionalityLuke Wilde
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.
2023-03-22ImageViewer: Scale image to window on resizeLucas CHOLLET
2023-03-22ImageViewer: Scale image to window on startupLucas CHOLLET
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.
2023-03-22ImageViewer: Scale image to window size on image changeLucas CHOLLET
2023-03-22ImageViewer: Don't resize window on image rotation or flipLucas CHOLLET
2023-03-22Spreadsheet: Port to Core::FileLucas CHOLLET
2023-03-22PDFViewer: Create OutlineModel items with the correct pointerJulian Offenhäuser
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.
2023-03-22LibWeb: Use actual token representations when parsing CSS `<urange>`Sam Atkins
nasty_hacks--; // :^)