Commit graph

11734 commits

Author SHA1 Message Date
Timothy Flynn 9a62c01ebc LibJS: Implement ECMA-402 Date.prototype.toLocaleString 2021-12-10 13:58:33 +00:00
Sam Atkins 54bbb97ac6 Browser+LibWeb+WebContent: Add variables display to Inspector
This allows us to see which custom properties apply to a given element,
which previously wasn't shown.
2021-12-10 06:52:17 +01:00
Timothy Flynn 53df13fed7 LibJS: Implement Intl.DateTimeFormat.prototype.formatRangeToParts 2021-12-09 23:43:04 +00:00
Timothy Flynn 04f8fb07e1 LibJS: Implement Intl.DateTimeFormat.prototype.formatRange 2021-12-09 23:43:04 +00:00
Timothy Flynn 1f35eda37b LibJS: Store range format patterns in the Intl.DateTimeFormat object
Now that LibUnicode generates these patterns, the AO steps to retrieve
them may be implemented.
2021-12-09 23:43:04 +00:00
Timothy Flynn 7a0d5e3f7a LibJS: Do not return views into potentially freed memory
In a future commit, the "part" view returned from FormatDateTimePattern
may be a view into a string that goes out of scope. Ensure the AO only
returns valid views. A similar approach is used in Intl.NumberFormat.
2021-12-09 23:43:04 +00:00
Timothy Flynn 2024d9e9ea LibUnicode: Add method to combine two format pattern skeletons
The fields of the generated elements must be in the same order as the
table here:
https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table

Further, only one field from each group of fields is allowed.
2021-12-09 23:43:04 +00:00
Timothy Flynn 9d4c4303fd LibUnicode: Parse and generate date time range format patterns 2021-12-09 23:43:04 +00:00
Timothy Flynn fe84a365c2 LibUnicode: Parse and generate format pattern skeletons
Pattern skeletons are more or less the "key" of format patterns. Every
format pattern is assigned a skeleton. Interval patterns (which are not
yet parsed) are also assigned a skeleton - this is used to match them to
an "owning" format pattern. So we will use the skeleton generated here
to match format patterns at runtime with their available interval
patterns.

An alternative approach would be to append interval patterns directly to
their owning format pattern, but this has some draw backs:

    1. Skeletons aren't totally unique. A skeleton may appear in both
       the "dateFormats" and "availableFormats" objects, in which case
       the same interval formats would be generated more than once.

    2. Otherwise unique format patterns may only differ by the interval
       patterns assigned to them. This would cause the UniqueStorage for
       the format patterns to increase in size, impacting both compile
       times and libunicode.so size.
2021-12-09 23:43:04 +00:00
Linus Groh bdb8fc54f2 LibJS: Update spec comment in balance_duration_relative()
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/665871e
2021-12-09 23:18:01 +00:00
Linus Groh 82efbfcf3d LibJS: Update spec comment in Temporal.Duration.prototype.round()
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/513c05b
2021-12-09 23:14:36 +00:00
scwfri 8d0143a380 HackStudio+TextEditor: Persist EditingEngineType across editors
Persist EditingEngine mode in HackStudio and TextEditor when opening new
files or editing splits. Previously, the EditingEngine defaulted to a
RegularEditingEngine for a new Editor, even if Vim Emulation had been
selected in the existing Editor.
2021-12-09 21:31:06 +01:00
scwfri fa94978a7e LibGUI: Add EngineType to EditingEngine classes
This will allow users of EditingEngine classes to determine current type
of EditingEngine (currently either vim or regular).
2021-12-09 21:31:06 +01:00
Sam Atkins c9062b4ed5 LibWeb: Remove now-unused CustomStyleValue 2021-12-09 21:30:31 +01:00
Sam Atkins c3437bccb3 LibWeb: Handle dependency cycles in CSS var()s :^)
We now detect situations like this, where variables infinitely recur,
without crashing:

