With #12480, Breadcrumbbar's on_focus_change() uses
on_click(). In SpaceAnalyzer, double clicking triggers the
TreeWidgetMap's on_path_change(), which triggers Breadcrumbbar's
on_focus_change(), which also triggers the TreeWidgetMap's
on_path_change() again. This resulted in use-after-free of
Breadcrumbbar, thus resulted in the crash. Not updating the
TreeWidgetMap's viewpoint recursively solves the issue.
Ports / other userland often needs such an implementation to function.
Lets expose `AK::timing_safe_compare` under the same name used used in
OpenBSD / FreeBSD / Solaris and other projects.
This is not strictly required, as we are comparing hashes, not the
password it self. However given this is generic code that could be
used anywhere in the system, it seems prudent to be cautious and
make sure we don't inadvertently leak any information about the hash
via timing attacks in future usages of `LibCore::Account`.
Reported-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
This makes code readable in Hack Studio.
This commit also replaces the 'highlight' window colour
with one that matches theme (the previous was the default).
PBM, PGM, and PPM image loaders are mostly common. The only difference
is how the data is read and the associated magic numbers. The magic
numbers are already made common using the loading contexts. Now make
the implementations common via a class template which accepts the
context to disambiguate.
Much of the code in PBM, PGM, and PPM image loaders is common. The
contexts are nearly identical. Instead of writing multiple contexts,
write 1 with a template argument to pass in the details of the given
format.
Since we want to store an initial value for every CSS::PropertyID,
it's pretty silly to use a HashMap when we can use an Array.
This takes the function from ~2.8% when mousing around on GitHub all the
way down to ~0.6%. :^)
Previously we were making a copy of the full set of custom properties
that applied to a DOM element. This was very costly and dominated the
profile when mousing around on GitHub.
Note that this may break custom properties on pseudo elements a little
bit, and that's something we'll have to look into.
Computing the pseudo element of a CSS::Selector was very hot when
mousing around on GitHub in Browser. A profile had it at ~10%.
After these changes, it's totally gone from the profile. :^)
Instead of calling quick_sort() every time a StackingContext child
is added to a parent, we now do a single pass of sorting work after the
full StackingContext tree has been built.
Before this change, the quick_sort() was ~13.5% of the profile while
hovering links on GitHub in the Browser. After the change, it's down to
~0.6%. Pretty good! :^)
Also use the daylight global to determine the current time zone name,
i.e. tzname[0] is standard time, tzname[1] is daylight savings time.
Note that altzone isn't required to be defined on all systems, so we
have to #ifdef to check if it exists in order for Lagom to build.
This was not handling the nullary call case correctly, remove the whole
nullary check as there's nothing particularly expensive in the catch-all
case anyway.
For seletors whose subject is unversal (i.e selectors that end in "*")
we were not serializing the asterisk. Instead "foo bar *" came out as
"foo bar foo". This patch fixes that by correctly serializing the last
simple selector if it's universal.
The smooth scrolling looks slightly off in the terminal as the
scrollbar animation lasts longer than the actual scroll.
This behaviour is also consistent with other terminal emulators.
-Layer now has methods for flip/rotate/crop, which are responsible
for handling the alpha mask.
-Fixed crash when the display image size is out of sync with
the content image size.
-Changed API for setting content and mask image in Layer. Now, both
must be set at the same time, and it can result in an error if
you provide mismatched dimensions.