Commit Graph

29891 Commits

Author SHA1 Message Date
Sam Atkins
4d42915485 LibWeb: Ensure that CSS initial values are always valid :^)
First off, this verifies that an initial value is always provided in
Properties.json for each property.

Second, it verifies that parsing that initial value succeeds.

This means that a call to `property_initial_value()` will always return
a valid StyleValue. :^)
2021-11-10 21:58:14 +01:00
Sam Atkins
63aa399873 LibWeb: Allow none value for transform property
This is the initial value for `transform`. We already handle the value
later, we just were not parsing it.
2021-11-10 21:58:14 +01:00
Sam Atkins
11f0ece58f LibWeb: Add initial values for all CSS properties
It's a little verbose to repeat these in cases like the borders, but if
everything has an initial value, we can guarantee that
`property_initial_value()` will return something! :^)
2021-11-10 21:58:14 +01:00
Sam Atkins
ca3b86c922 LibWeb: Add initial values and longhands to background definition
There is no specified initial value, but `transparent` is equivalent to
setting all the background properties to their defaults.
2021-11-10 21:58:14 +01:00
Sam Atkins
1fa985b0a6 LibWeb: Correct initial values in Properties.json
- `align-items`: `normal` is the initial value in the CSS-ALIGN spec,
but `stretch` is in CSS-FLEXBOX. The FLEXBOX spec is the one we've
actually implemented elsewhere, and ALIGN adds new values with special
syntax, so it's not trivial to add it here.
- `border-spacing`: `0` is equivalent to `0px 0px` and we don't yet
parse the double-value syntax.
- `text-decoration-thickness`: Had the wrong value.
2021-11-10 21:58:14 +01:00
Idan Horowitz
a445deb205 LibJS: Remove left-over debug assertion from the Await AO 2021-11-10 18:11:26 +00:00
Idan Horowitz
d5f637fa21 LibJS: Do not parse async methods with a new line after the "async"
This was already checked in normal function expressions, but was
missing for Object Expressions.
2021-11-10 18:11:26 +00:00
Ben Wiederhake
ad5061bb7a Kernel: Make (f)statvfs report filesystem ID correctly 2021-11-10 16:13:10 +01:00
Ben Wiederhake
631447da57 Kernel: Fix TOCTOU in fstatvfs
In particular, fstatvfs used to assume that a file that was earlier
opened using some path will forever be at that path. This is wrong, and
in the meantime new mounts and new filesystems could take up the
filename or directories, leading to a completely inaccurate result.
This commit improves the situation:
- All filesystem information is now always accurate.
- The mount flags *might* be erroneously zero, if the custody for the
  open file is not available. I don't know when that might happen, but
  it is definitely not the typical case.
2021-11-10 16:13:10 +01:00
Tim Schumacher
26a48f3516 Ports: Use GNU patch instead of the OpenBSD version
The OpenBSD version is having some weird issues, so:

Reject OpenBSD, return to GNU.
2021-11-10 14:48:39 +01:00
Tim Schumacher
bd6c48f6ea Utilities: tar: Always create parent directory when extracting 2021-11-10 14:48:20 +01:00
Jan de Visser
3425730294 LibSQL: Implement table joins
This patch introduces table joins. It uses a pretty dumb algorithm-
starting with a singleton '__unity__' row consisting of a single boolean
value, a cartesian product of all tables in the 'FROM' clause is built.
This cartesian product is then filtered through the 'WHERE' clause,
again without any smarts just using brute force.

