Commit graph

35269 commits

Author SHA1 Message Date
Karol Kosek
fd57ecfdcf Base: Reduce Comma (U+002C) width from 12px to 4px in Katica Bold 12
Previous value was pretty much an overkill.
Changing it to 4px, to align it nicely with the semicolon. :^)
2022-03-04 23:07:27 +01:00
Linus Groh
e890cd5464 LibWeb: Implement CanvasRenderingContext2D.getImageData()
The actual copying of the pixel values into the created ImageData object
is a bit ugly, but Gfx::Painter doesn't like the underlying RGBA8888
bitmap.
2022-03-04 23:03:29 +01:00
Linus Groh
08608932cc LibWeb: Change CanvasRenderingContext2D.createImageData() args to long
Not sure why these are doubles in the IDL definition, both the IDL in
the spec and the implementation in the CanvasRenderingContext2D class
use integers.
2022-03-04 23:03:29 +01:00
Linus Groh
ca3c45cc1f LibGfx: Support the RGBA8888 storage format in Bitmap::set_pixel() 2022-03-04 23:03:29 +01:00
Linus Groh
3f3326f1dc LibWeb: Implement CanvasRenderingContext2D.drawImage() closer to spec
Also add support for HTMLCanvasElement for the image parameter, leading
to replacing HTMLImageElement with the CanvasImageSource Variant type.

Also stub out the 'check the usability of the image argument' and 'is
not origin-clean' operations, while taking into consideration that these
can throw (and require DOM::ExceptionOr).
2022-03-04 23:03:29 +01:00
Linus Groh
ed03f37ae9 LibWeb: Add CanvasRenderingContext2D's origin-clean flag 2022-03-04 23:03:29 +01:00
Linus Groh
6521c04bf3 LibWeb: Remove dbgln() from ImageData::create_with_size()
This is not generally useful information, and can be noisy on websites
that heavily use ImageData, e.g. in combination with canvas.
2022-03-04 23:03:29 +01:00
Linus Groh
1719862d12 LibWeb: Hide some debug logging behind CANVAS_RENDERING_CONTEXT_2D_DEBUG
This can be quite noisy and isn't generally useful information.
2022-03-04 23:03:29 +01:00
Linus Groh
a2e6abe159 LibWeb: Add HTMLMediaElement.canPlayType()
For the time being, the answer is no, or rather: "" :^)
2022-03-04 23:03:29 +01:00
Idan Horowitz
55c247d044 LibWeb: Correct SVG smooth curve reflected control point calculation
We were calculating the reflected control points in the svg smooth
curve instructions incorrectly, and this issue was masked by the fact
that we were treating it as a relative coordinate in relative mode.
2022-03-04 20:08:58 +01:00
Ali Mohammad Pur
6608812e4b Kernel: Over-align the FPUState on the stack in sigreturn
The stack is misaligned at this point for some reason, this is a hack
that makes the resulting object "correctly" aligned, thus avoiding a
KUBSAN error.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
a5d4824abe UserspaceEmulator: Pass signal information through to emulated process
With this, SA_SIGINFO is also fully (as much as the kernel, at least)
supported by UE.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
1125cbe336 UserspaceEmulator: Update signal handlers to use the new stack layout
The kernel sets up the stack like this, so set it up the same way.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
baf7038919 UserspaceEmulator: Add a SoftMMU::read<T> function
...and implement SoftCPU::read_memory<T> with it.
This allows the MMU to read a typed object (using 1-byte reads), which
is significantly nicer to use than reading the struct fields manually.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
70b53b44b2 UserspaceEmulator: Wrap the GPRs in ValueWithShadow
...instead of manually tracking their shadow data.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
f6e82a8e0a UserspaceEmulator: Make it possible to wrap PODs in ValueWithShadow
Instead of making it hold the shadow data as another `T`, make it hold
the data as a byte array, and allow it to read the byte array as `T`.
This makes it much easier to make a "read_typed" function in the MMU.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
e08cf8f554 UserspaceEmulator: Let SoftCPU.h include Emulator.h
...instead of Emulator.h including SoftCPU.h.
This will be used in a later commit to access into Emulator from a
template in SoftCPU.h.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
23f6a00162 Kernel: Fix silly unintentional use of operator,
Everyone's favourite activity, copy pasta, has produced yet another
confusing use of operator,; fix this and make it less confusing.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
88d7bf7362 Kernel: Save and restore FPU state on signal dispatch on i386/x86_64 2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
e14e919b78 Kernel: Fill some siginfo and ucontext fields on SA_SIGINFO
There's no reason to fill in any of these fields if SA_SIGINFO is not
given, as the signal handler won't be reading from them at all.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
4bd01b7fe9 Kernel: Add support for SA_SIGINFO
We currently don't really populate most of the fields, but that can
wait :^)
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
585054d68b Kernel: Comment the living daylights out of signal trampoline/sigreturn
Mere mortals like myself cannot understand more than two lines of
assembly without a million comments explaining what's happening, so do
that and make sure no one has to go on a wild stack state chase when
hacking on these.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
7238c946f0 Kernel: Make the signal trampoline stack alignment a bit more readable
The comments were confusing, and had a mathematical error, stop trying
to be clever and just let the computer do the math.
Also assert that we're pushing exactly as many stack elements as we're
using for the alignment calculations.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
848eaf2220 Kernel: Reject sigaction() with SA_SIGINFO
We can't handle this, so let sigaction() fail instead of PANIC()'ing
later when we try to dispatch a signal with SA_SIGINFO set.
2022-03-04 20:07:05 +01:00
Ali Mohammad Pur
cf63447044 Kernel: Move signal handlers from being thread state to process state
POSIX requires that sigaction() and friends set a _process-wide_ signal
handler, so move signal handlers and flags inside Process.
This also fixes a "pid/tid confusion" FIXME, as we can now send the
signal to the process and let that decide which thread should get the
signal (which is the thread with tid==pid, but that's now the Process's
problem).
Note that each thread still retains its signal mask, as that is local to
each thread.
2022-03-04 20:07:05 +01:00
Timothy Flynn
18b9d02edd LibWeb: Implement setTimeout/setInterval with ESO according to the spec
Our setInterval implementation currently crashes on DuckDuckGo when it's
invoked with a string argument. In this path, we were creating a native
function to evaluate and execute that string. That evaluation was always
returning a Completion, but NativeFunction expects ThrowCompletionOr.
The conversion from Completion to ThrowCompletionOr would fail a VERIFY
because that conversion is only valid if the Completion is an error; but
we would trigger this conversion even on success.

