Commit graph

19114 commits

Author SHA1 Message Date
Andreas Kling 78733417a4 LibWeb: Register FormAssociatedElement with their owner form
This will eventually allow us to implement HTMLFormControlsCollection.
2021-04-20 23:38:27 +02:00
Andreas Kling e454e1a45d LibWeb: Make HTMLSelectElement a FormAssociatedElement 2021-04-20 23:38:27 +02:00
Andreas Kling c6b7b98b64 Kernel: Don't consider kernel memory regions for syscall origin check
We should never enter the syscall handler from a kernel address.
2021-04-20 23:38:27 +02:00
Gunnar Beutner d71f64b97f Toolchain: Build GCC with optimizations 2021-04-20 23:23:23 +02:00
Gunnar Beutner 1e06a9b10f Ports: Build shared library for xz with -pthread 2021-04-20 21:08:17 +02:00
Gunnar Beutner 2520ccfca4 LibPthread: Add stubs for pthread_spin_* functions
The stress-ng port depends on these now that it detects we have
thread support.
2021-04-20 21:08:17 +02:00
Gunnar Beutner 88cebb05ad LibC+LibPthread: Implement function forwarding for libpthread
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.
2021-04-20 21:08:17 +02:00
Gunnar Beutner db3fd11646 Kernel: Remove requirement for the thread entitlement for the futex syscall
GCC inserts calls to pthread_mutex_lock when compiling C++ code with
threads enabled.
2021-04-20 21:08:17 +02:00
Gunnar Beutner 75d41657d5 Toolchain+Ports: Enable threads for gcc
This enables POSIX threads for GCC and makes the -pthread
argument available.
2021-04-20 21:08:17 +02:00
Linus Groh 7400e3d8fc LibWeb: Don't call ResourceLoader error callback on 4xx status code
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 :^)
2021-04-20 19:47:23 +02:00
Linus Groh 7af1d2c170 LibJS: Make Object.getOwnPropertyDescriptor() work with string indexed property
E.g. for "0" we have to contruct a PropertyName with Type::Number so it
looks in the indexed properties as expected.
2021-04-20 18:53:07 +02:00
Linus Groh 614bad86bc LibJS: Fix Object.getOwnPropertyDescriptor() attributes for numeric property
We were getting the attributes of the existing value and then
immediately assigned the default attributes instead.
2021-04-20 18:42:10 +02:00
Linus Groh 09f8d52b00 Ports: Consistently indent with four spaces 2021-04-20 18:38:13 +02:00
Maciej Zygmanowski 899698c317 Inspector: Don't allow to inspect Inspector itself
The Inspector hangs when user tries to do that.
2021-04-20 18:35:46 +02:00
Tobias Christiansen 5338708091 LibWeb: Display <ol> and respect list-style-type in <ul>
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
2021-04-20 18:29:19 +02:00
Tobias Christiansen bfcfe84240 LibWeb: Make the ListItemMarkerBox index-aware.
In the ListItemBox we get the index of the current <li> element in the
parent and pass it to the ListItemMarkerBox.

This patch is work towards #2059
2021-04-20 18:29:19 +02:00
Tobias Christiansen c09ac536c5 LibWeb: Add capabilities to find the index of a child in its parent.
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
2021-04-20 18:29:19 +02:00
Timothy Flynn e92bffb2e3 LibSQL: Parse DROP TABLE statement 2021-04-20 18:28:34 +02:00
Timothy Flynn 110cd98c0a Lagom: Add sql utility and LibSQL unit tests 2021-04-20 18:28:34 +02:00
Timothy Flynn d41d1d2035 LibSQL: Add unit testing of the SQL parser 2021-04-20 18:28:34 +02:00
Timothy Flynn 5ec471b78d Userland: Add 'sql', a REPL for LibSQL
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.
2021-04-20 18:28:34 +02:00
Timothy Flynn 377992d33e LibSQL: Create a very barebones SQL parser
This parser builds on the LibSQL lexer and currently only allows users
to parse 'CREATE TABLE' statements.
2021-04-20 18:28:34 +02:00
Timothy Flynn 90517da9ca LibSQL: Introduce a SQL library with a tokenizer
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.
2021-04-20 18:28:34 +02:00
Timothy Flynn 55b7b8e930 AK+Meta: Add a debug option for LibSQL 2021-04-20 18:28:34 +02:00
Panagiotis Vasilopoulos 492f7132d2 Ports: Improve consistency and quality of ports
- Replaced /Root with
- Improved documentation.
- Removed a few typos.
- Replaced  with
- Added brackets in some cases.

