Commit Graph

35203 Commits

Author SHA1 Message Date
Andreas Kling
72689ce7bd LibJS: Add fast_is<PrivateIdentifier>() 2022-03-05 23:49:37 +01:00
Idan Horowitz
bc0fafade9 LibWeb: Add all overloads of CanvasRenderingContext2D::drawImage() 2022-03-05 23:40:08 +01:00
Idan Horowitz
59e9e7cc61 LibWeb: Add a very basic and ad-hoc version of IDL overload resolution
This initial version lays down the basic foundation of IDL overload
resolution, but much of it will have to be replaced with the actual IDL
overload resolution algorithms once we start implementing more complex
IDL overloading scenarios.
2022-03-05 23:40:08 +01:00
Idan Horowitz
24cf56896b LibWeb: Use image's intrinsic dimensions when checking their usability
Instead of the rendered dimensions.
2022-03-05 23:40:08 +01:00
Jakub Berkop
d084f8d90a Profiler: Present read event info in tree structure
This commit adds "Filesystem Events" View to the Profiler. This tab
 will present combined information for recorded Filesystem events.
Currently only accumulated count and duration is presented.
Duration amount currently only shows events that took over 1ms,
which means that in most cases 0 is show.
2022-03-05 21:47:01 +01:00
Andreas Kling
bc82b3eaec LibWeb: Improve height:auto for position:absolute blocks
Previously we were not giving automatic height to position:absolute
blocks that had both top:auto and bottom:auto.
2022-03-05 21:26:19 +01:00
Andreas Kling
e61bf997db LibWeb: Don't break on *every character* in AllPossibleLineBreaks mode
This mode is used to find the min-content inline size, so we should
break between words, not characters.
2022-03-05 21:26:19 +01:00
Karol Kosek
32bd57bdc9 LibWeb: Use monospace font for <kbd> and <samp> elements 2022-03-05 21:25:14 +01:00
Karol Kosek
049abbc417 LibWeb: Strike-through <s> and <del> elements by default 2022-03-05 21:25:14 +01:00
Karol Kosek
ed70a67a49 LibWeb: Set default fantasy font to Comic Book
> Fantasy fonts are primarily decorative or expressive fonts that
> contain decorative or expressive representations of characters.
https://drafts.csswg.org/css-fonts/#valdef-font-family-fantasy

Seems like this font fits this description. :)
2022-03-05 21:25:14 +01:00
Karol Kosek
d7c27ad11a LibWeb: Set default serif font to Roman
It's the only Serif font we have, so let's use it!
2022-03-05 21:25:14 +01:00
electrikmilk
056ca62778 FontEditor: Add code previews for fixed-width fonts
Add pseudo code to font preview for fixed-width programming fonts.
2022-03-05 21:24:25 +01:00
Jelle Raaijmakers
59fa8323cf LibGL: Implement lighting parameter error checking 2022-03-05 21:23:56 +01:00
Jelle Raaijmakers
e1c863d99a LibSoftGPU: Use non-normalized light vector for attenuation
There were some issues with the old code: we were saving the length of
the light vector but not actually using it anywhere, if we were dealing
with a zero-vector this could potentially divide by zero resulting in a
black fragment color, and we were erroneously using P2's length instead
of P1's length when P1's W coordinate is zero in the SGI arrow
operation.

This fixes some lighting bugs in Grim Fandango, but this probably
affects all lighting as well.
2022-03-05 21:23:56 +01:00
Karol Kosek
743c0f0882 Base: Widen Plus Sign, Soliduses and Circumflex Accent in Katica Bold 12
Previously, the characters looked the same as in the Regular font
version.

Codepoints of modified characters: U+002B, U+002F, U+005C and U+005E.
2022-03-05 19:07:32 +01:00
Itamar
e9de381607 LibCpp: Don't include parameter type in FunctionType::to_string if null
The type of a function parameter can be null if we failed to parse it.
In such a case, calling to_string() on a FunctionType node used to cause
a null dereference.

This caused the language server to crash when processing
AK/StdLibExtraDetails.h
2022-03-05 15:36:03 +01:00
Tim Schumacher
495a1be925 tar: Implement support for extended headers :^) 2022-03-05 13:17:13 +01:00
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
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