summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
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--; // :^)
2023-03-22LibWeb: Store the original representation of CSS tokensSam Atkins
This is required for the `<urange>` type, and custom properties, to work correctly, as both need to know exactly what the original text was.
2023-03-22LibWeb: Correct logic when consuming a CSS number in scientific notationSam Atkins
Before, we were classifying the number as a "number" type if it had an "E", even if that was not followed by an exponent.
2023-03-22LibFileSystem: Fix leak in `read_path`Cameron Youell
2023-03-22Help: Don't abort opening help:// URLs when error *didn't* occurAndreas Kling
Fixes #14158
2023-03-22LibWeb: Consider inline content (line boxes) when measuring overflowAndreas Kling
Fixes #13628
2023-03-22Presenter: Don't give a style value if there are no stylesKyle Lanmon
2023-03-22Presenter: Support multiple frames per slideKyle Lanmon
2023-03-22Shell: Implement arithmetic expansions for POSIX modeAli Mohammad Pur
This also adds a 'math' immediate function that can be used in Shell proper to do arithmetic stuff.
2023-03-22Shell: Resolve nonexistent string env variables to the empty stringAli Mohammad Pur
We did this for lists, but not for strings.
2023-03-22Shell: Load a different rc file when in POSIX modeAli Mohammad Pur
2023-03-22LibFileSystemAccessClient: Don't make illegal operation on filesLucas CHOLLET
`handle_prompt_end` is calling `is_device` and `is_directory` on the path chosen by the user. However, this path is not necessarily unveiled. Meaning that it the both functions results in an illegal operation. This is a regression introduced with the usage of LibFileSystem in 1d24f394. This patch, revert the behavior at its previous state, i.e. calling both functions with the fd provided by the FSAS.
2023-03-22LibPDF: Pass the right point width to the font loader in TrueTypeFontJulian Offenhäuser
2023-03-22LibPDF: Fix navigate_to_before_eof_marker() for PDFs not ending in EOLJulian Offenhäuser
The way this was factored before, we would miss the %%EOF marker if it didn't have a valid end-of-line sequence after it.
2023-03-22LibPDF: Don't consume anything other than EOL in Reader::consume_eol()Julian Offenhäuser
This was previously a slightly confusing API. Even when there was no EOL marker at the current location, we would still consume one byte. It will now consume either EOL or nothing at all.
2023-03-22LibPDF: Be more cautious of errors when looking for linearization dictJulian Offenhäuser
We would previously assume that, following the header, there must be a valid PDF object that could be a linearization dict. However, if the file is not linearized, this is not necessarily true. We now try to detect if there even is an object, and don't treat parsing errors as fatal.
2023-03-22LibPDF: Don't treat a broken document header as a fatal errorJulian Offenhäuser
As the current goal is to make our best effort loading documents, we might as well ignore a broken header and power through, giving the user a warning.
2023-03-22LibGfx/JPEG: Replace a FIXME with some explanationsLucas CHOLLET
Calling the `ycbcr_to_rgb` function still looks unsuitable for this usage, but it does the job correctly.
2023-03-22LibGUI: Resolve use-after-free errorLucas CHOLLET
Objects taken by reference are no longer valid when used in `deferred_invoke`. Explicitly copying them solve the issue.
2023-03-22LibWeb: Change "popup"-related storage types to named enumsTimothy Flynn
2023-03-22LibWeb: Change the "noreferrer" storage type to a named enumTimothy Flynn
2023-03-22LibWeb+WebContent: Change the "noopener" storage type to a named enumTimothy Flynn
2023-03-21LibGfx: Move all image loaders and writers to a subdirectoryLucas CHOLLET
2023-03-21LibFileSystem: Move `TempFile` from `LibCore` to `LibFileSystem`Cameron Youell
As suggested in commit de18485
2023-03-21LibCore: Remove all unused `DeprecatedFile` functionsCameron Youell
2023-03-21Everywhere: Use `LibFileSystem` where trivialCameron Youell
2023-03-21LibFileSystem: Create `LibFileSystem`Cameron Youell
Copy over updated `DeprecatedFile` functions
2023-03-21LibCore: Add ErrorOr wrapper for `utimensat`Cameron Youell
2023-03-21LibGfx/OpenType: Do not preemptively return while searching for kerningLukasACH
The kerning value for a particular glyph may not be in the first table. Continue until we either run out of tables or we find an applicable value.
2023-03-21LibGfx/OpenType: Get size of ValueRecord from PairPos valueFormat fieldLukasACH
The stored ValueRecord in the font file only contains the fields specified in the valueFormat field of the PairPosFormat1 table. This means we need to construct the ValueRecord dynamically at runtime and cannot bit_cast it to a struct.
2023-03-21LibGfx/OpenType: Move function read_value_record, add argument streamLukasACH
read_value_record(u16 value_format, FixedMemoryStream& stream) takes a bitmask value_format that describes the available fields of the ValueRecord and a FixedMemoryStream at the location of the next ValueRecord. It then advances the stream and returns a complete ValueRecord.
2023-03-21LibJS: Ensure Date tests can pass in any time zone by testing UTC valuesTimothy Flynn
When we create a Date object from a timestamp, or set its value by way of Date.prototype.setTime, the timestamp is interpreted as UTC. Change test expecatations against such instances to use UTC as well.
2023-03-21LibCore: Set tm_isdst to a negative value before invoking mktimeTimothy Flynn
If it is default-initialized to 0, mktime will assume that DST is not in effect for the specified time. Setting it to a negative value instructs mktime to determine for itself whether DST is in effect.
2023-03-21LibWeb: Parse CSS identifiers case-insensitivelyimplicitfield
2023-03-21LibWeb: Don't try to parse GPOS lookup types we don't understand yetAndreas Kling
At the moment, we only understand lookup type 2 (pair adjustment) so let's ignore lookup tables with other types. This fixes an issue where we'd choke on Noto Sans versions that come with a chained context positioning lookup table (type 8). Fixes #17924