Commit Graph

28282 Commits

Author SHA1 Message Date
Linus Groh
1a7136b37a LibWeb: Return undefined from event handler setters, not an empty value 2021-09-24 13:19:13 +02:00
Linus Groh
a1a164e6b8 LibWeb: Return undefined from generated setters, not an empty value
These now crash as VM::call() uses ThrowExceptionOr<T>, which refuses to
hold an empty JS::Value as its non-exception result.
We only need to return an empty value when should_return_empty() says
so for the return value of throw_dom_exception_if_needed().

Co-authored-by: Luke Wilde <lukew@serenityos.org>
2021-09-24 12:57:04 +02:00
Liav A
09bdb00eb0 Ports: Remove unnecessary patch from the neofetch port 2021-09-24 10:48:30 +02:00
Eric Seifert
01a06dde0e Ports: Add Ruby 3.0.2 2021-09-24 10:04:47 +02:00
Linus Groh
32932f83be LibJS: Rename {Abstract,Typed => Loosely,Strictly}{Equals,Inequals}
This affects the AST's BinaryOp enum as well as the Bytecode's
ENUMERATE_BYTECODE_OPS and JS_ENUMERATE_COMMON_BINARY_OPS macros.
2021-09-24 09:13:57 +02:00
Linus Groh
facbe32fcd LibJS: Rename abstract_relation() to is_less_than()
This got turned into a proper AO with a new name recently.

See: https://github.com/tc39/ecma262/commit/587adc0
2021-09-24 09:13:57 +02:00
Linus Groh
580a7e0f7c LibJS: Rename abstract_eq() to is_loosely_equal()
This got turned into a proper AO with a new name recently.

See: https://github.com/tc39/ecma262/commit/c7d6d1c
2021-09-24 09:13:57 +02:00
Linus Groh
c7ff89891c LibJS: Rename strict_eq() to is_strictly_equal()
This got turned into a proper AO with a new name recently.

See: https://github.com/tc39/ecma262/commit/19d7ca4
2021-09-24 09:13:57 +02:00
Liav A
bc5a04f798 Base: Fix typo in boot_parameters(7) manual page 2021-09-24 03:55:28 +00:00
Liav A
c8c94aa13d Base: Remove mentioned pci_ecam per-device option from boot_paramters(7)
This option was removed and can't be used anymore.
2021-09-24 03:55:28 +00:00
Monroe Clinton
a59010bd97 Spreadsheet: Add missing examples 2021-09-24 04:53:57 +03:30
Idan Horowitz
5f80d8245d LibJS: Close iterator on throw completion in Array.from
This regressed in #10190
2021-09-24 02:28:17 +03:00
Idan Horowitz
99bc429f3f LibJS: Add missing exception checks to {Array, TypedArray}.from() 2021-09-24 02:28:17 +03:00
Idan Horowitz
ee825d6d9e LibJS: Convert get_method to ThrowCompletionOr 2021-09-23 23:59:13 +03:00
Idan Horowitz
ab594e5f2f LibJS: Convert Value::invoke and VM::call to ThrowCompletionOr 2021-09-23 23:59:13 +03:00
Idan Horowitz
a90107b02a LibJS: Convert is_regexp to ThrowCompletionOr 2021-09-23 23:59:13 +03:00
Idan Horowitz
1db7e096e2 LibJS: Switch is_array to ThrowCompletionOr 2021-09-23 23:59:13 +03:00
Brian Gianforcaro
0b9e633482 Meta: Upgrade sonar scanner to latest 4.6.2.2475 release
I didn't realize there was a new release, as it wasn't posted in the
Sonar Cloud Documentatoin, but was tagged on the github project page.

See: https://github.com/SonarSource/sonar-scanner-cli/releases
2021-09-23 20:37:37 +00:00
Jelle Raaijmakers
37b5baf9ff Ports: Build PHP-FPM instead of CGI 2021-09-23 18:51:21 +02:00
Jelle Raaijmakers
9a6283c524 Kernel: Define PT_READ_I and PT_READ_D
Looking at how these two constants are commonly used in other systems,
we should be able to mimic their behavior using our PT_PEEK constant.