Most of the changes were reviewed and applied manually.
2021-04-20 18:20:00 +02:00
Panagiotis Vasilopoulos 139288b071 Ports: Fix up imgcat 2021-04-20 17:32:10 +02:00
Gunnar Beutner 2d62cf8b79 Ports: Update the lint-ports.py script to ignore missing auth_type for SerenityOS repositories 2021-04-20 17:04:51 +02:00
Gunnar Beutner 12ed436562 Ports: Remove auth_type for our own packages
Otherwise we'd have to update them in this repository
every time something changes.
2021-04-20 17:04:51 +02:00
Gunnar Beutner 111ac4b1f4 Shell: Auto-completion shouldn't suggest non-executable files for the program name 2021-04-20 17:02:10 +02:00
Panagiotis Vasilopoulos e45e0eeb47 Everywhere: Replace SERENITY_ROOT with SERENITY_SOURCE_DIR 2021-04-20 15:27:52 +02:00
Andreas Kling 3f5c934ea6 Ext2FS: Put bg_used_dirs_count debug logging behind EXT2_DEBUG 2021-04-20 15:08:56 +02:00
Idan Horowitz 63af67ea01 LibJS: Throw on a regex searchString in String.startsWith
As is required by the specification:
"Let isRegExp be ? IsRegExp(searchString). If isRegExp is true,
throw a TypeError exception."
2021-04-20 14:38:54 +02:00
Idan Horowitz b1e5330e64 LibJS: Stop early-returning on missing searchString in String.startsWith
A missing searchString is allowed by the specification and is treated
as js_undefined. ("undefined test".startsWith() => true)
2021-04-20 14:38:54 +02:00
Idan Horowitz 81d7d68416 LibWeb: Use correct event name for the onmousemove global event handler
The current event name was accidentally set for the onmousedown event.
2021-04-20 14:38:54 +02:00
Spencer Dixon 1206e9803f Userland: Add support for sending UDP to netcat. 2021-04-20 14:15:35 +02:00
Andreas Kling b092353e4d LibWeb: Add basic support for HTMLInputElement.form
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.
2021-04-20 12:05:56 +02:00
Andreas Kling 00d8e3b02b LibWeb: Don't include "Wrapper" suffix in JS wrapper class_name()
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.
2021-04-20 12:05:56 +02:00
Andreas Kling 4d35ffdf3c LibJS: Include the class name of objects in MarkupGenerator output
Add a little label before the "{ }" so you can see what kind of object
it is. This makes Browser's JS console significantly nicer to use. :^)
2021-04-20 12:05:56 +02:00
Idan Horowitz df84cd77b8 Meta: Actually check for draft PRs before sending discord notifications 2021-04-20 12:02:13 +02:00
Tobias Christiansen a8915ecd61 FileManager+FileOperation: Report Errors when doing an file operation
Report back errors from the FileOperation to the FileManager and
display them in the MessageBox
2021-04-20 12:02:01 +02:00
Tobias Christiansen 7d60164d93 FileManager: Don't crash on error in FileOperation
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.
2021-04-20 12:02:01 +02:00
Idan Horowitz 28b8a2ec7a LibIPC: Make Connection::send_sync return a NonnullOwnPtr
Since we VERIFY that we received a response, the response pointer is
always non-null.
2021-04-20 10:10:15 +02:00
Idan Horowitz a2b34b7e6b LibDesktop: Fail gracefully on allowlist failures instead of asserting
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.
2021-04-20 10:10:15 +02:00
Linus Groh ac3e7ef791 LibJS: Fix crash in Object.{freeze,seal}() with indexed properties
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.
2021-04-20 09:38:22 +02:00
Linus Groh 085816645f LibJS: Take PropertyName in Object::set_integrity_level() internal lambda
At least for IntegrityLevel::Frozen we already construct a PropertyName
from the key value, let's reuse that.
2021-04-20 09:38:22 +02:00
Leandro Pereira 29fd75f22f LibGUI: Make statusbar label flat when displaying override_text
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).
2021-04-20 09:24:52 +02:00
Brian Gianforcaro 8f6a5a1c39 Meta: Add a rebuild-world command to serenity.sh
This was brought up as something that would be useful by
`RealKC` on the discord, and I happened to agree that it
would be useful. Especially given the abundance of Toolchain
changes recently.
2021-04-20 08:10:21 +02:00
Brian Gianforcaro c195ee6fd2 Meta: Add allow-list for icon size detection in CMake
The only icons we are currently warning about are designed
and rendered as small icons intentionally, as their only use
is in desktop applets, and thus are exempt to this rule.

This reduces build spam back down to a minimum.
I should have just done this in the first place, back in #4729
2021-04-20 08:10:21 +02:00
Andreas Kling 955eef83b0 LibWeb: Add basic support for HTMLCanvasElement.toDataURL() :^)
This allows you to serialize a <canvas> element's bitmap into a
data: URI. Pretty neat! :^)
2021-04-19 23:49:16 +02:00
Andreas Kling 6793574003 LibGfx: Improve PNG encoder API somewhat
This is still far from ideal, but let's at least make it take a
Gfx::Bitmap const&.
2021-04-19 23:49:16 +02:00