Commit graph

39183 commits

Author SHA1 Message Date
Liav A
6256bdb075 Ports: Add QOI converter and QOI benchmark utility 2022-07-08 12:01:52 +02:00
Liav A
5fe4feee33 Ports: Add stb header files 2022-07-08 12:01:52 +02:00
Timothy Flynn
bf85bf2a9e LibJS: Use Intl.PluralRules within Intl.RelativeFormat
The Polish test cases added here cover previous failures from test262,
due to the way that 0 is specified to be "many" in Polish.
2022-07-08 11:51:54 +02:00
Timothy Flynn
36abcd820d LibJS: Implement Intl.PluralRules.prototype.select 2022-07-08 11:51:54 +02:00
Timothy Flynn
f11cb7c075 LibJS: Populate pluralCategories in Intl.PluralRules.resolvedOptions 2022-07-08 11:51:54 +02:00
Timothy Flynn
670bd066a5 LibJS: Replace JS::Intl::PluralRules::Type with Unicode::PluralForm
The JS::Intl enum was added when implementing the PluralRules
constructor. Now that LibUnicode has a plural rules implementation,
replace the JS::Intl enum with the analagous Unicode enum.
2022-07-08 11:51:54 +02:00
Timothy Flynn
2982aa0373 LibJS: Mark the NumberFormat parameter of FormatNumericToString as const
Not critical, but in subsequent commits this will be invoked from a
constant context.
2022-07-08 11:51:54 +02:00
Timothy Flynn
8aeacccd82 LibUnicode: Generate a list of available plural categories per locale
Separate lists are generated for cardinal and ordinal form.
2022-07-08 11:51:54 +02:00
Timothy Flynn
ea78bac36d LibUnicode: Parse and generate per-locale plural rules from the CLDR
Plural rules in the CLDR are of the form:

"cs": {
    "pluralRule-count-one": "i = 1 and v = 0 @integer 1",
    "pluralRule-count-few": "i = 2..4 and v = 0 @integer 2~4",
    "pluralRule-count-many": "v != 0 @decimal 0.0~1.5, 10.0, 100.0 ...",
    "pluralRule-count-other": "@integer 0, 5~19, 100, 1000, 10000 ..."
}

The syntax is described here:
https://unicode.org/reports/tr35/tr35-numbers.html#Plural_rules_syntax

There are up to 2 sets of rules for each locale, a cardinal set and an
ordinal set. The approach here is to generate a C++ function for each
set of rules. Each condition in the rules (e.g. "i = 1 and v = 0") is
transpiled to a C++ if-statement within its function. Then lookup tables
are generated to match locales to their generated functions.

NOTE: -Wno-parentheses-equality is added to the LibUnicodeData compile
flags because the generated plural rules have lots of extra parentheses
(because e.g. we need to selectively negate and combine rules). The code
to generate only exactly the right number of parentheses is quite hairy,
so this just tells the compiler to ignore the extras.
2022-07-08 11:51:54 +02:00
Liav A
8de395694d Kernel/Storage: Do proper locking & reset in the AHCIController code
The initialize_hba method now calls the reset method to reset the HBA
and initialize each AHCIPort. Also, after full HBA reset we need to turn
on the AHCI functionality of the HBA and global interrupts since they
are cleared to 0 according to the specification in the GHC register.
2022-07-08 01:06:47 +03:00
Liav A
4d36989954 Kernel/Storage: Move Identify page allocation to the AHCIPort class
Instead of doing this in a parent class like the AHCIController, let's
do that directly in the AHCIPort class as that class is the only user of
these sort of physical pages. While it seems like we waste an entire 4KB
of physical RAM for each allocation, this could serve us later on if we
want to fetch other types of logs from the ATA device.
2022-07-08 01:06:47 +03:00
Liav A
bf82c4b81b Kernel/Storage: Rename AHCIPortHandler => AHCIInterruptHandler
This reflects better what this object is all about - handling interrupts
of AHCI ports, and nothing more than that.
2022-07-08 01:06:47 +03:00
Liav A
cc734c106e Kernel/Storage: Simplify AHCIPortHandler class
The way AHCIPortHandler held AHCIPorts and even provided them with
physical pages for the ATA identify buffer just felt wrong.
To fix this, AHCIPortHandler is not a ref-counted object anymore. This
solves the big part of the problem, because AHCIPorts can't hold a
reference to this object anymore, only the AHCIController can do that.
Then, most of the responsibilities are shifted to the AHCIController,
making the AHCIPortHandler a handler of port interrupts only.
2022-07-08 01:06:47 +03:00
Liav A
4169ac4a7b Kernel/Storage: Remove 3 stale methods in AHCIPortHandler class 2022-07-08 01:06:47 +03:00
Liav A
9416dede54 Kernel/AHCI: Don't use UNMAP_AFTER_INIT in header files
Instead, declare such methods and functions in the code itself.
2022-07-08 01:06:47 +03:00
Liav A
d771ca3278 Kernel: Clean up the AHCI code a bit
The AHCI code is not very good at OOM conditions, so this is a first
step towards OOM correctness. We should not allocate things inside C++
constructors because we can't catch OOM failures, so most allocation
code inside constructors is exported to a different function.

