summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-12-08LibJS: Simplify TemporalInstantStringLinus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/271d71c
2021-12-08LibJS: Move calendar validation out of parse_temporal_calendar_stringLuke Wilde
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/7207a1c
2021-12-08LibJS: Simplify return in parse_temporal_date_time_stringLuke Wilde
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/1f7e486
2021-12-08LibJS: Remove duplicated spec step in parse_iso_date_timeLuke Wilde
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/516bf24
2021-12-08LibTLS: Avoid implicitly copying ByteBufferBen Wiederhake
2021-12-08LibSQL: Avoid implicitly copying ByteBufferBen Wiederhake
2021-12-08LibHTTP: Avoid implicitly copying ByteBufferBen Wiederhake
2021-12-08LibGemini: Avoid implicitly copying ByteBufferBen Wiederhake
2021-12-08LibCore: Avoid implicitly copying ByteBufferBen Wiederhake
2021-12-08LibJS: Implement Intl.DateTimeFormat.prototype.formatToPartsTimothy Flynn
2021-12-08LibJS: Implement (most of) Intl.DateTimeFormat.prototype.formatTimothy Flynn
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-08LibJS: Cache the data locale used by Intl.DateTimeFormatTimothy Flynn
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-08LibJS: Add an accessor for the %Date.now% instrinsic propertyTimothy Flynn
2021-12-08LibJS: Implement Date's Week Day AOTimothy Flynn
2021-12-08LibJS: Implement Date's TimeClip AOTimothy Flynn
2021-12-08LibUnicode: Parse and generate time zone names in long and short formTimothy Flynn
2021-12-08LibUnicode: Generate era, month, weekday and day period calendar symbolsTimothy Flynn
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-08LibJS: Do not override hour, minute, and second format field lengthsTimothy Flynn
This was an oversight in e42d954743056e476bbb1623cfc60e7797a8a6ca. 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-08LibJS+LibUnicode: Generate missing patterns with fractionalSecondDigitsTimothy Flynn
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-08LibJS+LibUnicode: Supply field type in CalendarPattern's for-each methodTimothy Flynn
Some callers will want different behavior depending on what field is being provided to the callback.
2021-12-08 LibJS: Mark Function object's private environment during GCAndreas Kling
2021-12-08LibJS: Mark entire private environment chains during GCAndreas Kling
2021-12-08LibJS: Make sure private environments are marked during GCAndreas Kling
2021-12-08LibJS: Only allocate space for Object private elements if neededAndreas Kling
Most JavaScript objects don't have private elements, so this reduces the size of typical JS::Object instances by two pointers.
2021-12-06LibIPC: Add IPC::take_over_accepted_client_from_system_server<Client>()Andreas Kling
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-06LibIPC: Add IPC::MultiServer convenience classAndreas Kling
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-06LibCore: Make LocalServer::take_over_from_system_server() return ErrorOrAndreas Kling
This allows us to use TRY() or MUST() when calling it.
2021-12-06LibWeb: Make StyleSheet::m_parent_style_sheet a WeakPtrAndreas Kling
It's not safe for this to be a raw pointer, as the child can outlive the parent.
2021-12-06LibWeb: Make CSSStyleSheet::m_owner_css_rule a WeakPtrAndreas Kling
It's not safe for this to be a raw pointer, as the imported style sheet can outlive the rule.
2021-12-06LibWeb: Make CSSImportRule::m_document a WeakPtrAndreas Kling
It's not safe for this to be a raw reference, as CSSImportRule can outlive the document.
2021-12-06LibJS: Add tests for calendar fields of DateTimeFormat's resolvedOptionsTimothy Flynn
These are (mostly) testable now that LibUnicode parses format patterns.
2021-12-06LibJS: Always respect user-provided format field lengthsTimothy Flynn
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-06LibJS: Fallback to [[pattern]] when [[pattern12]] is unavailableTimothy Flynn
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-05LibCore: Implement new ptrace_peekbuf wrapper for PT_PEEKBUF syscallBen Wiederhake
2021-12-05Kernel+strace: Remove unnecessary indirection for PEEKBen Wiederhake
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-05LibWeb: Cast unused smart-pointer return values to voidSam Atkins
2021-12-05LibVT: Cast unused smart-pointer return value to voidSam Atkins
2021-12-05LibGUI: Cast unused smart-pointer return values to voidSam Atkins
2021-12-05Userland: Cast unused BackgroundAction::construct() results to voidSam Atkins
User code does not need to keep this alive, so casting to void is safe. But maybe a bit weird.
2021-12-05LibELF: Cast unused smart-pointer return value to voidSam Atkins
2021-12-05LibDSP: Cast unused smart-pointer return value to voidSam Atkins
2021-12-05LibCpp: Cast unused smart-pointer return values to voidSam Atkins
2021-12-05LibC: Add a couple of missing errno codesIdan Horowitz
These are required to compile a port.
2021-12-05LibC: Stub out the rest of the getnameinfo flagsIdan Horowitz
These are required for the compilation of some ports.
2021-12-05Kernel: Add the SIOCATMARK ioctl request macroIdan Horowitz
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-04LibCore: Add syscall wrapper for chmod()Kenneth Myhra
2021-12-04LibSQL: Gracefully react to unimplemented valid SQLJan de Visser
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-04LibSQL: Improve error handlingJan de Visser
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-04LibWeb: Stop sending "load" event twice to iframesAndreas Kling
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-04LibWeb: Fix DOMImplementation changing content type of wrong documentAndreas Kling
DOMImplementation.createDocument() should set the content type of the newly created document, not replace the content type of the DOMImplementation's own host document.