Commit Graph

27325 Commits

Author SHA1 Message Date
Callum Walker
fd3735199b LibCore: Fix link_file inverting src and dst paths on duplicate names
File::link_file takes the dst_path then the src_path so on duplicate
names we tried to create a link at the original file location, which
then flipped the parameters back round again and we ended up with a
broken link from "dst_path (1)" to "src_path (1)".
2021-09-12 04:58:22 +00:00
Andreas Kling
19de6bb1cc LibWeb+Browser: Add Debug menu action for toggling Same-Origin Policy
Sometimes it's useful to turn off the SOP for testing purposes.
Let's make that easy by having a Debug menu item for it. :^)
2021-09-12 02:13:28 +02:00
Liav A
c181494b19 Kernel/SysFS: Move the PCI bus directory to the /sys/bus directory
The USB bus directory is already in /sys/bus directory, so I don't see a
reason why the PCI bus directory shouldn't be in that directory too.
2021-09-12 01:44:19 +02:00
Luke Wilde
1927600852 LibWeb: Add the History object and stub pushState and replaceState
The spec allows us to optionally return from these for any reason.
Our reason is that we don't have all the infrastructure in place yet to
implement them.
2021-09-12 01:41:44 +02:00
Luke Wilde
3faed65e2b LibWeb: Add full support for optional and nullable to IDL string types
Used by History.
2021-09-12 01:41:44 +02:00
Luke Wilde
f8eb616fe3 LibWeb: Add support for the IDL any type
The any type is essentially a raw JS::Value.
2021-09-12 01:41:44 +02:00
Luke Wilde
3eca8cb243 LibWeb: Add Document::is_fully_active
This is used in a bunch of places in the HTML spec. The current use
case for this is History.
2021-09-12 01:41:44 +02:00
Timothy Flynn
f5c988b3ce LibJS: Convert MapIterator.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
77efecadf7 LibJS: Convert Map.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
9e57ea71af LibJS: Convert GeneratorObject.prototype to be a PrototypeObject
The added #include in GeneratorObject.h is to resolve usage of
Bytecode::RegisterWindow.
2021-09-12 01:40:56 +02:00
Timothy Flynn
43e4cec3e2 LibJS: Convert FinalizationRegistry.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
94f076a774 LibJS: Convert Date.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
8bfb665b72 LibJS: Convert DataView.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
4d1d0f05a9 LibJS: Convert ArrayIterator.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
bd4c116d08 LibJS: Convert ArrayBuffer.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
696967d7b6 LibJS: Convert WeakSet.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
777ae53615 LibJS: Convert WeakRef.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
966f4faae4 LibJS: Convert WeakMap.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
be0880fb2c LibJS: Convert StringIterator.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
f195cb41a8 LibJS: Convert SetIterator.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
75d5c17aec LibJS: Convert Set.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
a41d0d23f9 LibJS: Convert Promise.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
b749194e70 LibJS: Convert RegExpStringIterator.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
65b0c26c44 LibJS: Convert RegExp.prototype to be a PrototypeObject 2021-09-12 01:40:56 +02:00
Timothy Flynn
1078d5e58a LibJS: Create a class to provide common methods for object prototypes
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-12 01:40:56 +02:00
Mustafa Quraish
d38d03ce28 PixelPaint: Fit image to view when opened
When opening a file, make it fit on the screen. I think this is
sensible default behaviour.
2021-09-12 00:17:04 +02:00
Mustafa Quraish
f890f8529a PixelPaint: Make Fit Image To View account for rulers
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-12 00:17:04 +02:00
Mustafa Quraish
1e1e5bb5f7 PixelPaint: Remove unused methods to access files directly
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-12 00:17:04 +02:00
Mustafa Quraish
f337580191 PixelPaint: Use FileSystemAccessServer exclusively, remove unveil
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-12 00:17:04 +02:00
Mustafa Quraish
3141d51164 PixelPaint: Use LibConfig to allow custom pixel grid threshold
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-12 00:17:04 +02:00
Mustafa Quraish
451cba8b47 PixelPaint: Don't draw pixel grid outside image bounds
Fixes #9971
2021-09-12 00:17:04 +02:00
Timothy Flynn
6d55e0572d LibJS: Remove ErrorType::NotA and ErrorType::NotAn 2021-09-12 00:16:39 +02:00
Timothy Flynn
470262c8ab LibJS: Use ErrorType::NotAnObjectOfType instead of NotA 2021-09-12 00:16:39 +02:00
Timothy Flynn
9def17d4cb Spreadsheet: Use ErrorType::NotAnObjectOfType instead of NotA 2021-09-12 00:16:39 +02:00
Timothy Flynn
1139aa45b6 WebContent: Use ErrorType::NotAnObjectOfType instead of NotA 2021-09-12 00:16:39 +02:00
Timothy Flynn
c59b97043e LibWeb: Use ErrorType::NotAnObjectOfType instead of NotA 2021-09-12 00:16:39 +02:00
Timothy Flynn
fd8ec1fffa LibJS: Add a variant of ErrorType::NotA named NotAnObjectOfType
This is a clearer name. Subsequent commits will convert files to use the
new name, then the old name will be deleted.
2021-09-12 00:16:39 +02:00
Timothy Flynn
76589d6728 LibJS: Change wording of ErrorType::NotA to be independent of context
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-12 00:16:39 +02:00
Andreas Kling
0398089275 LibWeb: Throw SyntaxError on bogus querySelector{,All} input selector 2021-09-11 22:54:26 +02:00
Andreas Kling
935075c26e LibJS: Specify right base for PromiseResolvingElementFunction subclasses 2021-09-11 22:26:53 +02:00
Andreas Kling
971dc44ed3 LibJS: Don't use MarkedValueList in PromiseValueList
Instead, override visit_edges() and mark the values like any other Cell
subclass would.

This makes PromiseValueList play nice with zombification.
2021-09-11 22:16:30 +02:00
Andreas Kling
2253235a0f LibWeb: Revoke outstanding WeakPtrs on wrapper zombification
This fixes an issue with false positives in the GC zombie debugger.
2021-09-11 20:38:45 +02:00
Andreas Kling
0d2c3f62d3 LibJS: Use move semantics more when creating Reference objects
Turns a bunch of FlyString copies into moves.
2021-09-11 20:38:45 +02:00
Idan Horowitz
6704961c82 AK: Replace the mutable String::replace API with an immutable version
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-11 20:36:43 +03:00
Idan Horowitz
aba4c9579f Browser: Use String::count instead of String::replace(X, X, true)
There's no need to create a new String just to count the amount of
occurrences of a substring.
2021-09-11 20:36:43 +03:00
Idan Horowitz
6d2b003b6e AK: Make String::count not use strstr and take a StringView
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-11 20:36:43 +03:00
thankyouverycool
4e40eaf34c TextEditor: Remove wordiness and a separator in View menu
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-11 19:22:14 +02:00
thankyouverycool
9a5a9fbee0 LibGUI+TextEditor: Allow cursor line highlighting to be toggled 2021-09-11 19:22:14 +02:00
David Isaksson
a5ff941c86 PixelPaint: Add mouse indicators to the rulers 2021-09-11 19:16:29 +02:00
David Isaksson
242acfcbae LibGfx: Apply translation and scale to Painter::draw_triangle() 2021-09-11 19:16:29 +02:00