Also, don't use a HashMap for holding RefPtr of AHCIPort objects in
AHCIPortHandler because this structure is not very OOM-friendly. Instead
use a fixed Array of 32 RefPtrs, as at most we can have 32 AHCI ports
per AHCI controller.
2022-07-08 01:06:47 +03:00
Tim Schumacher
6677cd6d70 Meta: Don't overwrite newer files when building the root filesystem 2022-07-07 21:49:48 +01:00
Tim Schumacher
5bbd5e7322 Ports: Don't create ccache symlinks for tools we don't have 2022-07-07 19:32:33 +02:00
Andrew Kaster
b1b61c902d WebSocket: Change target name to deconflict with LibWebSocket on Lagom
When compiling with Lagom, we give both LibWebSocket and the WebSocket
IPC service the Lagom:: prefix as an alias, but strip the Lib from all
library target names before applying the prefix. This creates a conflict
when external projects used the aliased name between the server and the
library. Give WebSocket a name that deconflicts it, but keep the binary
name the same, /bin/WebSocket.
2022-07-07 16:50:05 +02:00
Luke Wilde
7fbc354829 Ports: Update OpenSSL to 1.1.1q 2022-07-07 16:30:51 +02:00
Andreas Kling
94509c9844 LibWeb: Use correct margin & padding values in anonymous wrapper boxes
Anonymous wrappers get their non-inherited properties from the initial
state of a new CSS::ComputedValues object. Before this patch, all the
values in their margin and padding LengthBox would be "auto".
2022-07-06 20:31:27 +02:00
Andreas Kling
8abbbdf6fa LibWeb: Cache a pointer to the IFC root in InlineLevelIterator 2022-07-06 20:31:27 +02:00
Andreas Kling
4935055407 LibWeb: Keep the "remaining free space" across flexbox algo steps
Instead of recomputing the "remaining free space" per flex line,
remember it after calculating it during the "resolve flexible lengths"
step so we can reuse it later.
2022-07-06 20:31:24 +02:00
Andreas Kling
83a6be593c LibWeb: Add a 1-entry lookup cache to FormattingState
This makes repeated lookups of the state for the same box much faster
by bypassing the HashMap.
2022-07-06 20:31:22 +02:00
Andreas Kling
e7370443f2 LibWeb: Make non-finite CSS lengths resolve to "auto"
When we're performing max-content layout (a separate throwaway layout
pass that only exists to discover the intrinsic max-content size of
a specific box), we act as if the containing block has infinite width.

This allows an infinite length to propagate into the layout system,
which is fine, but at some point it needs to be turned into a finite
number or some loop conditions will not make sense and we can hang
indefinitely (e.g in the flexible lengths resolution algorithm.)

We fix this by making Length::resolved() turn non-finite values into
an "auto" length.
2022-07-06 20:31:19 +02:00
Timothy Flynn
b3deec061e LibJS: Implement Intl.Locale.prototype.weekInfo property 2022-07-06 16:56:42 +02:00
Timothy Flynn
12e7c0808a LibUnicode: Generate per-region week data
This includes:
* The minimum number of days in a week for that week to count as the
  first week of a new year.
* The day to be shown as the first day of the week in a calendar.
* The start/end days of the weekend.

Like the existing hour cycle data, week data is presented per-region in
the CLDR, rather than per-locale. The method to add likely subtags to a
locale to perform region lookups is the same.

The list of regions in the CLDR for hour cycle, minimum days, first day,
and weekend days are quite different. So rather than changing the
existing HourCycleRegion enum to a generic Region enum, we generate
separate enums for each of the week data fields. This allows each lookup
into these fields to remain simple array-based index access, without any
"jumps" for regions that don't have CLDR data for a field.
2022-07-06 16:56:42 +02:00
Timothy Flynn
88a560dd84 LibJS: Implement Intl.Locale.prototype.textInfo property 2022-07-06 16:56:42 +02:00
Timothy Flynn
4868b888be LibUnicode: Generate per-locale text layout information
Currently contains just each locale's character order, but is set up to
easily add other text layout fields from the CLDR if ECMA-402 eventually
requires them.
2022-07-06 16:56:42 +02:00
Timothy Flynn
814f13bc2a LibJS: Implement Intl.Locale.prototype.timeZones property 2022-07-06 16:56:42 +02:00
Timothy Flynn
fa005bd276 LibTimeZone: Parse and generate a list of time zones used by region
The zone1970.tab file in the TZDB contains regional time zone data, some
of which we already parse for the system time zone settings map.

