We weren't properly creating a `LoadRequest` which resulted in `m_page`
not having a value in certain situations inside
`ResourceLoader::load(LoadRequest&)`
The Unicode spec defines much more complicated caseless matching
algorithms in its Collation spec. This implements the "basic" case
folding comparison.
Case folding rules have a similar mapping style as special casing rules,
where one code point may map to zero or more case folding rules. These
will be used for case-insensitive string comparisons. To see how case
folding can differ from other casing rules, consider "ß" (U+00DF):
>>> "ß".lower()
'ß'
>>> "ß".upper()
'SS'
>>> "ß".title()
'Ss'
>>> "ß".casefold()
'ss'
And remove links that aren't adding much value but will often get out of
date (i.e. links to UCD files, which are already all listed in
unicode_data.cmake).
InodeWatcherFlags is an enumeration from the Kernel. To avoid using it
outside of Serenity, add a FileWatcherFlags for FileWatcher, much like
we already have FileWatcherEvent::Type.
This is currently being implicitly including by InodeWatcherEvent.h by
way of FileWatcher.h. The former will soon be removed from the latter,
which would otherwise cause a compile error in these files.
Dependabot cannot be configured to significantly change the way it
formats its commit message, and it currently includes a "Signed-Off-By"
tag which is not allowed by our linter.
This updates our CI commit linter to exclude bots from the checks.
This implements FileWatcher using inotify filesystem events. Serenity's
InodeWatcher is remarkably similar to inotify, so this is almost an
identical implementation.
The existing TestLibCoreFileWatcher test is added to Lagom (currently
just for Linux).
This does not implement BlockingFileWatcher as that is currently not
used anywhere but on Serenity.
Playback can resume after encountering loader errors (though not
always). Ideally, these should be visible to the user and the loader
state should be reset after encountering such errors. This patch
also has the side effect of not crashing on seek when playing MP3 files
(However, it still does not seek to the correct location) :^)
`get()` is intended as a replacement for `get_deprecated()` and `get_ptr
()`. The former returns the same value for "key not found" and "key
found and contains `null`" which is ambiguous. The latter returns a raw
pointer which is spooky. Returning `Optional<JsonValue const&>` covers
all the previous uses for these.
The `get_foo()` methods are helpers to make user code less verbose. Most
of the time, we only want a specific type of value: if we want a number
and get a string, we respond the same as if the value was not there at
all. These make that easier to express.
This also adjusts the `has_i32()` method and friends to examine the
value instead of just looking at the underlying type.
The existing `is_i32()` and friends only check if `i32` is their
internal type, but a value such as `0` could be literally any integer
type internally. `is_integer<T>()` instead determines whether the
contained value is an integer and can fit inside T.
This saves us an actual seek and rereading already stored buffer data in
cases where the seek is entirely covered by the currently buffered data.
This is especially important since we implement `discard` using `seek`
for seekable streams.
The current sample count is already reported like that, so this fixes a
mismatch between current and total. In the future, we should look into
abstracting this away properly instead of requiring the user to think of
converting it manually everywhere.
This prevents unnecessary queries being executed when pasting text
or typing very quickly. The debounce timeout is 5ms, which is half the
rate at which the UI is updated. Therefore, there should be no
noticable impact on user experience.
Previously, results were cached for each query in a single list.
The majority of CPU time was spent determining which items in the
cache had been seen previously. This commit removes the need to
check previous results by holding a separate list of results for each
provider type.
This makes Assistant feel much more responsive to user input,
especially when the filesystem has a lot of files.
The old `GUI::Window` resizing behavior created a new backing store for
each resize event (i.e. every visible window size). This caused a lot of
trashing and on my machine, caused up to 25% of CPU time spent in
creating new backing stores.
The new behavior is a bit more sensible:
* If the window size is shrinking, the backing store is already large
enough to contain the entire window - so we don't create a new one.
* If the window size is growing, as soon as the backing store can no
longer contain the window, it is inflated with a large margin (of an
arbitrary chosen 64 pixels) in both directions to accommodate some
leeway in resizing before an even larger backing store is required.
* When the user stops resizing the window, the backing store is
resized to the exact dimensions of the window.
For me, this brings the CPU time for creating backing stores down to 0%.
Unicode declares that to titlecase a string, the first cased code point
after each word boundary should be transformed to its titlecase mapping.
All other codepoints are transformed to their lowercase mapping.