Commit graph

45377 commits

Author SHA1 Message Date
Sam Atkins
54b1326165 Userland: Replace all uses of load_from_gml with try_load_from_gml
MOAR FIXMES! ;^)
2023-01-07 14:39:30 +01:00
Sam Atkins
703da34947 LibGUI: Create an alias for Widget UnregisteredChildHandler 2023-01-07 14:39:30 +01:00
Sam Atkins
33f42e3490 LibWeb: Remove redundant BFC::is_block_formatting_context() method
This is marked as virtual, but the super-method isn't, and also, the
super-method already returns the correct value, so this isn't needed.
2023-01-07 11:49:04 +00:00
Staubfinger
25dd0a4d2d AK: Make Statistics::median return a mean for an even number of values
The previous implementation of Statistics::median() was slightly
incorrect with an even number of elements since in those cases it needs
to be the arithmetic mean of the two elements that share the middle
position.
2023-01-07 12:40:47 +01:00
Liav A
0cede94c39 Kernel/Net: Introduce a new mechanism to initialize a PCI device
Instead of using a clunky if-statement paradigm, we now have all drivers
being declaring two methods for their adapter class - create and probe.
These methods are linked in each PCINetworkDriverInitializer structure,
in a new s_initializers static list of them.
Then, when we probe for a PCI device, we use each probe method and if
there's a match, then the corresponding create method is called. After
the adapter instance is created, we call the virtual initialize method
on it, because many drivers actually require a sort of post-construction
initialization sequence to ensure the network adapter can properly
function.

As a result of this change, it's much more easy to add more drivers and
the initialization code is more readable and it's easier to understand
when and where things could fail in the whole initialization sequence.
2023-01-07 12:36:57 +01:00
Liav A
90ac9d7253 Kernel/Net: Allocate regions before invoking the RTL8139 constructor
Instead of allocating those regions in the constructor, which makes it
impossible to fail in case of OOM condition, allocate them in the static
factory method so we could propagate errors in case of failure.
2023-01-07 12:36:57 +01:00
Liav A
102186b0f5 Kernel/Net: Allocate regions before invoking Intel driver constructors
Instead of allocating after the construction point ensure that all Intel
drivers are allocating necessary buffer regions and then pass them to
the constructors.
This could let us fail early in case of OOM, so we don't touch a network
adapter before we ensure we have all the appropriate mappings in place.
2023-01-07 12:36:57 +01:00
Karol Kosek
301f9de915 PixelPaint: Port to Core::Stream :^) 2023-01-07 10:53:43 +00:00
Karol Kosek
4f699d0f58 LibCore: Add forward declaration for Core::Stream::File 2023-01-07 10:53:43 +00:00
Karol Kosek
86f6586c6e LibFileSystemAccessClient: Add functions returning FSAC::File
This patch reimplements the now deprecated try_open_file(),
try_request_file() and try_request_file_read_only_approved() functions,
with the difference that the new ones return a FSAC::File object
(currently a wrapper with a Core::Stream and a filename) instead of a
Core::File.

Implemented in a similar manner to 6dd716adf2.
2023-01-07 10:53:43 +00:00
Karol Kosek
2cbe2dd3c0 LibFileSystemAccessClient+CrashReporter: Introduce FSAC::File and use it
The new result returned just a file stream, which wasn't sufficient
enough for most applications because it didn't provide a filename.

