Commit graph

23779 commits

Author SHA1 Message Date
Gunnar Beutner 7f6e148e17 Documentation: Shuffle around systems in the build instruction docs
The crowd has spoken and it's clear they want... Windows and Arch Linux.
2021-07-12 12:28:01 +02:00
Gunnar Beutner cbdc7f9e41 UserspaceEmulator: Fix stack for new processes
Fixes #8646.
2021-07-12 12:27:13 +02:00
Andrew Kaster 1455604b13 AK+Meta: Remove unused AUTOCOMPLETE_DEBUG flag 2021-07-12 12:26:52 +02:00
Andrew Kaster ca920ba082 Meta+Documentation: Remove unused -DDEBUG from build 2021-07-12 12:26:52 +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
Tom 026ffa343d Kernel: Allow Lock to block from BlockCondition
This enables the Lock class to block a thread even while the thread is
working on a BlockCondition. A thread can still only be either blocked
by a Lock or a BlockCondition.

This also establishes a linked list of threads that are blocked by a
Lock and unblocking directly unlocks threads and wakes them directly.
2021-07-12 11:27:18 +02:00
Tom d9fb93c5ce Kernel: Fix deadlock cancelling timer
It's possible that a timer may have been queued to be executed by
the timer irq handler, but if we're in a critical section on the
same processor and are trying to cancel that timer, we would spin
forever waiting for it to be executed.
2021-07-12 11:27:18 +02:00
Tom 6938be00f1 Kernel: Initialize threading and process management earlier
This re-arranges the order of how things are initialized so that we
try to initialize process and thread management earlier. This is
neccessary because a lot of the code uses the Lock class, which really
needs to have a running scheduler in place so that we can properly
preempt.

This also enables us to potentially initialize some things in parallel.
2021-07-12 11:27:18 +02:00
Andreas Kling c2792212f4 Kernel: Remove "supervisor" bit from PhysicalPage
Instead of each PhysicalPage knowing whether it comes from the
supervisor pages or from the user pages, we can just check in both
sets when freeing a page.

It's just a handful of pointer range checks, nothing expensive.
2021-07-12 11:09:42 +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
Tom 9318d9f284 Kernel: Fix allocating VMObject from page array
The VMObject constructor takes the size in bytes.

Fixes #8670
2021-07-12 10:45:53 +02:00
Brian Gianforcaro 84b4b9447d Kernel: Move new process registration out of Space spinlock scope
There appears to be no reason why the process registration needs
to happen under the space spin lock. As the first thread is not started
yet it should be completely uncontested, but it's still bad practice.
2021-07-12 10:20:21 +02:00
Tom 60a559af7e Kernel: Avoid unnecessary context switch when no other thread is ready
If no other thread is ready to be run we don't need to switch to the
idle thread and wait for the next timer interrupt. We can just give
the thread another timeslice and keep it running.
2021-07-12 10:19:31 +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
Gunnar Beutner 7d38057705 Meta: Only use -display sdl for multiple screens when it's available 2021-07-11 23:27:43 +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
Sam Atkins 8671d79ba4 LibWeb: Add direct StyleComponentValueRule constructors
Rather than passing a ComponentType, and then manually modifying the
data fields, we now create them initialized.

The constructor that takes a Token is intentionally left implicit,
so that we can automatically convert when using the TokenStream later.
2021-07-11 23:19:56 +02:00
Sam Atkins 82d12b170a LibWeb: Merge CSS Parser's QualifiedStyleRule and AtStyleRule
AtStyleRule being a subclass of QualifiedStyleRule was causing
problems when trying to distinguish between them. Combining them
and then distinguishing between them with a Type enum makes that
check simpler, and is in line with how similar checks are done
elsewhere in the parser.
2021-07-11 23:19:56 +02:00
Sam Atkins a6085e19ae LibWeb: Implement CSS selector parsing entry points
They're still using the same parsing code, so there's a lot of room
for improvement, but it's good for now.
2021-07-11 23:19:56 +02:00
Sam Atkins 004ae453d1 LibWeb: Add context to new CSS parser, and deprecate the old one
The new one is the same as the old one, just in the new Parser's
source files. This isn't the most elegant solution but it seemed
like the best option. And it's all temporary, after all.
2021-07-11 23:19:56 +02:00
Sam Atkins 390cc30a97 LibWeb: Bring CSS::Parser::parse_as_comma_separated_list...() to spec
Previous implementation was returning everything in a single Vector,
when what we really want is a Vector of Vectors, one for each comma-
separated part of the list.
2021-07-11 23:19:56 +02:00
Sam Atkins 985ed47a38 LibWeb: Use EOF code point instead of Optional in CSS Tokenizer
Optional seems like a good idea, but in many places we were not
checking if it had a value, which was causing crashes when the
Tokenizer was given malformed input. Using an EOF value along with
is_eof() makes things a lot simpler.
2021-07-11 23:19:56 +02:00
Sam Atkins caff7fff94 LibWeb: Convert CSS::Parser methods to return desired types
This is very much stubbed out for now. Most notably is
Parser::convert_rule() where most of the conversion will happen
from the parser's internal rule classes to CSSRule and its children.
2021-07-11 23:19:56 +02:00
Sam Atkins f9ffa34622 LibWeb: Remove broken CSS:Parser::is_combinator()
A single DELIM token is only one character long, so the check for
a "||" DELIM didn't work. We now just do the check inline.
2021-07-11 23:19:56 +02:00
Sam Atkins 9115c23bd5 LibWeb: Fix greedy CSS Tokenizer whitespace parsing
Whitespace parsing was too greedy, consuming the first non-
whitespace character after it.
2021-07-11 23:19:56 +02:00
Sam Atkins 06fc099310 LibWeb: Fix Off-by-one error in CSS::Parser::next_token() 2021-07-11 23:19:56 +02:00