Commit graph

22416 commits

Author SHA1 Message Date
Timothy Flynn
e96df1599c SQLStudio: Display real column names in the results tab 2023-02-03 20:34:45 +01:00
Timothy Flynn
4fe437b4d2 SQLStudio: Separate the script and results tabs with a vertical splitter 2023-02-03 20:34:45 +01:00
Timothy Flynn
cb06031180 LibSQL+SQLServer: Send result column names over IPC to SQL clients 2023-02-03 20:34:45 +01:00
Timothy Flynn
d6dee8c0e8 LibSQL+Userland: Pass SQL IPC results to clients in a structure
SQLClient exists as a wrapper around SQL IPC to provide a bit friendlier
interface for clients to deal with. Though right now, it mostly forwards
values as-is from IPC to the clients. This makes it a bit verbose to add
values to IPC responses, as we then have to add it to the callbacks used
by all clients. It's also a bit confusing seeing a sea of "auto" as the
parameter types for these callbacks.

This patch moves these response values to named structures instead. This
will allow adding values without needing to simultaneously update all
clients. We can then separately handle the new values in interested
clients only.
2023-02-03 20:34:45 +01:00
Timothy Flynn
f0441ee16a LibSQL: Store selected column names in the results for SELECT statements 2023-02-03 20:34:45 +01:00
Lucas CHOLLET
a053807be5 TextEditor: Propagate errors from read_file() 2023-02-03 19:58:41 +01:00
Lucas CHOLLET
3454185d08 TextEditor: Use request_file_read_only_approved for the drop event
This allows TextEditor to open the file without asking for user consent.
2023-02-03 19:58:41 +01:00
Lucas CHOLLET
40f9cf2de6 TextEditor: Port to Core::Stream 2023-02-03 19:58:41 +01:00
Lucas CHOLLET
36e66502c9 grep: Port to Core::Stream
It also adds support for `ErrorOr` in one lambda.
2023-02-03 19:43:41 +01:00
Liav A
f354b52099 SystemServer: Propagate errors properly in the main code
To do this properly, we also create Strings with formatting of device
nodes' names, taking into consideration errors when doing that.
Also, we use LibCore System mknod method instead of raw LibC functions
to be able to propagate errors from these calls too.
2023-02-03 19:38:23 +01:00
Aliaksandr Kalenik
ab99e95549 LibWeb: Parse font-stretch CSS property 2023-02-03 12:49:13 +00:00
Sam Atkins
968481c7cd Settings: Change initial window size to fit the current content
Previously, it would open with a scrollbar visible which felt a little
silly. :^)
2023-02-03 12:44:04 +00:00
Sam Atkins
d48e632696 Utilities/w: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
8c4abf0ed8 Utilities/route: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
f1f02b33e6 Utilities/pmap: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
39f3a15022 Utilities/netstat: Replace uses of JsonObject::get_deprecated()/get_ptr 2023-02-03 07:19:52 -05:00
Sam Atkins
f14a1da633 Utilities/mount: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
c1d3f39cc4 Utilities/lsusb: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
e8ebbcdbc5 Utilities/lsof: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
5d8a87bf1f Utilities/lsjails: Replace uses of JsonObject::get_deprecated()/get_ptr 2023-02-03 07:19:52 -05:00
Sam Atkins
a04ca015bf Utilities/lsirq: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
7ce32cb82a Utilities/lscpu: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
8647743504 Utilities/json: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
f63eaee20c Utilities/ifconfig: Replace uses of JsonObject::get_deprecated()/get_ptr 2023-02-03 07:19:52 -05:00
Sam Atkins
08c26e988a Utilities/fortune: Replace uses of JsonObject::get_deprecated()/get_ptr 2023-02-03 07:19:52 -05:00
Sam Atkins
609a123c43 Utilities/df: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
d4f0cfec7f Utilities/arp: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Zaggy1024
0f45153bbb LibVideo/VP9: Use proper indices for updating inter_mode probabilities
I previously changed it to use the absolute inter-prediction mode
values instead of the ones relative to NearestMv. That caused the
probability adaption to take invalid indices from the counts and broke
certain videos.

Now it will just convert to the PredictionMode enum when returning from
parse_inter_mode, which allows us to still use it the same as before.
2023-02-03 09:10:14 +01:00
Zaggy1024
7b92eff4a6 LibVideo/VP9: Use u32 to store the parsed value counts
There were rare cases in which u8 was not large enough for the total
count of values read, and increasing this to u32 should have no real
effect on performance (hopefully).
2023-02-03 09:10:14 +01:00
Zaggy1024
69e9f9ff63 LibVideo/VP9: Prevent negation overflow in BitStream::read_s 2023-02-03 09:10:14 +01:00
Zaggy1024
f58c5ff569 LibVideo/VP9: Correct the mode/partition probability adaption counts 2023-02-03 09:10:14 +01:00
Zaggy1024
4224f253af LibVideo/VP9: Increase the size of summed boolean counts in merge_probs
This fixes an issue where probabilities that sum to greater than 255
would wrap and cause the maximum probability adaption to take effect.
2023-02-03 09:10:14 +01:00
Timothy Flynn
7c1fe32af3 WebContent: Remove pending file requests before invoking their callbacks
It's currently possible for the callback of a file request to request
more file objects. This could cause the hash map storing these requests
to be rehashed while one of its callbacks is being invoked. AK::Function
explicitly forbids this with an assertion.

