summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2023-01-20LibGfx: Add scaffolding for reading ICC tag tableNico Weber
The idea is that we'll have one type for each tag type. For now, this treats all tag types as unknown, but it puts most of the infrastructure for reading tags in place.
2023-01-20LibGfx: Extract Profile::read_header() functionNico Weber
2023-01-20LibGfx: Make ICCHeader use FourCC types for fourcc fieldsNico Weber
No behavior change. Arguably more expressive.
2023-01-20LibGfx: Make DistinctFourCC compatible with BigEndianNico Weber
2023-01-20LibCore: Remove `FileStream`Tim Schumacher
2023-01-20wasm: Interface with the standard output via `Core::Stream`Tim Schumacher
2023-01-20gunzip: Use `Core::Stream` to write the decompression outputTim Schumacher
2023-01-20WebServer: Use `Core::Stream` to read served filesTim Schumacher
2023-01-20LibGfx: Use `Core::Stream` to write bitmap fontsTim Schumacher
2023-01-20LibAudio: Use `AllocatingMemoryStream` as the MP3 loader bit reservoirTim Schumacher
2023-01-20LibWasm: Use `AllocatingMemoryStream` around `Wasm::Printer`Tim Schumacher
2023-01-20LibCore: Avoid logical OOB read in AllocatingMemoryStream::offset_of()Ali Mohammad Pur
The previous impl was trimming the last chunk to the free space instead of the used space, which yielded an OOB read if the needle wasn't found.
2023-01-20LibJS: Mark infallible operations that may throw only due to OOMTimothy Flynn
2023-01-20LibJS: Add a macro for infallible operations that may throw OOMTimothy Flynn
If a spec step hasn't been marked as fallible, but might throw due to OOM, this is to make it clear that OOM is the only thing that may cause a failure.
2023-01-20Everywhere: Convert known short-strings to the infallible String factoryTimothy Flynn
For now, this is limited to strings that are 3 bytes or less. We can use 7 bytes on 64-bit platforms, but we do not yet assume 64-bit for Lagom hosts (e.g. wasm).
2023-01-20ColorLines: Use AK::shuffle() for shufflingSam Atkins
2023-01-20LibGfx: Fix TGA decoder being out of boundary after calling frame methodLiav A
This happened because the reader was incrementing the byte index of it after each read of a byte from the Span, so by the end of the frame method, we could be at the end of the mapped file, so the next call on the same decoder will just resume from that point and will be quickly out of boundary. To ensure this doesn't happen we only set the bitmap to m_context member at the end of the method, and call to that method again will just give the already-generated bitmap. In case of setting the bitmap as volatile, we test for that case and re-generate a reader to read the frame again correctly.
2023-01-20LibWeb: Improve auto height calculation for tablesAliaksandr Kalenik
Change `compute_auto_height_for_block_level_element` to use max height (`m_automatic_content_height` produced from TFC) for tables with auto height which is more correct behaviour than treating them like block containers.
2023-01-20LibWeb: Include table intrinsic offsets in child boxes positionAliaksandr Kalenik
Table's border and padding should be taken in account while calculating child boxes x and y offsets.
2023-01-20LibGfx: Re-structure the whole initialization pattern for image decodersLiav A
When trying to figure out the correct implementation, we now have a very strong distinction on plugins that are well suited for sniffing, and plugins that need a MIME type to be chosen. Instead of having multiple calls to non-static virtual sniff methods for each Image decoding plugin, we have 2 static methods for each implementation: 1. The sniff method, which in contrast to the old method, gets a ReadonlyBytes parameter and ensures we can figure out the result with zero heap allocations for most implementations. 2. The create method, which just creates a new instance so we don't expose the constructor to everyone anymore. In addition to that, we have a new virtual method called initialize, which has a per-implementation initialization pattern to actually ensure each implementation can construct a decoder object, and then have a correct context being applied to it for the actual decoding.
2023-01-20LibGfx: Re-work the abstractions of sending image for decoding over IPCLiav A
Originally I simply thought that passing file paths is quite OK, but as Linus pointed to, it turned out that passing file paths to ensure some files are able to be decoded is awkward because it does not work with images being served over HTTP. Therefore, ideally we should just use the MIME type as an optional argument to ensure that we can always fallback to use that in case sniffing for the correct image type has failed so we can still detect files like with the TGA format, which has no magic bytes.
2023-01-20LibCore: Add MIME type string for TGA filesLiav A
2023-01-20LibCore: Return StringView from guess_mime_type_based_on_filename methodLiav A
2023-01-19LibJS: Return OptionalNone in fallible functions in the Intl namespaceTimothy Flynn
2023-01-19LibJS: Add a special ThrowCompletionOr constructor for OptionalNoneTimothy Flynn
Currently, if you have a fallible function with an Optional return type and try to return OptionalNone like this: ThrowCompletionOr<Optional<SomeType>> { return OptionalNone {}; } Then ThrowCompletionOr's m_value (whose type is an Optional<ValueType>) will be set to empty, rather than containing an empty Optional. This is due to the ThrowCompletionOr's WrappedValueType constructor. This patch adds a constructor specifically for OptionalNone. If someone attempts to construct a ThrowCompletionOr with OptionalNone, but the ValueType is not an Optional, a compile error like the following will occur: ThrowCompletionOr<String> foo() { return OptionalNone {}; } error: no matching constructor for initialization of 'AK::String' Otherwise, it will fill ThrowCompletionOr's m_value with an empty Optional.
2023-01-19LibLocale: Remove now-unused [LanguageID,LocaleID]::to_deprecated_stringTimothy Flynn
2023-01-19LibJS: Port Intl locale resolution to StringTimothy Flynn
2023-01-19LibJS: Do not fully qualify references to CanonicalizeUnicodeLocaleIdTimothy Flynn
This might've been needed at some point to disambiguate between another function of the same name that is in LibLocale. But now that it takes a VM parameter, it is for sure clear to the compiler what is being called.
2023-01-19LibJS: Propagate OOM errors from the PartitionPattern Abstract OperationTimothy Flynn
2023-01-19LibJS: Propagate OOM errors from Intl Abstract OperationsTimothy Flynn
This excludes the PartitionPattern AO as that has a much larger foot- print and will be handled separately.
2023-01-19LibLocale+LibJS: Port locale parsing and processing to StringTimothy Flynn
In order to prevent this commit from having to refactor almost all of Intl, the goal here is to update the internal parsing/canonicalization of locales within LibLocale only. Call sites which are already equiped to handle String and OOM errors do so, however.
2023-01-19LibLocale: Add a method to convert LocaleID to a StringTimothy Flynn
2023-01-19LibCore: Implement FileWatcher for macOSTimothy Flynn
The macOS FileWatcher depends on macOS dispatch queues, which run on a different thread than the Core::EventLoop. This implementation handles filesystem events on its dispatch queue, then forwards the event back to the main Core::EventLoop for notifying the FileWatcher owner.
2023-01-19LibCore: Allow subclassing FileWatcherTimothy Flynn
This will be handy for platforms which need to be able to store extra OS-specific members. For example, macOS needs to store a dispatch queue, and event stream, etc.
2023-01-19Userland: Add missing Math.h and IntegralMath.h header includesTimothy Flynn
These are currently being implicitly including by FixedPoint.h by way of Format.h. The former will soon be removed from the latter, which would otherwise cause a compile error in these files.
2023-01-19Utilities: Rewrite sort(1) to be more posixyPeter Elliott
2023-01-19Utilities: Replace fgrep with grep --fixed-stringsPeter Elliott
2023-01-19Presenter: Disable actions when there is no loaded presentationJoao Luz
2023-01-19LibC: Remove the stub iconv headerTim Schumacher
This was added in 2019 to trick GCC into accepting a newlib build, but now this no longer seems to be required to build the toolchain.
2023-01-19LibAudio: Skip MP3 frames if not enough historic data is availableTim Schumacher
2023-01-19LibAudio: Clear the MP3 bit stream when seekingTim Schumacher
2023-01-19SoundPlayer: Translate device samples to source samples before seekingTim Schumacher
2023-01-19SoundPlayer: Don't offset the seek bar with the last seek valueTim Schumacher
The audio loader plugins already do this internally, if we do this a second time the seek bar will just end up getting rendered at the wrong place.
2023-01-19LibCore: Let offset-related Stream functions return an unsigned valueTim Schumacher
A negative return value doesn't make sense for any of those functions. The return types were inherited from POSIX, where they also need to have an indicator for an error (negative values).
2023-01-19LibCore: Return `EBADF` on unsupported stream operationsTim Schumacher
2023-01-19LibDebug: Identify embedded resources with a preceding dotTim Schumacher
2023-01-19LibDebug: Factor out the "looks like embedded resource" conditionTim Schumacher
2023-01-18LibWeb: Convert the Location object to IDLLinus Groh
This includes: - Moving it from Bindings/ to HTML/ - Renaming it from LocationObject to Location - Removing the manual definitions of the constructor and prototype - Removing special handling of the Location interface from the bindings generator - Converting the JS_DEFINE_NATIVE_FUNCTIONs to regular functions returning DeprecatedString instead of PrimitiveString - Adding missing (no-op) setters for the various attributes, which are expected to exist by the bindings generator
2023-01-18LibGfx+Ladybird+Userland: Don't sniff for TGA images with only raw bytesLiav A
Because TGA images don't have magic bytes as a signature to be detected, instead assume a sequence of ReadonlyBytes is a possible TGA image only if we are given a path so we could check the extension of the file and see if it's a TGA image. When we know the path of the file being loaded, we will try to first check its extension, and only if there's no match to a known decoder, based on simple extension lookup, then we would probe for other formats as usual with the normal sniffing method.
2023-01-18LibWeb: Fix `FrameLoader::load_error_page`Cameron Youell
We weren't properly creating a `LoadRequest` which resulted in `m_page` not having a value in certain situations inside `ResourceLoader::load(LoadRequest&)`