Commit Graph

26215 Commits

Author SHA1 Message Date
Timothy Flynn
137e98cb6f LibUnicode: Add public accessors to generated locale data 2021-08-26 22:04:09 +01:00
Timothy Flynn
b7a95cba65 LibUnicode: Implement grammar validators for Unicode TR-35
ECMA-402 requires validating user input against the EBNF grammar for
Unicode locales described in TR-35: https://www.unicode.org/reports/tr35

This commit adds validators for that grammar, as well as other helper to
e.g. canonicalize a locale string.
2021-08-26 22:04:09 +01:00
Timothy Flynn
3127454642 CI: Skip Unicode caches for Fuzzer build
There is a bit of a race here between the Fuzzer and non-Fuzzer Lagom
builds. If the Unicode caches are empty, and the Fuzzer build completes
first, then the UCD and CLDR directories will be empty or won't exist.
Skip handling the Unicode caches for this build.
2021-08-26 22:04:09 +01:00
Timothy Flynn
e883792fd4 CI: Cache downloaded Unicode CLDR database 2021-08-26 22:04:09 +01:00
Timothy Flynn
ea21573ed8 LibUnicode: Download Unicode's CLDR database and generate locale data
The Unicode standard publishes a database known as the Common Locale
Data Repository (CLDR). This is a massive set of data from which anyone
implementing Unicode's Technical Standard #35 may generate their
implementation: https://www.unicode.org/reports/tr35/

This commit updates LibUnicode to download the compressed database and
extract a small subset. That subset is used to generate a list of
available locales and the territories (AKA regions) associated with each
locale.
2021-08-26 22:04:09 +01:00
Timothy Flynn
262e412634 AK: Implement method to convert a String/StringView to title case
This implementation preserves consecutive spaces in the orginal string.
2021-08-26 22:04:09 +01:00
TheFightingCatfish
d2af27d2d0 FileManager: Change the cwd when opening a directory
The `open()` function of DirectoryView should change the current working
directory, so that the "Go to Location" menu item can process relative
paths correctly. Update other functions in DirectoryView to use `open()`
when opening a directory.
2021-08-26 22:02:15 +02:00
TheFightingCatfish
ce66c40160 FileManager: Remove "on activation" debug spam 2021-08-26 22:02:15 +02:00
Ali Mohammad Pur
355c2eef57 AK: Make explode_byte depend on sizeof(FlatPtr) instead of ARCH(...)
The assumption that FlatPtr is 64-bit on every platform except i686 is
not correct, and also makes the definition of explode_byte() less nice
to look at.
2021-08-26 22:00:17 +02:00
Ralf Donau
a6fc80f069 Games: Remove unveiling /tmp/portal/config
Config::pledge_domains is applied before, hence /tmp/portal/config
can and should be veiled.
2021-08-26 21:40:39 +02:00
Ralf Donau
5a0be07cf0 FlappyBug: Use LibConfig instead of Core::ConfigFile 2021-08-26 19:54:50 +02:00
Stephan Unverwerth
b54573739c LibGL: Implement glTexEnvf
This controls how fetched texels are combined with the color that was
produced by a preceding texture unit or with the vertex color if it is
the first texture unit.

Currently only a small subset of possible combine modes is implemented
as required by glquake.
2021-08-26 19:54:31 +02:00
Stephan Unverwerth
19a08ff187 LibGL: Implement glPixelStorei
This sets the length of a row for the image to be transferred. This
value is measured in pixels. When a rectangle with a width less than
this value is transferred the remaining pixels of this row are skipped.
2021-08-26 19:53:57 +02:00
Scott R. Parish
eb368a5000 Calculator: The equal key will now also finish the operation
Prior to this if you typed "1+2=" you would not get the answer, instead
you'd be left with "2" on the screen; Calculator wanted you to hit the
enter key to get the answer. Now you can either use the enter or the
equal key to finish the operation and get the answer.
2021-08-26 17:35:15 +02:00
Thitat Auareesuksakul
f119c5580a Solitaire: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
Thitat Auareesuksakul
573d14b7b5 Chess: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
Thitat Auareesuksakul
666397e1a7 2048: Use LibConfig instead of Core::ConfigFile 2021-08-26 16:39:22 +02:00
Andreas Kling
1fa5fba432 LibWeb: Make the base StyleValue::to_length() return an undefined length
Previously it was returning an "auto" length. This caused all the new
"initial" values to effectively turn into auto values long before layout
had a chance to resolve them.

