Commit graph

25969 commits

Author SHA1 Message Date
Andreas Kling
1268b39ba0 LibGfx: Make FastBoxBlurFilter go faster
When entering FastBoxBlurFilter::apply_single_pass(), we VERIFY that the
bitmap format is BGRA8888.

This invariant allows us to use get_pixel<BGRA8888>() instead of the
generic get_pixel() throughout the function. This removes a lot of
branches and makes the filter significantly faster. :^)
2021-08-18 11:35:51 +02:00
Andreas Kling
2432c5264b LibGfx: Remove ancient unused NO_FPU macros 2021-08-18 11:35:51 +02:00
Martin Åberg
0ed2a03450 Meta: Assume and find GNU du
We want to use use the 'du' option '--apparent-size' which is a
GNU coreutils extension. GNU coreutils is a build dependency so
we know it is available. With this commit we first try to pick up
du as 'gdu', and if that fails, try 'du' instead.
2021-08-18 10:59:50 +02:00
Rob Ryan
dd0244a97d Browser: Add Ctrl-D keyboard shortcut for bookmarking the current page 2021-08-18 10:39:13 +02:00
Rob Ryan
34a64ed25b LibGUI+Browser: Add UrlBox class
This allows the address bar to "select all" when initially gaining focus
as Firefox and Chrome do. A future improvement on this would be for the
Widget class to mange and provide focus transition as part of the events
instead of the UrlBox class. Currently focus is updated before the event
is provided to the UrlBox class.
2021-08-18 10:39:13 +02:00
Rob Ryan
fbf824a50f LibGUI: Allow widgets to make themselves non-auto-focusable
This patchs adds a way for widgets exclude themselves from being a focus
candidate in Window::focus_a_widget_if_possible().

This is to allow the URL box to not get auto-focused when the browser
is loaded.
2021-08-18 10:39:13 +02:00
Gunnar Beutner
6f19bf8501 Kernel: Fix a crash introduced by my TCP RST fix 2021-08-18 10:38:26 +02:00
Jean-Baptiste Boric
c972afbea6 LibC: Fix sigsetjmp and siglongjmp 2021-08-18 10:33:48 +02:00
Jean-Baptiste Boric
6165811081 LibC: Expose sig_sysname array 2021-08-18 10:33:48 +02:00
Jean-Baptiste Boric
77bec6b01d LibC: Move SIG_* definitions for sigprocmask into bits/sighow.h 2021-08-18 10:33:48 +02:00
Sam Atkins
b7aba70a28 LibWeb: Fix check for too many 'normal' values in font declaration
I had the values backwards, oops!
2021-08-18 10:32:32 +02:00
Sam Atkins
b64b97ef88 LibWeb: Implement font-fallback
If the font-family property is set to a StyleValueList, we now iterate
through it, looking up each font in turn until one is found.

StyleResolver no longer needs to handle FontFamily specifically, which
is a nice bonus.

Serenity's current dependence on bitmap fonts leads to some weirdness
here - for example, the `if (!found_font)` path can trigger even if a
generic font family like "sans-serif" is used, since our default
sans-serif font might not be available in the desired size or weight.
The `monospace` variable only exists for that reason.

This is not a complete solution, by a long way! Serenity's font support
is still quite basic, so more work needs to be done there before we can
start implementing the spec's font-matching algorithm. But this is still
an improvement. :^)
2021-08-18 10:32:32 +02:00
Sam Atkins
ceece1c75e LibWeb: Handle numeric font-weights
The code was assuming the font-weight would be a Length, apparently
since NumericStyleValue didn't exist at the time. Now, it's always a
numeric value, so treat it as such.

We also replace the hardcoded numbers with references to the FontWeight
enum.

Also, it was always setting the weight to 900, so that has been fixed.
2021-08-18 10:32:32 +02:00
Sam Atkins
3c541452b7 LibWeb: Calculate font-size in NodeWidthStyle::apply_style()
Previously, this made the same "everything is px" assumption as in
`StyleProperties::load_font()`, so I've replaced it with the calculation
from there.
2021-08-18 10:32:32 +02:00
Sam Atkins
8c39fee34d LibWeb: Handle non-px font sizes
The previous code assumed all font sizes were in px, but now we perform
the conversion. There is an existing bug with em sizes returning 0,
which seems to affect other places too - see
`NodeWithStyle::apply_style()`.

