Commit graph

6602 commits

Author SHA1 Message Date
Idan Horowitz
84b028bd71 LibJS: Add Temporal.Instant.prototype.round()
As well as the required Abstract Operations.
2021-07-12 19:05:17 +01:00
Idan Horowitz
75d1ffea00 LibCrypto: Add the >= operator to UnsignedBigInteger 2021-07-12 19:05:17 +01:00
Idan Horowitz
01c731aa59 LibJS: Add the GetOptionsObject & GetOption Temporal AbstractOperations
These are used by any Temporal method that accepts an options object.
2021-07-12 19:05:17 +01:00
Idan Horowitz
2382f67e0b LibJS: Add Temporal.Instant.prototype.equals() 2021-07-12 19:05:17 +01:00
Idan Horowitz
84403ab423 LibJS: Add Temporal.Instant.from() 2021-07-12 19:05:17 +01:00
Idan Horowitz
33cf6274e8 LibJS: Add Temporal.Instant.compare() 2021-07-12 19:05:17 +01:00
Idan Horowitz
b816037739 LibJS: Add the ToTemporalInstant Abstract Operation & its requirements
This is Abstract Operation is required for the majority of
InstantConstructor's and InstantPrototype's methods.

The implementation is not entirely complete, (specifically 2 of the
underlying required abstract operations, ParseTemporalTimeZoneString
and ParseISODateTime are missing the required lexing, and as such are
TODO()-ed) but the majority of it is done.
2021-07-12 19:05:17 +01:00
Idan Horowitz
141c46feda AK: Add a DateTimeLexer
This is an AK::GenericLexer that exposes helper methods for parsing
date and time related literals (years, months, days, hours, minutes,
seconds, fractional seconds & more)
2021-07-12 19:05:17 +01:00
Karol Kosek
b2daaca5ee HackStudio: Activate window only on file drop 2021-07-12 20:02:15 +02:00
Karol Kosek
d7f0472b25 SoundPlayer: Activate window only on file drop 2021-07-12 20:02:15 +02:00
Karol Kosek
e7fbd48ed9 ImageViewer: Activate window only on file drop 2021-07-12 20:02:15 +02:00
Karol Kosek
7f418a5c6a HexEditor: Accept file drops 2021-07-12 19:50:58 +02:00
Ariel Don
4eba921d48 ls: Add option to list subdirectories recursively
List subdirectories encountered using -R or --recursive flags with ls.
2021-07-12 19:15:19 +04:30
Ariel Don
3289b6a887 LibCore: Implement File::is_link()
It was already possible to check if a path was a directory or a device.
Now, it is possible to check if a path is a link in a similar manner.
2021-07-12 19:15:19 +04:30
Andrew Kaster
2af591267c LibWasm: Adjust signed integer operations to avoid UB
Perform signed integer shifts, addition, subtraction, and rotations
using their corresponding unsigned type. Additionally, mod the right
hand side of shifts and rotations by the bit width of the integer per
the spec. This seems strange, but the spec is clear on the desired
wrapping behavior of arithmetic operations.
2021-07-12 18:42:45 +04:30
Ali Mohammad Pur
d74eca78aa LibWasm: Skip initializing active empty data sections 2021-07-12 18:42:45 +04:30
Ali Mohammad Pur
65355c388b LibWasm: Use AK::StackInfo to track stack size
This way, we can make sure that it doesn't overflow when ASAN is
enabled.
2021-07-12 18:42:45 +04:30
Andrew Kaster
f7c7954314 LibCore: Tolerate misaligned addresses in struct hostent
macOS's C library is not a good neighbor and doesn't ensure that
the entry in struct hostent's h_addr_list are aligned properly for
a char const*. In Socket::connect, use ByteReader instead of a c-style
cast to work around this possible misalignment.
2021-07-12 18:42:45 +04:30
Brandon van Houten
19d34414bc Utilities: Make less accept 'page up' and 'page down' keys 2021-07-12 16:10:01 +02:00
Karol Kosek
f99507bf02 LibGUI: Ignore drop events by default
Before this change, parent widgets such as Buttons or Labels
were stealing drop events their parents.

I noticed it during drag-n-dropping files into visualization widgets
in Sound Player (which takes practically the entire application size
and gave impression that drop events weren't supported in the app
at all).
2021-07-12 15:59:33 +02:00
LuK1337
d940f7ba4f LibGUI: Use wrapped text rect for paint invalidation
This fixes an issue where after anything past first line would not get
invalidated after unhovering an icon.
2021-07-12 15:59:16 +02:00
Gunnar Beutner
cbdc7f9e41 UserspaceEmulator: Fix stack for new processes
Fixes #8646.
2021-07-12 12:27:13 +02:00
Andrew Kaster
f26d4e1d90 IPCCompiler: Use GENERATE_DEBUG from AK/Debug instead of custom defines
The IPCCompiler was using GENERATE_DEBUG_CODE, which was missing from
AK/Debug.h.in, and plain old DEBUG. Let's just use the one that
was already in the debug header, but unused.
2021-07-12 12:26:52 +02:00
Andrew Kaster
6ba87a6b5e LibC: Use correct macro to disable assert()
The C standard doesn't say anything about DEBUG, just NDEBUG :^)
2021-07-12 12:26:52 +02:00
Karol Kosek
67e3daa679 Breakout: Only paint areas that needs to be updated 2021-07-12 12:26:15 +02:00
Andreas Kling
2e3df52862 Revert "LibThreading: Fix BackgroundAction result use-after-free"
This reverts commit b2e6088bff.

