Commit graph

20039 commits

Author SHA1 Message Date
Jonah 00da2e86e6 LibJS/Temporal: Unroll the loop in to_temporal_duration_record
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/8e80575
2022-11-20 11:56:56 +00:00
Jonah 912867526b LibJS/Temporal: Unroll the loop in to_temporal_partial_dictation_record
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/8e80575
2022-11-20 11:56:56 +00:00
Jonah 381b36b83f LibJS/Temporal: Rename ToIntegerWithRounding to ToIntegerIfIntegral
This is an editorial change to the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/1dceb57
2022-11-20 11:56:56 +00:00
Jonah 1cd0b5ad8a LibJS/Temporal: Reorder Tables by Order of Magnitude
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/f2d5642 and
https://github.com/tc39/proposal-temporal/commit/07673d3
2022-11-20 11:56:56 +00:00
Zaggy1024 7aabda37d1 LibVT/LibLine: Delete words when pressing Ctrl+Backspace in Terminal 2022-11-20 03:57:17 +03:30
Andreas Kling f7a252ae85 LibJS: Fix UTF-16 corruption in String.prototype.replace()
We were mistakenly trying to append UTF-16 code units to a StringBuilder
via the append(char) API. This patch fixes that by accumulating the
result in a Vector<u16> instead.

This'll be a bit worse for performance, since we're now doing additional
UTF-16 string conversions, but we're going for correctness at this stage
and can worry about performance later.
2022-11-19 11:30:06 -07:00
Sam Atkins c279fd1097 cksum: Manually count file size instead of using stat()
`stat()` doesn't work for stdin, but this does.
2022-11-19 17:00:10 +00:00
Sam Atkins b8a1d04a49 xml: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins fde9cba2a0 Utilities/w: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 8d798c2716 utmpupdate: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 6d7435d251 test-fuzz: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins f7fa88976f sysctl: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 722879e2b9 strace: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 4c3d2267db sql: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins f22d7ddd98 shot: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 84e817a9f2 route: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 97ef1ac260 pmap: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins bc76a4d787 nproc: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins c8b3e68c6e netstat: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins b5f4e96e71 mount: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 9d34a1f4a7 md: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 14ce07dd52 markdown-check: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins ccebf8bf59 man: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 75208f2333 lsusb: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 880b35739e lspci: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 376b5731a2 lsof: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 9e4689f4c8 lsirq: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 2be7f9f42d lscpu: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 03a3b6f91c lsblk: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 8d7179766a js: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins f6884235e2 LibCore: Add a ConfigFile::open() overload for Core::Stream::File
Core::Stream is already used internally, but ironically you could not
open a ConfigFile using one!
2022-11-19 17:00:10 +00:00
Sam Atkins 678b4983cb json: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 1d67a1e73f ifconfig: Port to Core::Stream and Core::System 2022-11-19 17:00:10 +00:00
Sam Atkins 78a94cd3b7 headless-browser: Port screenshot output to Core::Stream
As noted in https://github.com/SerenityOS/serenity/issues/15239
`headless-browser` is currently broken, with or without these changes.
2022-11-19 17:00:10 +00:00
Sam Atkins 2228786329 gron: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins c757db9475 gml-format: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins d39552a7b7 fortune: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 813fc10aae file: Port to Core::Stream
Some nicer way of dealing with `stat` would be good. :thonk:
2022-11-19 17:00:10 +00:00
Sam Atkins 7684e514dd du: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins e08a42acd8 dmesg: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 37d4e01fc4 diff: Port to Core::Stream
Also switched to calling Core::System::isatty(), and doing so once
instead of per hunk.
2022-11-19 17:00:10 +00:00
Sam Atkins ed6d353cdd df: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 05c3b48e63 Utilities: Port cpp utilities to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 39a4f1560b copy: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 6763e1bd60 comm: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 8ed5403d8c comm: Stop skipping a line in the output
Because of how we output lines in the loop above, if we leave that loop
when the last line was not the same in both files, then either
`file1_line` or `file2_line` has not been output yet.
`process_remaining()` does not print that line either, since it
immediately reads a new line. So, output the previously-missing line
before we call that. :^)
2022-11-19 17:00:10 +00:00
Sam Atkins 83366e2b2e cksum: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins d071a93047 base64: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 5a0c298074 arp: Port to Core::Stream 2022-11-19 17:00:10 +00:00
Sam Atkins 4ad1695c78 WebContent: Add $() and $$() functions to browser console
These are based on the ones in Firefox:

