Commit graph

58236 commits

Author SHA1 Message Date
Nico Weber
3616d14c80 LibGfx/JPEG: Allow decoding more subsampling factors
We now allow all subsampling factors where the subsampling factors
of follow-on components evenly decode the ones of the first component.

In practice, this allows YCCK 2111, CMYK 2112, and CMYK 2111.
2024-01-15 11:20:11 -07:00
Nico Weber
d99d086da3 LibGfx/JPEG: Move subsample-undoing to a separate function
Previously, we handled sampling factors as part of ycbcr_to_rgb().
That meant it worked ok for code paths that used YCbCr ("normal"
jpegs, and the YCC part of YCCK jpegs), but it didn't work for
example for the K channel in YCCK jpegs, nor for CMYK.

By making this a separate pass, it should now work for all cases.
It also makes it easier to support more subsampling arrangements
in the future, and to use something better than nearest neighbor
for upsampling subsampled blocks.
2024-01-15 11:20:11 -07:00
Nico Weber
398f34bb81 Ladybird/AppKit/CMake: Use a more civilized way of finding Cocoa
Finding Cocoa.framework is the linker's job, not CMake's.

No behavior change.
2024-01-15 11:18:55 -07:00
Nico Weber
d324517ed7 Ladybird/AppKit: The "Window" menu should be called "Window"
...not "Windows".
2024-01-15 12:15:16 -05:00
Nico Weber
36bdf45f36 Meta: Port recent changes to the GN build
Ports de32b77ceb.
2024-01-15 12:15:16 -05:00
Nico Weber
2650e64bd4 MacPDF: Add a "Debug" menu with a "Show Clipping Paths" entry
...and hook it up.

I opened MainMenu.xib in Xcode, added a new "Submenu Menu Item"
from the Library (cmd-shift-l), added a User Defined
"toggleShowClippingPaths:" action on First Responder and connected
the menu item's action to that action.

(I first tried duplicating the existing Window menu and editing that,
but the Window menu is marked as `systemMenu="window"` in the xib and
I couldn't find a way to undo that in Xcode. So the Debug menu first
acted as a second Window menu.)

I made "Debug" a toplevel menu to make it consistent with Ladybird.app
for now, but I'll probably make it a submenu of "View" in the future.
2024-01-15 11:59:20 -05:00
Aliaksandr Kalenik
64a48065b0 LibWeb: Check if corners have radius after converting to device pixels
Check needs to happen after conversion because non-zero radius in
CSSPixels could turn into zero in device pixels.

Fixes https://github.com/SerenityOS/serenity/issues/22765
2024-01-15 15:21:17 +01:00
Aliaksandr Kalenik
6087d2feec LibGfx+LibWeb: Do not ignore corner radius if it is defined in one axis 2024-01-15 15:21:17 +01:00
Sönke Holz
1ab4135975 LibC: Pass arguments correctly to sigprocmask in setjmp for riscv64
For some reason I decided to change the argument passing order before
submitting my PR, but this would cause the oldset argument to always
be 0x74 as a0 is overridden with 0 in that order.
2024-01-15 14:34:15 +01:00
Aliaksandr Kalenik
cc447c9c80 LibWeb+WebContent: Move paint recording init into Navigable
This refactoring makes WebContent less aware of LibWeb internals.
The code that initializes paint recording commands now resides in
`Navigable::paint()`. Additionally, we no longer need to reuse
PaintContext across iframes, allowing us to avoid saving and restoring
its state before recursing into an iframe.
2024-01-15 14:33:56 +01:00
Andreas Kling
72dd37438d LibWeb: Treat flex item cross axis max-size as "none" in more cases
There are a bunch of situations where we need to treat cross axis
max-size properties as "none", notably percentage values when the
reference containing block size is an intrinsic sizing constraint.

This fixes an issue where flex items with definite width would get
shrunk to 0px by "max-width: 100%" in case the item itself is an
SVG with no natural width or height.

For consistency, we now use the should_treat_max_width/height_as_none
helpers throughout FFC.

This makes the search/account/cart icons show up in the top right
on https://twinings.co.uk :^)
2024-01-15 12:55:47 +01:00
Nico Weber
9a93f677f4 LibPDF: Mark text rendering matrix as dirty after TJ numbers
Mostly because I audited all places that assigned to `m_text_matrix`
after #22760.

