Commit Graph

50636 Commits

Author SHA1 Message Date
Andreas Kling
e83681ee34 LibWeb: Use the right DOM node when placing cursor on double-click
This fixes a null pointer dereference when double-clicking in text
content on some pages.
2023-05-23 07:43:26 +02:00
Andreas Kling
80d6330a26 LibWeb: Don't create mutation record node lists if nobody is interested
By deferring allocation of StaticNodeList objects until we know somebody
actually wants the MutationRecord, we avoid a *lot* of allocation work.

This shaves several seconds off of loading https://tc39.es/ecma262/

At least one other engine (WebKit) skips creating mutation records if
nobody is interested, so even if this is observable somehow, we would
at least match the behavior of a major engine.
2023-05-23 06:31:37 +02:00
Tim Schumacher
0f2b6345c6 test-fuzz: Add all the missing fuzzers 2023-05-23 06:11:33 +02:00
Tim Schumacher
9690b4011b Lagom: Extract the list of fuzzing targets to a separate file 2023-05-23 06:11:33 +02:00
Tim Schumacher
faa08ef1a1 test-fuzz: Don't include all fuzzers into the same .cpp file
Instead, use the approach from BuggieBox to compile in the .cpp files
separately.
2023-05-23 06:11:33 +02:00
Rafał Babiarz
38a553e1ce Ladybird: Select all text in LocationEdit on click 2023-05-23 06:09:40 +02:00
Andreas Kling
821f808e52 LibWeb: Avoid rebuilding layout tree unless CSS display property changes
Before this, any style change that mutated a property we consider
"layout-affecting" would trigger a complete teardown and rebuild of the
layout tree.

This isn't actually necessary for the vast majority of CSS properties,
so this patch makes the invalidation a bit finer, and we now only
rebuild the layout tree when the CSS display property changes.

For other layout-affecting properties, we keep the old layout tree (if
we have one) and run the layout algorithms over that once again.
This is significantly faster, since we don't have to run all the CSS
selectors all over again.
2023-05-23 06:06:55 +02:00
Kemal Zebari
8f5cc613d2 Browser: Don't show error message box when canceling editor dialog
Currently, an error message box appears when a user tries to cancel
the editor dialog while editing or adding a bookmark.

This snapshot resolves this by having `add_bookmark()` and
`BookmarksBarWidget::edit_bookmark()` perform an if check on the
result of `BookmarkEditor::edit_bookmark()` to see if the dialog
was canceled.
2023-05-23 06:03:13 +02:00
Andi Gallo
0ad131e13d LibGfx: Fix parsing of rgba values
Trim whitespace of the alpha component before calling
parse_first_floating_point, which doesn't handle it.
2023-05-23 06:02:35 +02:00
Andi Gallo
1bbfe4630d LibWeb: Preserve case for key events
Case-preserving behavior matches observed behavior of other browsers and
the specification.
2023-05-23 06:02:00 +02:00
thankyouverycool
02d94a303c Base+Userland: Apply Human Interface Guidelines to Object text
Corrects a slew of titles, buttons, labels, menu items and status bars
for capitalization, ellipses and punctuation.

Rewords a few actions and dialogs to use uniform language and
punctuation.
2023-05-23 05:59:49 +02:00
thankyouverycool
024360e604 Documentation: Add section on Ellipses to Text.md 2023-05-23 05:59:49 +02:00
thankyouverycool
a03fb66216 LibGUI: Adjust size and layout of InputBox
Increases default dimensions of InputBox, giving it slightly more
divine proportions. Prompt text now always appears above the editor.
2023-05-23 05:59:49 +02:00
Tim Ledbetter
f3a6da580f du: Continue enumerating directories on error
Previously, the program would exit if a directory couldn't be read. We
now write an error message to stderr and continue.
2023-05-23 01:45:10 +02:00
Tim Ledbetter
abdca9b766 du: Print to stderr rather than stdout when directory can't be read 2023-05-23 01:45:10 +02:00
Tim Ledbetter
5dfb4e8066 LibC: Fix incorrect string length calculation in getsignalbyname()
This makes `kill` and `killall` work correctly with signal names.
2023-05-23 01:42:04 +02:00
Nico Weber
ae5d1d5a25 WebP: Let ALPH replace alpha channel instead of augmenting it
Pixels will leave the lossy decoder with alpha set to 255.
The old code would be a no-op in that case.