`$(selector, element = document)`:
    Equivalent to `element.querySelector(selector)`.

`$$(selector, element = document)`:
    Equivalent to `element.querySelectorAll(selector)`.
2022-11-19 16:56:31 +00:00
Sam Atkins c793beb0cc WebContent: Add $_ variable to browser console
This holds the return value of the expression that was last entered into
the browser console. If that last expression returned an error of some
kind, `$_` will be `undefined`. This matches the behaviour in Firefox.
2022-11-19 16:56:31 +00:00
Sam Atkins 3ec13fdb86 WebContent: Rename $0 getter and use global object instead of this
Using the global object works consistently in native accessors and
native functions, so changing this for consistency.
2022-11-19 16:56:31 +00:00
Sam Atkins f9c9506997 WebContent: Create a separate realm for JS console input
This allows us to expose extra functions and properties to the console,
such as `$0`, without them being available to website scripts.

`ConsoleEnvironmentSettingsObject` is basically a stub, since we require
an `EnvironmentSettingsObject` but it has abstract methods.
2022-11-19 16:56:31 +00:00
Timothy Flynn 9782660cb6 LibWebView: Update OOPWV's URL when a page starts/finishes loading
If the page's URL is changed from within the WebContent process (e.g.
window.location.href is set from JavaScript, or a navigation is started
from WebDriver), we would not store the URL at all within OOPWV. This
prevented actions like reloading from working properly, as the browser
would reload whatever URL was previously entered in the URL box.
2022-11-19 16:56:02 +00:00
thankyouverycool 325061b0e4 WindowServer: Add misbehavior restriction for Blocking modals
Two Blocking modals in the same modal chain which aren't descended
one from the other will block each other's input rendering the chain
noninteractive. This has caused confusion in the past for builders so
this warning makes the behavior explicitly forbidden.
2022-11-19 16:04:42 +01:00
thankyouverycool ef7d9c0166 LibGUI: Disallow shortcut propagation in Blocking modals and Popups
This restriction is already present for mouse shortcuts but was
forgotten in the recent key event refactor.
2022-11-19 16:04:42 +01:00
thankyouverycool 59e10d5283 WindowServer: Don't compute title usernames for frameless Windows
This was causing a slight delay when opening ComboBox ListViews.
As an easy first optimization, don't bother computing this at all
for frameless windows and those not type Normal.
2022-11-19 16:04:42 +01:00
thankyouverycool 4ba20f08c7 LibGUI: Don't search ComboBox Windows when holding a mod key 2022-11-19 16:04:42 +01:00
thankyouverycool 5c923977b7 LibGUI: Always close() Dialogs no matter the execution result
Fixes Blocking modal race conditions when new windows are created
in the same scope as Dialogs.
2022-11-19 16:04:42 +01:00
thankyouverycool 2028fbeae3 LibGUI: Remove redundant event handling in EmojiInputDialog
The Dialog class already handles closing on escape.
2022-11-19 16:04:42 +01:00
thankyouverycool a6581c2aac LibGUI: Paint text selections as active in Popups
And hide TextEditor cursors in active windows when focus is preempted
2022-11-19 16:04:42 +01:00
thankyouverycool f7eb72a8be Terminal+LibVT: Toggle TerminalWidget's focus on input preemption
This prevents Terminal's cursor from blinking when a Popup is open.
2022-11-19 16:04:42 +01:00
thankyouverycool 657ff1cd19 LibGUI: Set focus proxy for CommandPalette's TableView 2022-11-19 16:04:42 +01:00
thankyouverycool 3b18226fcb LibGUI: Let Widgets track their focus proxy delegators
And update them on relevant events.
2022-11-19 16:04:42 +01:00
thankyouverycool 4aa608aa71 LibGUI+Taskbar+Applets+Applications: Set various windows as Popups
Makes the Audio applet, Taskbar clock, CommandPalette, EmojiPicker,
and Assistant work as Popup windows. Popups are frameless, unmovable,
and unresizable by default, in addition to their preemptive function.
Also sets Assistant not to obey widget min size so its search result
area resizes correctly
2022-11-19 16:04:42 +01:00
thankyouverycool 24d299c9c8 LibGUI+WindowServer+Applets+Taskbar: Remove active input concepts
and the CaptureInput mode. They are a source of unneeded complexity
in WindowServer and have proven prone to regressions, so this patch
replaces them with a simple input preemption scheme using Popups.