This patch required a bunch of busy work to allow for example the
ColumnNameExpression having to deal with multiple tables potentially
having columns with the same name.
2021-11-10 14:47:49 +01:00
Jan de Visser
87f4c1677b LibSQL: Relax assignment rules for Null Values
It should be possible to assign a Value of any type to a Value which
currently is Null.
2021-11-10 14:47:49 +01:00
Jan de Visser
1c50e9aadc LibSQL: Add current statement to the ExecutionContext
Because SQL is the craptastic language that it is, sometimes expressions
need to know details about the calling statement. For example the tables
in the 'FROM' clause may be needed to determine which columns are
referenced in 'WHERE' expressions. So the current statement is added
to the ExecutionContext and a new 'execute' overload on Statement is
created which takes the Database and the Statement and builds an
ExecutionContaxt from those.
2021-11-10 14:47:49 +01:00
Jan de Visser
7ea54db430 LibSQL: Add 'schema' and 'table' to TupleElementDescriptor
These are needed to distinguish columns from different tables with the
same column name in one and the same (joined) Tuple. Not quite happy
yet with this API; I think some sort of hierarchical structure would be
better but we'll burn that bridge when we get there :^)
2021-11-10 14:47:49 +01:00
Jan de Visser
c2c47fb9bb LibSQL: Add the 'extend' operation to the Tuple class
Tuple::extend is similar to the Vector method of the same name; it
concatenates a second Tuple to the current one.
2021-11-10 14:47:49 +01:00
Jan de Visser
f3a9d61891 LibSQL: Add SQL files to assist in troubleshooting
These files contain the same SQL statements as the similarly named tests
in Tests/LibSQL/TestSqlStatementExecution.cpp test suite. They can be
fed to the sql utility to assist in troubleshooting failing tests.
2021-11-10 14:47:49 +01:00
Ben Wiederhake
4512e89159 strace: Interpret errno codes for pointer-like return codes 2021-11-10 14:47:31 +01:00
Ben Wiederhake
81b6be4bf4 strace: Switch to new flag handler, support more flags
In particular, strace now supports all O_*, MSG_*, MAP_*, and PROT_*
flags, as well as a more context-dependent default value (e.g.
"PROT_NONE").
2021-11-10 14:47:31 +01:00
Ben Wiederhake
491ed375fc strace: Better support for bitflags, show unrecognized flags 2021-11-10 14:47:31 +01:00
Tim Schumacher
d1eb604896 CMake: Build serenity_lib libraries with a custom SONAME
This allows libraries and binaries to explicitly link against
`<library>.so.serenity`, which avoids some confusion if there are other
libraries with the same name, such as OpenSSL's `libcrypto`.
2021-11-10 14:42:49 +01:00
Tim Schumacher
46aa477b8f CMake: Remove unused serenity_shared_lib function 2021-11-10 14:42:49 +01:00
Tim Schumacher
9af5d1d7cd FileIconProvider: Add soname libraries to the icon list 2021-11-10 14:42:49 +01:00
Tim Schumacher
80cb44afae Everywhere: Move shared library checks into a common function
While we're at it, unify the various different conditions that are
scattered accross the codebase.
2021-11-10 14:42:49 +01:00
Tim Schumacher
31c634be5a LibCoredump: Restrict library name check when querying symbols
`object_name()` already returns the cleaned library name, and we
currently don't have any libraries with suffixes in /usr/lib, so we can
convert this to an `ends_with()` check.
2021-11-10 14:42:49 +01:00
Tim Schumacher
d350d2dfce Emulator: Restrict library name check when querying symbols
Libraries in /usr/lib currently only end in .so, so no contains() is
needed for now.
2021-11-10 14:42:49 +01:00
Tim Schumacher
6c6381408f Emulator: Use existing queried library name in load check
We already asked the region about what its library name is, and we also
use that value when maybe constructing a path, so let's make the check
use that as well.
2021-11-10 14:42:49 +01:00
Tim Schumacher
fc6f265155 Profiler: Use existing path split when mmapping libraries
We already extracted the `path` part of the segment name, so use that
for checking if the filename looks like a shared library.
2021-11-10 14:42:49 +01:00
Ben Wiederhake
b7e6118098 AK: Properly declare inheritance of Bitmap from BitmapView
All the read-only methods of Bitmap simply defer to BitmapView. Let's
make this relationship official by using class inheritance. This might
even shave off a few instructions, although any sufficiently optimizing
compiler probably already optimized them away.
2021-11-10 14:39:42 +01:00
Ben Wiederhake
bf7a2ff941 AK+Kernel: Make BitmapView read-only 2021-11-10 14:39:42 +01:00
Ben Wiederhake
850db15d66 Everywhere: Remove unused AK/Bitmap includes 2021-11-10 14:39:42 +01:00
Sam Atkins
96936d04d6 LibWeb: Parse background-size as part of background shorthand 2021-11-10 14:38:49 +01:00
Sam Atkins
67214e0b61 LibWeb: Parse background-size property 2021-11-10 14:38:49 +01:00
Sam Atkins
ae2a3bf185 LibWeb: Add BackgroundSizeStyleValue
There's nothing really background-size-specific about this, but since
there is no `<size>` value type defined in the CSS spec at this time,
and background-size is the only user of it, I think this name makes more
sense. But I'm not 100% convinced.
2021-11-10 14:38:49 +01:00
Sam Atkins
891dd46a17 LibWeb: Store Repeat values directly in BackgroundRepeatStyleValue
...as opposed to storing StyleValues, which we have to later check are
IdentifierStyleValues, which store identifiers that we can convert to
Repeat values later. It's fewer allocations, and we can't end up with
invalid values by mistake. :^)
2021-11-10 14:38:49 +01:00
Sam Atkins
901a990b1b LibWeb: Remove concept of CSS pseudo-properties
We don't need them any more, so they're gone. :^)
2021-11-10 14:38:49 +01:00
Sam Atkins
1e53768f1b LibWeb: Combine background-repeat-x/y pseudo-properties
While right now this doesn't save much complexity, it will do once we
care about multiple background layers per node. Then, having a single
repeat value per layer will simplify things.

