Commit graph

57926 commits

Author SHA1 Message Date
Nico Weber b47695c87e Tests: Add a pdf that embeds a wide-gamut 16-bits/channel image
I opened Tests/LibGfx/test-inputs/png/wide-gamut-only.png in
Preview.app and used File->Export as PDF... to convert it to a PDF.

I then ran

    mutool clean -d Tests/LibPDF/wide-gamut-only.pdf \
                    Tests/LibPDF/wide-gamut-only.pdf

to decompress it, edited by hand to remove padding around the image
and shrunk the page's MediaBox to be as big as the image, and ran the
command above again to fix up binary offsets in the xref table.
2024-01-12 16:20:46 -07:00
Nico Weber 1b4f9bdbdb Tests: Add a png in Display P3 that shows up as solid color in sRGB
I created a 16-bpp RGB file in Display P3 in photoshop, filled it
with (0, 255, 0), and then drew something on it with (100, 255, 0).

(Since it's a 16-bpp image, 255 ix stored as 0xffff and 100 is stored
as 65535 * 100 / 255 == 0x6464 in the file.)

I verified that Edit->Convert to Profile...->sRGB resulted in an
image filled with (0, 255, 0) in that color space (due to gamut
clipping).

Similar to these:
* https://webkit.org/blog-files/color-gamut/Webkit-logo-P3.png
* https://www.dropbox.com/s/tgarynpj65ouafd/insta-logo.png?dl=1

...but in green instead of in red, and hand-drawn by me so no license
concerns.
2024-01-12 16:20:46 -07:00
Sönke Holz 8b14056adb LibELF: Ignore RISC-V attribute section program header
We have to skip our usual validations, as the checks might not hold for
this program header type (and the checks wouldn't really make sense for
PT_RISCV_ATTRIBUTES either).

PT_RISCV_ATTRIBUTES is defined here:
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/v1.0/riscv-elf.adoc#program-header-table
2024-01-12 16:11:16 -07:00
kleines Filmröllchen bdd92e881f pixelflut: Implement alternative flooding strategies
These allow column-wise, traditional scanline, or random pixel flooding.
Depending on the use case and amount of contestion, any of the
strategies may work best, as tested on 37c3.
2024-01-12 16:10:28 -07:00
kleines Filmröllchen fdfd4b5e3d pixelflut: Ignore EAGAIN errors
Very contested servers are likely to cause EAGAIN socket errors on the
client. Since these errors are not supposed to be fatal, just try
sending the pixel again.

This was tested successfully against massively contested 37c3 pixelflut
servers.
2024-01-12 16:10:28 -07:00
Liav A ca2be5c51b WindowServer: Read from /dev/input/mice for mouse packets
Instead of trying to acquire from an individual mouse device, let's read
from /dev/input/mice, where all mouse packets are blended together from
all mouse devices that are attached to the machine.
2024-01-12 16:08:08 -07:00
Liav A 97166a5570 SystemServer: Add the all-mice device in /dev/input/mice path 2024-01-12 16:08:08 -07:00
Liav A 8a0a3638f0 Kernel/HID: Introduce the all-mice device
This device will be used by userspace to read mouse packets from all
mouse devices that are attached to the machine.

This change is a preparation before we can enable seamless hotplug
capabilities in WindowServer for mouse devices, without any major change
on the userspace side.
2024-01-12 16:08:08 -07:00
ronak69 75183402fd Calculator: Finish operation-in-progress only on new binary operations
Because of this the unary operations got applied to the result of the
operation-in-progress instead of the current argument as shown here:

    `16 + 9 <sqrt> =`
        Previous output: `sqrt(16 + 9)` = `5`
        Expected output: `16 + sqrt(9)` = `19`
2024-01-12 16:03:09 -07:00
Liav A b634792022 Kernel: Enable i8042 first port translation by default
Without this, we have many issues with the keyboard, so enable this for
now until this is figured out.
2024-01-12 16:02:13 -07:00
Liav A 2a5f66e4d8 Kernel/HID: Fix PS2 keyboard scan code tables
We do this by implementing the following fixes:
- The Key_Plus is assigned to a proper map entry index now which is 0x4e
  both on the keypad and non-keypad keys.
