Commit graph

35920 commits

Author SHA1 Message Date
Sam Atkins
dfc02f9761 AK: Fix typo in warnln_if() 2022-03-19 11:01:49 -07:00
Sam Atkins
11ab8ee80a Base: Add a man-page for cmp(1) 2022-03-19 11:01:49 -07:00
Sam Atkins
1ba6974b60 cmp: Implement cmp(1) 2022-03-19 11:01:49 -07:00
Sam Atkins
25c2a76d10 LibMain: Add the ability to configure the exit code on error
Some POSIX utilities are specified to return a specific value on error,
which is not 1. `Main::set_return_code_for_errors()` lets you set it to
that value.
2022-03-19 11:01:49 -07:00
stelar7
60c228b914 LibWeb: Handle nullish this_value when creating idl functions 2022-03-19 17:40:23 +00:00
Tim Schumacher
13ef8469da Utilities: Add support for setting permissions to install 2022-03-19 10:26:33 -07:00
Tim Schumacher
9de742e321 Utilities: Add support for multiple sources to install 2022-03-19 10:26:33 -07:00
Tim Schumacher
62f0fa818d LibCore: Add File::ensure_directories() 2022-03-19 10:26:33 -07:00
Tim Schumacher
f44cd168b0 Utilities: Add the -c option to install 2022-03-19 10:26:33 -07:00
Liav A
7ff6d4d72b Kernel: Increase i8042 timeout when writing and reading from device
This proved to be crucial on my ICH7 test machine because it takes a bit
more time to do IO on its i8042 controller.
2022-03-19 15:37:03 +00:00
Andreas Kling
cbd343dced LibWeb: Only delay "load" event for script elements that load something
We shouldn't delay the load event for scripts that we're completely
refusing to run anyway. Also, for scripts that have inline text content,
we don't need to delay them either, as they will become ready before
returning from "prepare script".

This makes the "load" event finally fire on lots of websites, including
Wikipedia. :^)
2022-03-19 16:11:36 +01:00
Andreas Kling
c1f0d21bbe LibWeb: Rename the LayoutMode enum values and explain them
The old mode names, while mechanically accurate, didn't really reflect
their relationship to the CSS specifications.

This patch renames them as follows:

    Default => Normal
    AllPossibleLineBreaks => MinContent
    OnlyRequiredLineBreaks => MaxContent

There's also now an explainer comment with the LayoutMode enum about the
specific implications of layout in each mode.
2022-03-19 15:46:15 +01:00
Andreas Kling
ceb055a75e LibWeb: Don't delay document "load" event for non-loading link elements
If we try loading a link element but it's reject for whatever reason
(broken URL, content filtering, etc.) make sure we don't mark that link
element as delaying the document load event.
2022-03-19 15:04:48 +01:00
Andreas Kling
2c9dfadb21 LibWeb: Don't delay document "load" event for unclosed script tags
We previously had a bug where markup with unclosed script tags caused
the document load event to be delayed indefinitely. Fix this by only
marking script elements as delaying the load event once we encounter
the script end tag.
2022-03-19 15:04:48 +01:00
Liav A
462618b68c Kernel/Storage: Move Ramdisk code into a separate subdirectory 2022-03-19 13:41:06 +00:00
Liav A
f5acef0b81 Kernel: Use original Console m_x and m_y in Text based implementations 2022-03-19 13:39:59 +00:00
Lady Gegga
4644a53d0d Base: Add Tagbanwa to font Katica Regular 10
1760-1773 https://www.unicode.org/charts/PDF/U1760.pdf
2022-03-19 13:37:54 +00:00
Lady Gegga
5b4f512990 Base: Add Tagalog to font Katica Regular 10
1700-171F https://www.unicode.org/charts/PDF/U1700.pdf
2022-03-19 13:37:54 +00:00
Lady Gegga
847f4c0f16 Base: Add Chinese characters to font Katica Regular 10
4E40, 56E7, 592A, 5B52, 5EFE, 81E6, 8BA0
2022-03-19 13:37:54 +00:00
Lady Gegga
e4de30ba91 Base: Update glyph spacing in font tengchaH Regular 12
From 1 to 2.
2022-03-19 13:37:54 +00:00
Lady Gegga
d4bdbc40b9 Base: Update glyphs in font tengchaH Regular 12
Adjust 0030, 0033, 0035, 0037 to be 6px wide (matching the other
digits).
2022-03-19 13:37:54 +00:00
Sam Atkins
2975d7275d LibWeb: Don't serialize hex-colors as identifiers
ID selectors need to be serialized as identifiers in the spec, but other
hash-values do not. This was causing hex colors that start with a
number, like `#54a3ff`, to serialize as `#\35 4a3ff`, which is silly
and unnecessary.