This one is very difficult to trigger in practice.

`show_text()` marks the text rendering matrix dirty already,
so this only has an effect if the `TJ` array starts with a
number, and the matrix isn't marked dirty going in.

`Tm` caches the text rendering matrix, so I changed text.pdf
to contain:

```
1 0 0 1 45 130 Tm
[ 200 (Hello) -2000 (World) ] TJ T*
```

This first sets an x offset of 5 (on top of the normal 40), and
then undoes it (`200` is multiplied by font size (25) / -1000,
and `200 * 25 / -1000` is -5). Before this change, the topmost
"Hello World" ended up slightly indented.

Likely no behavior change in practice, but makes the code easier
to understand, and maybe it helps in the wild somewhere.
2024-01-15 08:39:04 +00:00
Nico Weber
f23f5dcd62 LibPDF: Mark text rendering matrix dirty for Td operator
0000342.pdf page 5 contains this snippet:

```
/T1_1 10.976 Tf
0 -31.643 TD
(This)Tj

1 0 0 1 54 745.563 Tm
22.181 -31.643 Td
[(vehicle)-270.926(uses)...
```

The `Tm` marked the text rendering matrix as dirty at the start,
but it then calls calculate_text_rendering_matrix() almost in the
next line, which recalculates the text rendering matrix and caches
the new matrix. The `Td` used to not mark it as dirty, and we'd
draw "vehicle" with an incorrect matrix.
2024-01-15 08:37:55 +00:00
Aliaksandr Kalenik
7c2713c14f LibWeb: Move set_needs_display() from layout node to paintable
For this method, there is no need to go through the layout node when we
can directly reach the paintable.
2024-01-15 09:00:35 +01:00
Aliaksandr Kalenik
814bed33b4 LibWeb: Move box_type_agnostic_position() from layout node to paintable
For this method, there is no need to go through the layout node when we
can directly reach the paintable.
2024-01-15 09:00:35 +01:00
Aliaksandr Kalenik
31e5b5f5de LibWeb: Use paintable to represent event tracking node
The use of layout nodes likely predated the paintable tree, but now
there is no point in introducing another level of indirection.
2024-01-15 09:00:35 +01:00
Sam Atkins
ad59fb7cf0 HackStudio: Make Editor ask Debugger if a breakpoint was added/removed
Rather than adding/removing a breakpoint indicator, and then telling the
debugger about it and hoping it works, let the debugger tell us if it
succeeded and then use that to update the indicator.

This prevents the user from adding breakpoints to invalid locations
while the debugger is running. It also avoids a couple of scary
VERIFY()s. We still allow creating breakpoints in invalid locations
while the debugger is *not* running.
2024-01-14 18:48:41 -07:00
Shannon Booth
3910efb80b LibWeb: Implement Element.removeAttributeNS 2024-01-14 16:10:18 -07:00
Shannon Booth
7a26a889cb LibWeb: Implement Element.getAttributeNodeNS 2024-01-14 16:10:18 -07:00
Shannon Booth
a7316d3641 LibJS: Update Temporal RoundDuration AO to some spec changes
This commit effectively just does a bulk update of this function to the
spec. Since there have been so many spec changes, no specific change was
made in mind, and many FIXMEs have been left for where we are still out
of date.

These changes also appear to include a normative change to the temporal
spec which was previously resulting in timeouts for some tests, and is
now resulting in a timeout.

Furthermore, this also resolves some crashes by protecting against
division by zero, instead throwing a RangeError. This can only happen
when a custom calender is provided which returns funky values. See:

https://github.com/tc39/proposal-temporal/commit/ed85e9

Diff Tests:
    +8     -4 💀    -4 💥
2024-01-14 16:08:52 -07:00
Shannon Booth
83b84cf0bd LibJS: Implement Temporal AO DifferenceDate 2024-01-14 16:08:52 -07:00
Shannon Booth
a372a16b2c LibJS: Improve const-correctness of CalendarDateUntil 2024-01-14 16:08:52 -07:00
Shannon Booth
23c5a7a0a3 LibJS: Expose const prototype getter in Object
This is used in the temporal proposal in an assertion.
2024-01-14 16:08:52 -07:00
Shannon Booth
9f7e27564c LibJS: Catch up DifferenceTemporalPlainYearMonth somewhat to the spec
The spec has moved along quite a bit since this was originally
implemented. Catch up on at least some of these changes, and leave
FIXMEs for what is missing.

