Commit Graph

26179 Commits

Author SHA1 Message Date
Jean-Baptiste Boric
c87aa6d908 LibC: Fix sigsetjmp on i686
Calling sigprocmask() through the PLT requires setting the ebx register
to the address of the global offset table, otherwise chaos ensues. Also
the value of the ecx register was assumed to be preserved across that
function call despite the fact that it is caller-saved in the x86
calling convention.
2021-08-26 00:54:23 +02:00
Karol Kosek
04694ae682 ThemeEditor: Place menu quit action as the last item
No other applications put this action as the first item.
2021-08-26 00:51:40 +02:00
Ali Mohammad Pur
ae97241ded Base: Add a Game of Life WebAssembly demo 2021-08-26 00:51:30 +02:00
Ali Mohammad Pur
ba8e1c6f9f Base: Refer to WebAssembly as 'Wasm' and not 'WASM' 2021-08-26 00:51:30 +02:00
Ali Mohammad Pur
04e3965b09 LibWasm: Use Operators::BitShiftRight for i64.shru
Using a left-shift operator for a right shift operation is not exactly
the most correct action :P
2021-08-26 00:51:30 +02:00
Jesse Buhagiar
924d890bfe LibGL: Implement fog effect in Software Rasterizer
We support three of the possible fog modes, EXP, EXP2 and LINEAR.
2021-08-25 23:50:54 +04:30
Jesse Buhagiar
d73cc3d0eb LibGL: Implement glFogi 2021-08-25 23:50:54 +04:30
Jesse Buhagiar
f55d2a22af LibGL: Implement glFogf 2021-08-25 23:50:54 +04:30
Jesse Buhagiar
7f1cd54b80 LibGL: Implement glFogfv
This currently just sets the fog colour in the rasterizer.
2021-08-25 23:50:54 +04:30
Karol Kosek
ffa7da0ca5 LibWeb: Handle CSS "ch" length unit (mostly)
This isn't 100% spec complaint, as it should use glyph_height()
depending on what the value of the writing-mode is, but we haven't
implemented it yet, so I think it'll be good enough for now.

This can be tested in https://wpt.live/css/css-values/ch-unit-008.html
Other css-unit tests fail as:
- 001 shows an issue related to a renderer (looks to me like you can't
  pass a width and height property to a span -- adding `display: block`
  to it passes the test),
- 002-004 and 009-012 use mentioned writing-mode,
- 016-017 loads custom fonts, which we also don't support (yet).
2021-08-25 17:55:53 +02:00
Karol Kosek
a230524c46 HackStudio: Update the tree view cursor on editor change and 'Save as'
The more important thing here is to update the tree view
on 'Save As..', as we want to drop every connection from an old file.

Updating the tree view on current editor change is just a cool small
bonus. :^)
2021-08-25 17:42:54 +02:00
Sam Atkins
b92a6d6542 LibWeb: Implement CSS unset builtin value
This is equivalent to `initial` or `inherit`, depending on if the
property is inherited by default.
2021-08-25 12:14:34 +02:00
Sam Atkins
3296fd70b3 LibWeb: Intercept CSS initial/inherit values in StyleProperties
When property() previously would have returned an InitialStyleValue, we
now look up what the initial value would be, and return that instead.

We also intercep 'inherit', but inheritance is not implemented yet so we
just return nothing.

This does cause a regression on Acid2: The eyes no longer appear, and I
am not sure why. :^(
2021-08-25 12:14:34 +02:00
Sam Atkins
160f434769 Base: Add cascade-keywords.html test page for CSS cascade keyword values
These are:

- `initial`
- `inherit`
- `unset`

Cascade4 and 5 also define `revert` and `revert-layer`, but let's not
get ahead of ourselves. :^)
2021-08-25 12:14:34 +02:00
Sam Atkins
8995839e3f LibWeb: Generate property_initial_value() function from Properties.json
Since we have initial-value data in Properties.json already, it makes
sense to use that instead of needing to duplicate the same information
in ComputedValues.h