```css
div {
  --a: var(--b);
  --b: var(--a);
  background: var(--a);
}

p {
  --foo: var(--foo);
  background: var(--foo);
}
```
2021-12-09 21:30:31 +01:00
Sam Atkins 3df0bf2c8d LibWeb: Mitigate the billion-laughs attack on CSS variables
We now stop processing variables once a length of 16384 tokens is
reached. This is an arbitrary number, but should be far beyond what
anyone will reasonably use, and small enough to not crash.
2021-12-09 21:30:31 +01:00
Sam Atkins 67e1125b4c LibWeb: Handle fallback values for CSS variables :^) 2021-12-09 21:30:31 +01:00
Sam Atkins 23dc0dac88 LibWeb: Parse and resolve UnresolvedStyleValues
If a property is custom or contains a `var()` reference, it cannot be
parsed into a proper StyleValue immediately, so we store it as an
UnresolvedStyleValue until the property is compute. Then, at compute
time, we resolve them by expanding out any `var()` references, and
parsing the result.

The implementation here is very naive, and involves copying the
UnresolvedStyleValue's tree of StyleComponentValueRules while copying
the contents of any `var()`s it finds along the way. This is quite an
expensive operation to do every time that the style is computed.
2021-12-09 21:30:31 +01:00
Sam Atkins 000fb5a70d LibWeb: Add new UnresolvedStyleValue class
This represents a property value that hasn't been converted to a
"proper" StyleValue yet. That is, it's either a custom property's value,
or a value that includes `var()` references, (or both!) since neither of
those can be fully resolved at parse time.
2021-12-09 21:30:31 +01:00
Sam Atkins d2f9d2fe51 LibWeb: Make StyleBlockRule more accessible to outsiders
For our naive var() implementation, we need to be able to create
StyleBlockRules outside of the Parser, and these changes make that
possible.
2021-12-09 21:30:31 +01:00
Sam Atkins 1d5d27aa22 LibWeb: Include custom properties in CSS dump 2021-12-09 21:30:31 +01:00
Andreas Kling c268d0fa13 LibWeb: Make CSS::Screen forward its ref count to DOM::Window 2021-12-09 21:28:52 +01:00
Andreas Kling 7fc770cfac LibWeb: Make DOM::NamedNodeMap forward its ref count to DOM::Element
This allows JS to keep an element alive by retaining a reference to
element.attributes
2021-12-09 21:28:52 +01:00
Andreas Kling d368b08698 LibWeb: Make DOMImplementation forward its ref count to DOM::Document
This allows document.implementation to keep the underlying document
alive for as long as we need it (for example, if someone holds on to a
DOMImplementation JS wrapper after the document is GC'd.)
2021-12-09 21:28:52 +01:00
Andreas Kling e1287a9a45 LibWeb: Use RefCountForwarder for NavigationTiming::PerformanceTiming
This object already forwarded its ref count to DOM::Window. This patch
simply adopts the new RefCountForwarder base to achieve the same thing.
2021-12-09 21:28:52 +01:00
Andreas Kling fed6a76990 LibJS: Add Handle::operator->() 2021-12-09 21:28:52 +01:00
Ben Wiederhake aa5f130c84 Inspector: Remove unused includes
Found while working on something else.
2021-12-08 17:18:37 -08:00
James Puleo dd25dfbc20 js: Improve usage of TRY when executing a file program 2021-12-08 17:17:35 -08:00
Linus Groh 859b810db1 LibJS/Tests: Enable two more skipped tests which now pass
Only two skipped tests remaining overall :^)
2021-12-08 20:08:26 +00:00
Linus Groh f1dafabbb9 LibJS: Simplify TemporalInstantString
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/271d71c
2021-12-08 19:57:19 +00:00
Luke Wilde 4f3c283f24 LibJS: Move calendar validation out of parse_temporal_calendar_string
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/7207a1c
2021-12-08 19:11:50 +00:00
Luke Wilde 80dcddacea LibJS: Simplify return in parse_temporal_date_time_string
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/1f7e486
2021-12-08 19:11:50 +00:00
Luke Wilde 6244969ae2 LibJS: Remove duplicated spec step in parse_iso_date_time
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/516bf24
2021-12-08 19:11:50 +00:00
Ben Wiederhake 9f91f610e2 test-crypto: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake 13cba5f8b4 Spreadsheet: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake 7967a8bd8c LibTLS: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake f3e496d995 LibSQL: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake f59f7674c8 LibHTTP: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake d78365f785 LibGemini: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Ben Wiederhake 643ec03608 LibCore: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Timothy Flynn 1e68e7f129 LibJS: Implement Intl.DateTimeFormat.prototype.formatToParts 2021-12-08 11:29:36 +00:00
Timothy Flynn adaf5985a4 LibJS: Implement (most of) Intl.DateTimeFormat.prototype.format
There are a few FIXMEs that will need to be addressed, but this
implements most of the prototype method. The FIXMEs are mostly related
to range formatting, which has been entirely ignored so far. But other
than that, the following will need to be addressed:

* Determining flexible day periods must be made locale-aware.
* DST will need to be determined and acted upon.
* Time zones other than UTC and calendars other than Gregorian are
  ignored.
* Some of our results differ from other engines as they have some
  format patterns we do not. For example, they seem to have a lonely
  {dayPeriod} pattern, whereas our closest pattern is
  "{hour} {dayPeriod}".
2021-12-08 11:29:36 +00:00
Timothy Flynn d010ba10c3 LibJS: Cache the data locale used by Intl.DateTimeFormat
Unlike the locale, the data locale has Unicode locale extensions removed
(e.g. the data locale for "en-US-u-ca-gregory" is just "en-US"). Cache
the data locale for LibUnicode lookups during formatting.
2021-12-08 11:29:36 +00:00
Timothy Flynn 4cc8cf9233 LibJS: Add an accessor for the %Date.now% instrinsic property 2021-12-08 11:29:36 +00:00
Timothy Flynn baf3f3bd6e LibJS: Implement Date's Week Day AO 2021-12-08 11:29:36 +00:00
Timothy Flynn e56be34148 LibJS: Implement Date's TimeClip AO 2021-12-08 11:29:36 +00:00
Timothy Flynn b76e44f66f LibUnicode: Parse and generate time zone names in long and short form 2021-12-08 11:29:36 +00:00
Timothy Flynn 2bbf8aa24c LibUnicode: Generate era, month, weekday and day period calendar symbols
The parsing in parse_calendar_symbols() might be a bit more verbose than
it really needs to be, but it is to ensure the symbols are generated in
a known order that we can control with enumerations.
2021-12-08 11:29:36 +00:00
Timothy Flynn 26f9666191 LibJS: Do not override hour, minute, and second format field lengths
This was an oversight in e42d954743.

These fields should always follow the locale preference in the CLDR.
Overriding these fields would permit formats like "h:mm:ss" to result in
strings like "1:2:3" instead of "1:02:03".
2021-12-08 11:29:36 +00:00
Timothy Flynn 9f7c727720 LibJS+LibUnicode: Generate missing patterns with fractionalSecondDigits
TR-35's Matching Skeleton algorithm dictates how user requests including
fractional second digits should be handled when the CLDR format pattern
does not include that field. When the format pattern contains {second},
but does not contain {fractionalSecondDigits}, generate a second pattern
which appends "{decimal}{fractionalSecondDigits}" to the {second} field.
2021-12-08 11:29:36 +00:00
Timothy Flynn 6ace4000bf LibJS+LibUnicode: Supply field type in CalendarPattern's for-each method
Some callers will want different behavior depending on what field is
being provided to the callback.
2021-12-08 11:29:36 +00:00
Andreas Kling fa879168f5 LibJS: Mark Function object's private environment during GC 2021-12-08 10:29:54 +01:00
Andreas Kling f25899ca34 LibJS: Mark entire private environment chains during GC 2021-12-08 10:29:54 +01:00
Andreas Kling 4790f9a628 LibJS: Make sure private environments are marked during GC 2021-12-08 10:29:54 +01:00
Andreas Kling 212319b25e LibJS: Only allocate space for Object private elements if needed
Most JavaScript objects don't have private elements, so this reduces the
size of typical JS::Object instances by two pointers.
2021-12-08 10:29:54 +01:00
Hendiadyoin1 67a1a9db1d WebContent: Add missing TRY on client initialization 2021-12-07 00:44:57 +01:00
Andreas Kling 971b3645ef LibIPC: Add IPC::take_over_accepted_client_from_system_server<Client>()
This is an encapsulation of the common work done by all of our
single-client IPC servers on startup:

    1. Create a Core::LocalSocket, taking over an accepted fd.
    2. Create an application-specific ClientConnection object,
       wrapping the socket.

