Commit graph

39827 commits

Author SHA1 Message Date
Liav A 622e3b06ce Meta: Put USB and PCI IDs in the right folder in the Build environment
Not sure why that happens and how it worked until now, but we need to be
more precise about the location of PCI and USB IDs when decompressing
them while building the OS.
2022-07-28 04:25:07 -07:00
demostanis ef2d4b9ed6 Base: Add sort(1) man page 2022-07-28 00:44:08 +00:00
MacDue 281e46e8b3 grep: Fix out of bounds StringView indexing
This is another case of out of bounds indexing exposed by 13406b8.
2022-07-27 22:51:54 +00:00
Undefine 97cc33ca47 Everywhere: Make the codebase more architecture aware 2022-07-27 21:46:42 +00:00
Tim Schumacher 6c4b5775e1 LibCore: Implement four-digit modes for FilePermissionsMask parsing 2022-07-27 21:45:01 +00:00
Tim Schumacher 130f04c493 LibCore: Implement the 'X' modifier into FilePermissionMask 2022-07-27 21:45:01 +00:00
djwisdom 8598fbb008 Ports: Update serenity-theming use latest commit 5d626d9 2022-07-27 21:43:33 +00:00
Timothy Flynn 60f3880650 LibJS: Remove %TypedArray%.prototype.toSpliced
This was removed from the change-array-by-copy proposal. See:
https://github.com/tc39/proposal-change-array-by-copy/commit/4c194d9
2022-07-27 17:35:50 +01:00
Timothy Flynn a8d532c4fe LibJS: Update Array.prototype.sort comments to align with implementation
This was fixed in the change-array-by-copy proposal. See:
https://github.com/tc39/proposal-change-array-by-copy/commit/60823eb
2022-07-27 17:35:50 +01:00
demostanis b89aced2e3 LaunchServer: Let open_file_url use app defaults
Before, programs using open_file_url (such as Terminal) would
fail to open any file if its extension (or mime type) wasn't
specified in LaunchServer.ini. This patch now permits it.
2022-07-27 17:11:25 +01:00
demostanis 48766449e5 LaunchServer+LibDesktop: Open from mime type
Before, LaunchServer would only open files based on their extension.
This wouldn't work if the file had the wrong one.
2022-07-27 17:11:25 +01:00
Andreas Kling 031322fde3 LibWeb: Make :enabled and :disabled selector handling more idiomatic 2022-07-27 17:29:48 +02:00
Andreas Kling 2ad98fdf80 LibWeb: Add fast_is<HTMLElement>()
This avoids slow RTTI lookups in selector matching.
2022-07-27 17:29:48 +02:00
Andreas Kling 9f32da1dbc LibWeb: Add fast_is<HTMLBaseElement>()
This avoids slow RTTI lookups in Document::base_url().
2022-07-27 17:29:48 +02:00
Sam Atkins 7b4004d682 LibWeb: Ensure PercentageOr<T>::resolved() returns a concrete T
Which is to say, a T where `is_calculated()` is false.

As is becoming a repeating theme with CSS types, we have two states for
a FooPercentage that is a `calc()` expression: Either the FooPercentage
holds the CalculatedStyleValue directly, or it holds a Foo which itself
holds the CalculatedStyleValue. The first case was already handled to
return Foo, and with this patch, the second is too. :^)
2022-07-27 17:03:55 +02:00
Sam Atkins 3fce4f7c91 LibWeb: Resolve calc() FooPercentages that only contained percentages
Fixes #14697

Percentages inside `calc()` only got converted to the concrete type
(eg, Length) when added or subtracted with one. So if the `calc
()` doesn't contain any of that type, it would resolve to a
Percentage.