Selector serialization is done elsewhere, so this case in Token is
probably also unnecessary, but there might be situations I haven't
thought of where serializing an ID does need to happen while it's still
a Token.
2022-03-19 13:22:13 +01:00
Ali Mohammad Pur
8f7021faf7 LibJS: Implement bytecode generation for For-In/Of statements
This also implements the rather interesting behaviour that #12772 relies
on, so this fixes that bug in BC mode (the AST interp remains affected).
2022-03-19 12:51:29 +01:00
Andreas Kling
83afc1154c LibWeb: Fix IFC over-shrinking the available space for line boxes
After accounting for left-side floats, we have to subtract the offset of
the IFC's containing block again, to get the real starting X offset
for the current line.

This was done correctly in leftmost_x_offset_at() but incorrectly in
available_space_for_line(), causing IFC to break lines too early in
cases where the containing block had a non-zero X offset from the BFC
root block.
2022-03-19 12:42:10 +01:00
Andreas Kling
8d5768b103 LibWeb: Don't treat inline-level children of flex items as whitespace
This was causing us to collapse some children of flex items as if they
were useless whitespace text nodes.
2022-03-19 12:42:10 +01:00
Andreas Kling
28b771560a LibWeb: Make SVG <svg> elements behave as CSS replaced elements
This makes SVG-in-HTML behave quite a bit better by following general
replaced layout rules. It also turns <svg> elements into inline-level
boxes instead of block-level boxes.
2022-03-19 12:42:10 +01:00
Andreas Kling
48abbefb99 LibWeb: Make Paintable::hit_test() return nothing
For paintables that don't know how to hit test themselves, let's just
return nothing instead of crashing.
2022-03-19 12:42:10 +01:00
Andreas Kling
3f55271c8e LibWeb: Don't crash when dumping layout tree pre-layout
If we haven't run layout yet, there aren't any paintables attached to
the tree, so we have to null check them.
2022-03-19 12:42:10 +01:00
martinfalisse
11dffbd96f Spreadsheet+LibGUI: Calculate cell position given scroll position
Take into account the current scroll position when calculating the
position of cells. This way when the user scrolls either horizontally
or vertically, the calculations done to find the cell position
will be correct.
2022-03-19 09:31:29 +03:30
martinfalisse
5759b25ca8 Spreadsheet: Handle case when drag-and-drop location is out of bounds
When the drop location of a drag-and-drop operation is not valid, then
don't continue with the drop_event. For example, if the ending location
is the header row or header column, or is outside of the table, then
should not continue.
2022-03-19 09:31:29 +03:30
martinfalisse
9e54815799 Spreadsheet: Implement extend functionality
Implements ability to extend a cell's contents by clicking the bottom
right of the cell and dragging in a linear direction. For now, the
content that is extended is simply a copy of the target cell's
values.
2022-03-19 09:31:29 +03:30
martinfalisse
f6ad98b1a1 Spreadsheet: Take into account cell order when copying and cutting
Since copying and cutting uses the cell values in the origin to decide
which values to paste in the destination, it is necessary to do it
in an ordered manner when the origin and destination ranges overlap.
Otherwise you may overwrite values in the origin unintentionally
before having successfully transferred them to the destination.
2022-03-19 09:31:29 +03:30
martinfalisse
2f2a705a8e Spreadsheet: Cut instead of copy when dragging a cell's items
Use cut instead of copy when dragging one or many cells' contents.
This is more intuitive as most other spreadsheet applications
handle the drag in this manner instead of as a copy operation.
2022-03-19 09:31:29 +03:30
martinfalisse
8a7d2c3336 Spreadsheet: Rename variables to better describe their function
Rename some variables relating to the drag-and-cut operations as
well as the select operation so that they are more clear.
2022-03-19 09:31:29 +03:30
martinfalisse
e98d0dafa0 Spreadsheet: On cut end select same cells in target location
When finished dragging and cutting, select the cells in the
destination. E.g. if you select 5 cells and drag and paste
them in a new location, select the 5 pasted cells in the
destination.
2022-03-19 09:31:29 +03:30
martinfalisse
10bbb01ed8 Spreadsheet: Set cursor manually so that correct cells are outlined
Due to the fact that in the AbstractView, when multiple cells are
selected, and then another cell is selected within this selection,
the cursor is not updated as the user may be beginning to drag, have
to override this functionality for the Spreadsheet application.

