summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2022-02-11LibWeb: Remove CascadeOrigin::Any enum valueAndreas Kling
Looks like I removed all uses of this value, but not the value itself! Thanks to Idan for pointing that out. :^)
2022-02-11LibWeb: Remove unused CascadeOrigin::AnyAndreas Kling
This was an ad-hoc concept from before we implemented the CSS cascade.
2022-02-10LibSQL: Return unimplemented errors from unimplemented MATCH expressionsTimothy Flynn
A bit friendlier than crashing the entire SQLService process.
2022-02-10LibSQL: Remove the now-unused ExecutionContext::result objectTimothy Flynn
The INSERT and SELECT statements set up this object for any expression evaluation to indicate errors. This is no longer needed.
2022-02-10LibSQL: Convert SQL expression evaluation to use ResultOrTimothy Flynn
Instead of setting an error in the execution context, we can directly return that error or the successful value. This lets all callers, who were already TRY-capable, simply TRY the expression evaluation.
2022-02-10LibSQL+SQLServer: Introduce and use ResultOr<ValueType>Timothy Flynn
The result of a SQL statement execution is either: 1. An error. 2. The list of rows inserted, deleted, selected, etc. (2) is currently represented by a combination of the Result class and the ResultSet list it holds. This worked okay, but issues start to arise when trying to use Result in non-statement contexts (for example, when introducing Result to SQL expression execution). What we really need is for Result to be a thin wrapper that represents both (1) and (2), and to not have any explicit members like a ResultSet. So this commit removes ResultSet from Result, and introduces ResultOr, which is just an alias for AK::ErrorOrr. Statement execution now returns ResultOr<ResultSet> instead of Result. This further opens the door for expression execution to return ResultOr<Value> in the future. Lastly, this moves some other context held by Result over to ResultSet. This includes the row count (which is really just the size of ResultSet) and the command for which the result is for.
2022-02-10LibCore: Convert AnonymousBuffer to use System::anon_createkleines Filmröllchen
2022-02-10LibCore/System: Add anon_create syscall wrapperkleines Filmröllchen
This wrapper is particularly helpful as we use a combination of similar syscalls on Linux to simulate the behavior of the Serenity-exclusive anon_create syscall. Users therefore won't have to worry about the platform anymore :^)
2022-02-10LibWeb: Make :root selector match <html> element onlyAndreas Kling
We were matching every HTML element, instead of just the root (<html>)
2022-02-10LibWeb: Add "tag name" buckets to StyleComputer::RuleCacheAndreas Kling
We can skip rules that require a specific tag name when matching against any element with a different tag name. :^)
2022-02-10LibWeb: Add "ID" buckets to StyleComputer::RuleCacheAndreas Kling
We can skip rules that require a specific ID when matching against any element that doesn't have that ID.
2022-02-10LibWeb: Cache CSS rules in buckets to reduce number of rules checkedAndreas Kling
This patch introduces the StyleComputer::RuleCache, which divides all of our (author) CSS rules into buckets. Currently, there are two buckets: - Rules where a specific class must be present. - All other rules. This allows us to check a significantly smaller set of rules for each element, since we can skip over any rule that requires a class attribute not present on the element. This takes the typical numer of rules tested per element on Discord from ~16000 to ~550. :^) We can definitely improve the cache invalidation. It currently happens too often due to media queries. And we also need to make sure we invalidate when mutating style through CSSOM APIs.
2022-02-10LibWeb: Perform CSS custom property cascade once instead of per-propertyAndreas Kling
Previously we would re-run the entire CSS selector machinery for each property resolved. Instead of doing that, we now resolve a final set of custom property key/value pairs at the start of the cascade.
2022-02-10LibWeb: Fix a bunch of trivial clang-tidy warnings in StyleComputerAndreas Kling
- Replace "auto" with "auto const" where appropriate. - Remove an unused struct. - Make sort_matching_rules() a file-local static function. - Remove some unnecessary includes.
2022-02-10LibWeb: Rename a CascadeOrigin parameter in StyleComputerAndreas Kling
2022-02-10HackStudio: Fix error handling logic in delete_actionDaste
The `result.is_error()` check was inverted, causing a crash.
2022-02-10HackStudio: Don't save file when filename is emptyDaste
When saving a new file, save_as_action will return if the filename input was empty, but save_action would still try to save the file. Added a guard to make sure we never try to save files with empty filenames.
2022-02-10pgrep: Port to LibMainRiccardo Arena
Use unveil to allow access only to required paths. Switch to new pledge format.
2022-02-10pidof: Port to LibMainRiccardo Arena
Use pledge/unveil to allow access only to required paths and syscalls.
2022-02-10LibJS: Do not refer to moved-from completions / valuesTimothy Flynn
In the ThrowCompletionOr constructors, the VERIFY statements are using moved-from objects. We should not rely on those objects still being valid after being moved.
2022-02-10LibJS: Add tests for Set.prototype.keys which is an alias for valuesdavidot
2022-02-10LibJS: Fix Map Iterators when elements are deleted during iterationdavidot
Before this would assume that the element found in operator++ was still valid when dereferencing it in operator*. Since any code can have been run since that increment this is not always valid. To further simplify the logic of the iterator we no longer store the index in an optional.
2022-02-10LibSQL: Do not crash when SELECTing from an empty tableTimothy Flynn
The crash was caused by getting the first element of an empty vector.
2022-02-10LibSQL+SQLServer: Move LibSQL/SQLResult.[h,cpp] to LibSQL/Result.[h,cpp]Timothy Flynn
Rename the file to match the new class name.
2022-02-10LibSQL: Remove now-unused SQLResult classTimothy Flynn
2022-02-10LibSQL+SQLServer: Return the new Result class from statement executionsTimothy Flynn
We can now TRY anything that returns a SQL::Result or an AK::Error.
2022-02-10LibSQL: Add a new Result class to replace SQLResultTimothy Flynn
The existing SQLResult class predates our TRY semantics. As a result, in the AST execution methods, there is a lot of is_error checking on values that could instead be wrapped with TRY. This new class will allow such semantics, and is also stack allocated (no need to be a RefPtr). It is heavily based on LibJS's completion class.
2022-02-10LibSQL: Do not return copies of vectors from table/index definitionsTimothy Flynn
2022-02-10LibSoftGPU: Dispatch based on ClipPlane enum at compile-timeLenny Maiorani
The `ClipPlane` enum is being looped over at run-time performing run-time dispatch to determine the comparison operation in `point_within_clip_plane`. Change this `for` loop to be linear code which dispatches using a template parameter. This allows for the `point_within_clip_plane` function to do compile-time dispatch. Note: This linear code can become a compile-time loop when static reflection lands in C++2[y|z] allowing looping over the reflected `enum class`.
2022-02-10Base+HackStudio: Add or insert missing iconselectrikmilk
Insert or add icons where they are missing.
2022-02-10js: Add a command line argument to evaluate a string as a scriptTimothy Flynn
For example: $ js -c "console.log(42)" 42
2022-02-10Utilities: Port realpath to LibMainRyan Chandler
2022-02-10Applications: Port Spreadsheet to LibMainLenny Maiorani
2022-02-10Applications: Port SpaceAnalyzer to LibMainLenny Maiorani
2022-02-10Applications: Port Debugger to LibMainLenny Maiorani
2022-02-10LibJS: Don't coerce this value to an object in Function.prototype.callLuke Wilde
2022-02-10LibJS: Don't coerce this value to an object in Function.prototype.applyLuke Wilde
2022-02-09LibJS: Implement Function.prototype.bind() according to the spec :^)Linus Groh
2022-02-09LibJS: Add FunctionObject constructor allowing null prototypeLinus Groh
This just calls through to the Object constructor added in the previous commit.
2022-02-09LibJS: Add Object constructor allowing null prototypeLinus Groh
2022-02-09LibJS: Remove unused BoundFunction::m_constructor_prototypeLinus Groh
This was not being used anywhere, and the way we determined it was not matching the spec at all, so let's remove it and do it properly.
2022-02-09LibRegex: Only skip full instructions when optimizing alternationsAli Mohammad Pur
It makes no sense to skip half of an instruction, so make sure to skip only full instructions!
2022-02-09Applications: Port Assistant to LibMainLenny Maiorani
2022-02-09Base+Browser: Add browser iconselectrikmilk
Add local storage and style sheet icons. I also noticed the name of the DOM tree icon needed updated (tree => dom_tree).
2022-02-09LibJS: Implement Sets using MapsAli Mohammad Pur
This implements ordered sets using Maps with a sentinel value, and includes some extra set tests. Fixes #11004. Co-Authored-By: davidot <davidot@serenityos.org>
2022-02-09LibJS: Make Map iterators independent of the underlying hashmapAli Mohammad Pur
This implements ordered maps as a pair of an RBTree for key order, and an underlying unordered hash map for storage. Fixes (part of) #11004.
2022-02-09LibHTTP: Skip the body when response code is 204Ali Mohammad Pur
...even if the headers claim that there's some data in the form of Content-Length. This finally fixes loading Discord with RequestServer ConnectionCache on :^)
2022-02-09LibTLS+RequestServer: Add an option to dump TLS keys to a log fileAli Mohammad Pur
This file allows us to decrypt TLS messages in wireshark, which can help immensely in debugging network stuff :^)
2022-02-09LibWeb: Paint box-shadows more efficientlySam Atkins
Our previous code roughly did this: 1. Generate a bitmap as large as the shadow would end up. 2. Paint a rectangle onto it. 3. Blur the whole bitmap. 4. Split it up and render each section. This patch takes advantage of the fact that (aside from corners) each horizontal or vertical strip of a box-shadow is identical to the others, to generate and blur a much smaller bitmap - only large enough for the four corners and 1px of central "side" in each direction. This greatly reduces the memory footprint, and should also speed things up, since there is much less to blur.
2022-02-09LibC: Remove debug spam in getaddrinfo()Andreas Kling