No change to test262.
2024-01-14 16:08:52 -07:00
Shannon Booth
d2710ad73f LibJS: Implement temporal AO SnapshotOwnProperties 2024-01-14 16:08:52 -07:00
Shannon Booth
107fa1fdb8 LibJS: Implement excluded values in CopyDataProperties
This is a change to this AO as part of the Temporal proposal.
2024-01-14 16:08:52 -07:00
Sönke Holz
a504d76b14 LibC: Implement setjmp and longjmp for riscv64
The assembly implementation is based on the x86_64 version.
2024-01-14 16:06:59 -07:00
Dan Klishch
5825eaa264 JSSpecCompiler: Save references to return value and function arguments 2024-01-14 16:05:51 -07:00
Dan Klishch
7f47340c82 JSSpecCompiler: Create FunctionDeclarations for all external functions 2024-01-14 16:05:51 -07:00
Dan Klishch
5338cdd153 JSSpecCompiler: Add bare-bones DCE pass
Right now the only dead code it eliminates is the unused phi nodes.
2024-01-14 16:05:51 -07:00
Andrew Kaster
162c334508 Revert "Assistant: Check for access before showing results"
This reverts commit 7c88ab2836.

Post-merge review revealed that the checks added in this PR prevent
any and all non-executable files from being displayed in Assistant,
which is a regression from intended functionality.
2024-01-14 15:51:32 -07:00
Hugh Davenport
7dba28fce8 MasterWord: Add fullscreen option
Required allowing resizing. Perhaps an additional setting to allow
fullscreen, but not resizing? Anyhow, the game still plays well if
you can resize and works as expected.
2024-01-14 15:18:43 -07:00
Hugh Davenport
5f56c946c2 SQLStudio: Add fullscreen option 2024-01-14 15:18:43 -07:00
Hugh Davenport
e6d0239c23 Settings: Add fullscreen option 2024-01-14 15:18:43 -07:00
Hugh Davenport
7fa0cf194f Applications: Add fullscreen option to Utilities 2024-01-14 15:18:43 -07:00
Hugh Davenport
8886324cbf Applications: Add fullscreen for Office category 2024-01-14 15:18:43 -07:00
Hugh Davenport
4aca883d51 Mail: Add fullscreen option 2024-01-14 15:18:43 -07:00
Hugh Davenport
4c31049d0c PixelPaint: Add fullscreen option 2024-01-14 15:18:43 -07:00
Hugh Davenport
64edf6913f Games: Add fullscreen option 2024-01-14 15:18:43 -07:00
Hugh Davenport
13c66ebf12 DevTools: Add fullscreen option
All except SQLStudio, as that causes a crash
2024-01-14 15:18:43 -07:00
Hugh Davenport
eb5e8ac11b Demos: Add fullscreen option to those that don't
Missing are the Model Gallery and Widget Gallery, as they don't have a
menu bar.
2024-01-14 15:18:43 -07:00
Hugh Davenport
8bb6dc9c4b Ports: Add hotkey for Utilities system menu 2024-01-14 15:16:45 -07:00
Hugh Davenport
08eeb4f83b SystemMenu: Add hotkey for Utilities category 2024-01-14 15:16:45 -07:00
Hugh Davenport
4c02133ba8 SystemMenu: Add hotkey for Media category 2024-01-14 15:16:45 -07:00
Hugh Davenport
79adeffcb6 SystemMenu: Add hotkeys for Office category 2024-01-14 15:16:45 -07:00
Hugh Davenport
d65e8735f6 Ports: Add hotkey for Internet system menu 2024-01-14 15:16:45 -07:00
Hugh Davenport
1e8002d7c7 SystemMenu: Add hotkeys for Internet menu 2024-01-14 15:16:45 -07:00
Hugh Davenport
b9fa189d26 SystemMenu: Add hotkeys for Graphics menu 2024-01-14 15:16:45 -07:00
Hugh Davenport
8dc146f9f2 Ports: Add hotkey for Development system menu 2024-01-14 15:16:45 -07:00
Hugh Davenport
3fa4161abd SystemMenu: Add hotkeys for Development menu 2024-01-14 15:16:45 -07:00