Now, we catch that returned Percentage and convert it to the proper
type. This fixes cases like `width: calc(100% / 2);`.
2022-07-27 17:03:55 +02:00
Sam Atkins ef2469bfed LibWeb: Add missing Formatters for CSS dimension types 2022-07-27 17:03:55 +02:00
MacDue 9d0dccaa3f less: Fix out of bounds StringView indexing
This fixes indexing the StringView before knowing if the index
is valid. This did not crash until the changes from 13406b8
which added runtime checks for StringView indexing.
2022-07-27 05:34:41 -07:00
sfdd d1671d4f86 Documentation: Better file formats documentation 2022-07-27 10:13:21 +01:00
b14ckcat b8cfec7b1f Kernel: Move SysFS USB create function 2022-07-27 05:52:35 +00:00
b14ckcat 4b1537387f Kernel: Fix USB hotplug crash
Currently the SysFS node for USB devices is only initialized for USB
hubs, which means it will cause a kernel crash upon being dereferenced
in a non-hub device. This fixes the problem by making initialization
happen for all USB devices.
2022-07-27 05:52:35 +00:00
Sam Atkins 11cb7c7b28 WindowServer: Ensure windows are wide enough to show title buttons :^)
Previously, windows without a defined minimum size (or one produced from
the minimum sizes of their contents) would be shrunk down to 0 x 0,
which makes the title buttons stick out the side and become impossible
to interact with.

This patch uses the theme metrics to calculate a minimum size that is as
small as possible while still keeping the title buttons and app icon
usable. This is combined with the minimum size requested by the app
itself.

Switching themes automatically updates the calculated minimum sizes for
all existing windows. As noted, if the new theme has narrower title
buttons then the old minimum is kept, but this shouldn't be noticeable
unless you're looking for it.
2022-07-27 00:01:42 +01:00
Sam Atkins 0fcb6920e3 Browser: Give BookmarksBarWidget a minimum size
Without this, it gets a minimum size that's very large and stops you
from resizing the Browser window narrower than 609px.
2022-07-27 00:01:42 +01:00
Karol Kosek fe60459353 LibAudio: Seek to the first frame on reset in FLAC
The files weren't starting exactly from the beginning before.
This happened because the parameter now takes the sample index, instead
of a seekpoint.
2022-07-26 23:59:06 +01:00
Karol Kosek 2878ad681e LibAudio: Read FLAC Metadata blocks larger than the buffer size
Out of 40/63 failed tests, this change reduces the number down to four.
:^)

See: #14683
2022-07-26 23:59:06 +01:00
MacDue 43ebe5ca75 Base: Add some more border-radius test cases
* A border-radius + a border on a <img> tag
   - The border-radius on the <img> should shrink to line up with
     the border.
* A border-radius + a border on a div with overflow: hidden
   - The clipping border-radius should shrink (same as the image).
2022-07-26 23:56:29 +01:00
MacDue b68f48eb71 LibWeb: Shrink the inner border radii to accommodate the border widths
This fixes the shape of the subreddit logo on new reddit.
2022-07-26 23:56:29 +01:00
Kenneth Myhra 890514a057 LibWeb: Introduce the File interface from the FileAPI spec 2022-07-26 20:54:30 +01:00
Kenneth Myhra df91dbfbb6 LibWeb: Add missing spec links to the Blob interface 2022-07-26 20:54:30 +01:00
Kenneth Myhra 6305ef197f LibWeb: Fix const issue on type() accessor for the Blob interface 2022-07-26 20:54:30 +01:00
Kenneth Myhra c038a8c9c9 LibWeb: Make process_blob_parts() publicly accessible
This pulls process_blob_parts() out of the Blob class and makes it
publicly accessible.
2022-07-26 20:54:30 +01:00
Kenneth Myhra 622a4f29a7 LibWeb: Add public get accessor function for Blob's internal ByteBuffer
Blob::bytes() returns the ReadonlyBytes representation of our internal
ByteBuffer.

This change requires us to ByteBuffer::copy() Blob's ReadonlyBytes to a
ByteBuffer in XHR::send() and corresponding error handling of the copy
operation.