It's not a huge change in terms of lines saved, but I do feel that it
improves expressiveness. :^)
2021-12-06 19:22:16 +01:00
Andreas Kling 6d0f504822 LibIPC: Add IPC::MultiServer convenience class
This encapsulates what our multi-client IPC servers typically do on
startup:

    1. Create a Core::LocalServer
    2. Take over a listening socket file descriptor from SystemServer
    3. Set up an accept handler for incoming connections

IPC::MultiServer does all this for you! All you have to do is provide
the relevant client connection type as a template argument.
2021-12-06 19:22:16 +01:00
Andreas Kling 81047d8f9c LibCore: Make LocalServer::take_over_from_system_server() return ErrorOr
This allows us to use TRY() or MUST() when calling it.
2021-12-06 19:22:16 +01:00
Andreas Kling 229a45ab14 SQLServer: Port to LibMain :^) 2021-12-06 19:22:16 +01:00
Andreas Kling 69ea1ff743 LaunchServer: Port to LibMain :^) 2021-12-06 19:22:16 +01:00
Andreas Kling 58b99df16d LibWeb: Make StyleSheet::m_parent_style_sheet a WeakPtr
It's not safe for this to be a raw pointer, as the child can outlive the
parent.
2021-12-06 19:22:16 +01:00
Andreas Kling e8b85b13e2 LibWeb: Make CSSStyleSheet::m_owner_css_rule a WeakPtr
It's not safe for this to be a raw pointer, as the imported style sheet
can outlive the rule.
2021-12-06 19:22:16 +01:00
Andreas Kling f47c658275 LibWeb: Make CSSImportRule::m_document a WeakPtr
It's not safe for this to be a raw reference, as CSSImportRule can
outlive the document.
2021-12-06 19:22:16 +01:00
Timothy Flynn 20b6ffef4f LibJS: Add tests for calendar fields of DateTimeFormat's resolvedOptions
These are (mostly) testable now that LibUnicode parses format patterns.
2021-12-06 15:46:34 +01:00
Timothy Flynn e42d954743 LibJS: Always respect user-provided format field lengths
ECMA-402 doesn't explicitly handle a note in the TR-35 spec related to
expanding field lengths based on user-provided options. Instead, it
assumes the "implementation defined" locale data includes the possible
values.

LibUnicode does not generate every possible combination of field lengths
in its implementation of TR-35's "Missing Skeleton Fields", because the
number of generated patterns would grow out of control. Instead, it's
much simpler to handle this difference at runtime.
2021-12-06 15:46:34 +01:00
Timothy Flynn 9dc9700e3b LibJS: Fallback to [[pattern]] when [[pattern12]] is unavailable
Other implementations unconditionally initialize [[pattern12]] from
[[pattern]] regardless of whether [[pattern]] has an hour pattern of h11
or h12. LibUnicode does not do this. So when InitializeDateTimeFormat
defaults the hour cycle to the locale's preferred hour cycle, if the
best format didn't have an equivalent hour pattern, [[pattern12]] will
be empty.
2021-12-06 15:46:34 +01:00
Ben Wiederhake 152d455143 strace: Handle strings more gracefully
In particular, strace can now stomach memory errors while copying
invalid strings.