Instead, remove the callback from the hash map before invoking the
callback function.
2023-02-02 19:14:00 +00:00
Sam Atkins
3fbebe73a8 Chess: Replace 'Style' menu with a link to GamesSettings
GamesSettings provides a nicer way of editing these, rather than having
them crammed into a menu.
2023-02-02 14:52:21 +01:00
Sam Atkins
89d7d29d68 Chess: Automatically update and repaint when the config changes 2023-02-02 14:52:21 +01:00
Sam Atkins
05913b853a GamesSettings: Add chess settings :^)
This adds a tab for configuring the appearance of Chess, along with a
preview.
2023-02-02 14:52:21 +01:00
Sam Atkins
64c9c7a4da Chess: Paint pieces using BilinearBlend instead of NearestNeighbor
This makes the pieces look a lot nicer when the window isn't the exactly
ideal size. Vector images might be worth pursuing later.
2023-02-02 14:52:21 +01:00
Sam Atkins
e9eeaedc24 Chess: Stop hiding the frame border
This `fill_rect()` call was covering the nice border that we just
painted a few lines earlier.
2023-02-02 14:52:21 +01:00
Sam Atkins
3d38b7a127 Chess: Move configuration values into the "Games" domain
Chess is a game, after all. This makes more sense once we have chess
settings in GamesSettings. :^)
2023-02-02 14:52:21 +01:00
Sam Atkins
1cb6494852 Chess: Stop trying to read non-existent window-size config value
Nobody ever sets this, and it doesn't seem especially useful, so let's
remove it.
2023-02-02 14:52:21 +01:00
Sam Atkins
d3953c6b73 GamesSettings: Make CardSettingsWidget creation fallible 2023-02-02 14:52:21 +01:00
Sam Atkins
66f2f4d647 GamesSettings: Rename Preview -> CardGamePreview 2023-02-02 14:52:21 +01:00
Rodrigo Tobar
286e3e6872 LibPDF: Simplify Encoding to align with simple font requirements
All "Simple Fonts" in PDF (all but Type0 fonts) have the property that
glyphs are selected with single byte character codes. This means that
the Encoding objects should use u8 for representing these character
codes. Moreover, and as mentioned in a previous commit, there is no need
to store the unicode code point associated with a character (which was
in turn wrongly associated to a glyph).

This commit greatly simplifies the Encoding class. Namely it:

 * Removes the unnecessary CharDescriptor class.
 * Changes the internal maps to be u8 -> FlyString and vice-versa,
   effectively providing two-way lookups.
 * Adds a new method to set a two-way u8 -> FlyString mapping and uses
   it in all possible places.
 * Simplified the creation of Encoding objects.
 * Changes how the WinAnsi special treatment for bullet points is
   implemented.
2023-02-02 14:50:38 +01:00
Rodrigo Tobar
fb0c3a9e18 LibPDF: Stop calculating code points for glyphs
When rendering text, a sequence of bytes corresponds to a glyph, but not
necessarily to a character. This misunderstanding permeated through the
Encoding through to the Font classes, which were all trying to calculate
such values. Moreover, this was done only to identify "space"
characters/glyphs, which were getting a special treatment (e.g., avoid
rendering). Spaces are not special though -- there might be fonts that
render something for them -- and thus should not be skipped
2023-02-02 14:50:38 +01:00
Rodrigo Tobar
7c42d6c737 LibPDF: Fix ZapfDingbat's char codes
The initial values were fine, but those starting at 100 were wrong: they
are all octal values, but since they were missing an initial 0 they were
interpreted as decimals.
2023-02-02 14:50:38 +01:00
Rodrigo Tobar
2f773b3c5c LibPDF: Stop storing unicode code points in Encoding
In PDF's fonts, encoding objects are used to translate bytes into fonts'
glyphs. Glyphs (in the fonts we currently support) organise their glyphs
in such a way that they are accessed by name, and thus encoding
translate between a byte sequence and a glyph name.

Note that an no point this translation includes a Unicode character, and
therefore assigning a character to a glyph in the Encoding object is the
wrong thing to do. Moreover, using the code point for this character
during the byte-sequence-to-glyph translation sequence is double-wrong.

