summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-12LibJS: Change wording of ErrorType::NotA to be independent of contextTimothy Flynn
Currently, we have NotA and NotAn, to be used dependent on whether the following word begins with a vowel or not. To avoid this, change the wording on NotA to be independent of this context.
2021-09-11LibWeb: Throw SyntaxError on bogus querySelector{,All} input selectorAndreas Kling
2021-09-11LibJS: Specify right base for PromiseResolvingElementFunction subclassesAndreas Kling
2021-09-11LibJS: Don't use MarkedValueList in PromiseValueListAndreas Kling
Instead, override visit_edges() and mark the values like any other Cell subclass would. This makes PromiseValueList play nice with zombification.
2021-09-11LibWeb: Revoke outstanding WeakPtrs on wrapper zombificationAndreas Kling
This fixes an issue with false positives in the GC zombie debugger.
2021-09-11LibJS: Use move semantics more when creating Reference objectsAndreas Kling
Turns a bunch of FlyString copies into moves.
2021-09-11AK: Replace the mutable String::replace API with an immutable versionIdan Horowitz
This removes the awkward String::replace API which was the only String API which mutated the String and replaces it with a new immutable version that returns a new String with the replacements applied. This also fixes a couple of UAFs that were caused by the use of this API. As an optimization an equivalent StringView::replace API was also added to remove an unnecessary String allocations in the format of: `String { view }.replace(...);`
2021-09-11Browser: Use String::count instead of String::replace(X, X, true)Idan Horowitz
There's no need to create a new String just to count the amount of occurrences of a substring.
2021-09-11AK: Make String::count not use strstr and take a StringViewIdan Horowitz
This was needlessly copying StringView arguments, and was also using strstr internally, which meant it was doing a bunch of unnecessary strlen calls on it. This also moves the implementation to StringUtils to allow API consistency between String and StringView.
2021-09-11TextEditor: Remove wordiness and a separator in View menuthankyouverycool
In many cases we can lean on the name of a menu to reduce verbosity. "View"->"Visualize/Show/Turn on/etc" is a bit redundant and clutters the menu. It's a little thing, but it makes the system feel more tightly integrated if we stick to the same word patterns across apps.
2021-09-11LibGUI+TextEditor: Allow cursor line highlighting to be toggledthankyouverycool
2021-09-11PixelPaint: Add mouse indicators to the rulersDavid Isaksson
2021-09-11LibGfx: Apply translation and scale to Painter::draw_triangle()David Isaksson
2021-09-11PixelPaint: Add rulersDavid Isaksson
2021-09-11PixelPaint: Draw guide lines and selections above the pixel gridDavid Isaksson
2021-09-11ColorPicker: Add ability to select a color on the screenMustafa Quraish
This commit adds a `ColorSelectOverlay` class, and uses it to allow the user to pick a color from the screen. The API for `ColorSelectOverlay` is inspired from the `SelectableOverlay` in `Utilities/shot.cpp`. In particular, it opens up it's own window, so that we can have control over the cursor over the whole screen. There's one thing notably different: In addition to returning the final selected color from the `exec()` function, it also provides an `on_color_changed()` hook, which can be used to (optionally) get live updated as the mouse is moving around. This is a bit odd, but allows us to use the preview widget of the color picker to see the current color under the mouse (which will be selected upon clicking). When trying to select the color from text / other small elements, this is very useful.
2021-09-11WindowServer: Add IPC endpoint to get the color under cursorMustafa Quraish
This allows any client to ask the WindowServer to give it the color of the screen bitmap under the cursor. There's currently no way to get the screen bitmap *without* the cursor already drawn on it, so for now we just take a pixel beside the actual cursor position to avoid just getting the cursors color.
2021-09-11Compositor: Add API to get the color of a pixelMustafa Quraish
This just returns the color of a given pixel position from the front bitmap of the corresponding screen.
2021-09-11Kernel+Userland: Remove loadable kernel modulessLiav A
These interfaces are broken for about 9 months, maybe longer than that. At this point, this is just a dead code nobody tests or tries to use, so let's remove it instead of keeping a stale code just for the sake of keeping it and hoping someone will fix it. To better justify this, I read that OpenBSD removed loadable kernel modules in 5.7 release (2014), mainly for the same reason we do - nobody used it so they had no good reason to maintain it. Still, OpenBSD had LKMs being effectively working, which is not the current state in our project for a long time. An arguably better approach to minimize the Kernel image size is to allow dropping drivers and features while compiling a new image.
2021-09-11LibJS: Visit WeakMap's values as long as their keys were not collectedIdan Horowitz
While the WeakMap only holds a weak reference to its keys, their accompanying values should be kept alive as long as they're accessible.
2021-09-11LibJS: Visit OrdinaryFunctionObject's owning realmIdan Horowitz
2021-09-11LibJS: Visit GeneratorObject's previous value if it's any kind of CellIdan Horowitz
Not just if it's an Object (which is one kind of Cell).
2021-09-11LibJS: Revoke any outstanding WeakPtr<Shape> when zombifying shapesAndreas Kling
The forward transition cache in Shape uses WeakPtr<Shape> to learn when a cached transition has been garbage collected. When running in zombification mode, we have to explicitly revoke any outstanding WeakPtrs to a Shape when it becomes a zombie. That ensures that it gets pruned from transition caches.
2021-09-11LibJS: Include source locations in VM::dump_backtrace() outputAndreas Kling
2021-09-11LibJS: Fix ASAN poisoning range in new HeapBlocksAndreas Kling
When poisoning HeapBlock::m_storage, we have to compute the storage size by excluding the HeapBlock header.
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-11Kernel: Run clang-format on SerialDevice.hIdan Horowitz
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-11Kernel: Initialize and expose SerialDevice(s) properlyLiav A
I forgot that we need to also initialize SerialDevice and also to ensure it creates a sysfs node properly. Although I had a better fix for this, it keeps the CI happy, so for now it's more than enough :)
2021-09-11Base: Fix Markdown formatting in links to man pagesBen Wiederhake
A quick grep revealed these stats (counting only the first occurrence per line): `thing`(1): 154 `thing(1)`: 9 thing(1): 4 This commit converts all occurrences to the `thing`(1) format.
2021-09-11Base: Fix Markdown casing in headingsBen Wiederhake
2021-09-11Base: Fix Markdown links in man pagesBen Wiederhake
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-11Documentation: Fix slightly-broken headersBen Wiederhake
GithubFlavoredMarkdown sees the angled brackets (<>) and censors them. Perhaps because it does not allow HTML tags in headings.
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-11AK: Forbid creating StringView from temporary FlyStringBen Wiederhake
2021-09-11AK: Forbid creating StringView from temporary ByteBufferBen Wiederhake
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