Popup windows now have ergonomics similar to menus: When open,
a popup preempts all mouse and key events for the entire window
stack; however, they are fragile and will close after WindowServer
swallows the first event outside them. This is similar to how combo
box windows and popups work in the classic Windows DE and has the
added benefit of letting the user click anywhere to dismiss a popup
without having to worry about unwanted interactions with other
widgets.
2022-11-19 16:04:42 +01:00
thankyouverycool 35bd79701c WindowServer: Add request_close_fragile_windows() helper 2022-11-19 16:04:42 +01:00
thankyouverycool c23adeaaf7 WindowServer: Add foremost_popup_window() helper 2022-11-19 16:04:42 +01:00
thankyouverycool 3027cf7e99 LibGUI+WindowServer: Remove InputPreemptor concept
This functionality will be superceded by WindowType:Popups
2022-11-19 16:04:42 +01:00
thankyouverycool 5d567565a4 LibGUI+WindowServer: Replace WindowInput{Enter,Leave} Events
with WindowInput{Preempted,Restored} Events and allow Widgets to save
the state of their focus preemption. As of now, only Popups will
preempt input and trigger these events.
2022-11-19 16:04:42 +01:00
thankyouverycool 901878bad9 LibGUI: Use move_cursor() API for AutocompleteProvider
Fixes failure to update focus rect when moving between items.
2022-11-19 16:04:42 +01:00
thankyouverycool 2c58902939 LibGUI: Use WindowType:Autocomplete for AutocompleteProvider
And fix its inability to focus/resize correctly.
2022-11-19 16:04:42 +01:00
thankyouverycool 1718a40ac7 LibGUI+WindowServer: Add WindowType:Autocomplete and helpers 2022-11-19 16:04:42 +01:00
Julian Offenhäuser 0bc3333740 LibPDF: Parse integer numbers with atoi() instead of strtof()
strtof() produces rounding errors for very large numbers, which we
don't want for integers, as they may have to be precise.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser c2ad29c85f LibPDF: Implement png predictor decoding for flate filter
For flate and lzw filters, the data can be transformed by this
predictor function to make it compress better. For us this means that
we have to undo this step in order to get the right result.

Although this feature is meant for images, I found at least a few
documents that use it all over the place, making this step very
important.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser 4bd79338e8 LibPDF: Fix off-by-one error in Reader::remaining() 2022-11-19 15:42:08 +01:00
Julian Offenhäuser 4b1a72ff7a LibPDF: Fix loop condition in parse_xref_stream()
We previously compared two unrelated values to determine if we parsed
the xref table to completion. We now check if we added every subsection
instead, and double check to make sure we never read past the end.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser a17a23a3f0 LibPDF: Make some variable names in parse_xref_stream() more clear
I found these to be a bit misleading.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser f926dfe36b LibPDF: Implement the DCT filter
This filter basically tells us that we are dealing with a JPEG.
Note that by serializing the resulting image we assume that this filter
is the last one in the chain, everything else would be highly unlikely.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser baaf42360e LibPDF: Derive alternate ICC color space from the number of components
We currently don't support ICC color spaces and fall back to a "simple"
one instead.