- Shift+Q now prints out "Q" properly on scan code set 2.
- Key BackSlash (or Pipe on shift key being pressed down) is now working
  properly as well.
- Key_Pipe (which is "|" for en-US layout) is now working in scan code
  set 2.
- Numpad keys as well as the decimal separator key are working again.
2024-01-12 16:02:13 -07:00
Hendiadyoin1 23d6c88027 Kernel/MM: Don't allocate a temporary Vector when parsing the memory map
Instead we can achieve the same by just using an optional.
2024-01-12 15:59:47 -07:00
Hendiadyoin1 adac43ab1c Kernel: Use new PCI BAR API in IOWindow and correct IO bounds checks
The IO bounds checks were on 32 bit instead of the actual limit of
16 bit, which would have caused problems later down the line.
2024-01-12 15:59:47 -07:00
Hendiadyoin1 bd118f4eb0 Kernel: Use the new BAR address API for the NVMe stack
This includes changing the cached `m_bar` value to a `PhysicalAddress`
2024-01-12 15:59:47 -07:00
Hendiadyoin1 2dc20f9e39 Kernel: Use the new API to query and map BAR spaces in most places
This might be a bit overkill in some instances, but it's nice to be
consistent
2024-01-12 15:59:47 -07:00
Hendiadyoin1 c65455e122 Kernel: Expand BAR address mask up to 64 bit
Otherwise we would end up truncating the address when applying the mask

Co-Authored-By: Sönke Holz <sholz8530@gmail.com>
2024-01-12 15:59:47 -07:00
Hendiadyoin1 2f98c7d470 Kernel: Add convenience helpers for mapping PCI BAR spaces 2024-01-12 15:59:47 -07:00
Taj Morton 55cd89aea8 Kernel/FileSystem/FATFS: Use AssertSize to enforce FAT structure sizes 2024-01-12 15:54:46 -07:00
Taj Morton d6a519e9af Kernel/FileSystem/FATFS: Restrict reads to the size of the file
Resolves issue where empty portions of a sector (or empty sectors in
a cluster) would be included with the returned data in a read().
2024-01-12 15:54:46 -07:00
Taj Morton 2995ee5858 Kernel/FileSystem/FATFS: Support FAT12 file system clusters 2024-01-12 15:54:46 -07:00
Taj Morton 1f70a728f0 Kernel/FileSystem/FATFS: Support FAT16 file system clusters 2024-01-12 15:54:46 -07:00
Taj Morton 67f567348f Kernel/FileSystem/FATFS: Support for FAT12/16 DOS BIOS Parameter Blocks 2024-01-12 15:54:46 -07:00
Andrew Kaster 02edd240ae LibWeb+WebContent: Spawn Worker processes from the chrome
Instead of spawning these processes from the WebContent process, we now
create them in the Browser chrome.

Part 1/N of "all processes are owned by the chrome".
2024-01-12 15:53:11 -07:00
Andrew Kaster 6ea4c248ab CI: Update comment-on-pr version
This new rev changes the Dockerfile to use a ruby 3 image, just like the
upstream repo.
2024-01-12 11:16:11 -07:00
Andreas Kling bc3a16396e LibWeb: Move font list from NodeWithStyle to ComputedValues
Same here, no need for this to live in NodeWithStyle. Inheritance
behavior for free in ComputedValues.
2024-01-12 17:26:16 +01:00
Andreas Kling c82d517447 LibWeb: Move line-height from NodeWithStyle to ComputedValues
There's no need for this to live in the NodeWithStyle anymore. By moving
it to ComputedValues we get all the right inheritance behavior for free.
2024-01-12 17:26:16 +01:00
Andreas Kling e7de5cb4d2 LibWeb: Bring CSS line-height closer to other engines
This patch makes a few changes to the way we calculate line-height:

- `line-height: normal` is now resolved using metrics from the used
  font (specifically, round(A + D + lineGap)).

- `line-height: calc(...)` is now resolved at style compute time.