This commit removes the characters associated to each translation in the
built-in Encoding objects. In order to keep commits short and sweet, I'm
currently simply removing the character from the enumeration, leaving
the old structure this information was held on intact. Instead, I'm
filling the "code_point" member with a zero, and filling both mappings
(which will be changed later on too) with the glyph name and the
associated char code.
2023-02-02 14:50:38 +01:00
Andreas Kling
5577d5f789 LibGUI: Use the correct font when relayouting Breadcrumbbar
When the system is broadcasting a "system font changed" notification,
the Breadcrumbbar will be notified before its button children. This
means that we have to use the Breadcrumbbar's font() for calculations
inside Breadcrumbbar as the buttons themselves still have the old font
at this point.
2023-02-02 14:49:54 +01:00
Andreas Kling
63ac6ced31 LibGUI: Merge two loops over the segments in Breadcrummbar::relayout() 2023-02-02 14:49:54 +01:00
Andreas Kling
eb9d2c64c8 LibGUI: Center TreeView item icons vertically
This makes tree views with icons look a lot better at larger font sizes.
2023-02-02 14:49:54 +01:00
Keir Davis
797a53b307 Piano: Propagate errors in PlayerWidget
Co-authored-by: Sam Atkins <atkinssj@serenityos.org>
2023-02-02 14:47:24 +01:00
Karol Kosek
4311fd2774 LibWeb: Implement Element.attachShadow and Element.shadowRoot :^) 2023-02-02 14:43:29 +01:00
Karol Kosek
9ed4fe7049 LibWeb: Allow to set a root mode value when constructing a ShadowRoot 2023-02-02 14:43:29 +01:00
Karol Kosek
01e2cc5330 LibWeb: Add a helper function for checking if element is a shadow host 2023-02-02 14:43:29 +01:00
Karol Kosek
2cc108a15e LibWeb: Rename DOM::shadow_root() to shadow_root_internal()
The shadowRoot property getter that will be added in subsequent commits
has an additional check that checks whether the shadow root is opened.
I didn't update the function logic to match with the IDL interface,
because it's very likely we don't want that check in the existing code,
so that for example closed shadow root elements can still be updated.
2023-02-02 14:43:29 +01:00
Karol Kosek
9a7f786262 LibWeb: Make ShadowRoot.mode return ShadowRootMode instead of String 2023-02-02 14:43:29 +01:00
Karol Kosek
34913c48d3 LibWeb: Actually initialize ShadowRoot bindings
`mode` and `host` attributes were always undefined.
2023-02-02 14:43:29 +01:00
Tim Ledbetter
d4cb089acb PixelPaint: Update text tool font color on primary color change 2023-02-02 14:41:59 +01:00
Guilherme Gonçalves
230c0b34d4 LibWeb+LibWebSocket: DOM WebSocket subprotocol support
This adds support for WebSocket subprotocols to WebSocket DOM
objects, with some necessary plumbing to LibWebSocket and its
clients.

See the associated pull request for how this was tested.
2023-02-02 14:41:34 +01:00
Tim Ledbetter
9115e99e4b PixelPaint: Scale move tool resize anchors
The areas where the user must click to resize the image are now
scaled to ensure they do not overlap. This allows us to display the
correct cursor when zoomed out, as well as making the
borders look nicer.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
c82825379a PixelPaint: Show resize anchors when using the move tool
This commit adds a two color border around areas that the user must
drag to resize, when using the move tool.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
4c617d370e PixelPaint: Highlight active layer when using the move tool
This commit adds a two color border around the currently selected
layer when using the move tool.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
7b3bc883f1 PixelPaint: Set initial position correctly when using the move tool
This fixes an issue, where single clicking in the corner of the image
without moving the mouse would cause the layer to jump to the top left
corner of the canvas.
2023-02-02 14:40:17 +01:00
Jelle Raaijmakers
62f4486190 LibSoftGPU: Only enable texture stages if required
Copying over every texel (4x`f32x4`) for every texture unit is
relatively expensive. By checking if we even need to remember these
texel values, we reduce the time spent in `rasterize_triangle` by
around 2% as measured in Quake III.
2023-02-02 14:38:26 +01:00
Jelle Raaijmakers
69b94e4235 LibSoftGPU: Make blending simpler and more efficient
Previously, we would precalculate "alpha blend factors" on every
configuration update and then calculate the source and destination
blending factors in one go using all these factors. The idea here was
probably that we would get better performance by avoiding branching.

However, by measuring blending performance in Quake III, it seems that
this simpler version that only calculates the required factors reduces
the CPU time spent in `rasterize_triangle` by 3%.

As a bonus, `GL_SRC_ALPHA_SATURATE` is now also implemented.
2023-02-02 14:38:26 +01:00
Jelle Raaijmakers
f0f9d8f1e0 Profiler: Standardize percentage formatting
This implements the same percentage formatting for the disassembly and
flamegraph views as we have for the profile model.
2023-02-02 14:37:01 +01:00
Timothy Flynn
5d1acdc455 FileSystemAccessServer: Send correct error code for failed file access
When a file cannot be accessed, we currently send errno as the error
code. However, there are system calls which occur (by way of dbgln)
between the failed file access and accessing errno. This prevents the
client-side detection of ENOENT from working.