If no alternative is specified however, we are allowed to pick the
closest match based on the number of color components.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser 16ed407c01 LibPDF: Support cascading stream filters
You can specify multiple filters as an array, where each one is fed the
output of the one before it.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser becd648a78 LibPDF: Parse hexadecimal values in name objects correctly 2022-11-19 15:42:08 +01:00
Julian Offenhäuser 0308300b78 PDFViewer: Take the mousewheel delta into account for scrolling
We now respect the system-wide setting for scroll speed, where we would
previously use a fixed step.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser 9b1331a984 PDFViewer: Simplify user-facing error messages
We now show a simple, if less helpful, message to the user and print
the verbose error message to serial instead.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser e782d03f96 PDFViewer: Invalidate document when a page fails to load
This fixes an issue where we would show an error message on every
subsequent paint event, making it impossible to close or use the
application further.

Some more architectural work is needed if we want to invalidate the
sidebar entries as well.
2022-11-19 15:42:08 +01:00
thankyouverycool ef30073127 LibGUI: Let Delete remove selections greater than 1 in GlyphMapWidget
Updates keydown_event() to work with the new bubbling mechanism
for action shortcuts.
2022-11-19 15:41:09 +01:00
thankyouverycool 92a75ccaed FontEditor: Include file basename in error messages when available
And write messages in the [action] failed: [error] format to match
common error message formatting elsewhere in Userland.
2022-11-19 15:41:09 +01:00
thankyouverycool 9725fd162f LibGUI+Applications: Allow GlyphMapWidget's set_font() to fail
And TRY early during initialization in FontEditor to leave the app
in a valid state on error. Fixes OOM crashes when cloning the original
font for highlight modifications.
2022-11-19 15:41:09 +01:00
thankyouverycool 1be830e3c6 LibGfx: Add pure virtual fallible clone() for Fonts 2022-11-19 15:41:09 +01:00
thankyouverycool d9fb838cf6 LibGUI+FontEditor: Allow system emoji to be toggled in GlyphMapWidget
And remove their red backgrounds when visible to not be confused with
deletion highlights.
2022-11-19 15:41:09 +01:00
thankyouverycool c974e644ec FontEditor: Add Layout options to View menu
Like other apps, FontEditor now organizes widget visibility toggles
under a View->Layout submenu. The main toolbar and the status bar
can now be turned on and off.
2022-11-19 15:41:09 +01:00
thankyouverycool 61d93092cf FontEditor: Remove redundant set_scale() helper 2022-11-19 15:41:09 +01:00
thankyouverycool 8f7dbf363e FontEditor: Remove overzealous find-and-replace ""sv operator 2022-11-19 15:41:09 +01:00
thankyouverycool 894b41ef4d FontEditor: Consolidate GlyphEditor's flip_{horizontally,vertically} 2022-11-19 15:41:09 +01:00
thankyouverycool d867871bda FontEditor: Standardize Gfx::RotationDirections for rotate_90() 2022-11-19 15:41:09 +01:00
Andreas Kling fb00d3ed25 Kernel+lsirq: Track per-CPU IRQ handler call counts
Each GenericInterruptHandler now tracks the number of calls that each
CPU has serviced.

This takes care of a FIXME in the /sys/kernel/interrupts generator.

Also, the lsirq command line tool now displays per-CPU call counts.
2022-11-19 15:39:30 +01:00
MacDue 8a5d2be617 Everywhere: Remove unnecessary mutable attributes from lambdas
These lambdas were marked mutable as they captured a Ptr wrapper
class by value, which then only returned const-qualified references
to the value they point from the previous const pointer operators.

Nothing is actually mutating in the lambdas state here, and now
that the Ptr operators don't add extra const qualifiers these
can be removed.
2022-11-19 14:37:31 +00:00
MacDue 66a428ae03 LibJS+LibWeb: Return non-const types from Ptr class operators
Even if the pointer value is const, the value they point to is not
necessarily const, so these functions should not add the qualifier.

This also removes the redundant non-const implementations of these
operators.
2022-11-19 14:37:31 +00:00
Jamie Mansfield 24caacfe28 LibJS: Add spec comments to TypedArray.prototype.entries 2022-11-19 14:23:28 +00:00
Jamie Mansfield 67ed3e1d93 LibJS: Add spec comments to TypedArray.prototype.keys 2022-11-19 14:23:28 +00:00