This also implements 'larger', 'smaller' and calc() font-sizes.
2021-08-18 10:32:32 +02:00
Sam Atkins
c990340c5a LibGfx: Mark Typeface::get_font() const, because it is const 2021-08-18 10:32:32 +02:00
Sam Atkins
7106655c86 Base: Add more test cases to fonts.html
- More combinations of values
- Testing a font (Liberation Serif) which has multiple faces
- Add calc() tests for font-size and weight
- Check fallback when a font isn't available

While I was at it, reorganized the file so the CSS is inline - this
keeps it close to the relevant test case.
2021-08-18 10:32:32 +02:00
sin-ack
e11d177618 Userland+LibGUI: Add shorthand versions of the Margins constructor
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same
margin on all edges, for example. The constructors follow CSS' style of
specifying margins. The added constructors are:

- Margins(int all): Sets the same margin on all edges.
- Margins(int vertical, int horizontal): Sets the first argument to top
  and bottom margins, and the second argument to left and right margins.
- Margins(int top, int vertical, int bottom): Sets the first argument to
  the top margin, the second argument to the left and right margins,
  and the third argument to the bottom margin.
2021-08-18 10:30:50 +02:00
sin-ack
9c9a5c55cb Userland+LibGUI: Make Margins arguments match CSS ordering
Previously the argument order for Margins was (left, top, right,
bottom). To make it more familiar and closer to how CSS does it, the
argument order is now (top, right, bottom, left).
2021-08-18 10:30:50 +02:00
Gunnar Beutner
c17f9adb12 Kernel: Don't respond to TCP RST packets
As seen with GitHub Pages and probably lots of other hosts this might
cause a loop if the peer decides to respond to our RST packet again.
2021-08-18 10:26:51 +02:00
Martin Åberg
0bf867bb9a Meta: Create memory disk before mounting it on FreeBSD
There was previously a case where the build-image-qemu.sh script
decided to mount an existing disk image, but without creating the
memory disk device and recording its /dev file name.

After this commit, We create the memory disk device just before
it is used to mount the disk image.
2021-08-18 10:25:00 +02:00
Brian Gianforcaro
e9d8f158a1 AK+Kernel: StringView hash map Traits should not set peek type to String
This typo / bug in the Traits<T> implementation for StringView caused
AK::HashMap methods to return a `String` when looking up values out of
a hash map of type HashTable<StringView,StringView>.

This change fixes the typo, and fixes the only consumer, the kernel
Commandline class.
2021-08-18 10:21:19 +02:00
Andrew Kaster
9bdb44c5d2 CI: Ensure relevant patch files are part of Toolchain cache hash
We were over-hashing for the GNU build on GitHub Actions by including
the LLVM patch as well. The GNU Toolchain doesn't care about our LLVM
patches.

For Azure, fix the inversion of the condition for which jobs check which
Build*.sh script, and add the Toolchain patch files to the cache
hash calculation.
2021-08-18 08:26:38 +02:00
Timothy Flynn
325eabc770 LibRegex: Ensure the GoBack operation decrements the code unit index
This was missed in commit 27d555bab0.
2021-08-18 09:47:09 +04:30
Timothy Flynn
c4ee576531 AK: Add Utf8View::byte_offset_of overload for code point index lookups 2021-08-18 09:47:09 +04:30
Timothy Flynn
a9716ad44e LibRegex: In non-Unicode mode, parse \u{4} as a repetition pattern 2021-08-18 09:47:09 +04:30
BuggieBot
e85c62e3a0 Base: Add a quote to the fortunes database
[skip ci]
2021-08-18 09:18:59 +04:30
Timothy Flynn
a8f9f160f9 CI: Print on-target debug logs when the tests fail 2021-08-18 08:47:23 +04:30
Andreas Kling
c70e2f2519 Kernel: Protect the Custody cache with a mutex instead of a spinlock
We don't need to access the Custody cache in IRQs or anything like that,
so it should be fine to use a regular Mutex (via ProtectedValue.)

