summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2022-01-16LibJS: Don't require ParenClose in Parser::parse_formal_parameters()Linus Groh
The parentheses are dealt with outside this function, so we shouldn't use the (non)existence of one as the condition for consuming another comma and then parameter. Just check for a comma instead. This becomes relevant when parsing standalone function parameters as per the spec in the CreateDynamicFunction AO.
2022-01-16LibJS: Consume curly braces outside of Parser::parse_function_body()Linus Groh
The curly braces are not part of the FunctionBody production. This becomes relevant when parsing a standalone function body as per the spec in the CreateDynamicFunction AO.
2022-01-16LibJS: Add VM::active_function_object()Linus Groh
2022-01-16LibJS: Rename FunctionKind::{Regular => Normal}Linus Groh
This is what CreateDynamicFunction calls it.
2022-01-15LibJS: Implement Date.prototype.getTimezoneOffsetTimothy Flynn
2022-01-15LibJS: Implement MakeDay without using AK::years_to_days_since_epochTimothy Flynn
Implementing years_to_days_since_epoch without a loop will be tricky. The TimeFromYear AO gives a good enough approximation for MakeDay until we figure that out.
2022-01-15LibJS: Move time conversion constants to the Date headerTimothy Flynn
These are needed outside of the Date object .cpp file, so move them to the header.
2022-01-15LibJS: Remove Core::DateTime logic from the Date object :^)Timothy Flynn
2022-01-15LibJS+js: Pretty-print Date objects using the ToDateString AOTimothy Flynn
2022-01-15LibJS: Re-implement the Date constructor / prototype for spec complianceTimothy Flynn
First, this adds a constructor to the Date object to be created from a plain double. This is a first step to removing Core::DateTime as the basis for the Date object. A subsequent commit will remove the now- unused data from the object. Next, this implements the constructor in accordance to the spec. The constructor when NewTarget is undefined no longer allocates a Date on the heap. The other constructor properly uses recently created AOs to handle time zone and ensure the created [[DateValue]] is valid. Other methods on the constructor (Date.now) have not been touched yet. Last, the prototype is reimplemented. Again, we use other AOs to handle time zones and time clipping. Not all prototypes are fixed; most of them are, but a few (e.g. Date.prototype.getTimezoneOffset) were not fixed, but left in a mostly unimplemented state for another commit. In all of the above, spec comments are added. This is a rather large change; but it's tough to do any of these parts individually without breaking everything else.
2022-01-15LibJS: Make the thisTimeValue AO publicTimothy Flynn
It will be needed by the Date constructor.
2022-01-15LibJS: Implement spec-compliant ToDateString and its underlying AOsTimothy Flynn
2022-01-15LibJS: Protect LocalTZA against non-finite timesTimothy Flynn
It is undefined behavior to cast from a double to an integer if the value does not fit in the limits of the integer.
2022-01-15LibJS: Do not negate offset in LocalTZA for isUTC=falseTimothy Flynn
In commmit 7d2834344a7635ec45aba28a0351feca8e5f1c17, I think I combined the definitions of the LocalTZA and UTC AOs in my head, and thought the offset should be negated within LocalTZA. Instead, the offset should be left untouched, and the UTC AO is responsible for doing the subtraction.
2022-01-15LibJS: Implement the LocalTime, UTC, and TimeWithinDay AOsTimothy Flynn
2022-01-15LibJS: Sort Date.prototype methods by spec orderTimothy Flynn
When viewing the code side-by-side with the spec, it's much nicer when everything is in the same order. Also fixes the spec link for Date.prototype.getMilliseconds (it pointed at setMilliseconds by mistake).
2022-01-15LibTimeZone: Canonicalize the current time zone and fall back to UTCTimothy Flynn
If the tzname is unknown, fall back to UTC for now. Unknown time zones are most likely due to not parsing RULE entries yet, but at the very least, it only makes sense for current_time_zone to return a time zone that LibTimeZone actually knows about.
2022-01-15LibELF: Use shared memory mapping when loading ELF objectsAndreas Kling
There's no reason to make a private read-only mapping just for reading (and validating) the ELF headers, and copying out the data segments.
2022-01-15LibGL+LibSoftGPU: Add support for 8-bit luminance (+ alpha) texturesLuke Wilde
Used by Half-Life for single colour textures. The alpha variant is especially used for UI textures.
2022-01-15LibVT: Enable caller to control the visibility of the scrollbar widgetBrian Gianforcaro
In preparation for another feature, expose an API so that any users of this widget can control the scrollbar visibility.
2022-01-15LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServersin-ack
This change unfortunately cannot be atomically made without a single commit changing everything. Most of the important changes are in LibIPC/Connection.cpp, LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp. The notable changes are: - IPCCompiler now generates the decode and decode_message functions such that they take a Core::Stream::LocalSocket instead of the socket fd. - IPC::Decoder now uses the receive_fd method of LocalSocket instead of doing system calls directly on the fd. - IPC::ConnectionBase and related classes now use the Stream API functions. - IPC::ServerConnection no longer constructs the socket itself; instead, a convenience macro, IPC_CLIENT_CONNECTION, is used in place of C_OBJECT and will generate a static try_create factory function for the ServerConnection subclass. The subclass is now responsible for passing the socket constructed in this function to its ServerConnection base; the socket is passed as the first argument to the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before any other arguments. - The functionality regarding taking over sockets from SystemServer has been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket implementation of this functionality hasn't been deleted due to my intention of removing this class in the near future and to reduce noise on this (already quite noisy) PR.
2022-01-15LibCore: Implement LocalSocket::peer_pidsin-ack
Mostly a copy of Core::LocalSocket::peer_pid.
2022-01-15LibCore: Implement LocalSocket::adopt_fdsin-ack
Similar to File::adopt_fd, this function creates a new LocalSocket with an existing fd. The main use of this function is to create LocalSocket objects from fds that have been passed to us by SystemServer to take over.
2022-01-15LibCore: Implement LocalSocket::read_without_waitingsin-ack
This uses recv with MSG_DONTWAIT to disable blocking operation for a single call. LibIPC uses this to read in a non-blocking manner from an otherwise blocking socket.
2022-01-15LibCore: Implement LocalSocket::receive_fd and send_fdsin-ack
These are just wrappers over the sendfd and recvfd syscalls.
2022-01-14LibJS: Clip parsed IS0 8601 strings to +/- 8.64e15Timothy Flynn
2022-01-14LibJS: Implement Date.parse using AK::Time and LibTimeZoneTimothy Flynn
Fixes #4651
2022-01-14LibJS: Implement the localTZA AO for isUTC=falseTimothy Flynn
2022-01-14LibGL+LibSoftGPU: Implement `glDrawPixels` depth buffer supportJelle Raaijmakers
This enabled writing directly to the depth buffer, and allows games like Grim Fandango to render their pre-baked depth buffers correctly!
2022-01-14LibGL+LibSoftGPU: Implement rasterization positionJelle Raaijmakers
Implements support for `glRasterPos` and updating the raster position's window coordinates through `glBitmap`. The input for `glRasterPos` is an object position that needs to go through the same vertex transformations as our regular triangles.
2022-01-14LibGL: Add context lifetime debug outputJelle Raaijmakers
Also, make `::create_context` return a `NonnullOwnPtr`.
2022-01-14LibAudio: Expose the format name from the loader pluginskleines Filmröllchen
The format of these names is "Full Abbreviation (.fileformat)". For example: "FLAC (.flac)", "RIFF WAVE (.wav)", "MPEG Layer III (.mp3)", "Vorbis (.ogg)" The reasoning is that the container and therefore the file ending may differ significantly from the actual format, and the format should be given as unambiguously as possible and necessary.
2022-01-14LibCore: Add wrapper for sethostnameLucas CHOLLET
2022-01-14LibCore: Remove usage of a hardcoded constant in gethostname()Lucas CHOLLET
2022-01-14LibGL: Add a few defines so that Quake 2's OpenGL renderer compilesqeeg
2022-01-14Everywhere: Use my new serenityos.org e-mail :^)kleines Filmröllchen
2022-01-14LibJS: Add an else in StringPrototype::substrNico Weber
No behavior change, but makes the code look more like the spec test for this function.
2022-01-14LibJS: Fix substr() with negative arguments larger than string lengthNico Weber
length_in_code_units() returns a size_t, which is 64-bit unsigned in i686 builds. `size + (i32)int_length` hence produced a 64-bit unsigned result, so a negative value would wrap around and become a very large number. As fix, just omit the cast -- we assign the result of max() to a double anyways. With this, all test262 tests in annexB/built-ins/String/prototype pass.
2022-01-14LibJS: Correcly handle surrogates in escape()Nico Weber
Fixes test/annexB/built-ins/escape/escape-above{,-astral}.js in test262. All tests in test/annexB/built-ins/escape pass now.
2022-01-14AK+Everywhere: Make Variant::visit() respect the Variant's constnessAli Mohammad Pur
...and fix all the instances of visit() taking non-const arguments.
2022-01-14LibGUI: Add `AbstractZoomPanWidget` widget :^)Mustafa Quraish
This is an abstract widget that is meant to handle all the panning / zooming functionality so that all applications implementing it do not have to try to do their own coordinate math.
2022-01-13LibJS: Handle the [[LanguageDisplay]] tag when localizing languagesTimothy Flynn
2022-01-13LibUnicode: Do not limit language display names to known localesTimothy Flynn
Currently, the UnicodeLocale generator collects a list of known locales from the CLDR before processing language display names. For each locale, the identifier is broken into language, script, and region subtags, and we create a list of seen languages. When processing display names, we skip languages we hadn't seen in that first step. This is insufficient for language display names like "en-GB", which do not have an locale entry in the CLDR, and thus are skipped. So instead, create the list of known languages by actually reading through the list of languages which have a display name.
2022-01-13LibUnicode: Add a method to combine locale subtags into a display stringTimothy Flynn
This is just a convenience wrapper around the underlying generated APIs.
2022-01-13LibUnicode: Parse and generate locale display patternsTimothy Flynn
These patterns indicate how to display locale strings when that locale contains multiple subtags. For example, "en-US" would be displayed as "English (United States)".
2022-01-13LibELF: Accept Span instead of Pointer+Size in validate_program_headersIdan Horowitz
2022-01-13LibELF: Use StringBuilders instead of Strings for the interpreter pathIdan Horowitz
This is required for the Kernel's usage of LibELF, since Strings do not expose allocation failure.
2022-01-13LibJS: Mark CreateTemporalTimeZone("UTC") as infallibleLinus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/ea25cfa
2022-01-13LibC: Remove TODO() macros to not break mc portKenneth Myhra
The TODO() macro crashes the port Midnight Commander on start-up.
2022-01-13LibC: Add definition for PRIxMAXKenneth Myhra