Commit graph

29056 commits

Author SHA1 Message Date
davidot
4c8090a45d LibJS: Use ClassFieldInitializerStatement for class fields
This is necessary as we might have to perform named evaluation with the
field name.
Ideally we would also skip some setup parts of the function like
function_declaration_instantiation however this would require bigger
changes to ECMAScriptFunctionObject.
2021-10-20 23:19:17 +01:00
davidot
7e8724db71 LibJS: Add support for the '#privateName in obj' expression 2021-10-20 23:19:17 +01:00
davidot
16cc82460f LibJS: Add parsing and evaluation of private fields and methods 2021-10-20 23:19:17 +01:00
davidot
c7a6572789 LibJS: Add private references 2021-10-20 23:19:17 +01:00
davidot
d94b5e511f LibJS: Add slot [[PrivateElements]] and related methods to Object 2021-10-20 23:19:17 +01:00
davidot
13ead80ee6 LibJS: Add PrivateEnvironment 2021-10-20 23:19:17 +01:00
davidot
eeb42c21d1 LibJS: Lex private identifiers, identifiers prefixed with a '#' 2021-10-20 23:19:17 +01:00
davidot
6b2accce31 LibJS: Add static initializers to classes 2021-10-20 23:19:17 +01:00
davidot
1245512c50 LibJS: Make class definition evaluation more spec like in ordering 2021-10-20 23:19:17 +01:00
Linus Groh
d3ef08217b LibJS: Remove ErrorType::FixmeAddAnErrorString
Just add a proper ErrorType the first time, it's not that hard. We can
always iterate on the message later.
2021-10-20 18:46:24 +01:00
Linus Groh
cf109533de LibJS: Add ErrorTypes for Promise ownKeys trap invariant violations 2021-10-20 18:46:24 +01:00
Linus Groh
ca09f20dcf LibJS: Add ErrorType for IterableToListOfType value type mismatch 2021-10-20 18:46:24 +01:00
Linus Groh
8feae81025 LibJS: Add ErrorType for duplicate global environment binding 2021-10-20 18:46:24 +01:00
Tom
1d4919bb81 Meta: Document anon user's password 2021-10-20 18:07:24 +02:00
Idan Horowitz
44555eb50a LibJS: Convert test-js/test-web/test-wasm to ThrowCompletionOr 2021-10-20 12:27:19 +01:00
Idan Horowitz
40eb3a39d4 LibJS: Rename define_native_function => define_old_native_function
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
2021-10-20 12:27:19 +01:00
Idan Horowitz
ca27e5eff5 LibJS: Convert NativeFunction callback to ThrowCompletionOr 2021-10-20 12:27:19 +01:00
Idan Horowitz
20163c0584 LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
2021-10-20 12:27:19 +01:00
Idan Horowitz
3355b52cca LibJS: Remove unused JS_{DECLARE,DEFINE}_NATIVE_{GETTER,SETTER} macros 2021-10-20 12:27:19 +01:00
Idan Horowitz
56e769e4ba LibJS: Replace usages of JS_{DECLARE, DEFINE}_NATIVE_GETTER
These macros are equivalent to JS_{DECLARE, DEFINE}_NATIVE_FUNCTION and
were only sometimes used, so let's just get rid of them altogether.
2021-10-20 12:27:19 +01:00
Ben Wiederhake
ae9b52e387 Meta: Enable header checking in CI 2021-10-20 09:20:18 +01:00
Ben Wiederhake
8de696bdd0 HeaderCheck: It checks some of your headers 2021-10-20 09:20:18 +01:00
Ben Wiederhake
dee26ca5cd LibWeb: Add missing headers 2021-10-20 09:20:18 +01:00
Ben Wiederhake
0a53cf2a07 LibJS: Add missing header in EnvironmentCoordinate.h 2021-10-20 09:20:18 +01:00
Ben Wiederhake
f53b80e04f LibC: Add missing header in search.h 2021-10-20 09:20:18 +01:00
Andreas Kling
989c0b23fe LibWeb: Use the correct initial value for the CSS 'align-items' property 2021-10-19 19:19:29 +02:00
Andreas Kling
ff45eb7fb1 LibWeb: Make computed opacity always available
No need to store opacity as Optional<float> as there's always a value
(and the default initial value is 1.)
2021-10-19 19:19:13 +02:00
Andreas Kling
07f15aa550 LibWeb: Make computed flex-grow and flex-shrink always available
These values are not allowed to be absent (auto/none/etc) so we don't
need to use Optional<float> for them. This simplifies some things.
2021-10-19 19:17:01 +02:00
Andreas Kling
19eda59359 LibWeb: Add FlexFormattingContext to the forwarding header 2021-10-19 19:14:59 +02:00
Andreas Kling
e6e00d2a4d LibWeb: Remove already-fixed FIXME in creates_block_formatting_context()
We're already creating a BFC for children of inline-flex boxes.
2021-10-19 19:14:11 +02:00
Andreas Kling
225a5f2fe6 LibWeb: Add fast_is<T>() for SVGBox and SVGPathBox 2021-10-19 19:13:58 +02:00
Sam Atkins
04c0c103e0 LibWeb: Distinguish between integer and number when checking StyleValues 2021-10-19 19:12:09 +02:00
Sam Atkins
78e57096e2 LibWeb: Distinguish between integer and float in NumericStyleValue
We have this information when parsing, and some properties specifically
only allow integers, so it makes sense to keep that around.
2021-10-19 19:12:09 +02:00
Sam Atkins
450b782c18 LibWeb: Distinguish between length and percentage values
Though most CSS properties accept either, some do not, so distinguishing
between them lets us catch some invalid values at parse time.
2021-10-19 19:12:09 +02:00
Linus Groh
3f311ec0ac LoginServer: Fix typo in --auto-login option value name 2021-10-19 17:58:04 +01:00
Nícolas F. R. A. Prado
72f1e23e6b ImageViewer: Use scaled image size when resizing window to fit it
When the image is flipped or rotated, the window is resized to ensure
that the image still fits in the frame. However, currently the original
bitmap rect is used, which doesn't take into account the scaling
factor. Fix this by using the scaled rect instead.
2021-10-19 18:24:20 +02:00
Timothy Flynn
05d7ac1193 LoginServer: Log in when the user presses the enter key 2021-10-19 18:19:33 +02:00
Timothy Flynn
204a091765 LibCore: Avoid buffer overrun when invoking crypt() with a SecretString
For example, consider the following SecretString construction:

    String foo = "foo";
    auto ss = SecretString::take_ownership(foo.to_byte_buffer());