This patch will make a new File object that has both a file stream and
a filename.
2023-01-07 10:53:43 +00:00
Karol Kosek
247db3fdd0 LibFileSystemAccessClient: Rename try_* functions to try_*_deprecated
These functions return the deprecated `Core::File` class, so let's mark
it as such to avoid possible confusion between future non try_*
functions which will use Core::Stream family classes and to possibly
grab someone's attention. :^)
2023-01-07 10:53:43 +00:00
Jonah
e361025cfb Browser: Add Accessibility Tab to Inspector Widget
This tab allows you to view the accessibility tree like you do
the DOM tree. The implementation limited to the role currently,
once we add the name and description calculation algorithm, those
will be displayed here as well. Selections are also not currently
supported.
2023-01-07 10:51:53 +00:00
Jonah
367b1634fd LibWebView+WebContent: Expose the Accessibility Tree to Other Processes
This patch also stubs out notify_server_did_get_accessiblity_tree in
ladybird since ViewImplementation now has it. However, this feature
is still immature, so just stubbing out in ladybird for now. Once we
have more robust support in Serenity (namely ARIA properties/state
and accessible names and descriptions) we can port this
functionality over.
2023-01-07 10:51:53 +00:00
Jonah
a469bbd178 LibWeb: Add Functionality to Dump to Accessibility Tree
This will be used to display the accessibility tree in the inspector.
2023-01-07 10:51:53 +00:00
Jonah
3eef54823a LibWeb: Add Function To Build Accessiblity Tree
With this patch, the accessibility tree can be build from the root
node of a document. This can then be serialzed and sent to (soon
to come) consumers.
2023-01-07 10:51:53 +00:00
Jonah
cd95e5f656 LibWeb: Add (exclude/include)_from_accessibility_tree
These functions will be used in building the accessibility tree.
2023-01-07 10:51:53 +00:00
Jonah
ef48bd1878 LibWeb: Add has_global_aria_attribute
This helper will be used to help determine tree inclusion.
2023-01-07 10:51:53 +00:00
Jonah
e63d9d4925 LibWeb: Add Support for the ARIA Element Properties
Element now supports getting and setting ARIA properties from
JS and HTML.
2023-01-07 10:51:53 +00:00
Ali Mohammad Pur
0a244b9c1f Meta: Mark myself as a CODEOWNER of a bunch of paths 2023-01-07 01:38:30 +01:00
Karol Kosek
e9d73a6256 Spreadsheet: Port ExportDialog to Core::Stream 2023-01-07 04:03:01 +03:30
Karol Kosek
3a8450ae11 Spreadsheet: Port XSV writer to Core::Stream 2023-01-07 04:03:01 +03:30
Karol Kosek
5793f7749c Spreadsheet: Make file export functions return ErrorOr<> 2023-01-07 04:03:01 +03:30
Karol Kosek
29a3cdcfb7 Spreadsheet: Generate file previews in memory and save directly to file
When we were asked to make a new preview text, we first generated the
whole file in the /tmp directory and then read the first 8 lines to put
them in a text box. This was doing a bit of unnecessary work at first,
but more importantly, didn't work on a given file descriptor from
FileSystemAccessServer as we were copying a file to a filename instead,
meaning that we also had to unveil the whole home directory.

Anyway, previews will be written now to a MemoryStream by the generator,
which will limit to 8 lines. File saves will omit /tmp entirely,
allowing us to tighten program unveil list a little. :^)
2023-01-07 04:03:01 +03:30
Karol Kosek
c74441395b Spreadsheet: Use has_flag helper functions for XSV WriterBehaviors 2023-01-07 04:03:01 +03:30
Cody Hein
e0aae9e60a Spreadsheet: Remove cursor keys from is_navigation
This change allows for cursor navigation of a forumula while editing
rather than having to use the mouse to edit the cursor position within
a cell. Tab and Enter still allow you to navigate out of the cell to
next row or columns. :)
2023-01-07 03:46:52 +03:30
Liav A
04221a7533 Kernel: Mark Process::jail() method as const
We really don't want callers of this function to accidentally change
the jail, or even worse - remove the Process from an attached jail.
To ensure this never happens, we can just declare this method as const
so nobody can mutate it this way.
2023-01-07 03:44:59 +03:30
Nico Weber
a03d42b098 LibCrypto: Use default Crypto::Hash::Digest comparison operators
They do the same thing we previously laboriously did manually.
No behavior change.
2023-01-06 23:57:46 +01:00
Karol Kosek
7d330d379c Base: Make the serenity-application HackStudio template build again
Applies changes as seen in 0c24522635.
2023-01-06 21:09:15 +00:00
EWouters
5f87c3022c Ports: Set $LD for Clang, GCC and host in .hosted_defs.sh
Sets `$LD` to `$HOST_LD` in `.port_include.sh` if it is defined as well,
else it will be set to `ld`.

Makes libiconv build with the Clang toolchain.

This also impacts other ports when building them with the Clang
toolchain, and might result in more ports building correctly.
2023-01-06 14:00:31 -07:00
Thiago Henrique Hupner
401bc13776 AK: Use base URL when the specified URL is empty 2023-01-06 13:59:17 -07:00
Eli Youngs
96d3d3b0fe sed: Perform case insensitive substitutions with "/i" 2023-01-06 13:52:21 -07:00
Eli Youngs
0dc65cd835 sed: Write substitution output to a file with "/w"
A substitution command like "s/x/y/wabc" will now write all substituted
lines to a file called "abc". Note that this is in addition to writing
to stdout.
2023-01-06 13:52:21 -07:00
Eli Youngs
0ecbc5c02a Userland: Add a sed utility 2023-01-06 13:52:21 -07:00
Eli Youngs
87a961534f LibRegex: Prevent patterns from matching the empty string twice
Previously, if a pattern matched the empty string (e.g. ".*"), it would
match the string twice instead of once. Among other issues, this caused
a Regex replacement to duplicate its expected output, since it would
replace "both" empty matches.
2023-01-06 13:52:21 -07:00
Eli Youngs
5bf2cce839 LibRegex: Allow the SingleMatch flag to be used as a PosixFlag 2023-01-06 13:52:21 -07:00
Sam Atkins
0c24522635 LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)
Rip that bandaid off!