Instead, send over the error we already have stored in the ErrorOr
object.
2023-02-02 14:36:01 +01:00
Andrew Kaster
ae9dc95b1f LibSQL+Ladybird: Accept a list of paths for spawning SQLServer in Lagom
Use the new get_paths_for_helper_process method in Ladybird to query
Qt for the runtime path of the current executable as well as the build
directory paths.
2023-02-02 05:35:44 -07:00
Timothy Flynn
792258afe8 LibWeb: Restore handling of the serenity:ladybird/headless capability
This was refactored a bit incorrectly in d8fde14.
2023-02-02 12:21:44 +00:00
Andreas Kling
9347db6f91 LibGUI: Make Tray item height honor the current font size 2023-02-02 13:15:03 +01:00
Andreas Kling
be3a9048be LibGUI: Relayout Breadcrumbbar on font change 2023-02-02 13:15:03 +01:00
Andreas Kling
dd607fc619 LibGUI: Invalidate IconView cache on font change
Changing the font means we have to recalculate all the item rects etc.
2023-02-02 13:15:03 +01:00
Andreas Kling
ff0766056b LibGUI: Don't hard-code TreeView row height
Instead of overriding AbstractTableView::row_height() and returning a
hard-coded height for some reason, just remove the override.

This makes tree view row heights honor the current font size.
2023-02-02 13:15:03 +01:00
Timothy Flynn
bb4fda3b97 LibJS: Format the era of ISO year 0 as BC
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/2034315
2023-02-02 12:12:26 +00:00
Marcus Nilsson
feef83359d DisplaySettings: Made select wallpaper use allowed file types 2023-02-02 04:05:42 -07:00
Marcus Nilsson
be464c357a LibGUI: Add allowed file types to FilePicker
This patch adds a ComboBox to `FilePicker` where the user can select
which file types to show, all files that doesn't have an
extension that's in the selected file type will be hidden.

When creating a FilePicker with `FilePicker::construct` or
`FilePicker::get_open_filepath`, allowed file types can be
specified as the last argument.

If no file types are provided then there will be no visual change in the
GUI.

'All Files' and 'Image Files' have shorthands with
`GUI::FileTypeFilter::all_files()` and
`GUI::FileTypeFilter::image_files()`, respectively.
2023-02-02 04:05:42 -07:00
Marcus Nilsson
fe5dfe4cd5 LibGUI: Add allowed file extensions to FileSystemModel
This allows FileSystemModel to take an optional list of allowed file
extensions which it will use to filter out all files that don't end
with that file extension.

The file extensions are set via `set_allowed_file_extensions` which has
a coresponding `get_allowed_file_extensions`.
2023-02-02 04:05:42 -07:00
MacDue
c3bd841d50 SQLServer: Unveil /etc/passwd
This is now required to launch the SQLServer for Browser (without
this it now fails to launch).
2023-02-02 02:17:06 -07:00
Kemal Zebari
5d7331b4ed Browser: Disallow empty URLs in the bookmark editor
When an empty URL is given to `BookmarkEditor`, it will now
disable the button that saves the bookmark change since an empty
URL is an invalid URL.
2023-02-02 01:18:33 +01:00
Tim Ledbetter
4be6ee85e0 PixelPaint: Ensure layers are positioned correctly when painting
Previously, layer bitmaps could move slightly relative to their
boundary and the image background when panning and zooming.
2023-02-01 19:36:39 +01:00
Tim Ledbetter
607c8045dc PixelPaint: Allow dragging when color picking using the Alt key 2023-02-01 19:21:58 +01:00
Tim Ledbetter
06e09cf415 PixelPaint: Disable current tool when color picking using the Alt key 2023-02-01 19:21:58 +01:00
Tim Ledbetter
2f5bbc68ed PixelPaint: Use eyedropper cursor when color picking using Alt key 2023-02-01 19:21:58 +01:00
Tim Ledbetter
45e60a416b PixelPaint: Use layer coordinates when color picking using Alt key
Previously, raw coordinates were being used, which meant that color
was being sampled from the wrong position.
2023-02-01 19:21:58 +01:00
Lucas CHOLLET
81bd91c1c3 SystemServer: Propagate errors
This patch also includes some changes in the way that the environment
and arguments are passed to `exec`. It was needed to fit the signature
of `Core::System::exec`. That's beneficial though, as we are now doing
`String` manipulation in a fallible environment, so we can propagate
more errors.
2023-02-01 19:21:10 +01:00
Lucas CHOLLET
cd0b7656fa ConfigServer: Unveil "/etc/passwd"
This is needed to use functions like `getpwuid()`.
2023-02-01 19:21:10 +01:00
Nico Weber
d43b306814 LibGfx: Give ICC::TagType a virtual destructor
ICC::Profile deletes these objects via base class pointers, so this
is needed that destructors in the subclasses get called.