Example with a valid string:
    dbgputstr("95.976 traceme(38:38) Well, Hello Friends!") = 55
Example with an invalid string:
    dbgputstr(Error(errno=14){0x00012345, 678b}) = -14 EFAULT
(ANSI escapes removed for readability.)
2021-12-05 22:59:09 +01:00
Ben Wiederhake 49adebf0fc strace: Use new PT_PEEKBUF function
This necessarily introduces some usages (and benefits!) of the new
ErrorOr<> pattern. To keep commits atomic, I do not yet rewrite the
entire program to use ErrorOr<> correctly.
2021-12-05 22:59:09 +01:00
Ben Wiederhake 70e96fb917 LibCore: Implement new ptrace_peekbuf wrapper for PT_PEEKBUF syscall 2021-12-05 22:59:09 +01:00
Ben Wiederhake 3e223185b3 Kernel+strace: Remove unnecessary indirection for PEEK
Also, remove incomplete, superfluous check.
Incomplete, because only the byte at the provided address was checked;
this misses the last bytes of the "jerk page".
Superfluous, because it is already correctly checked by peek_user_data
(which calls copy_from_user).

The caller/tracer should not typically attempt to read non-userspace
addresses, we don't need to "hot-path" it either.
2021-12-05 22:59:09 +01:00
Sam Atkins 3ca2aee054 Applications: Cast unused smart-pointer TRY return values to void 2021-12-05 15:31:03 +01:00
Sam Atkins 7e05ccaa70 Demos: Cast unused smart-pointer return values to void 2021-12-05 15:31:03 +01:00
Sam Atkins 7196570f9b LibWeb: Cast unused smart-pointer return values to void 2021-12-05 15:31:03 +01:00
Sam Atkins 31ea222f97 LibVT: Cast unused smart-pointer return value to void 2021-12-05 15:31:03 +01:00
Sam Atkins 0e2fa09f52 Games: Cast unused smart-pointer return values to void 2021-12-05 15:31:03 +01:00
Sam Atkins d95e50643e LibGUI: Cast unused smart-pointer return values to void 2021-12-05 15:31:03 +01:00
Sam Atkins 2aa0885220 DHCP4Client: Cast unused Timer return values to void
Timers attach themselves to the provided parent, so they are safely kept
alive.
2021-12-05 15:31:03 +01:00
Sam Atkins d2024f04bd Userland: Cast unused BackgroundAction::construct() results to void
User code does not need to keep this alive, so casting to void is safe.
But maybe a bit weird.
2021-12-05 15:31:03 +01:00
Sam Atkins 92f8514a85 Services: Cast unused IPC::new_client_connection() results to void
These ones all manage their storage internally, whereas the WebContent
and ImageDecoder ones require the caller to manage their lifetime. This
distinction is not obvious to the user without looking through the code,
so an API that makes this clearer would be nice.
2021-12-05 15:31:03 +01:00
Sam Atkins c67c1b583a LibELF: Cast unused smart-pointer return value to void 2021-12-05 15:31:03 +01:00
Sam Atkins a0f6da7ceb LibDSP: Cast unused smart-pointer return value to void 2021-12-05 15:31:03 +01:00
Sam Atkins 081d9bd010 LibCpp: Cast unused smart-pointer return values to void 2021-12-05 15:31:03 +01:00
Sam Atkins b138070da9 Shell: Cast unused smart-pointer return values to void 2021-12-05 15:31:03 +01:00
Idan Horowitz 13dec3cdde LibC: Add a couple of missing errno codes
These are required to compile a port.
2021-12-05 12:53:29 +01:00
Idan Horowitz d68242ba2f LibC: Stub out the rest of the getnameinfo flags
These are required for the compilation of some ports.
2021-12-05 12:53:29 +01:00
Idan Horowitz e521ffd156 Kernel: Add support for the MSG_WAITALL sys$recvmsg flag 2021-12-05 12:53:29 +01:00
Idan Horowitz 5514d60d8d Kernel: Add support for the MSG_DONTROUTE sys$sendmsg flag 2021-12-05 12:53:29 +01:00
Idan Horowitz 1f16250de9 Kernel: Add the SIOCATMARK ioctl request macro
This is not actually implemented at the moment, as we do not support
sending or receiving out-of-band data at all currently, but it is
required for some ports to compile.
2021-12-05 12:53:29 +01:00
Elyse 8595fd585d SoundPlayer: Port to LibMain :^) 2021-12-04 15:07:18 -08:00
Kenneth Myhra d465d3a457 chmod: Port to LibMain :^)
This ports chmod to LibMain + changes input parameters on several
functions from raw C strings to StringView.
2021-12-04 15:05:46 -08:00
Kenneth Myhra 0d76d15f9d LibCore: Add syscall wrapper for chmod() 2021-12-04 15:05:46 -08:00
Jan de Visser c369626ac1 LibSQL: Gracefully react to unimplemented valid SQL
Fixes a crash that was caused by a syntax error which is difficult to
catch by the parser: usually identifiers are accepted in column lists,
but they are not in a list of column values to be inserted in an INSERT.