The ByteBuffer created by to_byte_buffer() will not contain the NUL
terminator. Therefore, the value returned by SecretString::characters
will not be NUL-terminated either.

Currently, the only use of SecretString is to pass its character data to
crypt(), which requires a NUL-terminated string. To ensure this cannot
result in a buffer overrun, make SecretString append a NUL terminator to
its buffer if there isn't one already.
2021-10-19 18:19:33 +02:00
Timothy Flynn
4739982c66 LibCore: Change Account::set_password to take a SecretString
This matches the API of Account::authenticate. The only caller to this
API is the passwd utility, which already has the new password stored as
a SecretString.
2021-10-19 18:19:33 +02:00
Andreas Kling
fcff6b7160 LibWeb: Don't assume we hit a layout node when handling mousedown events
Regression from the introduction of CSS pointer-events in
ec43f7a2b0.
2021-10-19 12:53:22 +02:00
Luke Wilde
defe4d50ff LibWeb: Add Event.eventPhase constants 2021-10-19 10:00:26 +02:00
Idan Horowitz
545d403f6b LibJS: Convert Value operator AOs to ThrowCompletionOr 2021-10-18 23:06:11 +01:00
Idan Horowitz
48ac15758e LibJS: Convert is_loosely_equal() to ThrowCompletionOr 2021-10-18 23:06:11 +01:00
Idan Horowitz
b5e28410c5 LibJS: Convert is_less_than() to ThrowCompletionOr 2021-10-18 23:06:11 +01:00
Idan Horowitz
c15a3b0576 LibJS: Convert Value::get() to ThrowCompletionOr 2021-10-18 23:06:11 +01:00
Timothy Flynn
72b409a2f7 Base: Add a test page for the various element classList APIs 2021-10-18 23:33:56 +02:00
Timothy Flynn
14349f058a LibWeb: Implement the Element classList attribute
And ensure it is updated (if it exists) when the 'class' attribute is
changed.
2021-10-18 23:33:56 +02:00
Timothy Flynn
d24ae8063b LibWeb: Implement DOMTokenList for managing space-separated tokens lists
DOMTokenList is used as the return type of, e.g., the Element.classList
property.
2021-10-18 23:33:56 +02:00
Timothy Flynn
4d8320a49a LibWeb: Add initial support for IDL methods with variadic parameters
Adds support for methods whose last parameter is a variadic DOMString.
We constructor a Vector<String> of the remaining arguments to pass to
the C++ implementation.
2021-10-18 23:33:56 +02:00
Linus Groh
2fa9422b3b LibJS: Convert PrototypeObject::typed_this_value() to ThrowCompletionOr 2021-10-18 21:24:30 +01:00