(Found by asan on CI when adding test coverage.)
2023-02-01 19:19:30 +01:00
Cubic Love
0cfce93e51 Base+Presenter: Add icons for Presenter
Add application and filetype icons for Presenter in 32px and 16px
2023-02-01 19:17:48 +01:00
Sam Atkins
ced59fb3a0 Spider: Make double-click skip the new-game animation 2023-02-01 14:19:15 +00:00
Sam Atkins
8744e8b561 Spider: Use a single State enum instead of a series of booleans 2023-02-01 14:19:15 +00:00
Sam Atkins
5de8b38783 Solitaire: Make double-click skip the new-game animation 2023-02-01 14:19:15 +00:00
Sam Atkins
e8d83b1ae1 Solitaire: Use a single State enum instead of a series of booleans
We had 4 different bools before, but the only valid states were either
that only one of them was true, or than none of them are true. An enum
is a better fit here, by enforcing that we can only be in one state at
a time.
2023-02-01 14:19:15 +00:00
Timothy Flynn
96f409ec1e LibWeb+WebContent: Do not reference-count file request objects
There is currently a memory leak with these file request objects due to
the callback on_file_request_finish referencing itself in its capture
list. This object does not need to be reference counted or allocated on
the heap. It is only ever stored in a HashMap until a response is
received from the browser, and it is not shared.
2023-02-01 14:04:44 +00:00
Nico Weber
c8832807d6 LibGfx+Tests: Remove code unnecessary after 9e7c16d0a4 2023-02-01 08:56:56 -05:00
Ali Mohammad Pur
c045d09840 LibLine: Quit event loop when an error occurs on update
Previously we were crashing, which was excessive, if we can't read
anymore, we should just return with an error.
2023-02-01 01:04:42 +03:30
Andreas Kling
ce6636e78e LibGfx: Make glyph ID lookup faster with a cache
This patch adds a "GlyphPage" cache which stores the mapping between
code points and glyph IDs in a segmented table of "pages".

This makes Font::glyph_id_for_code_point() significantly faster by
not reparsing the font tables every time you call it.

In the future, we can add more information to GlyphPage (such as
horizontal metrics for each glyph) to further reduce time spent in
text layout and painting.
2023-01-31 17:14:57 +01:00
Timothy Flynn
e74e8381d5 LibJS: Allow "approximately" results to differ in plural form
This is a normative change in the Intl.NumberFormat V3 spec. See:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/08f599b

Note that this didn't seem to actually affect our implementation. The
Unicode spec states:

https://www.unicode.org/reports/tr35/tr35-53/tr35-numbers.html#Plural_Ranges
"If there is no value for a <start,end> pair, the default result is end"

Therefore, our implementation did not have the behavior noted by the
issue this normative change addressed:

    const pr = new Intl.PluralRules("en-US");
    pr.selectRange(1, 1); // Is "other", should be "one"

Our implementation already returned "one" here because there is no such
<start=one, end=one> value in the CLDR for en-US. Thus, we already
returned the end value of "one".
2023-01-30 14:10:07 -05:00
Jelle Raaijmakers
5c1038e54f LibSoftGPU: Remove DeprecatedString usage 2023-01-30 13:49:52 -05:00
Jelle Raaijmakers
a8cb70c0c4 LibGPU: Remove DeprecatedString usage 2023-01-30 13:49:52 -05:00
Jelle Raaijmakers
e3f8ac2c05 LibGL: Remove DeprecatedString usage
We only use it for the extension string, which we now convert into a
`ByteBuffer` object containing the null-terminated bytes :^)
2023-01-30 13:49:52 -05:00
Timothy Flynn
6a50fb465c LibJS: Make use of the Intl MV in more Intl.NumberFormat AOs
This is an editorial change in the Intl.NumberFormat V3 spec. See:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/c24b33e

Note our implementation was already using the Intl MV in these AOs just
due to C++ type safety.
2023-01-30 12:19:14 -05:00
Timothy Flynn
a283daaab7 LibJS: Refactor the Intl.NumberFormat GetStringOrBooleanOption AO
This is an editorial change in the Intl.NumberFormat V3 spec. See:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/654bfad
2023-01-30 12:19:14 -05:00
Timothy Flynn
be347f67dc LibJS: Shorten some spec text for BestAvailableLocale
This is an editorial change in the Intl.NumberFormat V3 spec. See:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/654bfad
2023-01-30 12:19:14 -05:00
Timothy Flynn
4475f21e9e LibJS: Allow locale approximately signs to be empty in Intl.NumberFormat
This is a normative change in the Intl.NumberFormat V3 spec. See:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/23e69cf

This isn't particularly testable because every locale in the CLDR has a
non-empty "approximatelySign" field in cldr-numbers-modern. The issue
for this change seems to be considering the "miscPatterns/approximately"
field instead, which has different semantics. But as noted on the CLDR
issue https://unicode-org.atlassian.net/browse/CLDR-14918, the ICU uses
the "approximatelySign" field (as do our implementation).
2023-01-30 12:19:14 -05:00
Timothy Flynn
5b3b14be0a LibJS: Move resolution of some Intl.NumberFormat options to a common AO
This is a normative change in the Intl.NumberFormat V3 spec. See:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/29acfc6