Fixed this by putting in a heuristic check; we probably need a better
way to do this.

Included tests for this case.

Also introduced a new SQL Error code, `NotYetImplemented`, and return
that instead of crashing when encountering unimplemented SQL.
2021-12-04 20:49:22 +03:30
Jan de Visser 001949d77a LibSQL: Improve error handling
The handling of filesystem level errors was basically non-existing or
consisting of `VERIFY_NOT_REACHED` assertions. Addressed this by
* Adding `open` methods to `Heap` and `Database` which return errors.
* Changing the interface of methods of these classes and clients
downstream to propagate these errors.

The constructors of `Heap` and `Database` don't open the underlying
filesystem file anymore.

The SQL statement handlers return an `SQLErrorCode::InternalError`
error code if an error comes back from the lower levels. Note that some
of these errors are things like duplicate index entry errors that should
be caught before the SQL layer attempts to actually update the database.

Added tests to catch attempts to open weird or non-existent files as
databases.

Finally, in between me writing this patch and submitting the PR the
AK::Result<Foo, Bar> template got deprecated in favour of ErrorOr<Foo>.
This resulted in more busywork.
2021-12-04 20:49:22 +03:30
Andreas Kling 108de5dea0 LibWeb: Stop sending "load" event twice to iframes
The "completely finish loading" algorithm (from the HTML spec) is
responsible for sending a "load" event to nested browsing context
containers (iframes).

This patch removes the old mechanism for sending "load" events, which we
had mistakenly kept around, causing two events to be sent instead of
one. :^)
2021-12-04 14:47:24 +01:00
Andreas Kling 58309444d7 LibWeb: Fix DOMImplementation changing content type of wrong document
DOMImplementation.createDocument() should set the content type of the
newly created document, not replace the content type of the
DOMImplementation's own host document.
2021-12-04 14:38:16 +01:00
Andreas Kling d7a116bb0e groups: Port to LibMain :^) 2021-12-04 14:24:04 +01:00
Andreas Kling 96e4077c38 SystemMonitor: Port to LibMain :^)
There's a lot more work to do on this application to take full advantage
of TRY() etc. This patch just scratches the surface.
2021-12-04 14:24:04 +01:00
Andreas Kling 01228bf4ef CrashReporter: Port to LibMain and use TRY() while building the UI :^) 2021-12-04 14:24:04 +01:00
Andreas Kling 2511da1f57 gron: Use StringView literals more (instead of raw C strings) 2021-12-04 14:24:04 +01:00
Andreas Kling 855c425719 gron: Port to LibMain :^) 2021-12-04 14:24:04 +01:00
Andreas Kling b0659b50dc jp: Port to LibMain :^) 2021-12-04 14:24:04 +01:00
Andreas Kling c3733bea92 Applets/ClipboardHistory: Port to LibMain :^) 2021-12-04 14:24:04 +01:00
Andreas Kling de182d4b46 stat: Modernize slightly :^)
- Port to LibMain
- Use AK::Format instead of printf()
2021-12-04 14:24:04 +01:00
Andreas Kling 0de575ec11 ls: Port to LibMain :^) 2021-12-04 14:24:04 +01:00
Andreas Kling 1640445cb2 LibCore: Add lstat() syscall wrapper 2021-12-04 14:24:04 +01:00
Daniel Bertalan 21acebd372 HackStudio: Fix cursor not jumping to column 1 in the embedded terminal
Normally, it's the TTY layer's job to translate '\n' into the separate
'\r' and '\n' control characters needed by the terminal to move the
cursor to the first column of the next line.
(see 5d80debc1f).