This does the following, in one big, awkward jump:
- Replace all uses of `set_main_widget<Foo>()` with the `try` version.
- Remove `set_main_widget<Foo>()`.
- Rename the `try` version to just be `set_main_widget` because it's now
  the only one.

The majority of places that call `set_main_widget<Foo>()` are inside
constructors, so this unfortunately gives us a big batch of new
`release_value_but_fixme_should_propagate_errors()` calls.
2023-01-06 13:36:02 -07:00
Nico Weber
d223477bc6 LibGfx+icc: Print device attribute flags
These flags are always 0 in practice in all profiles I've seen so far,
but hey, probably nice to dump them anyways.

And hey, it's just 86 lines to print 4 bits.
2023-01-06 21:33:46 +01:00
Nico Weber
915cc5d4e3 LibGfx: Fix incorrect bitmask in Gfx::ICC::Flags 2023-01-06 21:33:46 +01:00
Andreas Kling
80ce0419b6 LibWeb: Fix abspos flex container with height:auto getting zero height
When laying out abspos boxes, we compute the height twice: before and
after the inside of the box has been laid out.

The first pass allows percentage vertical values inside the box to be
resolved against the box's height. The second pass resolves the final
used value for the height of the box itself.

In cases where the box height depends on the results of inside layout,
we were incorrectly setting the box to having a definite zero height.
This led to incorrect results when sizing an abspos flex container,
since the FFC sizes containers (in row layouts) based on whether the
container has a definite height.

To avoid this problem, this patch adds an enum so we can differentiate
between the two abspos height computation passes. If the first pass
discovers a dependency on the inside layout, we simply bail out of
computing the height, leaving it as indefinite. This allows the FFC
to size its container correctly, and the correct height gets set by
the second pass.
2023-01-06 21:12:55 +01:00
Kenneth Myhra
6d54e5ce9a LibWeb: Verify optional argument has a value before static_cast-ing it 2023-01-06 20:51:21 +01:00
Nico Weber
c00ce2fba0 LibGfx+icc: Verify ICCProfile ID at parse time instead of in icc
Always computing computing the md5 takes some time, but most
icc profiles are small. So that's probably fine.

If this ends up being a perf problem in the future, or if it ends up
rejecting tons of embedded proiles from images, we can row it back.
But let's see if we can get away with this first.
2023-01-06 20:26:14 +01:00
Nico Weber
31af741c66 LibGfx: Rename variable in parse_profile_id() to match spec better 2023-01-06 20:26:14 +01:00
Linus Groh
8750e1d080 Documentation: Add section about curly braces to CodingStyle.md 2023-01-06 19:52:06 +01:00
Nico Weber
b0068c387b LibGfx: Verify ICC reserved header bytes are zero
I checked that they are zero for all profiles in Compact-ICC-Profiles
and for all .icc files in /Library/ColorSync and
/System/Library/ColorSync on my Mac (running macOS 12.6.2).
2023-01-06 19:17:22 +01:00
Nico Weber
090bd02a88 LibGfx: Extract all_bytes_are_zero() function in ICCProfile 2023-01-06 19:17:22 +01:00
Nico Weber
aa107ef2d6 LibGfx: Add quotes and reflow for glanceability 2023-01-06 19:17:22 +01:00
Nico Weber
478bd97b25 LibGfx: Rename ICCHeader::profile_md5 to profile_id to match spec 2023-01-06 19:17:22 +01:00
Linus Groh
cbad79fa86 CI: Use default provided GITHUB_TOKEN for PR label workflow
Using BUGGIEBOT_TOKEN doesn't work in all cases for unknown reasons.

See also:
https://github.com/actions/github-script#using-a-separate-github-token
2023-01-06 19:11:41 +01:00
Børlaag
fb3e890bd9 Documentation: Update VirtualBox docs memory section 2023-01-06 11:08:58 -07:00