It also means we can remove the pseudo-property concept entirely! :^)
2021-11-10 14:38:49 +01:00
Sam Atkins
5d0acb63ae LibWeb: Use BackgroundRepeatStyleValue in background shorthand
This is step 1 in removing the two `background-repeat-x/y`
pseudo-properties. Since adding the concept of compound StyleValues, we
don't need `background-repeat` to be split in two any more.
2021-11-10 14:38:49 +01:00
Sam Atkins
368595d850 Base: Add CSS background test page
Also organized the welcome page list slightly.
2021-11-10 14:38:49 +01:00
Sam Atkins
532f1e859d LibWeb: Parse background-clip and background-origin
Including as part of the `background` shorthand. :^)
2021-11-10 14:38:49 +01:00
Sam Atkins
018a4aa85c LibWeb: Parse background-attachment as part of background property 2021-11-10 14:38:49 +01:00
Sam Atkins
116a5fe5d0 LibWeb: Add background-position to background property
This required modifying the background-parsing code to use a
TokenStream, but that turned out to be pretty simple.
2021-11-10 14:38:49 +01:00
Sam Atkins
988a8ed3d8 LibWeb: Parse CSS background-position property
This is done a bit differently from other properties: using a
TokenStream instead of just a Vector of ComponentValues. The reason for
this is, we can then use call the same function when parsing the
`background` shorthand. Otherwise, we would have to know in advance how
many values to pass down, which basically would involve duplicating the
`background-position` parsing code inside `background`.

The StyleValue is PositionStyleValue, since it represents a
`<position>`: https://www.w3.org/TR/css-values-4/#typedef-position
Unfortunately, background-position's parsing is a bit different from
`<position>`'s, (background-position allows 3-value syntax and
`<position>` doesn't) so we'll need to come back and write a different
parsing function for that later.
2021-11-10 14:38:49 +01:00
Luke Wilde
5594a492f0 LibJS: Implement Temporal.ZonedDateTime.prototype.toJSON 2021-11-10 12:56:56 +00:00
Luke Wilde
6856b6168a LibJS: Implement Temporal.ZonedDateTime.prototype.toLocaleString 2021-11-10 12:56:56 +00:00
Luke Wilde
a9ad993e78 LibJS: Implement Temporal.ZonedDateTime.prototype.toString 2021-11-10 12:56:56 +00:00
Luke Wilde
dc72d416b2 LibJS: Implement the required AOs for ZonedDateTime stringifiers 2021-11-10 12:56:56 +00:00
Idan Horowitz
04253c3254 LibJS: Add tests for async functions and await expressions 2021-11-10 08:48:27 +00:00
Idan Horowitz
46dabf02ec LibJS: Add support for await expressions 2021-11-10 08:48:27 +00:00
Idan Horowitz
681787de76 LibJS: Add support for async functions
This commit adds support for the most bare bones version of async
functions, support for async generator functions, async arrow functions
and await expressions are TODO.
2021-11-10 08:48:27 +00:00