This allows threads to block while waiting for the custody cache.
Thanks to Sergey for pointing this out. :^)
2021-08-18 00:44:35 +02:00
Jesse Buhagiar
8ad42e6771 LibGL: Implement glGetIntegerv 2021-08-18 00:35:26 +02:00
Jesse Buhagiar
0b67369830 LibGL: Implenent glGetBooleanv 2021-08-18 00:35:26 +02:00
Martin Åberg
5d146628e1 Documentation: Update FreeBSD prerequisites
FreeBSD comes with Clang as default host compiler and provides
GCC in the package system. The commit adds a few dependencies to
the pkg command line.
2021-08-18 00:35:09 +02:00
Linus Groh
90f7e01179 LibJS/Tests: Add Temporal.Calendar.from() tests for more object types 2021-08-17 23:06:05 +01:00
Linus Groh
0cdad283c0 LibJS: Reflect Record wording editorial change in the Temporal spec
See: https://github.com/tc39/proposal-temporal/commit/c8f14d0
2021-08-17 21:59:35 +01:00
Linus Groh
74ee1c9a8c LibJS: Add PlainDateTime fast path to various Calendar.prototype getters
This is a recent editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/c3880a3
2021-08-17 21:59:35 +01:00
Linus Groh
d46c531023 LibJS: Add and use newly introduced ToIntegerThrowOnInfinity Temporal AO
See: https://github.com/tc39/proposal-temporal/commit/2ed58f4
2021-08-17 21:59:35 +01:00
Timothy Flynn
4073fe497a Meta: Add Azure DevOps badge to README 2021-08-17 21:06:15 +01:00
Timothy Flynn
ef3ab8dd5f CI: Remove Lagom from GitHub Actions entirely
Fuzzing was the only Lagom build left.
2021-08-17 21:06:15 +01:00
Timothy Flynn
e3d4778a63 CI: Build Lagom with fuzzing on Azure 2021-08-17 21:06:15 +01:00
Nico Weber
9fd2f97d27 echo: Implement -e flag
This lets you do things like `echo -e '\e[31mhello\e[m'` to print
red text, without having to resort to the tyranny of printf(1).
2021-08-17 19:59:23 +01:00
Andrew January
f62ac5d81d Kernel/SysFS: Prepend to the custody cache instead of append
Usage patterns mean we are more likely to need a Custody we just cached.
Because lookup walks the list from the beginning, prepending new items
instead of appending means they will be found quicker.

This reduces the number of items in the cache we need to walk by 50% for
boot and application startups.
2021-08-17 16:30:03 +02:00
Timothy Flynn
86069fa28d CI: Remove nightly Clang toolchain GitHub Action 2021-08-17 13:31:43 +01:00
Timothy Flynn
3ce6f26924 CI: Build and test SerenityOS with the Clang toolchain on Azure 2021-08-17 13:31:43 +01:00
Timothy Flynn
5eba8c948d CI: Use Azure caching for Lagom build
Adds a compiler cache and a cache for the UCD files.
2021-08-17 13:31:43 +01:00
Timothy Flynn
831f90c9d4 Meta: Semi-automatically detect ccache for Lagom builds
The top-level CMakeLists.txt already automatically detects ccache, but
CI will invoke CMake with Lagom's CMakeLists.txt. Add an option to Lagom
to do the same detection.
2021-08-17 13:31:43 +01:00
Timothy Flynn
eedb26110a Kernel: Fix compilation with Clang
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2021-08-17 13:31:43 +01:00
Timothy Flynn
7ea55c883b Toolchain: Make Kernel/API headers available to Clang toolchain build
Copied from 9b79867909.
2021-08-17 13:31:43 +01:00
Linus Groh
1292d80b93 LibJS: Implement Temporal.Calendar.prototype.mergeFields() 2021-08-17 00:26:19 +01:00
Andreas Kling
1ea604adb1 Kernel/ProcFS: Avoid String allocation when traversing /proc/PID/fd/ 2021-08-17 01:21:47 +02:00
Andreas Kling
45a5cf95f9 Kernel: Add a little explainer comment to ListedRefCounted 2021-08-17 01:21:47 +02:00