This removes the need for Blob to declare XMLHttpRequest as a friend
class.
2022-07-26 20:54:30 +01:00
Timothy Flynn 417a385db1 LibJS: Allow out-of-order plural ranges to be formatted
This is a normative change to the Intl NumberFormat V3 spec:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/0c3d849
2022-07-26 10:46:08 -07:00
Timothy Flynn fd7d97fba5 LibJS: Allow out-of-order number ranges to be formatted
This is a normative change to the Intl NumberFormat V3 spec:
https://github.com/tc39/proposal-intl-numberformat-v3/commit/0c3d849
2022-07-26 10:46:08 -07:00
Timothy Flynn 415742ab98 LibJS: Allow out-of-order date ranges to be formatted
This is a normative change to the Intl spec:
https://github.com/tc39/ecma402/commit/769df4b
2022-07-26 10:46:08 -07:00
gbowser3@gmail.com 16d189e96b LibGUI: Move tooltip position up 4 pixels to prevent cursor pop-under 2022-07-26 12:42:18 +02:00
MacDue 13406b83b1 AK: VERIFY() the index is in bounds in StringView::operator[]
That this did not already happen took me by surprise, as for
most other similar containers/types in AK (e.g. Span) the index
will be checked. This check not happening could easily let
off-by-one indexing errors slip through the cracks.
2022-07-26 12:41:46 +02:00
Andreas Kling 5f34c8ab03 LibWeb: Make automatic heights for abspos non-replaced behave better
Previously we were checking if values were "auto" after resolving the
"auto"-ness out of them, which didn't work. There's still a bunch of
work to do on this algorithm, but now we can at least resolve some basic
automatic height scenarios.
2022-07-26 01:53:41 +02:00
Andreas Kling 0258fd8043 LibWeb: Remove FFC helpers is_{main,cross}_axis_margin_first_auto()
We already cache these values with each flex item, so let's just use
those instead.
2022-07-26 01:53:41 +02:00
Andreas Kling 71ec46b8cc LibWeb: Don't treat calc() in used flex basis as definite for now
We'll eventually need some way to determine if a calc() value results
in a definite size.
2022-07-26 01:53:41 +02:00
Andreas Kling 7200b3a16c LibWeb: Make two passes in FFC where to support percentage min/max sizes
Percentage sizes of flex items are relative to the flex container, but
even when the flex container is automatically sized, we still have to
support them.

To make this work, we first do a pass where percentage sizes are ignored
(treated as "auto", basically) in order to get a "reference" value.

Then we do a second pass where percentages can be resolved against this
reference value.
2022-07-26 01:53:41 +02:00
Andreas Kling 3def9e47f6 LibWeb: Improve min/max content contribution calculations for flex items
Follow the spec more closely.
2022-07-26 01:53:41 +02:00
Andreas Kling 4c89252f6a LibWeb: Clamp flex items to min/max main size during intrinsic sizing
We were neglecting to clamp flex items when calculating the intrinsic
main size of the flex container. This was covered by a FIXME, which we
can now remove. :^)
2022-07-26 01:53:41 +02:00
Andreas Kling dc66a3cad9 LibWeb: Simplify flex container main size determination
We had an older incomplete implementation of flex container max-content
sizing that we used for unconstrained main size determination.

This patch replaces the old implementation with a call to the new
max-content sizing code.

Note that this isn't a complete implementation of flex container sizing
still, but at least we've deduplicated some code.
2022-07-26 01:53:41 +02:00
Andreas Kling 18b1854aea LibWeb: Add FFC helpers for getting the computed main/cross size of box 2022-07-26 01:53:41 +02:00
Andreas Kling a4d7dc40bf LibWeb: Move get_pixel_{width,height} helpers into FFC class 2022-07-26 01:53:41 +02:00
Andreas Kling 60ac258a48 LibWeb: Mark flex item cross sizes as definite when spec asks us to
The CSS-FLEXBOX-1 spec gives us two situations in which flex item cross
sizes should be considered definite. Both of them happen *during* flex
layout, which is super finicky but it is what it is.
2022-07-26 01:53:41 +02:00
Andreas Kling 83bb16ede3 LibWeb: Avoid some unnecessary inside layouts during intrinsic sizing
When calculating intrinsic sizes, we don't need to recurse into *every*
box and layout its insides. IIUC, we can skip any unconstrained box with
definite sizes in both axes. So this patch does exactly that.
2022-07-26 01:53:41 +02:00
Andreas Kling 3ede8dbffb LibWeb: Rename IntrinsicSizeDetermination to IntrinsicSizing
This matches the exact terminology used in CSS-SIZING-3:
https://drafts.csswg.org/css-sizing-3/#intrinsic-sizing
2022-07-26 01:53:41 +02:00
Andreas Kling 97f53de8a2 LibWeb: Take size constraints into account in fit-content calculations
Also avoid calculating both min-content and max-content sizes when only
one of them is needed.
2022-07-26 01:53:41 +02:00