In HackStudio, we directly inject data into the TerminalWidget to
display command status. This means that this automatic translation
doesn't happen, so we need to explicitly give it the '\r' too.
2021-12-04 14:44:00 +03:30
Tim Schumacher 0ca63cfd6e find: Implement support for multiple directories 2021-12-03 15:39:00 +01:00
Tim Schumacher 5a21c3b389 find: Use a Vector for parsing instead of moving optind 2021-12-03 15:39:00 +01:00
Tim Schumacher 4ca35ac1b8 find: Port to LibMain 2021-12-03 15:39:00 +01:00
Itamar c3c2fe153b LibCpp: Add "ignore invalid statements" option to Preprocessor
When we run the Preprocessor from the CppComprehensionEngine of
the language server, we don't want the preprocessor to crash if it
encounters an invalid preprocessor statement (for example, an #endif
statement without an accompanying previous #if statement).

To achieve this, this commit adds an "ignore_invalid_statements" flag
to the preprocessor which is set by the CppComprehensionEngine.

Fixes #11064.
2021-12-03 15:38:21 +01:00
Itamar 408f05bbb9 HackStudio: Decrease the maximal crash frequency of the server to 10 sec
The maximal crash frequency of the language server was previously 3
seconds, but in practice it was too high.
When working with larger projects the language server can get into a
"crash and respawn" loop that takes more than 3 seconds.

10 seconds seems like a reasonable threshold beyond which we no longer
attempt to respawn the server.
2021-12-03 15:38:21 +01:00
Itamar 28ff7d49ad HackStudio: Only send the content of open files to language server
When respawning the language server, we only need to send the content
of opened files to the server.

The on-disk content of files that are not currently open is up to
date, so the server can read them on its own.
2021-12-03 15:38:21 +01:00
Itamar 3e9a96f1d8 HackStudio: Add HackStudio::for_each_open_file 2021-12-03 15:38:21 +01:00
Martin Blicha 8fb52c6962 LibGUI: Make FilteringProxyModel reference-count its parent model
Before this change, the destructor of FilteringProxyModel
would crash if the parent model had been destroyed earlier.

This unifies the behaviour of FilteringProxyModel with
SortingProxyModel in this respect.
2021-12-02 22:43:54 +01:00
Idan Horowitz f415218afe Kernel+LibC: Implement sigaltstack()
This is required for compiling wine for serenity
2021-12-01 21:44:11 +02:00
Timothy Flynn bf79c73158 LibUnicode: Do not generate data for "generic" calendars
This is not a calendar supported by ECMA-402, so let's not waste space
with its data.

Further, don't generate "gregorian" as a valid Unicode locale extension
keyword. It's an invalid type identifier, thus cannot be used in locales
such as "en-u-ca-gregorian".
2021-12-01 16:36:26 +00:00
Timothy Flynn f02ecc1da2 LibUnicode: Fix copy-paste error in calendar_pattern_style_to_string
The string returned must be lowercase.
2021-12-01 16:36:26 +00:00
Timothy Flynn d2588d852b LibJS: Change all [[RelevantExtensionKeys]] to return constexpr arrays
There's no need to allocate a vector for this internal slot. Similar to
commit: bb11437792
2021-12-01 16:36:26 +00:00
Jelle Raaijmakers e27b077c2a LibGL: Add GL::present_context()
This provides a convenience method that performs the virtual resolution
for `::present` on the provided `GLContext`.
2021-12-01 12:35:08 +01:00
Jelle Raaijmakers bed0f3466a LibGL: Remove TextureUnit::unbind_texture() 2021-12-01 10:21:13 +01:00
Jelle Raaijmakers a4603fbc06 3DFileViewer: Add checkbox to disable texture 2021-12-01 10:21:13 +01:00
Jelle Raaijmakers 5788a139d8 LibGL: Implement texture unit texturing states 2021-12-01 10:21:13 +01:00
Hendiadyoin1 713a9ca5f1 LookupServer: Remove unused this capture in a lambda function
this was causing CI to fail
2021-11-30 16:15:52 -08:00
Andreas Kling 2e010db0a5 LibCpp: Update list of well-known C++ types to match current AK 2021-11-30 23:34:40 +01:00
Andreas Kling 9cd89f0085 LibCpp: Use StringView for the known keywords array 2021-11-30 23:34:40 +01:00
Andreas Kling fc0a040e5d CrashReporter: Remove unnecessary button height overrides from GML 2021-11-30 23:34:40 +01:00
Andreas Kling 85eb0eaad0 CrashReporter+HackStudio: Let's call it "Debug in Hack Studio"
"Inspect in Hack Studio" was a bit vague.
2021-11-30 23:34:40 +01:00
Andreas Kling d3bd9f1f0c HackStudio: Scope the "delete file from project" action to tree view
Otherwise it triggers when trying to delete characters in the editor.
2021-11-30 23:34:40 +01:00
Andreas Kling 354c4690d2 LibCore: Use LibCore syscall wrappers in get_password() 2021-11-30 23:34:40 +01:00
Andreas Kling 612eafea2c LibCore: Add syscall wrappers for tcgetattr() and tcsetattr() 2021-11-30 23:34:40 +01:00
Andreas Kling 2b0c2360bb KeyboardPreferenceLoader: Use Core::System::ioctl() 2021-11-30 23:34:40 +01:00
Andreas Kling fd2ea6923c top: Use Core::System::ioctl() 2021-11-30 23:34:40 +01:00
Andreas Kling 90aa1abfed LibCore: Add ioctl() syscall wrapper 2021-11-30 23:34:40 +01:00
Andreas Kling 9815ad556a fortune: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling 8ba9a54310 lspci: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling 74a6fb64b2 DHCPClient: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling 6e7ff8cf1c netstat: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling 2bb27184b4 KeyboardPreferenceLoader: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling fbeebce4e3 whoami: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling a93205199b AudioServer: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling cac3f3c81f top: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling e399835466 ChessEngine: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling 6e2f7a15fb InspectorServer: Port to LibMain :^) 2021-11-30 23:34:40 +01:00
Andreas Kling fe00393941 LibCore: Change Core::LocalServer::on_ready_to_accept => on_accept
Everyone used this hook in the same way: immediately accept() on the
socket and then do something with the newly accepted fd.

This patch simplifies the hook by having LocalServer do the accepting
automatically.
2021-11-30 23:34:40 +01:00
Andreas Kling 6cb3092b42 WebContent: Remove unnecessary client map
WebContent processes only serve a single client, so we don't need to
keep a map of them.
2021-11-30 23:34:40 +01:00
Andreas Kling 314a687eeb ImageDecoder: Remove unnecessary client map
ImageDecoder processes only serve a single client, so we don't need to
keep a map of them.
2021-11-30 23:34:40 +01:00
Andreas Kling 8c8bf9433f LibIPC: Mark ClientConnection::die() as an override 2021-11-30 23:34:40 +01:00
Erik Biederstadt e052d647b7 Spreadsheet: Allow sheet renaming after double clicking on the tabwidget 2021-12-01 00:44:26 +03:30
Erik Biederstadt 0cfe446d3f LibGUI: Allow double clicking on tabwidgets 2021-12-01 00:44:26 +03:30