Whenever an entry is added to the cache, the last element is removed to
make space for the new entry(if the cache is full). To make this an LRU
cache, the entry needs to be moved to the front of the list when there
is a cache hit so that the least recently used entry moves to the end
to be evicted first.
Although the algorithm for sizing tracks (rows or columns) is defined
once for both dimensions in the specification
(https://www.w3.org/TR/css-grid-2/#algo-track-sizing), we have
implemented it twice separately for sizing rows and columns.
In addition to code duplication, another issue is that these
implementations of the same algorithm have already diverged in some
places, and this divergence is likely to become even worse as our
implementation evolves.
This change unifies code for both dimension into one method that runs
track sizing.
While this change brings a bit of collateral damange (border.html and
minmax.html got changes in layout snaphots) it ultimately brings more
benefits because now we can evolve layout for both rows and colums
without duplicating the code :)
Commit 1a97382 introduced the fallible GUI::Application::create() and
removed GUI::Application::construct() breaking the SDL2 port, let's
update it to use the fallible version.
<Ctrl-Del> will crash when deleting at the end of line
where the next line contains only punctuation and seperator characters,
because TextDocument::first_word_break_after will return a wrong index
of the next word break (+1 bigger than the correct index),
thus RemoveTextCommand will try to remove a out-of-bound text range
causing a crash.
<Ctrl-Backspace> will stuck when deleting at the end of line
which contains only one single character. When finding the
previous word break position starting at column 0 in
TextDocument::first_word_break_before, the code enters an
infinite while loop. The early return should simply fix this.
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.
This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.
From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
The font isn't set in the constructor, there may be a case where the
font hasn't loaded before the first paint event. Therefore, we should
not paint if the font is null. All other methods should be fine.
`m_original_font` is only set if `GlyphMapWidget::set_font` is called.
But, if the user of `GlyphMapWidget` decides not to set a font,
there will be no value for `m_original_font`.
This commit fixes that issue by checking if `m_original_font` is not
null before attempting to use it.
We now load SVG icons (via the Qt resource system) and render them into
a QIcon (with normal and disabled variants) using system colors.
We also re-render them if the system color theme changes.
This instantly makes Ladybird look less foreign on my Linux box.
I drew the icons myself, and they could definitely be more optimized,
but this was my first time using Inkscape. :^)
The graphics directory is a more suitable home for game assets.
Also, move card backs into their own subfolder in preparation for a
themes subfolder for card fronts.
`Length::resolved(Node&)` transforms infinite values to "auto".
Following transformations:
Infinite (Length) -> "auto" -> 0 (px)
cause border-box width to be resolved in zero when it should be inf px.
Removing `Length::resolved(Node&)` makes it work right:
Infinite (Length) -> Infinite (px)
Fixes#18649