This broke replaced elements with intrinsic size but no specified width
or height, and is the reason that Mr. ACID2 temporarily lost his eyes.
2021-08-26 13:25:52 +02:00
Andreas Kling
243e9a8b4a LibWeb: Correct CSS initial values for min-width and min-height
The initial value for these is auto, not 0.
2021-08-26 13:25:52 +02:00
Andreas Kling
cf8f1c5a5f LibWeb: Remove unused CSS::StyleProperties::string_or_fallback() 2021-08-26 13:25:52 +02:00
Andy Jansson
bb399c6955 FileManager: Change read_i32 call to read_bool
The FileManager/Window/Maximized flag was incorrectly read from the
ConfigServer using read_i32 instead of the intended read_bool function
call.

It is now being read with the correct type :^)
2021-08-26 12:05:51 +02:00
Andreas Kling
827bf5232e Minesweeper: Use LibConfig instead of Core::ConfigFile 2021-08-26 00:54:28 +02:00
Andreas Kling
d9b5dae809 Meta: Add Jesse Buhagiar to the contributors list :^) 2021-08-26 00:54:28 +02:00
Andreas Kling
6ad63ae71c Browser: Use LibConfig instead of Core::ConfigFile 2021-08-26 00:54:28 +02:00
Andreas Kling
0cd4b8cbb7 TextEditor: Use LibConfig instead of Core::ConfigFile 2021-08-26 00:54:28 +02:00
Andreas Kling
3114fe612c Terminal: Use Config::pledge_domains() 2021-08-26 00:54:28 +02:00
Andreas Kling
1a0a35f4b8 FileManager: Use Config::pledge_domains() 2021-08-26 00:54:28 +02:00
Andreas Kling
eeddaa988a ConfigServer+LibConfig: Add pledge_domains() API
This API lets applications specify which configuration domains they
will be accessing throughout their lifetime. It works similarly in
spirit to the kernel's pledge().

You cannot pledge_domains() more than once, and once you have used it,
it's no longer possible to access any other configuration domain.

This is obviously just a first cut of this mechanism, and we may need
to tweak it further as we go.
2021-08-26 00:54:28 +02:00
Andreas Kling
870ecd5190 LibConfig: VERIFY that a Core::EventLoop exists before connecting
It's not possible to connect to ConfigServer without having an event
loop available. This VERIFY makes it much easier to understand why
things are not working. :^)
2021-08-26 00:54:28 +02:00
Andreas Kling
67a0fa2b78 LibCore: Add Core::EventLoop::has_been_instantiated()
This static bool getter can be used to VERIFY that an event loop exists,
in situations where one is expected.

This is helpful if the absence of an event loop would generate strange
and/or loud errors that don't immediately point to this as a cause.
2021-08-26 00:54:27 +02:00
Andreas Kling
82d8cd2b87 Terminal+LibVT: Use LibConfig instead of Core::ConfigFile 2021-08-26 00:54:27 +02:00
Andreas Kling
39d9373bca FileManager: Use LibConfig instead of Core::ConfigFile :^) 2021-08-26 00:54:27 +02:00
Andreas Kling
bdcd0abf9d Userland: Introduce ConfigServer and LibConfig
ConfigServer is an IPC service that provides access to application
configuration and settings. The idea is to replace all uses of
Core::ConfigFile with IPC requests to ConfigServer.

This first cut of the API is pretty similar to Core::ConfigFile.

The old:

    auto config = Core::ConfigFile::open_for_app("App");
    auto value = config->read_entry("Group", "Key");

The new:

    auto value = Config::read_string("App", "Group", "Key");

