Commit graph

50694 commits

Author SHA1 Message Date
Jelle Raaijmakers
b76219f702 Meta: Add myself to CODEOWNERS for LibSQL 2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
69e09fed39 LibSQL: Free heap storage when deleting rows 2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
c58c87d7ef LibSQL: Implement freeing heap storage
This allows us to free entire chains of blocks in one go.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
d7bbb8d64a LibSQL: Find free blocks when opening a database file
The free block list now gets populated on opening a database file.
Ideally we persist this list inside the heap itself, but for now this
prevents excessive heap growth.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
a6abc1697f LibSQL: Keep track of free heap blocks when trimming storage
When overwriting existing heap storage that requires fewer blocks, make
sure to free all remaining blocks so they can be reused in the future.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
c5ebc4bb40 LibSQL: Reuse heap blocks when overwriting storage
Previously, only the first block in a chain of blocks would be
overwritten while all subsequent blocks would be appended to the heap.
Now we make sure to reuse all existing blocks in the chain.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
2d2911e1a3 LibSQL: Test SQL::Heap separately
Move the long storage test from TestSqlStatementExecution into a new
test unit called TestSqlHeap. Split it up into a flushed and non-flushed
variant so we test the write-ahead log as well.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
d5df832318 LibSQL: Clean up TestSqlDatabase
Missing imports, make methods static. No functional changes.
2023-05-25 06:19:16 -07:00
0GreenClover0
b4c6cddd96 LibWeb: Handle invalid UTF-8 in Fetch's Body#text() 2023-05-25 06:03:40 -07:00
Andreas Kling
7d24c13d8b LibWeb: Make input element placeholders look better
We now create a flex container inside the input element's UA shadow tree
and add the placeholder and non-placeholder text as flex items (wrapped
in elements whose style we can manipulate).