This change re-implements setTimeout & setInterval in direct accordance
with the spec. So we avoid making that NativeFunction altogether, and
DDG can progress past its invocation to the timer. With this change, we
also have other features we did not previously support, such as passing
any number of arguments to the timers. This does not implement handling
of nesting levels yet.
2022-03-04 19:51:26 +01:00
Timothy Flynn
8156ec5da8 Base: Replace setInterval test page with a more thorough timer test page
Ensure we test both setTimeout and setInterval (and their cancellation
methods), and test scenarios such as raising exceptions in the callback,
passing extra arguments, etc.
2022-03-04 19:51:26 +01:00
Timothy Flynn
7b54845c8e LibWeb: Allow calling invoke-a-callback with an existing argument list
Some callers, e.g. setTimeout / setInterval, will want to invoke this AO
with an arguments list retrieved from the JS VM (as opposed to invoking
it with a variadic list at the call site).
2022-03-04 19:51:26 +01:00
Karol Kosek
5c978266e3 Spreadsheet: Ask about unsaved changes on "Open..." action activation 2022-03-04 11:56:52 -05:00
Karol Kosek
cef595aa5c CharacterMap+FontEditor: Switch current Unicode block on arrow press 2022-03-04 11:53:04 -05:00
Karol Kosek
17f9d3d45e CharacterMap: Go to character on arrow press in Search window 2022-03-04 11:53:04 -05:00
Karol Kosek
d4097f104e CharacterMap: Move search selection on arrow press in the search textbox 2022-03-04 11:53:04 -05:00
Lenny Maiorani
d5fdc6096c Libraries: Make CharacterBitmap instances at compile-time
`CharacterBitmap` instances are generated at run-time and put on the
heap, but they can be created in a `constexpr` context and stored in
static memory.

Also, remove additional `width` and `height` `static` values in favor
of using the `constexpr` member functions of `CharacterBitmap`.