This is because in spreadsheets when multiple cells are selected,
and then you click on one of the cells within the selection,
the selection should be cleared and the targetted cell highlighted.
2022-03-19 09:31:29 +03:30
martinfalisse
1287238430 Spreadsheet: Select the correct cell on click
Due to the margin that is given to be able to select cells for
cutting or extending, have to override the mouse click function
so that the targetted cell is chosen and not the one that may be
beneath the cursor.
2022-03-19 09:31:29 +03:30
martinfalisse
4f0a123b2f Spreadsheet: Display different cursors depending on action
Depending on the cursor location with respect to a selected cell,
display different icons pertaining to the distinct possible actions,
for example dragging and cutting, extending the cell's contents, or
doing a simple selection.
2022-03-19 09:31:29 +03:30
martinfalisse
a378e3ccbf Spreadsheet: Add states for cursor hovering
Add states for the cutting and extending icons that are to be shown
depending on where the user's cursor is with respect to the target
cell.
2022-03-19 09:31:29 +03:30
Lenny Maiorani
a0367aa43b DevTools+LibJS+LibWeb: Change class_name to use StringView
This helps make the overall codebase consistent. `class_name()` in
`Kernel` is always `StringView`, but not elsewhere.

Additionally, this results in the `strlen` (which needs to be done
when printing or other operations) always being computed at
compile-time.
2022-03-19 00:20:46 +00:00
Lenny Maiorani
5b7a5b3c01 LibCpp: Change class_name to use StringView instead of char const*
This helps make the overall codebase consistent. `class_name()` in
`Kernel` is always `StringView`, but not elsewhere.

Additionally, this results in the `strlen` (which needs to be done
when printing or other operations) always being computed at
compile-time.
2022-03-19 00:20:46 +00:00
Lenny Maiorani
327e9a2187 LibCore: Change class_name to use StringView instead of char const*
This helps make the overall codebase consistent. `class_name()` in
`Kernel` is always `StringView`, but not elsewhere.

Additionally, this results in the `strlen` (which needs to be done
when printing or other operations) always being computed at
compile-time.
2022-03-19 00:20:46 +00:00
Lenny Maiorani
66189169f9 LibGfx: Change class_name to use StringView instead of char const*
This helps make the overall codebase consistent. `class_name()` in
`Kernel` is always `StringView`, but not elsewhere.

Additionally, this results in the `strlen` (which needs to be done
when printing or other operations) always being computed at
compile-time.
2022-03-19 00:20:46 +00:00
Tim Schumacher
aa9d6f17b6 Revert "LibC: Make WEOF a signed value on clang"
We have fixed Clang to define `wint_t` as an unsigned value.

This reverts commit ccb9cae8e9.
2022-03-19 00:11:45 +00:00
Tim Schumacher
2788d46ae0 Toolchain: Make wint_t unsigned for Clang 2022-03-19 00:11:45 +00:00
Tim Schumacher
5d0869d5ca Toolchain: Enable IFUNC support for GCC 2022-03-19 00:11:45 +00:00
Tim Schumacher
b55a3a504e Toolchain: Enforce correct sizes for size_t and ptrdiff_t 2022-03-19 00:11:45 +00:00
Sam Atkins
7e98c8eaf6 AK+Tests: Fix StringUtils::contains() being confused by repeating text
Previously, case-insensitively searching the haystack "Go Go Back" for
the needle "Go Back" would return false:

1. Match the first three characters. "Go ".
2. Notice that 'G' and 'B' don't match.
3. Skip ahead 3 characters, plus 1 for the outer for-loop.
4. Now, the haystack is effectively "o Back", so the match fails.

Reducing the skip by 1 fixes this issue. I'm not 100% convinced this
fixes all cases, but I haven't been able to find any cases where it
doesn't work now. :^)
2022-03-18 23:51:56 +00:00
djwisdom
00eca26085 Base+Fonts: Glyphs 00A0-017F temporarily removed
Will put them back again after adjusting the style of the glyphs.
2022-03-19 00:51:41 +01:00
djwisdom
e00f459e36 Base+Fonts: Remove Satori Code fonts 2022-03-19 00:51:41 +01:00