ConfigServer uses the ~/.config directory as its backing store
and all the files remain human-editable. :^)
2021-08-26 00:54:27 +02:00
Jean-Baptiste Boric
c97f7ea23b Tests: Test setjmp/sigsetjmp LibC functions
Since there are no real users of these functions in Serenity's
userland and this is my third attempt at this... This time, the great
LibTest test suite will make sure that I do it right!
2021-08-26 00:54:23 +02:00
Jean-Baptiste Boric
0248e6ae27 LibC: Check for expected size of struct __jmp_buf
This structure is accessed through assembly code inside setjmp.S, make
some effort to ensure both header and assembly files are in sync.
2021-08-26 00:54:23 +02:00
Jean-Baptiste Boric
295e89af04 LibC: Fix sigsetjmp on x86_64
Registers were clobbered, offset values into __jmp_buf were wrong...
2021-08-26 00:54:23 +02:00
Jean-Baptiste Boric
c87aa6d908 LibC: Fix sigsetjmp on i686
Calling sigprocmask() through the PLT requires setting the ebx register
to the address of the global offset table, otherwise chaos ensues. Also
the value of the ecx register was assumed to be preserved across that
function call despite the fact that it is caller-saved in the x86
calling convention.
2021-08-26 00:54:23 +02:00
Karol Kosek
04694ae682 ThemeEditor: Place menu quit action as the last item
No other applications put this action as the first item.
2021-08-26 00:51:40 +02:00
Ali Mohammad Pur
ae97241ded Base: Add a Game of Life WebAssembly demo 2021-08-26 00:51:30 +02:00
Ali Mohammad Pur
ba8e1c6f9f Base: Refer to WebAssembly as 'Wasm' and not 'WASM' 2021-08-26 00:51:30 +02:00
Ali Mohammad Pur
04e3965b09 LibWasm: Use Operators::BitShiftRight for i64.shru
Using a left-shift operator for a right shift operation is not exactly
the most correct action :P
2021-08-26 00:51:30 +02:00
Jesse Buhagiar
924d890bfe LibGL: Implement fog effect in Software Rasterizer
We support three of the possible fog modes, EXP, EXP2 and LINEAR.
2021-08-25 23:50:54 +04:30
Jesse Buhagiar
d73cc3d0eb LibGL: Implement glFogi 2021-08-25 23:50:54 +04:30
Jesse Buhagiar
f55d2a22af LibGL: Implement glFogf 2021-08-25 23:50:54 +04:30
Jesse Buhagiar
7f1cd54b80 LibGL: Implement glFogfv
This currently just sets the fog colour in the rasterizer.
2021-08-25 23:50:54 +04:30
Karol Kosek
ffa7da0ca5 LibWeb: Handle CSS "ch" length unit (mostly)
This isn't 100% spec complaint, as it should use glyph_height()
depending on what the value of the writing-mode is, but we haven't
implemented it yet, so I think it'll be good enough for now.

This can be tested in https://wpt.live/css/css-values/ch-unit-008.html
Other css-unit tests fail as:
- 001 shows an issue related to a renderer (looks to me like you can't
  pass a width and height property to a span -- adding `display: block`
  to it passes the test),
- 002-004 and 009-012 use mentioned writing-mode,
- 016-017 loads custom fonts, which we also don't support (yet).
2021-08-25 17:55:53 +02:00
Karol Kosek
a230524c46 HackStudio: Update the tree view cursor on editor change and 'Save as'
The more important thing here is to update the tree view
on 'Save As..', as we want to drop every connection from an old file.

Updating the tree view on current editor change is just a cool small
bonus. :^)
2021-08-25 17:42:54 +02:00
Sam Atkins
b92a6d6542 LibWeb: Implement CSS unset builtin value
This is equivalent to `initial` or `inherit`, depending on if the
property is inherited by default.
2021-08-25 12:14:34 +02:00
Sam Atkins
3296fd70b3 LibWeb: Intercept CSS initial/inherit values in StyleProperties
When property() previously would have returned an InitialStyleValue, we
now look up what the initial value would be, and return that instead.

We also intercep 'inherit', but inheritance is not implemented yet so we
just return nothing.

This does cause a regression on Acid2: The eyes no longer appear, and I
am not sure why. :^(
2021-08-25 12:14:34 +02:00
Sam Atkins
160f434769 Base: Add cascade-keywords.html test page for CSS cascade keyword values
These are:

- `initial`
- `inherit`
- `unset`

Cascade4 and 5 also define `revert` and `revert-layer`, but let's not
get ahead of ourselves. :^)
2021-08-25 12:14:34 +02:00