- `line-height` values are now absolutized at style compute time.

As a consequence of the above, we no longer need to walk the DOM
ancestor chain looking for line-heights during style computation.
Instead, values are inherited, resolved and absolutized locally.

This is not only much faster, but also makes our line-height metrics
match those of other engines like Gecko and Blink.
2024-01-12 15:04:06 +01:00
Andreas Kling f0722671c3 LibWeb: Cache the viewport rect across all of style computation
Fetching the viewport rect is currently somewhat expensive, since it
requires finding the navigable the document is active in.

We can avoid the cost of repeated calls by simply allowing StyleComputer
to cache the viewport rect at the start of style computation.
2024-01-12 14:12:04 +01:00
Tim Ledbetter 3cd455e554 Calculator: Make the equals button non-focusable
This is not necessary, as pressing Enter will activate the button
whether it is in focus or not. This makes the equals button behave the
same as all other buttons.
2024-01-12 12:53:12 +00:00
Tim Ledbetter 043d5d5c27 Calculator: Make calculator display non-interactive
Previously, it was possible for the user to input text into the
calculator display. With this change, the calculator display is made
read-only.
2024-01-12 12:53:12 +00:00
Nico Weber 92852b8477 LibGfx/ICC: Move MatrixMatrixConversion curve type check to ctor
A bit faster:

```
    N           Min           Max        Median         Avg       Stddev
x  50    0.97179127     1.0031381    0.98313618  0.98407591 0.0092019442
+  50    0.95996714    0.99507213    0.96965885  0.97242294 0.0095455053
Difference at 95.0% confidence
	-0.011653 +/- 0.00372012
	-1.18415% +/- 0.378032%
	(Student's t, pooled s = 0.0093753)
```
2024-01-12 12:37:56 +00:00
Nico Weber 5f85aff036 LibPDF: Move ColorSpace::style() to take ReadonlySpan<float>
All ColorSpace subclasses converted to float anyways, and this
allows us to save lots of float->Value->float conversions during
image color space processing.

A bit faster:

```
    N           Min           Max        Median         Avg       Stddev
x  50    0.99054313     1.0412271    0.99933481   1.0052408  0.012931916
+  50    0.97073889     1.0075941    0.97849107  0.98184034 0.0090329046
Difference at 95.0% confidence
	-0.0234004 +/- 0.00442595
	-2.32785% +/- 0.440287%
	(Student's t, pooled s = 0.0111541)
```
2024-01-12 12:37:56 +00:00
Nico Weber 5ff2a824cc LibGfx/ICC: Move MatrixMatrixConversion::map() inline
According to ministat, a bit faster to render page 3 of 0000849.pdf:

```
    N           Min           Max        Median         Avg       Stddev
x  50      1.000875     1.0427601     1.0208509   1.0201902   0.01066116
+  50    0.99707389       1.03614     1.0084391   1.0107864  0.010002724
Difference at 95.0% confidence
	-0.00940384 +/- 0.0041018
	-0.921773% +/- 0.402062%
	(Student's t, pooled s = 0.0103372)
```
2024-01-12 12:37:56 +00:00
Nico Weber 56a4af8d03 LibPDF: Don't reallocate Vectors in ICCBasedColorSpace all the time
Microoptimization; according to ministat a bit faster:

```
    N           Min           Max        Median         Avg       Stddev
x  50     1.0179932     1.0561159     1.0315337   1.0333617 0.0094757426
+  50      1.000875     1.0427601     1.0208509   1.0201902   0.01066116
Difference at 95.0% confidence
	-0.0131715 +/- 0.00400208
	-1.27463% +/- 0.387287%
	(Student's t, pooled s = 0.0100859)
```
2024-01-12 12:37:56 +00:00
Timothy Flynn 75262a92e1 LibJS: Update spec notes for a resizable ArrayBuffer workaround
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/22de374