This was a speculative fix that ended up not fixing the issue.
2021-07-12 11:29:37 +02:00
LuK1337
ac78f1e812 TaskbarWindow: Redraw start button when default font changes 2021-07-12 11:08:09 +02:00
LuK1337
8992271c5c LibGUI: Redraw widgets when default font changes 2021-07-12 11:08:09 +02:00
LuK1337
b40d771512 LibGUI: Add FontsChanged event and deliver it to windows and widgets 2021-07-12 11:08:09 +02:00
Maurice Hieronymus
dfc33cd412 HackStudio: Disable debug specific context entries
Context menu entries like evaluate expression and
move execution to line action should only be enabled
when a debug session is running. Otherwise they should
be disabled.
2021-07-12 00:47:04 +02:00
Maurice Hieronymus
488d0722bd HackStudio: Disable run button while debugging
This commit disables the run button while we
are in debug mode. Otherwise the stop button
gets disabled when we run the program while
we are in debug mode. This would prevent us
from exiting the debug mode.
2021-07-12 00:47:04 +02:00
Sam Atkins
86994336a7 LibWeb: Correct parsing invalid list of declarations
We were only discarding at most one token when a declaration is
invalid, when we should discard all until we see a ; or EOF.
2021-07-11 23:19:56 +02:00
Sam Atkins
c249fbd17c LibWeb: Correct escape handling in CSS Tokenizer
Calling is_valid_escape_sequence() with no arguments hides what it
is operating on, so I have removed that, so that you must explicitly
tell it what you are testing.

The call from consume_a_token() was using the wrong tokens, so it
returned false incorrectly. This was resulting in corrupted output
when faced with this code from Acid2. (Abbreviated)

```css
.parser { error: \}; }
.parser { }
```
2021-07-11 23:19:56 +02:00
Sam Atkins
e381ca258f LibWeb: Add more logging to CSS parser 2021-07-11 23:19:56 +02:00
Sam Atkins
9cfbc07c24 LibWeb: Implement CSS::Parse::parse_nth_child_pattern()
This is a modified copy of the code from Selector.cpp, to work on a
TokenStream instead of a String.
2021-07-11 23:19:56 +02:00
Sam Atkins
cf333574ac LibWeb: Convert StyleFunctionRule.m_values to ComponentValues
The input is ComponentValues, and the output is too, so storing as
a String in the middle was inefficient and unnecessary.
2021-07-11 23:19:56 +02:00
Sam Atkins
fabc09a593 LibWeb: Increase clarity with CSS token debug logging
Had to adjust some places that were using Token.to_string() for
non-debug-logging purposes. Changed its name to to_debug_string()
to make the usage clearer.
2021-07-11 23:19:56 +02:00
Sam Atkins
e5ac5e1fab LibWeb: Fix CSS attribute and ID selector parsing
There were several crashes here from out-of-bounds memory access.
2021-07-11 23:19:56 +02:00
Sam Atkins
78d191554a LibWeb: Remove non-compliant whitespace stripping in CSS Parser 2021-07-11 23:19:56 +02:00
Sam Atkins
7e4f75c78c LibWeb: Fix whitespace handling in CSS selectors
Whitespace marks the end of a compound-selector, no matter where
it occurs. `check_for_eof_or_whitespace()` reconsumes the whitespace
token for convenience.
2021-07-11 23:19:56 +02:00
Sam Atkins
57f6d86996 LibWeb: Implement remaining CSS parse_as...() entry points 2021-07-11 23:19:56 +02:00
Sam Atkins
65fe3895e6 LibWeb: Enabling @import in new CSS parser 2021-07-11 23:19:56 +02:00
Sam Atkins
6b6bf4a0aa LibWeb: Implement CSS::parse_css_value()
A lot of this is not spec-compliant and copied from the old parser.
In future PRs, we can revise it.
2021-07-11 23:19:56 +02:00
Sam Atkins
c91c00f587 LibWeb: Remove unnecessary CSS:: namespace from CSS Parser code
It's feeling unwieldy having it everywhere.
2021-07-11 23:19:56 +02:00
Sam Atkins
28e8bb9b1d LibWeb: Convert style declarations and at rules into CSSRules 2021-07-11 23:19:56 +02:00
Sam Atkins
2c84379846 LibWeb: Add accessors to CSS::DeclarationOrAtRule 2021-07-11 23:19:56 +02:00
Sam Atkins
6d14791c40 LibWeb: Use TokenStream in CSS Parser
Each method can either be called with a TokenStream, or with no
arguments to replicate the previous behaviour.
2021-07-11 23:19:56 +02:00
Sam Atkins
b7116711bf LibWeb: Add TokenStream class to CSS Parser
The entry points for CSS parsing in the spec are defined as accepting
any of a stream of Tokens, or a stream of ComponentValues, or a String.
TokenStream is an attempt to reduce the duplication of code for that.
2021-07-11 23:19:56 +02:00
Sam Atkins
6c03123b2d LibWeb: Give CSS Token and StyleComponentValueRule matching is() funcs
The end goal here is to make the two classes mostly interchangeable, as
the CSS spec requires that the various parser algorithms can take a
stream of either class, and we want to have that functionality without
needing to duplicate all of the code.
2021-07-11 23:19:56 +02:00
Sam Atkins
9c14504bbb LibWeb: Rename CSS::Token::TokenType -> Type 2021-07-11 23:19:56 +02:00