summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-06-01LibGUI+Shell+bt+ls: Use proper APIs for creating file URLsMax Wipfli
This patch replaces ad-hoc generation of file URL strings with using URL::create_with_file_scheme().
2021-06-01LibHTTP: Percent encode/decode request URIMax Wipfli
This percent encodes/decodes the request URI when creating or parsing raw HTTP requests. This is necessary because AK::URL now contains percent decoded data, meaning we have to re-encode it for creating raw requests.
2021-06-01LibWeb: Remove usage of URL::set_path() in FrameLoaderMax Wipfli
This replaces a call to URL::set_path() with URL::set_paths(), as set_path() will be deprecated and removed.
2021-06-01Spreadsheet: Remove usage of URL::set_path()Max Wipfli
This replaces a call to URL::set_path() with URL::set_paths(), as set_path() will be deprecated and removed.
2021-06-01AK: Remove URLParserMax Wipfli
This removes URLParser, because its two exposed functions, urlencode() and urldecode(), have been superseded by URL::percent_encode() and URL::percent_decode(). This is in preparation for the introduction of a new URL parser.
2021-06-01AK+Everywhere: Replace usages of URLParser::urlencode() and urldecode()Max Wipfli
This replaces all occurrences of those functions with the newly implemented functions URL::percent_encode() and URL::percent_decode(). The old functions will be removed in a further commit.
2021-06-01basename: Tidy up a little moreAndreas Kling
This looks a little nicer with a single outln() invocation. :^)
2021-06-01basename: Support suffix strippingAndreas Kling
Allow passing an optional suffix argument to `basename` which is then stripped from the resulting basename (unless the resulting basename is identical to the suffix.) https://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html
2021-06-01LibCore: Add StringView overloads for Core::ArgsParserAndreas Kling
These allow you to get StringView wrappers around on-stack string arguments, which seems pretty nice. :^)
2021-06-01Hearts: Fix sorting for pick_low_points_high_value_cardGunnar Beutner
Previously the function did not sort the hand at all which means we wouldn't necessarily pick the card with the highest value.
2021-06-01Hearts: Prefer to pass high value cardsGunnar Beutner
Previously we'd prefer to pass high points cards. Instead we should prefer to pass high value cards first.
2021-06-01Hearts: Pick better non-matching cardsGunnar Beutner
When we don't have a matching card for the lead card rather than always preferring to play hearts we should try to get rid of our high value cards first if no other player has hearts cards higher than what we have.
2021-06-01Hearts: Make debugging AI suggestions easierGunnar Beutner
When building Hearts with HEARTS_DEBUG we highlight the card the AI would have picked. This makes comparing AI and human decisions easier.
2021-06-01Hearts: Pick better cards when we're the third playerGunnar Beutner
When we're the third player in a trick and we don't have a lower value card we would previously pick a slightly higher value card. Instead we should pick the highest value card unless there are points in the current trick or the lead card is spades and the higher value card we would've picked is higher than the queen and another player still has the queen. The rationale is that we have to take the trick anyway so we might as well get rid of our highest value card. If the trailing player has a lower value card of the same type we take the trick but don't gain any points. If they don't have a card of the same type it doesn't matter whether we play a high value or low value card.
2021-06-01Hearts: Pick better lead cardsGunnar Beutner
Previously the AI would prefer playing a lead card for which no other player had a card with a higher value even though it also had a card for which a higher value card was still in play.
2021-06-01LibPthread: Correct error check in `sem_post` and `sem_wait`Jelle Raaijmakers
2021-06-01LibGUI: Add a FIXME about race in AutocompleteBox::apply_suggestion()Itamar
2021-06-01LibGUI: Check that AutocompleteBox's selection row is validItamar
Previously we didn't check that the selection's row index is in a valid range before attempting to access its data via the model. This could cause an out-of-bounds access to the model's Vector of suggestions. I think this should fix #7404, but I can't verify it does because I wasn't able to reproduce it on my machine.
2021-06-01LibGUI/TreeView: Select parent on collapseJelle Raaijmakers
When collapsing a tree that contains the current selection, the parent node becomes selected instead.
2021-05-31LibJS: Add left shift & right shift operator support for BigIntegersIdan Horowitz
Based on https://tc39.es/ecma262/#sec-numeric-types-bigint-leftShift (This commit also includes the matching tests)
2021-05-31lsof: Replace copy with reference in a for loopLinus Groh
2021-05-31cal: Remove unused variable declarationsLinus Groh
2021-05-31Userland: Remove a bunch of unused includesLinus Groh
As reported by CLion.
2021-05-31Userland: Avoid a bunch of JsonObject copiesLinus Groh
JsonValue::as_object() returns a reference.
2021-05-31SpaceAnalyzer: Replace fprintf(stderr) with warnln()Linus Groh
2021-05-31Debugger: Replace printf() with outln()Linus Groh
2021-05-31Applets/Network: Replace fprintf(stderr) with dbgln()Linus Groh
This is an applet, so we're not going to see its stderr anyway.
2021-05-31LibX86: Replace fprintf(stderr) with warnln()Linus Groh
2021-05-31LibWeb/WrapperGenerator: Replace a fprintf() with warnln()Linus Groh
2021-05-31LibRegex: Replace fprintf()/printf() with warnln()/outln()/dbgln()Linus Groh
2021-05-31LibHTTP: Replace fprintf(stderr) with warnln()Linus Groh
2021-05-31LibGUI: Replace fprintf(stderr)/printf() with warnln()/dbgln()Linus Groh
2021-05-31LibGfx: Replace if constexpr (PNG_DEBUG) printf() with dbgln_if()Linus Groh
The debug console seems more appropriate than stdout here.
2021-05-31LibGemini: Replace fprintf(stderr) with warnln()Linus Groh
2021-05-31LibCore: Replace fprintf(stderr)/printf() with warnln()/out()Linus Groh
2021-05-31LibC: Replace fprintf(stderr) with warnln()Linus Groh
2021-05-31LibGfx: Make JPGLoader iterate components deterministicallysin-ack
JPGLoader used to store component information in a HashTable, indexed by the ID assigned by the JPEG file. This was fine for most purposes, however after f89e8fb7 this was revealed to be a flawed implementation which causes non-deterministic iteration over components. This issue was previously masked by a perfect storm of int_hash being stable for the integer values 0, 1 and 2; and AK::HashTable having just the right amount of buckets for the components to be ordered correctly after being hashed with int_hash. However, after f89e8fb7, malloc_good_size was used for determining the amount of space for allocation; this caused the ordering of the components to change, and images started showing up with the red and blue channels reversed. The issue was finally determined to be inconsistent ordering after randomly changing the order of the components caused Huffman decoding to fail. This was the result of about 10 hours of hair-pulling and repeatedly doing full rebuilds due to bisecting between commits that touched AK. Gunnar, I like you, but please don't make me go through this again. :^) Credits to Andrew Kaster, bgianf, CxByte and Gunnar for the debugging help.
2021-05-31LibWeb: Rename "FrameHostElement" to "BrowsingContextContainer"Luke
With the renaming of "Frame" to "BrowsingContext", this changes "FrameHostElement" to "BrowsingContextContainer" to further match the spec. https://html.spec.whatwg.org/#browsing-context-container
2021-05-31LibGL: Use Texture Units in Rasterizer and ContextJesse Buhagiar
The Context and Software Rasterizer now gets the array of texture units instead of a single texture object. _Technically_, we now support some primitive form of multi-texturing, though I'm not entirely sure how well it will work in its current state.
2021-05-31LibGL: Implement glActiveTextureJesse Buhagiar
2021-05-31LibGL: Implement basic texture unitsJesse Buhagiar
These are merely a way to hold the different texture target bind points that a texture can be bound to.
2021-05-31Spreadsheet: Keep value when clicking out of a cellBrandon Hamilton
2021-05-31LibELF: Support weak symbols when using BIND_NOWGunnar Beutner
When using BIND_NOW (e.g. via -Wl,-z,now) we would fail to load ELF images while doing relocations when we encounter a weak symbol. Instead we should just patch the PLT entry with a null pointer. This can be reproduced with: $ cat test.cpp int main() { std::cout << "Hello World!" << std::endl; } $ g++ -o test -Wl,-z,now test.cpp $ ./test did not find symbol while doing relocations for library test: _ITM_RU1
2021-05-31AK: Remove the public ByteBuffer::trim methodGunnar Beutner
This removes the public trim() method because it is no longer necessary. Callers can instead use resize().
2021-05-31AK: Replace ByteBuffer::grow with resize()/ensure_capacity()Gunnar Beutner
Previously ByteBuffer::grow() behaved like Vector<T>::resize(). However the function name was somewhat ambiguous - and so this patch updates ByteBuffer to behave more like Vector<T> by replacing grow() with resize() and adding an ensure_capacity() method. This also lets the user change the buffer's capacity without affecting the size which was not previously possible. Additionally this patch makes the capacity() method public (again).
2021-05-31LibWeb: Return null in Window.{top,parent} if browsing context is nullLuke
We were asserting that it exists, but the spec says to return null in this case. Top: https://html.spec.whatwg.org/multipage/browsers.html#dom-top Parent: https://html.spec.whatwg.org/multipage/browsers.html#dom-parent
2021-05-31LibELF + LibDebug: Reduce allocations during symbolificationBrian Gianforcaro
Avoid promotion of static strings to AK::String, instead use AK::StringView and operator ""sv, to force string view's instead which avoids allocation of String. This code path isn't hot enough that it makes a huge difference, but every bit counts.
2021-05-30pls: Fix typo in TERM environment variable propagationAndreas Kling
2021-05-30pls: Drastically simplify this programAndreas Kling
Since this program is setuid-root, it should be as simple as possible. To that end, remove `/etc/plsusers` and use filesystem permissions to achieve the same thing. `/bin/pls` is now only executable by `root` or members of the `wheel` group. Also remove all the logic that went to great lengths to `unveil()` a minimal set of filesystem paths that may be used for the command. The complexity-to-benefit ratio did not seem justified, and I think we're better off keeping this simple. Finally, remove pledge promises the moment they are no longer needed.
2021-05-31LibCrypto: Fix bound checks when reading bitmapsBen Wiederhake
This only affects malformed RSA keys. Instead of accepting and continuing with potentially broken pointers (and in ASAN, crashing), we now consider bitmaps malformed, and stop parsing. Found by OSS Fuzz: #31698, long-standing-bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31698 Fun fact: The "if" only exists because of OSS Fuzz. 8cc279ed74dc0b16a187052d2454c26c8c6ecaf2