The issue noted here has been fixed in the same way that we previously
worked around it. Update the spec notes to match.
2024-01-12 07:09:54 -05:00
Timothy Flynn 7566ff90ee Meta: Port recent changes to the GN build
bc6eebb1d7
2024-01-12 07:09:54 -05:00
Ali Mohammad Pur da5b1680bb Shell: Print paths in plain mode when stdout is not a tty
This makes e.g. `pwd | ...` behave as expected, where pwd doesn't add a
hyperlink around the path.
2024-01-12 12:47:40 +01:00
Andreas Kling 06f7f549f2 LibWeb: Combine has_attribute/attribute calls in HTMLFormElement
No need to walk the NamedNodeMap twice for these. Also, for the "id"
attribute, we can use the cache in Element::id().
2024-01-12 12:47:12 +01:00
Andrew Kaster b5ec520f84 LibWeb: Implement named and indexed property access for HTMLFormElement 2024-01-12 09:11:18 +01:00
Andrew Kaster 521ed0e911 LibWeb: Delete LegacyPlatformObject and move behavior to PlatformObject
We have two known PlatformObjects that need to implement some of the
behavior of LegacyPlatformObjects to date: Window, and HTMLFormElement.

To make this not require double (or virtual) inheritance of
PlatformObject, move the behavior of LegacyPlatformObject into
PlatformObject. The selection of LegacyPlatformObject behavior is done
with a new bitfield of feature flags instead of a dozen virtual
functions that return bool. This change simplifies every class involved
in the diff with the notable exception of Window, which now needs some
ugly const casts to implement named property access.
2024-01-12 09:11:18 +01:00
Andrew Kaster 6047f1adcb LibJS: Ensure JS::Date has a key function and its vtable is in LibJS
Without a key function, the vtable for this class can be emitted into
every shared object or executable that needs it. This can cause bugs and
bad behavior when trying to access the vtable or RTTI for the class.

This is most easily seen when trying to call ``is<JS::Date>``, which
currently will do a dynamic_cast. Based on compiler, linker and loader
choices about ordering, it's possible that the code checking the RTTI
and the code that created the object could have a different vtable and
type_info in mind, causing false negatives for the ``is`` check.
2024-01-12 09:11:18 +01:00
Andrew Kaster 23600fd76e BindingsGenerator: Qualify calls to WebIDL::convert_to_int
And make sure that the header for AbstractOperations is included in all
the implementation files that call AOs from it.
2024-01-12 09:11:18 +01:00
Nico Weber cfd05b1a55 LibPDF: Use MatrixMatrixConversion when possible
Reduces time spent rendering page 3 of 0000849.pdf from 1.32s to 1.13s
on my machine.

Also reduces the time to run Meta/test_pdf.py on 0000.zip
(without 0000849.pdf) from 56s to 54s.
2024-01-12 09:09:56 +01:00
Nico Weber c161b2d2f9 LibPDF: Extract ICCBasedColorSpace::sRGB() helper 2024-01-12 09:09:56 +01:00
Nico Weber 4704e6aa5f LibGfx/ICC: Refactor matrix/matrix conversion code a bit
No behavior change; the goal is to make it usable by LibPDF too.
2024-01-12 09:09:56 +01:00
Nico Weber 2fc6ec0f46 LibGfx/ICC: Fastpath for matrix->matrix image conversions
Doesn't help with PDF at all since that doesn't call convert_image()
(-‸ლ)
2024-01-12 09:09:56 +01:00
Tim Ledbetter 7772637d03 SystemMonitor: Condense process statistics displayed in processes tab
Previously, some non-default process statistics were displayed in a
long human readable format in the processes tab, which could negatively
affect readability. A shorter format is now used in the processes tab,
while the process properties window retains the longer format.
2024-01-12 09:07:51 +01:00
Hugh Davenport c566ef2a9d PartitionEditor: Show better error when can't find partition table 2024-01-11 20:57:40 +00:00
Hugh Davenport 91cdda7763 Calculator: Allow system shortcuts
Before the key events for shortcuts such as ALT-F4 did not work as the
widget was swallowing up the shortcut. This changes ignores the event
if nothing else matched
2024-01-11 19:00:46 +00:00
Sam Atkins 340936ad09 Base: Document NumericInput properties
I forgot to do this when I added them.
2024-01-11 11:36:27 +00:00