summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-12LibJS: Convert ArrayIterator.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert ArrayBuffer.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert WeakSet.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert WeakRef.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert WeakMap.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert StringIterator.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert SetIterator.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert Set.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert Promise.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert RegExpStringIterator.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Convert RegExp.prototype to be a PrototypeObjectTimothy Flynn
2021-09-12LibJS: Create a class to provide common methods for object prototypesTimothy Flynn
Almost every JS prototype class defines a static "typed_this" helper to return the current "this" value as the analogous object type. This adds a PrototypeObject class to be inserted between the prototype object and the base Object class to define these methods on the prototype's behalf. Note that the generated "display_name" method must be defined static because the callers of typed_this are also static.
2021-09-12PixelPaint: Fit image to view when openedMustafa Quraish
When opening a file, make it fit on the screen. I think this is sensible default behaviour.
2021-09-12PixelPaint: Make `Fit Image To View` account for rulersMustafa Quraish
Because of the way rulers are implemented in the ImageEditor currently, the `Fit Image To View` action doesn't work correctly with them enabled. This patch makes them adjust to the effective viewport area and account for the rulers. This is a bit of a hack, but the correct way to deal with this would be to put the rulers in a new widget so they don't interfere with the actual viewport rect (which is being used all over).
2021-09-12PixelPaint: Remove unused methods to access files directlyMustafa Quraish
After transitioning to FileSystemAccessServer, some of the methods in `MainWidget` and `ProjectLoader` for opening files directly with a filename as opposed to with a file descriptor are unused. This commit removes them.
2021-09-12PixelPaint: Use FileSystemAccessServer exclusively, remove unveilMustafa Quraish
Use the newly added API in FileSystemAccessServer to get read-only access to a file specified on the commandline. We no longer need to unveil any image / .pp files on the filesystem :^)
2021-09-12PixelPaint: Use LibConfig to allow custom pixel grid thresholdMustafa Quraish
Depending on the size / scaling of the UI, someone might want to change what the threshold is to show the pixel grid. For instance if you are working on a 50x50 image, and want to see the grid while still fitting the whole image in the editor. Since there's no UI for settings in PixelPaint right now, this commit just uses LibConfig to read the following entry: ("PixelPaint", "PixelGrid", "Threshold") which is then used when drawing the grid.
2021-09-12PixelPaint: Don't draw pixel grid outside image boundsMustafa Quraish
Fixes #9971
2021-09-12LibJS: Remove ErrorType::NotA and ErrorType::NotAnTimothy Flynn
2021-09-12LibJS: Use ErrorType::NotAnObjectOfType instead of NotATimothy Flynn
2021-09-12Spreadsheet: Use ErrorType::NotAnObjectOfType instead of NotATimothy Flynn
2021-09-12WebContent: Use ErrorType::NotAnObjectOfType instead of NotATimothy Flynn
2021-09-12LibWeb: Use ErrorType::NotAnObjectOfType instead of NotATimothy Flynn
2021-09-12LibJS: Add a variant of ErrorType::NotA named NotAnObjectOfTypeTimothy Flynn
This is a clearer name. Subsequent commits will convert files to use the new name, then the old name will be deleted.
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.