summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-09-11LibJS+js+test-js: Add GC debug mode that keeps cells "alive" as zombiesAndreas Kling
This patch adds a `-z` option to js and test-js. When run in this mode, garbage cells are never actually destroyed. We instead keep them around in a special zombie state. This allows us to validate that zombies don't get marked in future GC scans (since there were not supposed to be any more references!) :^) Cells get notified when they become a zombie (via did_become_zombie()) and this is used by WeakContainer cells to deregister themselves from the heap.
2021-09-11LibWeb: Implement Window.scroll() and Window.scrollBy() JS methodsSam Atkins
... and `Window.scrollTo()`, which is an alias for `scroll()`. There is still work that needs to be done here, regarding bringing the scroll position calculation in line with the spec. Currently we get the viewport rect from outside, and treat it as if it was the result of calculating steps 5-9 of the `scroll()` method. But it works. :^)
2021-09-11LibWeb: Implement Window.scroll{X,Y} JS propertiesSam Atkins
...and pageXOffset/pageYOffset too, since those are just aliases for the same thing.
2021-09-11LibWeb+WebContent: Add WebContentClient::did_request_scroll_to() callSam Atkins
This call sets the absolute scroll position for the window.
2021-09-11LibWeb+WebContent: Modify did_request_scroll() IPC to take x&y deltasSam Atkins
This is in preparation for implementing JS scrolling functions, which specify both x and y scrolling deltas. The visible behavior has not changed. Also, moved the "mouse wheel delta * 20" calculation to the `EventHandler` since the JS calls will want to work directly in pixels.
2021-09-11Everywhere: Fix format-vulnerabilitiesBen Wiederhake
Command used: grep -Pirn '(out|warn)ln\((?!["\)]|format,|stderr,|stdout,|output, ")' \ AK Kernel/ Tests/ Userland/ (Plus some manual reviewing.) Let's pick ArgsParser as an example: outln(file, m_general_help); This will fail at runtime if the general help happens to contain braces. Even if this transformation turns out to be unnecessary in a place or two, this way the code is "more obviously" correct.
2021-09-11Utilities: Show dynamic ELF info with "show all" optionRodrigo Tobar
2021-09-11LibJS: Mark the global object in Environment::visit_edges()Andreas Kling
2021-09-11LibJS+LibWeb+Spreadsheet: Upcall visit_edges() via Base typedefAndreas Kling
Let's use Base::visit_edges() when calling the base class, to prevent accidentally skipping over anyone in the inheritance chain.
2021-09-11LibJS: Use Span<Cell*> instead of Vector<Cell*> in more placesAndreas Kling
2021-09-11LibJS: Mark instance field names in FunctionObject::visit_edges()Andreas Kling
2021-09-11LibWeb: Add naive support for the Document.referrer attributeAndreas Kling
It always returns the empty string for now.
2021-09-11PixelPaint: Add menu action to toggle pixel grid visibilityMustafa Quraish
You can now toggle on/off the visibility of the pixel grid from the View menu, if you don't want it shown for some reason.
2021-09-11PixelPaint: Show a pixel grid when zoomed in enoughMustafa Quraish
The editor now draws a grid showing the pixels if you are zoomed in enough. Currently the threshold is a scale of 15 (so if one pixel side on the image takes up > 15 pixels in the editor)
2021-09-11wasm: Avoid making StringView of temporary ByteBufferBen Wiederhake
2021-09-11nproc: Avoid making StringView of temporary ByteBufferBen Wiederhake
2021-09-11LibWasm: Avoid making StringView of temporary ByteBufferBen Wiederhake
2021-09-11SystemMonitor: Avoid making StringView of temporary ByteBufferBen Wiederhake
2021-09-11Spreadsheet: Avoid making StringView of temporary ByteBufferBen Wiederhake
2021-09-11LibJS: Tweak the WeakContainer::remove_swept_cells() API a little bitAndreas Kling
Make this API take a Span<Cell*> instead of a Vector<Cell*>&. This is behavior neutral, but stops the API looking like it wants to do mutable things to the Vector.
2021-09-11LibJS: Implement Intl.NumberFormat.prototype.resolvedOptionsTimothy Flynn
2021-09-11LibJS: Implement Intl.NumberFormat.supportedLocalesOfTimothy Flynn
2021-09-11LibJS: Implement the Intl.NumberFormat constructorTimothy Flynn
2021-09-11js: Implement pretty-printing of Intl.NumberFormatTimothy Flynn
2021-09-11LibJS: Implement a nearly empty Intl.NumberFormat objectTimothy Flynn
This adds plumbing for the Intl.NumberFormat object, constructor, and prototype.
2021-09-11LibJS: Handle Unicode locale extensions in the ResolveLocale operationTimothy Flynn
Currently, all callers of ResolveLocale invoke the operation with an empty [[RelevantExtensionKeys]] slot, so the block of the method that deals with those keys was unimplemented. This implements that block now to prepare for Intl.NumberFormat which has a [[RelevantExtensionKeys]]. Note that the find_key_in_value() method is a simple VERIFY_NOT_REACHED in just this commit until the Intl.NumberFormat's keys are handled in its implementation.
2021-09-11LibUnicode: Add some data related to currency codesTimothy Flynn
This data is published under ISO-4217 as an XML file. Since we can't parse XML files yet, and the data isn't very large, it was translated to C++ manually here.
2021-09-11LibUnicode: Extract canonicalization of Unicode extension valuesTimothy Flynn
LibJS will need to canonicalize Unicode extension values, so extract the lambda that was doing this work to its own function. This also changes the helpers it invokes to take the provided key as a StringView because we don't need (and won't always have) full String objects here.
2021-09-11LibUnicode: Generate numeric keyword values for each localeTimothy Flynn
This is needed for Intl.NumberFormat's usage of the ResolveLocale AO, where the [[RelevantExtensionKeys]] internal slot will be "nu".
2021-09-11WidgetGallery: Add GUI::ValueSlider widgetMustafa Quraish
This was a cool slider and was missing from the gallery completely. Vertical mode for this isn't enabled, and it looked awfully crammed in the bottom along with the other horizontal sliders, so for now I've just added this to the top, and it controls the opacity of the image along with the opacity slider.
2021-09-11UserspaceEmulator: Ignore perf_event and perf_register_string syscallsAndreas Kling
We can just fail these with ENOSYS pending a full implementation.
2021-09-11LibWeb: Ignore keydown events when there is no layout treeAndreas Kling
2021-09-11LibWeb: Stub out a dummy window.getComputedStyle()Andreas Kling
This just returns an empty CSSStyleDeclaration for now. The real thing needs to be a live object that provides a view onto the computed style of a given element. This is far from that, but it's something. :^)
2021-09-11LibWeb+LibJS: Remember source filenames when using HTML::ScriptAndreas Kling
It's a lot easier to debug JavaScript problems if you can see which file the errors are in. :^)
2021-09-11PixelPaint: Add "Clear Guides" to remove all GuidesTobias Christiansen
This patch adds a "Clear Guides" option to the "View"-menu.
2021-09-10LibJS: Implement Temporal.PlainMonthDay.prototype.equalsLuke Wilde
2021-09-10LibJS: Implement Temporal.PlainMonthDay.fromLuke Wilde
2021-09-10LibJS: Implement ToTemporalMonthDay AOLuke Wilde
2021-09-11LibGfx: Increase bit-width of variables used in do_draw_scaled_bitmapTobias Christiansen
To avoid expensive floating point operations the values are put in the upper half of an integer which is then used for calculations. When the src_rect is sufficiently large (when, say, PixelPaint is zoomed in x100), the precision provided by this strategy with regular 32-bit-long ints is no longer enough. This patch changes the used types to i64, which are 64 bits wide and the shifting is increased to 32 bits. On the 32-bit-arch a i64 doesn't fit in a single register anymore but it's probably okay to trust the compiler to do clever stuff around this issue.
2021-09-10LibJS: Share "parsed identifiers" between copied JS::Lexer instancesAndreas Kling
When we save/load state in the parser, we preserve the lexer state by simply making a copy of it. This was made extremely heavy by the lexer keeping a cache of all parsed identifiers. It keeps the cache to ensure that StringViews into parsed Unicode escape sequences don't become dangling views when the Token goes out of scope. This patch solves the problem by replacing the Vector<FlyString> which was used to cache the identifiers with a ref-counted HashTable<FlyString> instead. Since the purpose of the cache is just to keep FlyStrings alive, it's fine for all Lexer instances to share the cache. And as a bonus, using a HashTable instead of a Vector replaces the O(n) accesses with O(1) ones. This makes a 1.9 MiB JavaScript file parse in 0.6s instead of 24s. :^)
2021-09-10WindowServer: Fix 'sticky' mouse after resizeBen Wiederhake
This fixes #9933 and some dead code I accidentally left over. Thanks, @Maato!
2021-09-10Breakout: Improve collision response between ball and paddleDamien Firmenich
When the ball hits the side of the paddle, it would get stuck because the paddle moves faster than the ball. This commit forces the post- collision vertical velocity of the ball to be going up and makes sure that new ball's y-position is higher than in the previous frame.
2021-09-10HexEditor: Remove unveil() for CLI file, use FileSystemAccessServerMustafa Quraish
Previously we unveiled the file specified through the command-line interface. Now, we just make the request through the FileSystemAccessServer instead.
2021-09-10TextEditor: Remove unveil() for CLI file, use FileSystemAccessServerMustafa Quraish
Previously we unveiled the file specified through the command-line interface. Now, we just make the request through the FileSystemAccessServer instead.
2021-09-10TextEditor/FileArgument: Remove file existance check for early exitMustafa Quraish
This check was fine earlier when we had access to the full filesystem, but now that we are moving away from applications having unveiled access to the filesystem, this check would just get rejected from the kernel. This is rare / fast enough that performance should not really matter in any case.
2021-09-10PDFViewer: Open CLI files through FileSystemAccessServer without promptMustafa Quraish
Use `request_file_read_only_approved()` for the file (if any) is specified through a command line argument.
2021-09-10LibFileSystemAccessClient: Convert request paths to absolute if neededMustafa Quraish
FileSystemAccessServer requires all paths to be absolute, and will just crash if this is not the case. Instead of expecting the user to always provide an absolute path, the client just checks to see if the path provided was absolute, and if not makes a request with the absolute path instead.
2021-09-10FileSystemAccessServer: Allow read-only access without promptingMustafa Quraish
This commit adds a new request to the FileSystemAccessServer endpoint, allowing the clients to get read-only access to a file without getting a Dialog-box prompting the user for access. This is only meant to be used in cases where the user has asked specifically to open a file through the command-line arguments. In those cases, I believe it makes sense for the read-only access to be implicit. Always prompting the user gets a bit annoying, especially if you just quickly want to open a file through the CLI. The new request name has been made extremely specific to make sure that it's only used when appropriate.
2021-09-10AK+Everywhere: Reduce the number of template parameters of IntrusiveListAli Mohammad Pur
This makes the user-facing type only take the node member pointer, and lets the compiler figure out the other needed types from that.
2021-09-10LibDebug: Use the first memory segment of a library as the ELF's baseItamar
When parsing the libraries of the debugee process, we previously assumed that the region that's called `<library name>: .text` was also the base of the ELF file. However, since we started linking with `-z separate-code`, this is no longer the case - our executables have a read-only segment before the .text segment, and that segment is actually at the base of the ELF. This broke inserting breakpoints with the debugger since they were inserted at a wrong offset. To fix that, we now use the address of the first segment in the memory map for the ELF's base address (The memory map is sorted by address).