This parses the region names from that file and generates a list of time
zones which are used in each of those regions.
2022-07-06 16:56:42 +02:00
Timothy Flynn
f6aa6a480c LibJS: Implement Intl.Locale.prototype.numberingSystems property 2022-07-06 16:56:42 +02:00
Timothy Flynn
ee2be5895f LibJS: Implement Intl.Locale.prototype.hourCycles property 2022-07-06 16:56:42 +02:00
Timothy Flynn
4d32f38a76 LibJS: Partially implement Intl.Locale.prototype.collations property
We do not yet parse collation data from the CLDR. This stubs out the
collations property, analogous to Intl.supportedValuesOf.
2022-07-06 16:56:42 +02:00
Timothy Flynn
e9bc35d805 LibJS: Implement Intl.Locale.prototype.calendars property 2022-07-06 16:56:42 +02:00
Linus Groh
028a6b90b1 LibJS: Revert partial resizable ArrayBuffer implementation
This is a manual but clean revert of all commits from #12595.

Adding a partial implementation of the resizable ArrayBuffer proposal
without implementing all the updates to TypedArray infrastructure that
is also covered by the spec introduced a bunch of crashes, so we
decided to revert it for now until a full implementation is completed.
2022-07-06 15:52:57 +02:00
thankyouverycool
69a385f559 FontEditor: Rename FontEditorWidget => FontEditor::MainWidget 2022-07-06 14:25:30 +02:00
thankyouverycool
dcf6454059 FontEditor: Hide Widget::set_font() in GlyphEditorWidget
We were already doing the same for its getters, and this makes its
API more consistent with GlyphMapWidget.
2022-07-06 14:25:30 +02:00
thankyouverycool
bae36a7264 FontEditor: Remove unused headers and member variables 2022-07-06 14:25:30 +02:00
thankyouverycool
2227f8f8ae FontEditor: Simplify GlyphMapWidget context menu construction 2022-07-06 14:25:30 +02:00
thankyouverycool
dc3ee84aca FontEditor: Update GML for new layout system
This patch removes deprecated GML properties and manual sizing
calculations in favor of the new UIDimensions, and registers more
widgets in the FontEditor namespace to simplify widget setup.
2022-07-06 14:25:30 +02:00
thankyouverycool
1b9dff5fb1 FontEditor: Convert preview window to GML and propagate its errors 2022-07-06 14:25:30 +02:00
thankyouverycool
7376c68652 FontEditor: Propagate errors when pushing undo commands 2022-07-06 14:25:30 +02:00
thankyouverycool
510551bb4f LibGUI: Add fallible try_push() variant to UndoStack 2022-07-06 14:25:30 +02:00
thankyouverycool
ae333fad98 FontEditor: Normalize GlyphMap selection before creating UndoSelection
Fixes bogus indexing crashes when creating new restore states.
2022-07-06 14:25:30 +02:00
thankyouverycool
9962a744eb FontEditor: Improve error propagation during construction
FontEditor now builds its actions, toolbars, models and menus
with fallible methods. Widget assignment from GML is now organized
in order of use.
2022-07-06 14:25:30 +02:00
Andrew Kaster
0a62fcfbdf Meta: Build select Services in Lagom
Add overrides for serenity_bin and serenity_lib to allow the actual
CMakeLists.txt from Userland to be used to build as many services as
possible without adding more clutter to Meta/Lagom/CMakeLists.txt
2022-07-06 14:24:23 +02:00
Andrew Kaster
2b29e611fe Meta: Rename Lagom library target names from LagomFoo to LibFoo
This matches the target names for the main serenity build, and will make
simplifying the Lagom build much easier going forward.

The LagomFoo name came from a time when we had both library builds in
the same CMake generated project and needed to deconflict the names.
2022-07-06 14:24:23 +02:00
Andrew Kaster
02e8f29560 Meta: Use CMAKE_INSTALL_FOODIR variables instead of hardcoding usr/foo
In preparation for future refactoring of Lagom, let's use the variables
from GNUInstallDirs as much as possible for the helper macros and other
scripts used by the main build already.
2022-07-06 14:24:23 +02:00
Timon Kruiper
2b82c83ceb LookupServer: Use _POSIX_HOST_NAME_MAX instead of HOST_NAME_MAX
HOST_NAME_MAX is not defined on the BSDs, including macOS. Use
_POSIX_HOST_NAME_MAX instead, which is defined on all the platforms.
2022-07-06 14:24:23 +02:00