HTMLCollection is an awkward legacy interface from the DOM spec.
It provides a live view of a DOM subtree, with some kind of filtering
that determines which elements are part of the collection.
We now return HTMLCollection objects from these APIs:
- getElementsByClassName()
- getElementsByName()
- getElementsByTagName()
This initial implementation does not do any kind of caching, since that
is quite a tricky problem, and there will be plenty of time for tricky
problems later on when the engine is more mature.
You can now specify the "CustomGetByIndex" extended interface attribute
which will cause the generator to emit an override declaration for
JS::Object::get_by_index().
It's up to you to implement that function somewhere. Just like the
CustomGet mechanism already works. :^)
Try to find a font that has at least some of the requested properties.
This makes e.g. rfcs on tools.ietf.org easier to read since their
headers are now bold.
Height computation algorithm is actually
different for absolutely positioned boxes
and block formatting contexts (where it doesn't include floats)
Fixes#6408
Statements like SELECT, INSERT, and UPDATE also optionally include this
list, so move its parsing out of parse_delete_statement(). Since it will
appear before the actual statement, parse it first in next_statement();
then only parse for statements that are allowed to include the list.
Misread the graph: In the "WITH [RECURSIVE] common-table-expression"
section, common-table-expression is actually a repeating list. This
changes the parser to correctly parse this section as a list. Create a
new AST node, CommonTableExpressionList, to store both this list and the
boolean RECURSIVE attribute (because every statement that uses this list
also includes the RECURSIVE attribute beforehand).
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
This error page template is slightly hilarious and should probably
be replaced with AK::SourceGenerator or some such, but for now let's
just get rid of the call to String::format().
This was a helper that would call a syscall repeatedly until it either
succeeded or failed with a non-EINTR error.
It was only used in two places, so I don't think we need this helper.
https://sqlite.org/lang_expr.html
The entry point to using expressions, parse_expression(), is not used
by SQL::Parser in this commit. But there's so much here that it's easier
to grok as its own commit.
The following is a common (and soon to be *very* common) expression:
if (match(token_type))
consume();
Using consume_if() makes this a bit simpler and makes it less likely to
forget to invoke consume() after the match().
Problem:
- `constexpr` functions are additionally decorated with `inline`
keyword. This is redundant since `constexpr` implies `inline`.
Solution:
- Remove redundancies.
Modifying the selection while holding the shift button and selecting
with the mouse or the arrow keys no longer results in broken selections.
Fixes#6279.
With some themes (like the default one), it was possible to select a
property, making the text of its value not visible. I solved this by
setting set_should_fill_selected_rows to true.
In LibDebug this required implementing the Kill debug action, and
in HackStudio this required making the toolbar's stop action stop
the debugger if active.
Move LibCompress unit tests to LibCompress/Tests directory and register
them with CMake's add_test. This allows us to run these tests with
ninja test instead of running a separate executable.
Also split the existing tests in 3 test files that better follow the
source code structure (inspired by AK tests).
GCC will insert various calls to pthread functions when compiling
C++ code with static initializers, even when the user doesn't link
their program against libpthread explicitly.
This is used to make static initializers thread-safe, e.g. when
building a library that does not itself use thread functionality
and thus does not link against libpthread - but is intended to
be used with other code that does use libpthread explicitly.
This makes these symbols available in libc.
A website with a 4xx status code is still a valid website, we should not
artificially hide it. In fact, many websites implement custom 404 error
pages for example, often containing search functionality or links back
to the homepage.
This might have implications regarding the loading of stylesheets where
the request 404s, but since we were not handling 5xx status codes as
errors either, I think that's fine for now (but might need additional
work later). Worst case, the parser rejects to load some error page HTML
as CSS :^)
In the ListItemMarkerBox render the correct thing when painting.
This covers decimal counting for ordered lists as well as square,
disc, and circle for unordered lists. Thus all currently supported
list-style-types are displayed correctly.
This closes#2059
For Elements depending on the index they are inside their parent. Most
notably the <ol> element.
Also added a typed version to only count children of a certain type.
This patch is work towards #2059
This adds a simple REPL command line utility for (eventually) executing
SQL statements / files. Currently, it just validates statements from
stdin and prints any errors.
LibSQL aims to be a SQLite clone for SerenityOS. Step 1 is creating a
tokenizer to lex SQL tokens. This lexer is heavily influenced by the
LibJS lexer.
HTMLInputElement now inherits from FormAssociatedElement, which will
be a common base for the handful of elements that need to track their
owner form (and register with it for the form.elements collection.)
At the moment, the owner form is assigned during DOM insertion/removal
of an HTMLInputElement. I didn't implement any of the legacy behaviors
defined by the HTML parsing spec yet.
The "Wrapper" suffix is not useful information to someone using the
JS console, so let's just drop it from the string returned when calling
class_name() on a JS binding wrapper.
did_error() caused the program to crash since the DialogBox tried to
run its own Notifier with the same - now invalid because closed - fd.
In addition to setting the member that is the Notifier to nullptr we
also tell the Notifier that it is not enabled anymore.
IPC::Connection::send_sync asserts that a response was received, so the
current gracefull fail check was useless, as LibIPC would always assert
before reaching it.
This was failing to take two things into account:
- When constructing a PropertyName from a value, it won't automatically
convert to Type::Number for something like string "0", even though
that's how things work internally, since indexed properties are stored
separately. This will be improved in a future patch, it's a footgun
and should happen automatically.
- Those can't be looked up on the shape, we have to go through the
indexed properties instead.
Additionally it now operates on the shape or indexed properties directly
as define_property() was overly strict and would throw if a property was
already non-configurable.
Fixes#6469.
Changing the statusbar appearance when overriding text makes it less
confusing as it's supposed to be something temporary, e.g. only when
hovering over a toolbar or menu item.
This behavior is present on old Windows systems, although things work
slightly differently there (where only the overridden text is displayed
rather than all the segments).
The shared library libicudata.so has a DT_SYMBOLIC entry:
Dynamic Section:
NEEDED libgcc_s.so
SONAME libicudata.so.69
SYMBOLIC 0x00000000
HASH 0x00000094
STRTAB 0x000000c8
SYMTAB 0x000000a8
STRSZ 0x0000002a
SYMENT 0x00000010
According to the ELF spec DT_SYMBOLIC has no special meaning
for the dynamic loader.
This commit adds an event called WM_SuperKeyPressed which is sent to all
windows via WindowManagerServerConnection.
The event is fired from WindowManager when the super key is pressed,
which is the windows key on most keyboards :)
Often you want to enable and then disable profiling after a period of time.
To make this slightly more ergonomic, add an option to wait for user
input after enabling profiling, this will disable profiling on exit
after the key press.
We intentionally skimp out on checking isatty() before them to cut down
on syscalls, so we should also accept the errors and just let them be.
Closes#6471.
As well as correctly calculating the height of TableRowBox, this change
calculates the heights of TableRowGroupBoxs also.
As before, this does not correctly take into consideration the 'height'
attribute.
Now the horizontal layout is approximately correct for the
TableRowGroupBoxs we can now see that the `layout_row` method will need
updating to correctly calculate cell width across all rows, not just the
current TableRowGroupBox.
As the spec for the table fixup algorythm says:
> Treat table-row-groups in this spec also encompass the specialized
> table-header-groups and table-footer-groups.
The calculation for TLS relocations was incorrect which would
result in overlapping TLS variables when more than one shared
object used TLS variables.
This bug can be reproduced with a shared library and a program
like this:
$ cat tlstest.c
#include <string.h>
__thread char tls_val[1024];
void set_val() { memset(tls_val, 0, sizeof(tls_val)); }
$ gcc -g -shared -o usr/lib/libtlstest.so tlstest.c
$ cat test.c
void set_val();
int main() { set_val(); }
$ gcc -g -o tls test.c -ltlstest
Due to the way the TLS relocations are done this program would
clobber libc's TLS variables (e.g. errno).
This uses the per glyph width to determine if the glyph is actually
present in the font, and not just inside the range the font can covers
This means that characters that are in the font's range but that are
missing a glyph will show up as the missing character glyph instead of
being invisible.
This replaces the glyph width spinbox in the font editor with a
checkbox when editing fixed width fonts that indicates if the
currently selected character's glyph is present in the edited font
(For variable width fonts a non zero width implies presence)
This commit also changes the background color of glyphs in the glyph
map based on the presence of each specific glyph in the font.
Since we were always saving the glyph widths array to the font file, we
now also always load it, even on (which also simplifies the logic a bit)
fixed width fonts. We also set it initially to 0 instead of the default
fixed width, which allows us to use it to check for glyph presence in
both fixed width and variable width fonts.
Some of the expected values in test-math were wrong, which caused some
tests to fail.
The updated values were generated by Python's math library, and rounded
to 6 decimals places:
>>> import math
>>> round(math.exp(20.99), 6)
1305693298.670892
Examples of failure outputs:
FAIL: ../Userland/Tests/LibM/test-math.cpp:98:
EXPECT_APPROXIMATE(exp(v.x), v.exp) failed with
lhs=1305693298.670892, rhs=1304956710.432034, (lhs-rhs)=736588.238857
FAIL: ../Userland/Tests/LibM/test-math.cpp:99:
EXPECT_APPROXIMATE(sinh(v.x), v.sinh) failed with
lhs=652846649.335446, rhs=652478355.216017, (lhs-rhs)=368294.119428
FAIL: ../Userland/Tests/LibM/test-math.cpp💯
EXPECT_APPROXIMATE(cosh(v.x), v.cosh) failed with
lhs=652846649.335446, rhs=652478355.216017, (lhs-rhs)=368294.119429
We can now add a watchpoint to a variable by right clicking on it
in the variable view, and selecting add watchpoint. To remove a
watchpoint, the exact same action is repeated, except it will now say
remove watchpoint.
Previously, if the running debugger asked for HackStudio to open
an invalid file, it would crash trying to switch to it. Now it will
just continue without switching the editor.
This adds PT_PEEKDEBUG and PT_POKEDEBUG to allow for reading/writing
the debug registers, and updates the Kernel's debug handler to read the
new information from the debug status register.
The vsscanf library function lets the user skip assigning
parsed values to the arguments, e.g. with %*c - even though
a character is scanned it is not assigned to one of the
arguments.
The figlet port uses this. With this patch the port is actually
usable.
This uses the new on_action_enter & on_action_leave APIs to display
the full useragent string when hovering over one of the useragent
spoof menu options.
There are cases where the line editor could miss the WINCH signal
(e.g. in the shell, while another program is in the foreground),
This patch makes it so that LibLine notices the change in terminal size
in such cases.
This keybind opens the current buffer in an editor (determined by
EDITOR from the env, or the default_text_editor key in the config file,
and set to /bin/TextEditor by default), and later reads the file back
into the buffer.
Pretty handy :^)
Completing an empty URL string from the document base URL will just
return the document URL, so any document that had an "<iframe>"
would endlessly load itself in recursive iframes.
Since menu separator items don't have an associated identifier,
make sure we don't falsely report that we've enter item 0.
This fixes an issue where hovering over a separator would behave
as if we'd hovered over the first item in the menu wrt sending
MenuItemEntered.
We now display a description of the currently hovered action in the
text editor application's status bar. This is pretty cool! :^)
This is currentl achieved via the hooks on GUI::Application. Longer
term we'll probably want to find a more flexible abstraction for this,
since not all applications will be as simple as TextEditor.
Each statusbar segment now has an optional "override text" which can
be set, and if non-null will be displayed instead of the regular text.
This allows programs to display contextual information in the statusbar
temporarily without losing whatever text was already on there.
Actions can now have a longer text description, in addition to its
regular UI string. The longer text will soon be used to display
a more detailed description of hovered actions in statusbars.
We now send out MenuItemEntered and MenuItemLeft messages to the client
when the user hovers/unhovers menu items.
On the client side, these become GUI::ActionEvent, with one of two
types: ActionEnter or ActionLeave. They are sent to the Application.
This will allow GUI applications to react to these events.
Calling memcpy with null pointers results in undefined behaviour, even
if count is zero.
This in turns is exploited by GCC. For example, the following code:
memcpy (dst, src, n);
if (!src)
return;
src[0] = 0xcafe;
will be optimized as:
memcpy (dst, src, n);
src[0] = 0xcafe;
IOW the test for NULL is gone.
This is a superset of ascii that adds in the hebrew alphabet.
(Google currently assumes we are running windows due to not
recognizing Serenity as the OS in the user agent, resulting
in this encoding instead of UTF8 in google search results)
This would crash on an undefined match (no match), since the matched
result was assumed to be a string (such as on discord.com). The spec
suggests converting it to a string as well:
https://tc39.es/ecma262/#sec-regexp.prototype-@@replace (14#c)
Since WM operations are moved to a separate endpoint pair, Taskbar now
uses those to perform window management related operations.
Additionally, it now explicitly declares to WindowServer that it is a
window manager.
With this patch the window manager related functionality is split out
onto a new endpoint pair named WindowManagerServer/Client. This allows
window manager functionality to be potentially privilege separated in
the future. To this end, a new client named WMConnectionClient
is used to maintain a window manager connection. When a process
connects to the endpoint and greets the WindowServer as a window manager
(via Window::make_window_manager(int)), they're subscribed to the events
they requested via the WM event mask.
This patch also removes the hardcoding of the Taskbar WindowType to
receive WM events automatically. However, being a window manager still
requires having an active window, at the moment.