summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-07-24LibWeb: Add CalculatedStyleValue to the CSS StyleValuesTobias Christiansen
This adds the CalculatedStyleValue and all the structs needed to work with the calc() expressions.
2021-07-24LibWeb: Use Length::resolved() in FlexFormattingContextTobias Christiansen
It brew it's own tea resolving undefined and percentages. Let's use the API already in place rather to keep it flexible.
2021-07-23LibJS: Remove UTF-8 RegExpExec and AdvanceStringIndex overridesTimothy Flynn
All interested parties are now UTF-16 capable, so these are unused.
2021-07-23LibJS: Implement RegExp.prototype [ @@replace ] with UTF-16 code unitsTimothy Flynn
This also converts the GetSubstitution abstract operation take its input strings as UTF-16 now that all callers are UTF-16 capable. This means String.prototype.replace (and replaceAll) no longer needs UTF-8 and UTF-16 copies of these strings.
2021-07-23LibJS: Implement RegExp.prototype [ @@split ] with UTF-16 code unitsTimothy Flynn
2021-07-23LibJS: Implement RegExp.prototype [ @@search ] with UTF-16 code unitsTimothy Flynn
2021-07-23LibJS: Implement RegExp.prototype [ @@match ] with UTF-16 code unitsTimothy Flynn
2021-07-23LibJS: Implement RegExp.prototype.{exec,test} with UTF-16 code unitsTimothy Flynn
This converts RegExpExec to perform matching with UTF-16 strings. As a very temporary stop-gap, this adds overloads to RegExpExec and friends for both UTF-8 and UTF-16 strings. This is only needed until the rest of RegExp.prototype is UTF-16 capable. This also addresses a FIXME regarding code point index correction in RegExpExec when the Unicode flag is set.
2021-07-23LibJS: Implement RegExpCreate/RegExpInitialize closer to the specTimothy Flynn
RegExpInitialize specifies how the pattern string should be created before passing it to [[RegExpMatcher]]. Rather than passing it as-is, the string should be converted to code points and back to a "List" (if the Unicode flag is present), or as a "List" of UTF-16 code units. Further. the spec requires that we keep both the original pattern string and this parsed string in the RegExp object. The caveat is that the LibRegex parser further requires any multi-byte code units to be escaped (as "\unnnn"). Otherwise, the code unit is recognized as individual UTF-8 bytes.
2021-07-23LibRegex: Support ECMA-262 Unicode escapes of the form "\u{code_point}"Timothy Flynn
When the Unicode flag is set, regular expressions may escape code points by surrounding the hexadecimal code point with curly braces, e.g. \u{41} is the character "A". When the Unicode flag is not set, this should be considered a repetition symbol - \u{41} is the character "u" repeated 41 times. This is left as a TODO for now.
2021-07-23AK+LibRegex: Partially implement case insensitive UTF-16 comparisonTimothy Flynn
This will work for ASCII code points. Unicode case folding will be needed for non-ASCII.
2021-07-23LibRegex: Support UTF-16 RegexStringView and improve Unicode matchingTimothy Flynn
When the Unicode option is not set, regular expressions should match based on code units; when it is set, they should match based on code points. To do so, the regex parser must combine surrogate pairs when the Unicode option is set. Further, RegexStringView needs to know if the flag is set in order to return code point vs. code unit based string lengths and substrings.
2021-07-23AK: Add UTF-16 helper methods required for use within LibRegexTimothy Flynn
To be used as a RegexStringView variant, Utf16View must provide a couple more helper methods. It must also not default its assignment operators, because that implicitly deletes move/copy constructors.
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.inLeapYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.inLeapYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.monthsInYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.monthsInYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.daysInYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.daysInYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.daysInMonthIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.daysInMonthIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.daysInWeekIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.daysInWeekIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.weekOfYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.weekOfYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.dayOfYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.dayOfYearIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.dayOfWeekIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.dayOfWeekIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.dayIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.dayIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.monthCodeIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.monthCodeIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.monthIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.monthIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.yearIdan Horowitz
2021-07-23LibJS: Implement Temporal.Calendar.prototype.yearIdan Horowitz
2021-07-23LibJS: Implement Temporal.PlainDate.prototype.withCalendarIdan Horowitz
2021-07-23LibJS: Add missing PlainDateTime case in ToTemporalDateIdan Horowitz
2021-07-23Kernel: Add missing .globl definitionsGunnar Beutner
This ensures that we can properly take the address of these symbols in other code.
2021-07-23Kernel: Mark a few more things as READONLY_AFTER_INITGunnar Beutner
2021-07-23Kernel: Always build the kernel without default libsGunnar Beutner
When building the kernel from within SerenityOS we would link it against default libs which doesn't really make sense to me.
2021-07-23Kernel: Make some of the assembly code position-independent on x86_64Gunnar Beutner
2021-07-23Prekernel: Don't build the prekernel as a PIE imageGunnar Beutner
This is unnecessary because the prekernel is always loaded at a known base address.
2021-07-23Kernel: Make -pie work for x86_64Gunnar Beutner
2021-07-23Kernel: Use StringView when parsing pledges in sys$pledge(..)Brian Gianforcaro
This ensures no potential allocation as in some cases the pledge char* could be promoted to AK::String by the compiler to execute the comparison.
2021-07-23Tests: Add test coverage for sys$pledge(..) argument validationBrian Gianforcaro
2021-07-23Kernel: Fix bug where we half apply pledges in sys$pledge(..)Brian Gianforcaro
This bug manifests it self when the caller to sys$pledge() passes valid promises, but invalid execpromises. The code would apply the promises and then return an error for the execpromises. This leaves the user in a confusing state, as the promises were silently applied, but we return an error suggesting the operation has failed. Avoid this situation by tweaking the implementation to only apply the promises / execpromises after all validation has occurred.
2021-07-23Kernel: Migrate sys$pledge to use the KString APIBrian Gianforcaro
This avoids potential unhandled OOM that's possible with the old copy_string_from_user API.
2021-07-23Kernel: Annotate kernel_base and friends as READONLY_AFTER_INITBrian Gianforcaro
We don't want kernel_base to be modifiable by an attacker or a stray memory scribbler bug, so lets mark it as READONLY_AFTER_INIT.