No observable behavior change yet, since there still is no
decoder for lossy webp.
2023-05-22 19:24:49 +02:00
Timothy Flynn
35fdc7f8c8 SpiceAgent: Gracefully exit when the Spice server disconnects 2023-05-22 15:11:33 +02:00
Timothy Flynn
36d61c01bc SpiceAgent: Reduce copying of potentially large byte buffers
This moves buffers around instead of implicitly copying them, and marks
the message types that hold these buffers as move-only.
2023-05-22 15:11:33 +02:00
Timothy Flynn
b865277275 LibWeb: Wait for media candidates without endlessly queueing microtasks
Rather than queueing microtasks ad nauseam to check if a media element
has a new source candidate, let the media element tell us when it might
have a new child to inspect. This removes endless CPU churn in cases
where there is never a candidate that we can play.
2023-05-22 15:11:08 +02:00
Aliaksandr Kalenik
76aa17be86 LibWeb: Make sure collapsed margins are not ignored if box creates FC
Fixes a bug that if box creates new formatting context then all already
collapsed margins are ignored and only margin_top is used.
2023-05-22 12:51:24 +02:00
Andi Gallo
668578ddc0 LibWeb: Propagate children_are_inline in wrap_in_anonymous
This fixes a crash in box_baseline, due to cells created for
display: table expecting a box child and getting the inline node wrapper
instead.

Fixes #18972.
2023-05-22 10:25:18 +02:00
Karol Kosek
d1328639b4 mkfifo: Don't rely on global errno
Core::System::mkfifo() doesn't rely on POSIX's mkfifo() and sends the
syscall directly to our system. This means that the and errno doesn't
get updated which ultimately caused the program to display an incorrect
message 'mkfifo: Success (not an error)'.
2023-05-22 10:24:08 +02:00
Jelle Raaijmakers
4448a51824 LibGfx: Add search path to debug output in FontDatabase
This helps with debugging why fonts cannot be found.
2023-05-22 10:23:08 +02:00
Aliaksandr Kalenik
4fc4bd6c3f LibWeb: Set grid-auto-columns/rows in NodeWithStyle::apply_style() 2023-05-22 09:33:18 +02:00
Karol Kosek
6ab660b62f SystemMonitor: Store text in UnavailableProcessWidget using String class 2023-05-22 06:12:17 +02:00
Karol Kosek
2f8f7eb899 SystemMonitor: Propagate more errors on startup 2023-05-22 06:12:17 +02:00
Karol Kosek
412630637a SystemMonitor: Convert most widgets to a failable factory
I didn't convert widgets that don't do any failable tasks currently
or are lazy-initialized.
2023-05-22 06:12:17 +02:00
Luke Wilde
a5936864d9 LibWeb: Stub AudioContext constructor
This is enough to make Discord not throw up "Well this is awkward" on
login.
2023-05-22 06:07:05 +02:00
Luke Wilde
78db4e683f LibJS: Add "Month dd, yy hh:mm:ss" Date format
Required by Discord's Birthday page.
2023-05-22 06:07:05 +02:00
Luke Wilde
e038901555 LibWeb: Fire the contextmenu event on right click (if not holding shift)
This now allows websites such as Discord, YouTube and your favourite
"Right Click" xkcd comic to open a custom context menu when you right
click. You can bypass this by holding shift, just like Firefox.
2023-05-22 06:07:05 +02:00
MacDue
91d8665ab4 LibWeb: Tidy up apply_clip_overflow_rect() a little
Avoid possible null optional dereference when creating border radius
clipper, and avoid creating clipper if the clip rect is empty (which
prevents some debug spam). Also remove an unnecessary lambda.
2023-05-22 06:05:47 +02:00
Aliaksandr Kalenik
193290b19a LibWeb: Support grid-auto-columns and grid-auto-rows properties in GFC
Implements assignment of sizes specified in grid-auto-columns/rows for
implicitly created tracks.
2023-05-22 06:05:19 +02:00
Aliaksandr Kalenik
6e0601a63e LibWeb/CSS: Implement parsing of grid-auto-columns and grid-auto-rows 2023-05-22 06:05:19 +02:00
Aliaksandr Kalenik
b49e9d2eab LibWeb: Check if line name is present in GridTrackSizeList::to_string()
Fixes crash in GridTrackSizeList::to_string() when line names are
missing.
2023-05-22 06:05:19 +02:00
Pankaj Raghav
0c5d6c6c47 Kernel: Move NVMeInterruptQueue initialization out of its constructor
Add a helper initialize_interrupt_queue() helper to enable_irq instead
of doing it as part of its object construction as it can fail. This is
similar to how AHCI initializes its interrupt as well.
2023-05-21 18:01:29 -06:00
Pankaj Raghav
ac161f6a8d Kernel/NVMe: Add try_create() to NVMe{Poll|Interrupt}Queue
NVMe{Poll|Interrupt}Queue don't have a try_create() method. Add one to
keep it consistent with how we create objects. Also this commit is in
preparation to moving any initialization related code out of the
constructor.
2023-05-21 18:01:29 -06:00
Pankaj Raghav
b8c03d44a7 Kernel: Convert rw_dma_page to NonnullRefPtr in NVMeQueue
Propagate error if the rw_dma_page is NULL in try_create and use
relase_nonnull to convert RefPtr to NonnullRefPtr before passing it to
the NVMeQueue.
2023-05-21 18:01:29 -06:00
Pankaj Raghav
4014b06b08 Kernel: Remove the unused {cq|sq}_dma_page from NVMeQueue
{cq|sq}_dma_page are not used by the NVMeQueue class. Remove them.
2023-05-21 18:01:29 -06:00
Pankaj Raghav
d14c2a3583 Kernel: Move handle_interrupt out-of-line in PCIIRQHandler
Upgrade to GCC 13.1.0 triggered an UBSAN in PCIIRQHandler. Moving the
handle_interrupt() function out-of-line fixes this issue.
2023-05-21 18:01:29 -06:00
Sam Atkins
ff70418ffc Revert "LibGfx: Add NearestFractional scaling type to painter"
This reverts commit df30440117.

