Commit Graph

14409 Commits

Author SHA1 Message Date
Tim Schumacher
f6e86915f5 LibArchive: Implement a basic parser for tar extended headers 2022-03-05 13:17:13 +01:00
Tim Schumacher
ff19c1cffe tar: Use the prefixed path for listing and verbose output 2022-03-05 13:17:13 +01:00
Tim Schumacher
e0dba2b81b LibArchive: Add TarFileHeader::content_is_like_extended_header() 2022-03-05 13:17:13 +01:00
Tim Schumacher
e2d71823d3 tar: Prevent file buffering from reading uninitialized data
Regressed in 91fa10a0ab.
2022-03-05 13:09:42 +01:00
Jaime Valenzuela Durán
7c32400431 Base+LibGUI+LibGfx: Improve disabled text readability
Currently, disabled text colors are hardcoded. They look good in Default
and light themes, but no so good in dark ones. This PR adds new
variables for all themes to correctly display disabled text.
2022-03-05 10:25:14 +01:00
Linus Groh
26d29e9220 LibWeb: Implement LocationObject URL part getters closer to spec
- Perform a typed this check
- Use the 'associated URL' as the source of truth
- Don't append default port number in the host getter
- Don't return default port number in the port getter
- Add empty checks to the hash and search getters instead of returning
  '#' and '?' strings from the string builder
2022-03-05 10:24:53 +01:00
Linus Groh
7fb9f431ea LibWeb: Add LocationObject::url()
https://html.spec.whatwg.org/multipage/history.html#concept-location-url

> A Location object has an associated url, which is this Location
> object's relevant Document's URL, if this Location object's relevant
> Document is non-null, and about:blank otherwise.
2022-03-05 10:24:53 +01:00
Linus Groh
da8525279e LibWeb: Add LocationObject::relevant_document()
https://html.spec.whatwg.org/multipage/history.html#relevant-document

> A Location object has an associated relevant Document, which is this
> Location object's relevant global object's browsing context's active
> document, if this Location object's relevant global object's browsing
> context is non-null, and null otherwise.
2022-03-05 10:24:53 +01:00
Linus Groh
2f021e92a5 LibWeb: Add Window::browsing_context()
https://html.spec.whatwg.org/multipage/window-object.html#window-bc

> The Window object's browsing context is the Window object's associated
> Document's browsing context.
> NOTE: It is either null or a browsing context.
2022-03-05 10:24:53 +01:00
Linus Groh
986bd2e271 LibWeb: Add spec comments to LocationObject
This revealed a variety of issues, mostly missing origin checks,
conflating concepts like the 'associated URL', and serialization
(incorrect fallback values, string vs number, etc).

This commit fixes none of these issues, only adds FIXMEs.
2022-03-05 10:24:53 +01:00
u9g
4147b56e79 Spreadsheet: Allow integer() to throw in weird cases
Also makes numericResolve use parseInt to avoid using our own integer()
2022-03-05 05:46:35 +03:30
u9g
75a02300ba Spreadsheet: Add find, findIndex, indexOf, & has to CommonRange 2022-03-05 05:46:35 +03:30
u9g
87c818c571 Spreadsheet: Put common Range(s) functionality into CommonRange class 2022-03-05 05:46:35 +03:30
Andreas Kling
7d052250f2 LibWeb: Don't create unwanted layout nodes when recomputing style
When recomputing the style for an element that previously didn't have
a corresponding layout node, it may become necessary to create a layout
node for it.

However, we should not do this if it's within a subtree that can't have
layout children. Nor should we do it for elements who have an ancestor
with display:none.
2022-03-04 23:40:21 +01:00
Andreas Kling
a6a8ba80fc LibGfx: Rename Color::from_rgba() => Color::from_argb()
This matches the rename of RGBA32 to ARGB32. It also makes more sense
when you see it used with 32-bit hexadecimal literals:

Before:
    Color::from_rgba(0xaarrggbb)

After:
    Color::from_argb(0xaarrggbb)
2022-03-04 23:40:21 +01:00
Andreas Kling
5ace66a903 LibGfx: Rename RGBA32 => ARGB32
The ARGB32 typedef is used for 32-bit #AARRGGBB quadruplets. As such,
the name RGBA32 was misleading, so let's call it ARGB32 instead.

Since endianness is a thing, let's not encode any assumptions about byte
order in the name of this type. ARGB32 is basically a "machine word"
of color.
2022-03-04 23:40:21 +01:00
Andreas Kling
5c4bb03926 LibGfx+GameOfLife: Remove Gfx::make_rgb() and its one user 2022-03-04 23:40:21 +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
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
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
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
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
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
ForLoveOfCats
697e1810bf Calculator: Add keyboard input for more operations 2022-03-03 22:06:14 +01:00