Age | Commit message (Collapse) | Author |
|
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.
|
|
... 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. :^)
|
|
...and pageXOffset/pageYOffset too, since those are just aliases for the
same thing.
|
|
This call sets the absolute scroll position for the window.
|
|
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.
|
|
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.
|
|
|
|
|
|
Let's use Base::visit_edges() when calling the base class, to prevent
accidentally skipping over anyone in the inheritance chain.
|
|
|
|
|
|
It always returns the empty string for now.
|
|
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.
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
This adds plumbing for the Intl.NumberFormat object, constructor, and
prototype.
|
|
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.
|
|
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.
|
|
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.
|
|
This is needed for Intl.NumberFormat's usage of the ResolveLocale AO,
where the [[RelevantExtensionKeys]] internal slot will be "nu".
|
|
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.
|
|
We can just fail these with ENOSYS pending a full implementation.
|
|
|
|
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. :^)
|
|
It's a lot easier to debug JavaScript problems if you can see which file
the errors are in. :^)
|
|
This patch adds a "Clear Guides" option to the "View"-menu.
|
|
|
|
|
|
|
|
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.
|
|
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. :^)
|
|
This fixes #9933 and some dead code I accidentally left over.
Thanks, @Maato!
|
|
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.
|
|
Previously we unveiled the file specified through the command-line
interface. Now, we just make the request through the
FileSystemAccessServer instead.
|
|
Previously we unveiled the file specified through the command-line
interface. Now, we just make the request through the
FileSystemAccessServer instead.
|
|
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.
|
|
Use `request_file_read_only_approved()` for the file (if any) is
specified through a command line argument.
|
|
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.
|
|
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.
|
|
This makes the user-facing type only take the node member pointer, and
lets the compiler figure out the other needed types from that.
|
|
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).
|