However, converting a StyleValue to the kind of types used in
InitialValues is non-trivial. So this may or may not actually be useful.
2021-08-25 12:14:34 +02:00
Sam Atkins
38ee69adfa LibWeb: Add StyleValue to Forward.h 2021-08-25 12:14:34 +02:00
Sam Atkins
543550d1df LibWeb: Quote all initial values in Properties.json
This is in preparation for parsing these into StyleValues automatically.
Having them all be Strings makes the generation code simpler.
2021-08-25 12:14:34 +02:00
Sam Atkins
6d39f4342d LibWeb: Use single shared instance of Inherit/InitialStyleValue
These are always the same, so we can avoid allocating them repeatedly
and just use a single instance of each. :^)
2021-08-25 12:14:34 +02:00
Sam Atkins
d2342caf42 LibWeb: Parse CSS builtins before other values
These are straightforward to parse, so doing them first saves
potentially expensive calculations inside parse_foo_value() functions.
2021-08-25 12:14:34 +02:00
Brian Gianforcaro
aceea42ba4 Toolchain: Update BuildQemu.sh to latest 6.1.0
Change Log: https://wiki.qemu.org/ChangeLog/6.1
2021-08-25 12:13:13 +02:00
Brian Gianforcaro
9acf449ced Kernel: Make VirtualAddress methods constexpr
In order to use VirtualAddresses as compile time constants in the
AddressSanitizer implementation, we need to be able to use these
methods in constexpr functions / variable initializations.
2021-08-25 12:12:59 +02:00
Brian Gianforcaro
665e848576 CMake: Remove Prekernel incompatible options instead of overriding
The pattern of having Prekernel inherit all of the build flags of the
Kernel, and then disabling some flags by adding `-fno-<flag>` options
to then disable those options doesn't work in all scenarios. For example
the ASAN flag `-fasan-shadow-offset=<offset>` has no option to disable
it once it's been passed, so in a future change where this flag is added
we need to be able to disable it cleanly.

The cleaner way is to just allow the Prekernel CMake logic to filter out
the COMPILE_OPTIONS specified for that specific target. This allows us
to remove individual options without trashing all inherited options.
2021-08-25 12:12:59 +02:00
Marco Cutecchia
d1f936e3d0 HackStudio: Add "New File" actions for different file extensions
Currently this supports the following file types: cpp, header, gml,
js, css, html and plain files
2021-08-25 12:12:15 +02:00
Brian Gianforcaro
77d8a65498 LibJS: Fix incorrect Lexer VERIFY when parsing Unicode characters
This bug was discovered via OSS fuzz, it's possible to fall through
to this assert with a char_size == 1, so we need to account for that
in the VERIFY(..).

Repro test case can be found in the OSS fuzz bug:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37296
2021-08-25 09:21:23 +01:00
Dante Catalfamo
0f3f814945 Ports: Add port for mruby 2021-08-25 02:22:01 +02:00
Brian Gianforcaro
16ad297078 Kernel: Annotate Memory::Region APIs with [[nodiscard]]
This is an attempt to mitigate callers not observing the result of
map or remap.
2021-08-25 00:18:42 +02:00
Brian Gianforcaro
485f51690d Kernel: Always observe the return value of Region::map and remap
We have seen cases where the map fails, but we return the region
to the caller, causing them to page fault later on when they touch
the region.

The fix is to always observe the return code of map/remap.
2021-08-25 00:18:42 +02:00
Marco Cutecchia
0ae5de8c3c WebServer: Add 'Content-Type' header for error responses
Previously when the WebServer sent an error page the browser would
show the raw HTML since we forgot to send the 'Content-Type' header
2021-08-24 22:01:34 +02:00
Ralf Donau
a501b903b5 LibCore: Set file offset in ConfigFile::sync 2021-08-24 18:17:09 +02:00
Andreas Kling
fe09f85414 Browser: Use OutOfProcessWebView for the Browser JavaScript console
Instead of building the web DOM by hand, we now load an empty document
into an OutOfProcessWebView, and then append things to it by sending
little snippets of JavaScript to the host process. :^)
2021-08-24 16:59:11 +02:00
Andreas Kling
fd922cf92f LibWeb+WebContent: Add a simple API for running arbitrary JavaScript
This patch adds OutOfProcessWebView::run_javascript(StringView).
This can be used by the OOPWV embedder to execute arbitrary JavaScript
in the top-level browsing context on the WebContent process side.
2021-08-24 16:56:42 +02:00
Andreas Kling
6b2aadce11 Browser: Remove single-process mode :^)
Browser now only supports multi-process mode (Web::OutOfProcessWebView).
This is where we want to go, so let's just jump in the cold water. :^)
2021-08-24 16:37:28 +02:00
Andreas Kling
dfa9dcca98 LibWeb+Browser: Remove unnecessary InProcessWebView.h includes 2021-08-24 16:37:28 +02:00
Andreas Kling
c915174563 Userland: Remove IRC Client
The IRC Client application made some sense while our main communication
hub was an IRC channel. Now that we've moved on, IRC is just a random
protocol with no particular relevance to this project.

This also has the benefit of removing one major client of the single-
process Web::InProcessWebView class.
2021-08-24 16:37:28 +02:00
Andreas Kling
97f5383525 Kernel: Remove confusing nested scope in Thread::block()
There was a nested scope here that didn't actually scope anything
meaningfully, so just get rid of it.
2021-08-24 16:37:28 +02:00
Andreas Kling
a22634bb59 Kernel: Use TemporaryChange to update Thread::m_in_block
Let's use an RAII helper to avoid having to update this on every path
out of block().