This scaling type is now unused, and has issues with painting outside of
the Painter's clip-rect.
2023-05-22 01:38:41 +02:00
Sam Atkins
7cc118e84e Magnifier: Correct captured bitmap's clipping
Previously, we would get a line of junk pixels to the right or bottom of
the captured bitmap.

Two aspects to this:
- Use Painter's clip-rect functionality instead of trying to implement
  it ourselves.
- Switch from ScalingMode::NearestFractional to ::NearestNeighbor.
  Somehow, `draw_scaled_bitmap(NearestFractional)` draws outside of the
  Painter's clip-rect. I can't discern any difference in behavior
  between these two otherwise.

We also now use the same bitmap for drawing the grid as we used for the
bitmap, since this had issues where it wasn't drawn to the edge of the
bitmap.
2023-05-22 01:38:41 +02:00
Caoimhe
0f3f190a5a SpiceAgent: Handle file transfer requests properly :^)
Now, we write the data recieved to a file when the user drags a file
onto the Spice Viewer window. Once complete, the FileExplorer will open
with the copied file highlighted.
2023-05-21 18:45:53 +02:00
Caoimhe
d87f823a68 SpiceAgent: Implement FileTransferData messages 2023-05-21 18:45:53 +02:00
Caoimhe
af91c75080 SpiceAgent: Implement FileTransferStatus messages 2023-05-21 18:45:53 +02:00
Caoimhe
476774d681 SpiceAgent: Implement FileTransferStart messages 2023-05-21 18:45:53 +02:00
Caoimhe
0d98920930 SpiceAgent: Implement sending clipboard data to the spice server 2023-05-21 18:45:53 +02:00
Caoimhe
9f92e52464 SpiceAgent: Add support for copying images to the clipboard 2023-05-21 18:45:53 +02:00
Caoimhe
50a8db3922 SpiceAgent: Add support for reading chunks larger than 2048 bytes 2023-05-21 18:45:53 +02:00
Caoimhe
3b6d63f723 SpiceAgent: Implement setting the user's clipboard contents for text
We also now use GUI::Clipboard for setting the clipboard contents,
instead of using a custom connection to the Clipboard server.
2023-05-21 18:45:53 +02:00