This is to allow Intl.PluralRules to use these options, as they were in-
effect required by later AOs anyways.
2023-01-30 12:19:14 -05:00
Tim Schumacher
093cf428a3 AK: Move memory streams from LibCore 2023-01-29 19:16:44 -07:00
Tim Schumacher
2470dd3bb5 AK: Move bit streams from LibCore 2023-01-29 19:16:44 -07:00
Tim Schumacher
94f139c111 AK: Move buffered streams from LibCore 2023-01-29 19:16:44 -07:00
Tim Schumacher
8464da1439 AK: Move Stream and SeekableStream from LibCore
`Stream` will be qualified as `AK::Stream` until we remove the
`Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is
defined by `SeekableStream`, since defining its own would require us to
qualify it with `AK::SeekMode` everywhere.
2023-01-29 19:16:44 -07:00
Tim Schumacher
5f2ea31816 AK: Move Handle from LibCore and name it MaybeOwned
The new name should make it abundantly clear what it does.
2023-01-29 19:16:44 -07:00
Tim Schumacher
ae64b68717 AK: Deprecate the old AK::Stream
This also removes a few cases where the respective header wasn't
actually required to be included.
2023-01-29 19:16:44 -07:00
Nico Weber
fef15becb2 LibGfx: Support ICCs in JPEGs that are split across several tags
Most jpegs that use multi-tag ICCs are in CMYK format, so running
`icc` on them still produces

    Runtime error: Unsupported number of components in SOF

but it no longer prints several

    jpg: Ignoring ICC profile spanning several chunks (1/9)

lines before that.

(And if I manually comment out that error message, the profile
is printed fine. But we can't decode the actual pixel data yet.)
2023-01-29 19:17:35 +00:00
Timothy Flynn
78def34c5e LibSQL: Use kill to exit forked SQLServer processes to avoid Qt issues
In order to daemonize the SQLServer process for Ladybird, we double-fork
and exit the first child process to ensure the grandchild process is in
a detached state to become SQLServer. After commit c05fcd5, this happens
after Ladybird's QApplication is created. QApplication seems to hook up
some `exit` handling that makes the call to `exit(0)` here not actually
exit the child process.

Instead, using `kill` with SIGTERM will actually terminate the child
process.
2023-01-29 18:32:21 +00:00
thankyouverycool
4b8bae8151 Welcome: Rename m_initial_tip_index=>m_tip_index 2023-01-29 18:27:34 +00:00
thankyouverycool
883abffa25 Welcome: Load banner font in a fallible manner
And simplify painting logic by using the banner widget's relative
rect and tray_text() ColorRole.
2023-01-29 18:27:34 +00:00
thankyouverycool
08456be9dc LibGUI+LibGfx: Add Tray ColorRole helpers to Palette 2023-01-29 18:27:34 +00:00
thankyouverycool
bfc08bc84b Welcome: Replace instances of DeprecatedString with String 2023-01-29 18:27:34 +00:00
thankyouverycool
c216d71b6c Welcome: Use fallible try_create() 2023-01-29 18:27:34 +00:00
Tim Schumacher
89a4a9c7a7 LibDebug: Correct a (un-)signed mixup in the DWARF abbreviations map
I accidentally replaced this with `read_unsigned` in
908b88db34, now it's correct again.
2023-01-29 18:21:11 +00:00
MacDue
d11baf48ae LibGfx: Fix constructor initialisation style in GradientPainting 2023-01-29 13:49:35 +00:00
MacDue
285bd7a37a LibGfx: Stop passing color stop spans by const reference
No idea why I did this, possibly because these were once vectors?
Anyway, the const reference is pointless here.
2023-01-29 13:49:35 +00:00
MacDue
a75f9273b4 PixelPaint: Increase default window height by 10px
This stops the clone and gradient tools from being cut off the side
bar.
2023-01-29 13:38:27 +01:00
Nico Weber
e9dcc49f9c LibGfx: Validate tag types of AToBNTag, BToANTag, gamutTag, previewNTag
Also rewrite a few of the existing tag type checks using a new helper.
2023-01-29 11:40:14 +00:00
Nico Weber
bd4078ad45 LibGfx: Make ICC EMatrix3x3::operator[] a bit less silly 2023-01-29 11:35:37 +00:00
Nico Weber
1329799d20 LibGfx: Rename EMatrix to EMatrix3x3 in ICC code
There will be an EMatrix3x4 in a future change.
2023-01-29 11:35:37 +00:00
Nico Weber
f63ec8de68 LibGfx: Use auto more in ICC code 2023-01-29 11:35:37 +00:00
MacDue
489fe49321 LibWeb: Fix parsing/to_string for "switch" ARIA role
I accidentally regressed this in 890b4d7, this role needs to be
handled specially due to the clash with the C++ 'switch' keyword.
2023-01-29 00:57:41 +00:00
Linus Groh
476d4b4963 LibWeb: Remove no longer needed DeprecatedFlyString.h includes
ARIA roles no longer use DeprecatedFlyString, replace them with the
forwarding header, and StringView.h in one case, for other things from
AK used in those headers.
2023-01-29 00:02:55 +00:00
Linus Groh
8556d47240 LibWeb: Move ARIA-related code into the Web::ARIA namespace
ARIA has its own spec and is not part of the DOM spec, which is what the
Web::DOM namespace is for (https://www.w3.org/TR/wai-aria-1.2/).

This allows us to stay closer to the spec with function names and don't
have to add the word "ARIA" to identifiers constantly - the namespace
now provides that clarity.
2023-01-29 00:02:55 +00:00
Timothy Flynn
8414734a2d LibJS: Propagate the OOM error from setting the String length property 2023-01-29 00:02:45 +00:00
Timothy Flynn
b75b7f0c0d LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocate
Callers that are already in a fallible context will now TRY to allocate
cells. Callers in infallible contexts get a FIXME.
2023-01-29 00:02:45 +00:00
Timothy Flynn
109b190a19 LibJS: Fully qualify the use of AK::is in MUST_OR_THROW_OOM
This is to allow using this macro in contexts that have defined `is`
already. For example, in ObjectConstructor, there is a native function
`is` which would trip up the compiler without this change.
2023-01-29 00:02:45 +00:00
Timothy Flynn
2b5054c903 LibJS: Add a method to ThrowCompletionOr to drop allocation errors
This should solely be used to ignore completions from Heap::allocate in
currently-infallible contexts. It's mostly meant to let us both ignore
these errors and mark them with a FIXME in one go.
2023-01-29 00:02:45 +00:00
Timothy Flynn
2692db8699 LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errors
Note that as of this commit, there aren't any such throwers, and the
call site in Heap::allocate will drop exceptions on the floor. This
commit only serves to change the declaration of the overrides, make sure
they return an empty value, and to propagate OOM errors frm their base
initialize invocations.
2023-01-29 00:02:45 +00:00
Timothy Flynn
1c1b902a6a LibJS+LibWeb: Move headers around to allow including Value from Cell
The goal here is to allow Cell::initialize to return a ThrowCompletion,
to handle OOM for example. Cell.h will then need to include Completion.h
which must include Value.h. This currently can't happen because Value.h
includes BigInt.h, which in turn includes Cell.h. So we would have an
include cycle.

This removes BigInt.h from Value.h, as it is forward-declarable (it is
only referred to with a reference or pointer). Then the Value overload
for Cell::Visitor::visit is moved to Cell.h, and missing BigInt.h
includes as peppered as needed.
2023-01-29 00:02:45 +00:00
Timothy Flynn
b0a4df76de LibJS: Define Date constants such that translation units don't copy them
Variables that are constexpr must be delcared inline in the global
namespace to prevent copying them.

The static keyword is meaningless on variables in headers in the global
namespace. Declare the static bigint as extern and define it out-of-line
instead.
2023-01-29 00:02:45 +00:00
Linus Groh
e4158d8555 LibJS: Replace some deprecated_string() with utf8_string() in Temporal
The remaining ones are needed for PropertyKey, which is not yet String
compatible.
2023-01-28 22:58:03 +00:00
Linus Groh
b41e7b7e86 LibJS: Replace to_deprecated_string() with to_string() in Temporal
Turns out all of these can already be replaced with no further changes!
2023-01-28 22:54:44 +00:00
MacDue
890b4d7980 LibWeb: Replace ARIA role static FlyStrings with an enum
This replaces the FlyStrings for ARIA roles that were constructed in
a [[gnu::constructor]] with a single enum. I came across this as the
DOM inspector was crashing due to a null FlyString for an ARIA role.

After fixing that, I was confused as to why these roles were not an
enum. Looking at the spec there's a fixed list of roles and switching
from references to static strings to an enum was pretty much an
exercise in find and replace :).

No functional changes (outside of fixing the mentioned crash).
2023-01-28 22:09:18 +00:00
Karol Kosek
f23eba1ba8 ImageDecoder: Actually set is_animated and loop_count variables
Before 649f78d0a4, the is_animated and
loop_count objects were set directly when making a return object.

That commit moved the decode logic to a separate function but forgot to
assign `is_animated` and `loop_count`. The compiler didn't throw an
error about unused variables because we were also VERIFY()ing that these
variables were zero-initialized at the beginning of the function.
2023-01-28 21:49:23 +00:00
Linus Groh
3a9225608a LibAudio: Remove try_ prefix from fallible LoaderPlugin methods 2023-01-28 22:41:36 +01:00
Linus Groh
ee0297d9ec LibAudio: Remove try_ prefix from fallible LoaderPlugin methods 2023-01-28 22:41:36 +01:00
Linus Groh
108ea2b921 LibCore: Remove try_ prefix from fallible SharedCircularQueue methods 2023-01-28 22:41:36 +01:00
Linus Groh
65fa7db2b5 PixelPaint: Remove try_ prefix from fallible ProjectLoader methods 2023-01-28 22:41:36 +01:00
Linus Groh
86f28ceace PixelPaint: Remove try_ prefix from fallible IconBag methods 2023-01-28 22:41:36 +01:00
Linus Groh
8a884b2581 PixelPaint: Remove try_ prefix from fallible Image methods 2023-01-28 22:41:36 +01:00
Linus Groh
39f1a6eb6f PixelPaint: Remove try_ prefix from fallible Image methods 2023-01-28 22:41:36 +01:00
Linus Groh
9c08bb9555 AK: Remove try_ prefix from FixedArray creation functions 2023-01-28 22:41:36 +01:00
Nico Weber
909c2a73c4 LibGfx+icc: Read and display lut16Type and lut8Type ICC tag types 2023-01-28 21:40:45 +00:00
Nico Weber
a0513a360a LibGfx: Use AssertSize<> in ICC/Profile.cpp 2023-01-28 21:40:45 +00:00
Sam Atkins
53ebe607f8 LibWasm: Implement data.drop instruction 2023-01-28 22:57:25 +03:30
Sam Atkins
a2f42512c2 LibWasm: Move memory.init code together with other memory.foo impls
And add a spec link while I'm at it.
2023-01-28 22:57:25 +03:30
Sam Atkins
330911a274 LibWasm: Implement memory.copy instruction 2023-01-28 22:57:25 +03:30
Sam Atkins
42adba5ad4 LibWasm: Implement memory.fill instruction 2023-01-28 22:57:25 +03:30
Nico Weber
027c97d3b2 icc: Print profile size 2023-01-28 12:42:19 +01:00
Nico Weber
6c79201f43 LibGfx: Make PNGImageDecoderPlugin::icc_data() return data if present 2023-01-28 12:42:19 +01:00
Nico Weber
53f485c5f0 LibGfx: Process colorspace-related chunks in PNGLoader
This stores the data from all these chunks on PNGLoadingContext
but doesn't do anything with it yet.
2023-01-28 12:42:19 +01:00
Linus Groh
0f4bbfdfb7 LibJS: Add spec comments to FunctionPrototype 2023-01-28 00:41:18 +00:00
Linus Groh
6d6ea1fffe LibJS: Add spec comments to FinalizationRegistryPrototype 2023-01-28 00:41:18 +00:00
Linus Groh
2473940526 LibJS: Add spec comments to FinalizationRegistryConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
39301cce70 LibJS: Add spec comments to DataViewPrototype 2023-01-28 00:41:18 +00:00
Linus Groh
814e7260f3 LibJS: Add spec comments to DataViewConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
0f3899b24a LibJS: Add spec comments to Completion 2023-01-28 00:41:18 +00:00
Linus Groh
e32265c896 LibJS: Add spec comments to BooleanConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
02808948ec LibJS: Add spec comments to BigIntPrototype 2023-01-28 00:41:18 +00:00
Linus Groh
7b139c6982 LibJS: Add spec comments to ArrayConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
eefb73add2 LibJS: Add spec comments to ArrayBufferConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
039cd353f1 LibJS: Implement the thisBooleanValue AO and use it in BooleanPrototype 2023-01-28 00:41:18 +00:00
Nico Weber
b5deccf859 LibGfx: Split ICC/Profile.{h,cpp} into several files
s15Fixed16Number and XYZNumber are somewhat awkwardly duplicated
in both Profile.cpp and TagTypes.cpp. Other than that, this is a
pure code move.

No behavior change.
2023-01-28 00:27:07 +00:00
Nico Weber
6d51d8ad32 LibGfx: Bump copyright year in ICC/Profile.{h,cpp} 2023-01-28 00:27:07 +00:00
Nico Weber
721b280849 LibGfx: Move ICCProfile.{h,cpp} to ICC/Profile.{h,cpp} 2023-01-28 00:27:07 +00:00
MacDue
afb84df290 LibWeb: Add a few extra spec links to CanvasGradient 2023-01-28 00:26:48 +00:00
MacDue
f86b66dc2d LibWeb: Throw exception if any canvas radial gradient radius is < 0
As per the specification:
https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createradialgradient
2023-01-28 00:26:48 +00:00
Timothy Flynn
8dc4e05ecf LibJS: Port Intl.DurationFormat to String 2023-01-28 00:13:59 +00:00
Timothy Flynn
4c8f7d76c4 LibJS: Port Intl.RelativeTimeFormat to String 2023-01-28 00:13:59 +00:00
Timothy Flynn
a824e1ac6a LibJS: Remove last use of DeprecatedString from Intl.MathematicalValue 2023-01-28 00:13:59 +00:00
Timothy Flynn
a65bf16cd5 LibLocale: Remove last use of DeprecatedString from LibLocale 2023-01-28 00:13:59 +00:00
Timothy Flynn
9e4dbea0ee LibJS: Use String::join and String::trim in Temporal AOs 2023-01-28 00:13:46 +00:00
Linus Groh
6e7459322d AK: Remove StringBuilder::build() in favor of to_deprecated_string()
Having an alias function that only wraps another one is silly, and
keeping the more obvious name should flush out more uses of deprecated
strings.
No behavior change.
2023-01-27 20:38:49 +00:00
Sam Atkins
da81041e97 WindowServer: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
990f1c799e TelnetServer: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
ca85ce6db3 Taskbar: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
8dff4c577f LibXML: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
7891ad2a28 LibWeb: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
8d31e04b8a LibWasm: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
5cc4b37bf3 LibVideo: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
1568063cc8 LibTLS: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
6c66fd5ffb LibRegex: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
bc1504c794 LibPDF: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
a39ac5a312 LibJS: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
c4c65ba727 LibIMAP: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
6d5fb9eb02 LibGfx: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
88bbbe12ba LibGUI: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
12673d0e24 LibElf: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
2a699c904a LibDSP: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
b5a3600bc7 LibCrypto: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
914d557097 LibCpp: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
80b948ab0d LibCodeComprehension: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
0d37121fc4 Inspector: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
88d746c775 HackStudio: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
0cedbd2f50 VideoPlayer: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00