These changes also include the removal of some initialization code
which tests if the `CharacterBitmap` is created since it is always
created and removes function-local `static` values which cause
run-time branches to ensure it is initialized each time the function
is called.
2022-03-04 17:41:08 +01:00
Lenny Maiorani
dc518404ce LibGfx: Make Size constexpr-capable
There is nothing in the `Size` class which cannot be `constexpr`, but
without it being `constexpr` it prevents other things from being
`constexpr`-capable.
2022-03-04 17:41:08 +01:00
Andreas Kling
219e3b9235 LibWeb: Make stacking context tree dumps more readable
Include the Layout::Node::debug_description() and the z-index.
2022-03-04 15:52:42 +01:00
Andreas Kling
15ed0ebdc6 LibWeb: Implement hit testing a bit closer to spec
We now perform hit testing in reverse paint order as described in CSS2's
section about the z-index property.
2022-03-04 15:52:42 +01:00
Andreas Kling
0401d7da36 LibWeb: Preserve z-index:auto in CSS::ComputedValues
This is still interesting for debugging purposes, so let's not blindly
convert "auto" to 0. Code later down the line handles "auto" anyway.
2022-03-04 15:52:42 +01:00
Lenny Maiorani
d144da3a62 LibGfx: Refactor Vector[2,3,4] to VectorN with specializations
`Gfx::Vector[2,3,4]` are nearly identical implementations. This code
redundancy does not follow the DRY (Don't Repeat Yourself) principle
leading to possible out-of-sync errors between the classes.

Combining these classes into a class template which can be specialized
for each needed size makes the differences obvious through
`constexpr-if` blocks and `requires` clauses.
2022-03-04 12:56:05 +01:00
Andreas Kling
c2a66b77df LibWeb: Measure intrinsic block width *around* children's border edge
When calculating the intrinsic width of a block-level box, we were
previously measuring the content boxes of children. This meant that
shrink-to-fit sized blocks didn't gain enough width to contain children
with horizontal padding and/or border.
2022-03-04 12:34:26 +01:00
Jelle Raaijmakers
4f91616759 Kernel: Report AC'97 vendor and device ID 2022-03-04 11:07:25 +01:00
u9g
9fcd3f7920 Spreadsheet: Prevent infinite loop in Range ctor 2022-03-04 04:29:20 +03:30
u9g
12ef20b869 Spreadsheet: Improve R function to support all of the examples 2022-03-04 04:29:20 +03:30
u9g
93115ee044 Spreadsheet: Add Range(s).toArray() 2022-03-04 04:29:20 +03:30
Wuzado
6302ca0043 reboot: Port to LibMain
First commit to the project! :^)
2022-03-03 15:42:44 -08:00
electrikmilk
58a865f349 Base+Manpages: Add basic GML documentation
First draft of GML documentation, just to get things started.
2022-03-03 14:59:00 -08:00
Jakub Berkop
d01d754b83 Kernel: Fixed behavior of repeated calls to register_string
Previously register_string would return incorrect values when
called multiple times with the same input. This patch makes this
function return the same index, identical strings. This change was
required, as this functionality is now being used with read syscall
profiling, (#12465), which uses 'register_string' to registers file
path on every read syscall.
2022-03-03 14:53:35 -08:00
ForLoveOfCats
697e1810bf Calculator: Add keyboard input for more operations 2022-03-03 22:06:14 +01:00
ForLoveOfCats
19f80f88bf Calculator: Avoid focusing any keypad button other than the equal button
Having the return key sometimes press the equal button when nothing is
focused and press a different button when there is focus felt confusing.

The equal button is still able to be focused for the tab cycle to have
something to go to in order to jump out of the textbox but no other
keypad button can be focused now.
2022-03-03 22:06:14 +01:00
ForLoveOfCats
0d0ba375e2 Calculator: Utilize Button mimic_pressed to show when keys are pressed 2022-03-03 22:06:14 +01:00
ForLoveOfCats
e8f6a650ad LibGUI: Add mimic_pressed to Button to signify being virtually clicked
A button that is "mimic pressed" is drawn like it is being clicked when
it isn't necessarily actually being pressed. This lets programs which
keyboard based input that mirrors a button to show visual feedback when
a key is pressed.
2022-03-03 22:06:14 +01:00