summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-08-17Kernel+Userland: Remove global futexesAndreas Kling
We only ever use private futexes, so it doesn't make sense to carry around all the complexity required for global (cross-process) futexes.
2021-08-16LibJS: Correctly handle Unicode characters in JS source textdavidot
Also recognize additional white space characters.
2021-08-16LibJS: Disallow standalone super expressiondavidot
2021-08-16LibJS: Handle '++' and '--' more correctly within expressiondavidot
2021-08-16LibJS: Check that 'let' is followed by declaration before matching itdavidot
Since 'let' is a valid variable name (in non-strict mode) let may not be the start of a declaration but just an identifier.
2021-08-16LibJS: Add optional extra strict checks in parse_binding_patterndavidot
2021-08-16LibJS: Tighten default values in formal parameter parsingdavidot
Disallow default parameter for rest parameters. Disallow yield expressions as default values.
2021-08-16LibJS: Allow yielding a classdavidot
2021-08-16LibJS: Treat yield as an identifier in more non-generator contextsdavidot
And disallow some cases where we are in a generator context.
2021-08-16LibJS: Add more duplicated declarations detectiondavidot
This is a small step in the right direction although the amount of different checks is becoming unsustainable. In the future we probably want to have the current_scope handle all declarations.
2021-08-16LibJS: Be more strict about the lhs of a for in/of loopdavidot
This is not entirely correct as really Object- and ArrayExpressions are not allowed but that requires a bigger refactoring of for statement parsing.
2021-08-16LibJS: Force the lexer to parse a regex when expecting a statementdavidot
2021-08-16LibJS: Treat arrow expression as function and stop parsing afterdavidot
2021-08-16LibJS: Make functions reset break and continue contextdavidot
2021-08-16LibJS: Allow class methods named "get", "set" or "static"davidot
2021-08-16LibJS: Allow labelled functions in certain contextsdavidot
Also disallow duplicated labels.
2021-08-16LibJS: Fix that a windows-style new line was not escaped properlydavidot
2021-08-17LibAudio: Fix overflow on 24-bit FLAC LPC datakleines Filmröllchen
When computing sample values from a linear predictor, the repeated multiplication and addition can lead to very large values that may overflow a 32-bit integer. This was never discovered with 16-bit FLAC test files used to create and validate the first version of the FLAC loader. However, 24-bit audio, especially with large LPC shifts, will regularly exceed and overflow i32. Therefore, we now use 64 bits temporarily. If the resulting value is too large for 32 bits, something else has gone wrong :^) This fixes playback noise on 24-bit FLACs.
2021-08-17LibAudio: Rescale integer samples correctly in FLAC loaderkleines Filmröllchen
The FLAC samples are signed, so we need to rescale them not by their bit depth, but by half of the bit depth. For example, a 24-bit sample extends from -2^23 to 2^23-1, and therefore needs to be rescaled by 2^23 to conform to the [-1, 1] double sample range.
2021-08-17LibAudio: Use size_t in loopskleines Filmröllchen
This is more idiomatic :^)
2021-08-16LibWeb: Replace is_inherited_property() with generated codeSam Atkins
We already include the inheritance for each property in Properties.json, so made sense to use that instead of a list in StyleResolver. Added `inherited: true` to a couple of properties to match the previous code's behavior. One of those had a FIXME which I've moved to the JSON file, which is hacky, but it works.
2021-08-16LibJS: Add missing spec link to YearMonthFromFieldsLinus Groh
2021-08-16LibJS: Implement Temporal.PlainDate.prototype.toPlainMonthDay()Linus Groh
2021-08-16LibJS: Implement Temporal.Calendar.prototype.monthDayFromFields()Linus Groh
2021-08-16LibJS: Implement Temporal.Calendar.prototype.fields()Linus Groh
2021-08-16LibJS: Implement Temporal.PlainDate.prototype.toPlainYearMonth()Linus Groh
2021-08-16LibJS: Implement Temporal.Calendar.prototype.yearMonthFromFields()Linus Groh
2021-08-16LibTLS: Add DHE_RSA AES GCM cipher suitesSamuel Bowman
This adds the following cipher suites: * DHE_RSA_WITH_AES_128_GCM_SHA256 * DHE_RSA_WITH_AES_256_GCM_SHA384
2021-08-16LibTLS: Implement the DHE_RSA key exchange algorithmSamuel Bowman
This adds two methods, handle_dhe_rsa_server_key_exchange and build_dhe_rsa_pre_master_secret, to TLSv12 and a struct, server_diffie_hellman_params, to Context, which are used to implement the DHE_RSA key exchange algorithm. This grants us the benefits of forward secrecy and access to sites which support DHE_RSA. It is worth noting that the signature of the server provided Diffie-Hellman parameters is not currently validated. This will need to be addressed to prevent man-in-the-middle attacks.
2021-08-15LibJS: Parse and partially execute import and export statementsdavidot
We produce the import and export entries as per the spec. However we do not yet verify that named things that are exported are declared somewhere.
2021-08-15LibJS: Add a mode to parse JS as a moduledavidot
In a module strict mode should be enabled at the start of parsing and we allow import and export statements.
2021-08-15LibGL: Implement `glColorMask`Jesse Buhagiar
2021-08-15LibJS/Tests: Skip flaky FinalizationRegistry.prototype.cleanupSome testLinus Groh
2021-08-15LibWeb: Return correct selection_rect when the node is at the endTetsui Ohkubo
When the selection state of the node is SelectionState::End, the end position of the selection within the fragment is not properly calculated, because it forgets to subtract m_start from index_in_node, unlike SelectionState::StartAndEnd. This resulted in a wrong selection shadow being painted when the node is at the end of the selection. This change resolves #5880.
2021-08-15LibWeb: Ensure inline CSS loaded from HTML is ElementInlineDoubleNegation
This commit changes inline CSS loaded from style attributes of HTML elements to be loaded as CSS::ElementInlineCSSStyleDeclaration instead of CSS::CSSStyleDeclaration, fixing a crash when the style of that element is changed from JavaScript.
2021-08-15Kernel+Userland: Remove chroot functionalityAndreas Kling
We are not using this for anything and it's just been sitting there gathering dust for well over a year, so let's stop carrying all this complexity around for no good reason.
2021-08-15LibRegex: Implement and use a REPEAT operation for bytecode repetitionTimothy Flynn
Currently, when we need to repeat an instruction N times, we simply add that instruction N times in a for-loop. This doesn't scale well with extremely large values of N, and ECMA-262 allows up to N = 2^53 - 1. Instead, add a new REPEAT bytecode operation to defer this loop from the parser to the runtime executor. This allows the parser to complete sans any loops (for this instruction), and allows the executor to bail early if the repeated bytecode fails. Note: The templated ByteCode methods are to allow the Posix parsers to continue using u32 because they are limited to N = 2^20.
2021-08-15LibRegex: Remove (mostly) unused regex::MatchOutputTimothy Flynn
This struct holds a counter for the number of executed operations, and vectors for matches, captures groups, and named capture groups. Each of the vectors is unused. Remove the struct and just keep a separate counter for the executed operations.
2021-08-15LibRegex+LibJS: Combine named and unnamed capture groups in MatchStateTimothy Flynn
Combining these into one list helps reduce the size of MatchState, and as a result, reduces the amount of memory consumed during execution of very large regex matches. Doing this also allows us to remove a few regex byte code instructions: ClearNamedCaptureGroup, SaveLeftNamedCaptureGroup, and NamedReference. Named groups now behave the same as unnamed groups for these operations. Note that SaveRightNamedCaptureGroup still exists to cache the matched group name. This also removes the recursion level from the MatchState, as it can exist as a local variable in Matcher::execute instead.
2021-08-15LibRegex: Reduce RegexMatcher's BumpAllocator chunk sizeTimothy Flynn
Before the BumpAllocator OOB access issue was understood and fixed, the chunk size was increased to 8MiB as a workaround in commit: 27d555bab0d84913599cea3c4a6b0a0ed2a15b66. The issue is now resolved by: 0f1425c895ace40fbb10d68a55eeb3a6354479d3. We can reduce the chunk size to 2MiB, which has the added benefit of reducing runtime of the RegExp.prototype.exec test.
2021-08-15LibRegex: Disallow unescaped quantifiers in Unicode modeTimothy Flynn
2021-08-15LibRegex: Use correct source characters for Unicode identity escapesTimothy Flynn
2021-08-15LibRegex: Implement legacy octal escape parsing closer to the specTimothy Flynn
The grammar for the ECMA-262 CharacterEscape is: CharacterEscape[U, N] :: ControlEscape c ControlLetter 0 [lookahead ∉ DecimalDigit] HexEscapeSequence RegExpUnicodeEscapeSequence[?U] [~U]LegacyOctalEscapeSequence IdentityEscape[?U, ?N] It's important to parse the standalone "\0 [lookahead ∉ DecimalDigit]" before parsing LegacyOctalEscapeSequence. Otherwise, all standalone "\0" patterns are parsed as octal, which are disallowed in Unicode mode. Further, LegacyOctalEscapeSequence should also be parsed while parsing character classes.
2021-08-15LibRegex: Ensure escaped hexadecimals are exactly 2 digits in lengthTimothy Flynn
2021-08-15LibRegex: Ensure escaped code points are exactly 4 digits in lengthTimothy Flynn
2021-08-15LibRegex: Fix ECMA-262 parsing of invalid identity escapesTimothy Flynn
* Only alphabetic (A-Z, a-z) characters may be escaped with \c. The loop currently parsing \c includes code points between the upper/lower case groups. * In Unicode mode, all invalid identity escapes should cause a parser error, even in browser-extended mode. * Avoid an infinite loop when parsing the pattern "\c" on its own.
2021-08-15LibJS: Prevent stack overflow in flatten_into_array()Robert Stefanic
The check for stack space in VM from push_execution_context has been moved to a method on VM called did_reach_stack_space_limit. This allows us to check the stack size in other places besides push_execution_context. We can now verify that we have enough space on the stack before calling flatten_into_array to ensure that we don't cause a stack overflow error when calling the function with a large depth.
2021-08-15LibCore: Move EventLoop to AK::TimeBrian Gianforcaro
2021-08-15LibJS/Tests: Add test for PlainMonthDay default reference yearLinus Groh
2021-08-15LibJS/Tests: Add test for PlainYearMonth default reference dayLinus Groh