For example, see:
https://man.netbsd.org/NetBSD-6.0.1/i386/ptrace.2
2021-09-23 18:51:21 +02:00
Jelle Raaijmakers
380c42c405 LibC: Add getpriority() and setpriority() stubs
Expected behavior left as a FIXME is outlined here:
https://pubs.opengroup.org/onlinepubs/7908799/xsh/getpriority.html
2021-09-23 18:51:21 +02:00
Jelle Raaijmakers
a6539cc031 LibC: Add chroot() stub
Expected behavior left as a FIXME is described here:
https://pubs.opengroup.org/onlinepubs/7908799/xsh/chroot.html

It is marked as LEGACY but still used in projects such as PHP.
2021-09-23 18:51:21 +02:00
Jelle Raaijmakers
6f4fbd59d9 Ports: Update PHP to version 8.0.10 2021-09-23 18:51:21 +02:00
Jelle Raaijmakers
36a7091531 Ports: Remove the now superfluous PHP network patch 2021-09-23 18:51:21 +02:00
Tobias Christiansen
0ccde5417b LibWeb: Don't assume the parent is BFC in the IFC 2021-09-23 17:48:11 +02:00
Tobias Christiansen
4560a8b83f LibWeb: Flexbox: Use InlineFormattingContext when needed
Previously any children would be layout using a BlockFormattingContext.
Now we at least differentiate between IFC and BFC if the sizes in
question are not constrained by other things.
2021-09-23 17:48:11 +02:00
Tobias Christiansen
54013ffbe0 LibWeb: Proritize FlexFormattingContext when display: flex is specified
An item with display: flex and overflow: hidden would've caused a
BlockFormattingContext before.
2021-09-23 17:48:11 +02:00
Sam Atkins
e0a727bc76 LibWeb: Remove type checking from set_property_expanding_shorthands()
Now that the Parser checks that StyleValues are valid, we don't need to
do the checks here, since any value here is guaranteed to be acceptable.
2021-09-23 17:47:40 +02:00
Sam Atkins
f574f538d2 LibWeb: Use property_accepts_value() for parsing text-decoration 2021-09-23 17:47:40 +02:00
Sam Atkins
4bc9b9eaaa LibWeb: Use property_accepts_value() for overflow parsing 2021-09-23 17:47:40 +02:00
Sam Atkins
85254ada94 LibWeb: Fix auto conversion to identifier
Calling `is_identifier()` here was wrong, since it just means you can
get an Identifier from it. This meant that an `auto` LengthStyleValue
would return true, then it would get `static_cast` to the wrong class,
and return a garbage value.

Basically, I really need to tidy up the API for StyleValue, so it's
clear whether `is_foo()` means the object is a `FooStyleValue`, or it
can just return a `foo` value.
2021-09-23 17:47:40 +02:00
Sam Atkins
b08094bccc LibWeb: Use property_accepts_value() for list style parsing 2021-09-23 17:47:40 +02:00
Sam Atkins
dcf70ab821 LibWeb: Use property_accepts_value() for font parsing 2021-09-23 17:47:40 +02:00
Sam Atkins
b927972da7 LibWeb: Add range-checking to property_accepts_value()
For `number` and `integer` types, you can add a range afterwards to add
a range check, using similar syntax to that used in the CSS specs. For
example:

```json
"font-weight": {
  ...
  "valid-types": [
    "number [1,1000]"
  ],
  ...
}
```

This limits any numbers to the range `1 <= n <= 1000`.
2021-09-23 17:47:40 +02:00
Sam Atkins
e262596ee1 LibWeb: Use property_accepts_value() for parsing flexbox properties 2021-09-23 17:47:40 +02:00
Sam Atkins
37e69fb286 LibWeb: Use property_accepts_value() when parsing borders 2021-09-23 17:47:40 +02:00
Sam Atkins
5213760e4b LibWeb: Use property_accepts_value() for background parsing
We also get rid of `is_background_{image,repeat}()` since they're no
longer needed. :^)
2021-09-23 17:47:40 +02:00
Sam Atkins
35eb8b0dc2 LibWeb: Add better debug logging for CSS parsing errors
Hidden behind `CSS_PARSER_DEBUG`, so I won't drive everyone else crazy.
:^)
2021-09-23 17:47:40 +02:00
Sam Atkins
5d6a4c5fc2 LibWeb: Check parsed CSS values with property_accepts_value()
This brings us a few nice benefits:

- We only generate a `StyleValueList` for properties that accept
  multiple values.
- We reject declarations that have too many values.
- We check the type of each value that is parsed, to make sure it's
  acceptable to the property.

Probably there are some regressions here, since this is

Later, we can also replace many of the `is_foo()` functions and lambas
inside the Parser with more calls to `property_accepts_value()`. Also we
can remove some checks when resolving styles, since only valid types of
values will get to that point. But one step at a time. :^)
2021-09-23 17:47:40 +02:00
Sam Atkins
11d3098f40 LibWeb: Generate property_accepts_value() function :^)
Previously, we have not been validating the values for CSS declarations
inside the Parser. This causes issues, since we should be discarding
invalid style declarations, so that previous ones are used instead. For
example, in this code:

```css
.foo {
  width: 2em;
  width: orange;
}
```

... the `width: orange` declaration overwrites the `width: 2em` one,
even though it is invalid. According to the spec, `width: orange` should
be rejected at parse time, and discarded, leaving `width: 2em` as the
resulting value.

Many properties (mostly shorthands) are parsed specially, and so they
are already rejected if they are invalid. But for simple properties, we
currently accept any value. With `property_accepts_value()`, we can
check if the value is valid in `parse_css_value()`, and reject it if it
is not.
2021-09-23 17:47:40 +02:00
Sam Atkins
633ede5c6c LibWeb: Add valid-value information to Properties.json 2021-09-23 17:47:40 +02:00
Sam Atkins
57168150aa LibWeb: Add several CSS identifiers to the list
These ones are needed by the value-checking system, coming next.
2021-09-23 17:47:40 +02:00
Sam Atkins
603f611ceb LibWeb: Sort StyleValue enums alphabetically
I was finding it impossible to find them.
2021-09-23 17:47:40 +02:00
Sam Atkins
4a1dbb4f36 LibWeb: Move color identifier checking to StyleValue::is_color()
This allows us to perform this check outside of the CSS Parser.
2021-09-23 17:47:40 +02:00
Sam Atkins
a1bc89b814 LibWeb: Generate property_maximum_value_count()
This will allow the CSS Parser to check if a property has been give too
many arguments, and if so, reject it as invalid.
2021-09-23 17:47:40 +02:00
Sam Atkins
e40ea819d9 LibWeb: Prevent special-case CSS property parsing fallback
We don't want a property like `background` to fall back to parsing as a
single value or StyleValueList if `parse_background_style_value()`
fails. We just want it to fail.
2021-09-23 17:47:40 +02:00
Eric Seifert
8924b1f532 Kernel: Allow PROT_NONE in mmap and mprotect for stack regions
To allow for userspace guard pages (ruby uses this).
Redundant since serenity creates them automatically,
but should be allowed anyway.
2021-09-23 04:14:41 +00:00
Brian Gianforcaro
925f21353e Meta: Exclude LibWasm Parser.cpp from Sonar Cloud Static Analysis
We need to exclude this file from analysis for now, as there is a bug in
the sonar-runner tool where it crashes when trying to understand the use
of AK::Variant in LibWasm/Parser/Parser.cpp

See #10122 for details + link to the bug report to Sonar Cloud.
2021-09-23 01:07:11 +02:00
Brian Gianforcaro
eddccf11da Meta: Remove unused caching from Sonar Cloud configuration
I was experimenting with using caching while doing the initial prototype
of the Sonar Cloud workflow. However the cache size for the static
analysis data ended up being large enough that it would put us over the
git hub actions limit. Given that we currently only run this pipeline
once a day, it seems reasonable to just remove caching.

If in the future we decide to run the pipeline on every PR, caching
would become crucial as the current un-cached analysis time is around
1 hour and 50 minutes. If we did this we would need to move the pipeline
to Azure DevOps where we have effectively infinite cache available.
2021-09-23 01:07:11 +02:00
Karol Kosek
620e4fd0d2 WebContent: Pass an empty bitmap object if the pointer is null
Prior this commit we were always dereferencing the image bitmap pointer,
even if it was null, which resulted in a crash when trying to open
the context menu when an image wasn't loaded.

Closes: #10178
2021-09-22 22:10:11 +02:00