Note that this extends the time under `m_in_block == true` by a little
but that should be harmless.
2021-08-24 16:37:28 +02:00
Andreas Kling
0c1d41cc8a Kernel: Simplify Blockers so they don't need a "should block" flag
The `m_should_block` member variable that many of the Thread::Blocker
subclasses had was really only used to carry state from the constructor
to the immediate-unblock-without-blocking escape hatch.

This patch refactors the blockers so that we don't need to hold on
to this flag after setup_blocker(), and instead the return value from
setup_blocker() is the authority on whether the unblock conditions
are already met.
2021-08-24 16:37:28 +02:00
Andreas Kling
adbf472ca7 Kernel: Remove unused BlockTimeout::m_should_block
This was assigned but never read.
2021-08-24 16:37:28 +02:00
Andreas Kling
cfd9045891 Kernel: Remove unused Thread::Blocker::should_block() virtual
This was previously used after construction to check for early unblock
conditions that couldn't be communicated from the constructor.

Now that we've moved early unblock checks from the constructor into
setup_blocker(), we don't need should_block() anymore.
2021-08-24 16:37:28 +02:00
Andreas Kling
82c3cc4640 Kernel: Move Blocker setup out from constructors into setup_blocker()
Instead of registering with blocker sets and whatnot in the various
Blocker subclass constructors, this patch moves such initialization
to a separate setup_blocker() virtual.

setup_blocker() returns false if there's no need to actually block
the thread. This allows us to bail earlier in Thread::block().
2021-08-24 16:37:28 +02:00
davidot
c108c8ff24 LibJS: Disallow yield expression correctly in formal parameters
And add ZERO WIDTH NO BREAK SPACE to valid whitespace.
2021-08-24 07:42:37 +01:00
davidot
7bcffd1b6a LibJS: Fix some small remaining issues with parsing unicode escapes
Added a test to ensure the behavior stays the same.
We now throw on a direct usage of an escaped keywords with a specific
error to make it more clear to the user.
2021-08-24 07:42:37 +01:00
Andreas Kling
b012170d69 Kernel: Don't register thread as custom data for FutexBlocker
Same deal as WaitQueueBlocker, we can get the blocked thread from
Blocker::thread() now, so there's no need to register the current
thread as custom data.
2021-08-24 01:57:11 +02:00
Andreas Kling
2c74533ba6 Kernel: Don't register thread as custom data for WaitQueueBlocker
When adding a WaitQueueBlocker to a WaitQueue, it stored the blocked
thread in the registration's custom "void* data" slot.
This was only used to print the Thread* in some debug logging.

Now that Blocker always knows its origin Thread, we can simply add
a Blocker::thread() accessor and then get the blocked Thread& from
there. No need to register custom data.
2021-08-24 01:57:11 +02:00
Andreas Kling
a58c4bbcf5 Kernel: Make Thread::Blocker::m_thread a NonnullRefPtr<Thread>
There's no harm in the blocker always knowing which thread it originated
from. It also simplifies some logic since we don't need to think about
it ever being null.
2021-08-24 01:57:11 +02:00
Andreas Kling
c351945474 Kernel: Simplify unregistering a Blocker from a BlockerSet
The BlockerSet stores its blockers along with a "void* data" that may
contain some blocker-specific context relevant to the specific blocker
registration (for example, SelectBlocker stores a pointer to the
relevant entry in an array of SelectBlocker::FDInfo structs.)

When unregistering a blocker from a set, we don't need to key the
blocker by both the Blocker* and the data. Just the Blocker* is enough,
since all registrations for that blocker need to be removed anyway as
the blocker is about to be destroyed.

So we stop passing the "void* data" to BlockerSet::remove_blocker(),
which also allows us to remove the now-unneeded Blocker::m_block_data.
2021-08-24 01:57:11 +02:00
Linus Groh
6ce05026b4 LibJS: Implement Temporal.ZonedDateTime.prototype.toPlainMonthDay() 2021-08-24 01:53:30 +02:00
Linus Groh
ef581be4ec LibJS: Implement Temporal.ZonedDateTime.prototype.toPlainYearMonth() 2021-08-24 01:53:30 +02:00
Linus Groh
fc58f93734 LibJS: Implement Temporal.PlainDateTime.prototype.toPlainMonthDay() 2021-08-24 01:53:30 +02:00
Linus Groh
5573efa3bd LibJS: Implement Temporal.PlainDateTime.prototype.toPlainYearMonth() 2021-08-24 01:53:30 +02:00