This fixes the visual glitch where the placeholder would appear below
the bounding box of the input element. It also allows us to align the
text vertically inside the input element (like we're supposed to).

In order to achieve this, I had to make two small architectural changes
to layout tree building:

- Elements can now report that they represent a given pseudo element.
  This allows us to instantiate the ::placeholder pseudo element as an
  actual DOM element inside the input element's UA shadow tree.

- We no longer create a separate layout node for the shadow root itself.
  Instead, children of the shadow root are treated as if they were
  children of the DOM element itself for the purpose of layout tree
  building.
2023-05-25 14:42:24 +02:00
Andreas Kling
6fb661e781 LibWeb: Make HTMLDivElement not "final"
This is to prepare for making some custom internal divs inside the input
element UA shadow tree.
2023-05-25 14:42:24 +02:00
kuchikuu
ce764c340a Documentation: Add Qt6 SVG module to Ladybird build deps on Arch
Qt6 SVG is required to successfully compile Ladybird.

Without this package, a compilation error occurs:
Failed to find required Qt component "Svg".
2023-05-25 04:52:36 -06:00
Xexxa
8f16d37f00 Ladybird: Add shortcut to "Close Current Tab" 2023-05-25 09:04:11 +01:00
Xexxa
850b713889 Ladybird: Move "Settings" from "File" to "Edit" 2023-05-25 09:04:11 +01:00
Xexxa
689954dfc1 Ladybird: Add missing icons 2023-05-25 09:04:11 +01:00
Sam Atkins
6b8f484114 LibWeb: Stop generating now-unused property_accepts_value() function 2023-05-25 06:36:10 +02:00
Sam Atkins
c0e61f92c0 LibWeb: Remove now-unused parse_css_value(ComponentValue) method
:^)
2023-05-25 06:36:10 +02:00
Sam Atkins
7e8ed996c9 LibWeb: Use new StyleValue parsing for transform-origin 2023-05-25 06:36:10 +02:00
Sam Atkins
f759a16087 LibWeb: Use new StyleValue parsing for text-decoration 2023-05-25 06:36:10 +02:00
Sam Atkins
a473f6074d LibWeb: Use new StyleValue parsing for text-decoration-line 2023-05-25 06:36:10 +02:00
Sam Atkins
a7a61c4cd9 LibWeb: Use new StyleValue parsing for overflow 2023-05-25 06:36:10 +02:00
Sam Atkins
2da15f987f LibWeb: Use new StyleValue parsing for list-style 2023-05-25 06:36:10 +02:00
Sam Atkins
7386ed7cfb LibWeb: Use new StyleValue parsing for content 2023-05-25 06:36:10 +02:00
Sam Atkins
c8626f2294 LibWeb: Use new StyleValue parsing for font and font-family 2023-05-25 06:36:10 +02:00
Sam Atkins
100adffdfb LibWeb: Use new StyleValue parsing for flex-flow 2023-05-25 06:36:10 +02:00
Sam Atkins
5d8b01ad04 LibWeb: Use new StyleValue parsing for border and its sided versions 2023-05-25 06:36:10 +02:00
Sam Atkins
91c9d10a78 LibWeb: Use new StyleValue parsing for flex
To make this work, we also add `none` as a valid identifier for `flex`.
(This is correct, we just didn't need it before.)
2023-05-25 06:36:10 +02:00
Sam Atkins
021fd15434 LibWeb: Use new StyleValue parsing for background-size 2023-05-25 06:36:10 +02:00
Sam Atkins
8e34bdc123 LibWeb: Use new StyleValue parsing for background-repeat 2023-05-25 06:36:10 +02:00
Sam Atkins
a0ec05ef81 LibWeb: Use new StyleValue parsing for background-position[-x,-y] 2023-05-25 06:36:10 +02:00
Sam Atkins
b0fe07cba3 LibWeb: Use new StyleValue parsing for background 2023-05-25 06:36:10 +02:00
Sam Atkins
d90ad19201 LibWeb: Use new StyleValue parsing for "simple" properties
That is, properties that don't have a bespoke parsing function.
2023-05-25 06:36:10 +02:00
Sam Atkins
bcacc2357e LibWeb: Implement smarter CSS StyleValue parsing
We know what types and identifiers a property can accept, so we can use
that information to only parse things that can be accepted. This solves
some awkward ambiguity problems that we have now or will face in the
future, including:

- Is `0` a number or a length with no unit?
- Is `3.5` a number or a ratio?
- Is `bottom` an identifier, or a custom-ident?

Two CSS Parser methods are introduced here:

`parse_css_value_for_property()` attempts to parse a StyleValue that the
property can accept, skipping any types that it doesn't want.

`parse_css_value_for_properties()` does the same, but takes multiple
PropertyIDs and additionally returns which one the parsed StyleValue is
for. This is intended for parsing shorthands, so you can give it a list
of longhands you haven't yet parsed.

Subsequent commits will actually use these new methods.
2023-05-25 06:36:10 +02:00
Sam Atkins
da4b2d9ca3 LibWeb: Cache initial property values when parsing background
Previously we were looking these up once per background layer. Let's not
do that. :^)
2023-05-25 06:36:10 +02:00
Sam Atkins
aad2f0963f LibWeb: Teach the CSS parser about extra color keywords
All of these identifiers can be treated as a color, so let's make sure
the parser understands that.
2023-05-25 06:36:10 +02:00
Sam Atkins
465ecf37c2 LibWeb: Make property_id_from_string() return Optional 2023-05-25 06:36:10 +02:00
Sam Atkins
03613dc14d LibWeb: Make value_id_from_string() return Optional 2023-05-25 06:36:10 +02:00
Sam Atkins
9b61f79eae LibWeb: Generate property_accepts_[identifier/type]() functions
These will be used to parse StyleValues more intelligently.
2023-05-25 06:36:10 +02:00
Sam Atkins
6f3e48db57 LibWeb: Fill in some missing property data and bodge extra types
We don't yet have generic parsing support for `<filter-value-list>` or
`<paint>`, so listing them here confuses the new StyleValue parsing code
I'm working on. For now, let's skip `<filter-value-list>` since it's
only used in one pkace which manually parses it, and list the parts of
`<paint>` instead which are taken from here:
https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint
2023-05-25 06:36:10 +02:00
Sam Atkins
5533413061 LibWeb: Remove "Invalid" StyleValue type
We never actually use this, we always initialize StyleValues with a
proper type.
2023-05-25 06:36:10 +02:00
kleines Filmröllchen
3c212c8535 AK: Remove Duration::now_monotonic
This is the end of absolute time support in Duration. :^)
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
fc5cab5c21 Everywhere: Use MonotonicTime instead of Duration
This is easily identifiable by anyone who uses Duration::now_monotonic,
and any downstream users of that data.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
b2e7b8cdff AK: Introduce MonotonicTime
This class takes on the duties of CLOCK_MONOTONIC, a time without a
defined reference point that always increases. This informs some
important design decisions about the class API: MonotonicTime cannot be
constructed from external time data, except as a computation based on
other monotonic time, or the current monotonic time. Importantly, there
is no default constructor, since the reference point of monotonic time
is unspecified and therefore without meaning as a default.

The current use of monotonic time (via Duration) includes some potential
problems that may be caught when we move most to all code to
MonotonicTime in the next commit.

The API restrictions have one important relaxation:
Kernel::TimeManagement is allowed to exchange raw time data within
MonotonicTime freely. This is required for the clock-agnostic time
accessors for timeouts and syscalls, as well as creating monotonic time
data from hardware in the first place.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
69e27169c4 AK: Remove now-unused Duration methods
These are not applicable to Duration, since it's not a timestamp class.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
effcd080ca Userland: Remove remaining users of Duration::now_realtime()
This is a clear sign that they want to use a UnixDateTime instead.

This also adds support for placing durations and date times into SQL
databases via their millisecond offset to UTC.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
82c681e44b LibTimeZone+Userland: Change timezone functions to use UnixDateTime
This incurs a whole host of changes in, among others, JavaScript Intl
and Date.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
939600d2d4 Kernel: Use UnixDateTime wherever applicable
"Wherever applicable" = most places, actually :^), especially for
networking and filesystem timestamps.

This includes changes to unzip, which uses DOSPackedTime, since that is
changed for the FAT file systems.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
c1323febc2 AK: Introduce UnixDateTime
This is a generic wrapper for a time instant relative to the unix epoch,
and does not account for leap seconds. It should be used in place of
Duration in most current cases.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
0dfcaf1389 AK: Make Duration arithmetic constexpr
This is a trivial change, and since this batch of commits will make a
large-scale rebuild necessary anyways, it seems sensible. The feature is
useful for e.g. building compound constant durations at compile time in
a readable way.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
213025f210 AK: Rename Time to Duration
That's what this class really is; in fact that's what the first line of
the comment says it is.

This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
2023-05-24 23:18:07 +02:00