Commit Graph

28165 Commits

Author SHA1 Message Date
Idan Horowitz
01417c82c5 LibWeb: Make URLSearchParams iterable
This uses the new support for the iterable IDL property.
2021-09-28 16:51:27 +02:00
Idan Horowitz
14e99b9b68 LibJS: Change create_iterator_result_object's return type to Object*
This always returns an Object, so there's no reason to return a less
explicit Value.
2021-09-28 16:51:27 +02:00
Idan Horowitz
cdde3ba5c5 LibWeb: Add partial support for IDL Iterable declarations
This currently only supports pair iterables (i.e. iterable<key, value>)
support for value iterables (i.e. iterable<value>) is left as TODO().

Since currently our cmake setup calls the WrapperGenerator separately
and unconditionally for each (hard-coded) output file iterable wrappers
have to be explicitly marked so in the CMakeLists.txt declaration, we
could likely improve this in the future by querying WrapperGenerator
for the outputs based on the IDL.
2021-09-28 16:51:27 +02:00
Idan Horowitz
2fab43ba5d LibWeb: Add support for wrapping arbitrary values to WrapperGenerator
This patch essentially just splits the non return-specific logic from
generate_return_statement (i.e. the wrapping of the cpp value into
a javascript one) into a separate function generate_wrap_statement that
can be used to wrap any cpp value during wrapper generation.
2021-09-28 16:51:27 +02:00
Idan Horowitz
a11f7868a4 LibWeb: Only consume [a-zA-Z0-9_] characters for IDL types 2021-09-28 16:51:27 +02:00
Ali Mohammad Pur
72a45a472a LibPthread: Correct nonsensical loop exit condition in RWLock unlock
The loop should terminate after the exchange happens, we shouldn't
repeat the operation until the count hits zero.
Fixes #10241.
2021-09-28 12:34:51 +03:30
Ali Mohammad Pur
b63ea3bad1 LibPthread: Calculate the correct lock value in RWLock {rd,un}lock
The previous version was putting the old count in the control bits,
which is all kinds of wrong.
2021-09-28 12:32:46 +03:30
Brian Gianforcaro
ca7bb812f6 Meta: Explicitly disable caching in the Sonar Cloud workflow
Sonar Cloud raises a warning if this is not Explicitly enabled or
disabled, so lets mark it disabled to avoid that.
2021-09-28 10:58:09 +02:00
Brian Gianforcaro
ea2d68d14b Assistant: Zero initialize fuzzy match array
SonarCloud flagged the read of the matches array as a potential garbage
read. I don't believe the case it flagged was possible to reach due to
how the code is structured, however we should really just be zero
initializing these stack arrays.
2021-09-28 10:58:09 +02:00
Brian Gianforcaro
998234f9e9 LibCpp: Remove redundant comparison to Token::Type::PipePipe
SonarCloud flagged this 'Identical sub-expressions on both sides of
operator "||"'. When looking at the git history it looks like it was
just a copy / paste mistake that happened when Token::Type::Arrow
support was added.
2021-09-28 10:58:09 +02:00
Brian Gianforcaro
69bc04d870 LibDSP: Remove unused Effects::Delay::m_old_delay_size member
SonarCloud flagged this as m_delay_buffer is technically uninitialized
at the point at which the POD types are initialized in a constructor.

I don't check to see if this was actually a real issue, as the member
is ultimately unused. So lets just get rid of it.
2021-09-28 10:58:09 +02:00
Brian Gianforcaro
8fcdc255ff man: Add "-z seperate-code" to man7/Mitigations.md
Update the mitigations documentation with the lateest mitigation.
2021-09-28 10:57:00 +02:00
Brian Gianforcaro
afb09e84db Documentation: Add AK::SourceLocation pattern to Patterns.md
Document the emergent pattern of using `SourceLocation` for capture
file, line, function name information when calling an API.
2021-09-28 10:57:00 +02:00
Brian Gianforcaro
f71f1d66d6 Documentation: Add operator"" sv pattern to Patterns.md 2021-09-28 10:57:00 +02:00
Rodrigo Tobar
ad33efbc8c SystemMonitor: Unveil /usr/local/lib
This is necessary to symbolicate libraries installed under
/usr/local/lib.
2021-09-28 10:55:14 +02:00
Rodrigo Tobar
12e18e44ae LibSymbolication: Look for libraries under /usr/local/lib
While trying to investigate a problem with the ssl module in the python
port I found that the SystemMonitor Stack tab for a process wouldn't
show the symbols for the libssl and libcrypto shared libraries that are
installed under /usr/local/lib. The main reason for this is that
LibSymbolication didn't look for libraries under /usr/local/lib.

This commit adds support for looking for libraries under /usr/local/lib.
Absolute paths are still respected, and lookup gives precedence to
/usr/lib, just like dynamic linker does.
2021-09-28 10:55:14 +02:00
Rodrigo Tobar
f4ebcf4867 LibSymbolication: Return empty value on error
This was probably the intended behavior, but a return statement was
missing.
2021-09-28 10:55:14 +02:00
Hendiadyoin1
683bf558e4 AK: Add missing AK/Types.h include to VirtIO/Protocol.h
How did this even work?
2021-09-28 03:13:54 +03:00
Idan Horowitz
b56b0ba689 AK: Eliminate avoidable strlen call in String::matches
We already know the length of these substrings, so there's no need to
check their lengths using strlen in the StringView(char*) constructor.

This patch also removes an accidental 1-byte OOB read that was left over
from when this method received null-terminated char pointers instead of
string views, as well removes the unnecessary lambda call (two of the
checks were impossible, and this was only called in one place, so we can
just inline it)
2021-09-28 00:31:45 +02:00
Luke Wilde
f7ac3545cc LibWeb: Add initial support for CustomEvent
This is used surprisingly often. For example, it is used by a core
YouTube library called Structured Page Fragments.

It allows you to manually dispatch an event with arbitrary data
attached to it.

The only thing missing from this implementation is the constructor.
This is because WrapperGenerator is currently missing dictionary
capabilities.
2021-09-27 18:45:45 +02:00
Luke Wilde
b04fafee74 LibWeb: Add some missing events in EventWrapperFactory
I noticed some events we being wrapped into a generic Event while
working on CustomEvent. This also adds PageTransitionEvent's
constructor to the WindowObject.

I'm not sure if this is all of them.
2021-09-27 18:45:45 +02:00
Luke Wilde
067d839615 LibWeb: Add support for the any type in returning and parameters
Required for CustomEvent.
2021-09-27 18:45:45 +02:00
Luke Wilde
d30ec4d790 LibWeb: Add [CustomVisit] IDL interface extended attribute
This custom attribute will be used for objects that hold onto arbitrary
JS::Value's. This is needed as JS::Handle can only be constructed for
objects that implement JS::Cell, which JS::Value doesn't.

This works by overriding the `visit_edges` function in the wrapper.
This overridden function calls the base `visit_edges` and then forwards
it to the underlying implementation.

This will be used for CustomEvent, which must hold onto an arbitrary
JS::Value for it's entire lifespan.
2021-09-27 18:45:45 +02:00
Andreas Kling
8da21583db LibWeb: Make SVG <path> tolerate relative first path coordinates
If the first element of an SVG path spec uses relative coordinates,
we'll now treat them as absolute. This is achieved by defaulting to
(0,0) as the initial "last point" in the path.
2021-09-27 18:29:10 +02:00
Andreas Kling
975a71de45 LibWeb: Implement the Document.activeElement attribute
We were already tracking the active element in DOM::Document, so all we
had to do here was add the attribute to Document.idl :^)
2021-09-27 16:52:22 +02:00
Andreas Kling
7410736b0f LibWeb: Support window.devicePixelRatio
This always returns 1 for now. I've added a FIXME about returning 2 in
HiDPI mode.
2021-09-27 16:52:22 +02:00
Andreas Kling
e26e85a3d2 LibWeb: Support Document.hidden and Document.visibilityState
These just act as if the document is always visible for now.
2021-09-27 16:52:22 +02:00
Karol Kosek
484f6a7cfa LibCore: Buffer small byte reads
Prior this change, if you had a program which frequently reads small
amount of bytes, then it would constantly fire up syscalls.

This patch sets that the minimum size that is passed to the read syscall
is 1024 and then it saves these additional bytes in a buffer for next
reads, which greatly improves the cpu usage on such cases.

In other words: reading flacs is now very efficient.
2021-09-27 16:31:28 +02:00
Karol Kosek
48a925b1d2 LibCore: Add optional custom read size argument in populate_read_buffer
This is a small preparation so IODevice::read() can use it in the next
commit.
2021-09-27 16:31:28 +02:00
Edward Palmer
2f01d34b99 Documentation: Add build file copy instruction 2021-09-27 16:30:38 +02:00
FrHun
34844dd547 LibGUI: Refine AbstractButton pressing behaviour
Previously the code couldn't handle leaving the AbstractButton through
tab, while having it pressed through space or enter.
2021-09-27 16:29:50 +02:00
Liav A
acd44bdcad Kernel/Graphics: Modernize somewhat the code of BochsGraphicsAdapter
Reduce the amount of macros in favor to enum classes.
2021-09-27 16:15:04 +02:00
Liav A
38bddca378 Kernel/Graphics: Ensure we set BGR format of bochs-display if supported
Instead of blindly forcing BGR format on the bochs-display device, let's
ensure we do that only on QEMU bochs-display and not on VirtualBox
graphics adapter too.
2021-09-27 16:15:04 +02:00
Liav A
de1b649783 Kernel/Graphics: Force BGR format when modesetting the bochs-display
By default bochs-display uses the BGR format, but for future-proof
solution, let's force it explicitly to use that format.
2021-09-27 16:15:04 +02:00
Sam Atkins
d36e3af7be LibWeb: Don't try to ad-block data: urls
In some cases these can be several KiB or more in size, making checking
very slow, and it doesn't make sense to filter them out anyway. This
change speeds up loading pages with large data: urls, which previously
took up to 1ms per byte to process.
2021-09-27 16:13:29 +02:00
Andreas Kling
a79bdd2bd5 LibWeb+Browser: Make ad blocking work in the multi-process world
We now send the list of content filters over to new WebContent processes
after creating an OutOfProcessWebView. :^)
2021-09-27 11:40:56 +02:00
Nico Weber
b0858b2a55 Kernel: Fix a typo in a comment 2021-09-27 10:17:52 +02:00
Nico Weber
4c876e88e0 Kernel: Adjust aarch64 linker script
- .text now starts at 0x80000, where an actual (non-qemu) RPi expects
- use magic section name ".text.first" to make sure the linker script
  puts the kernel entry point at the start of the .text section
- remove a few things from the x86 linker script that aren't needed
  for aarch64 (yet?)
2021-09-27 10:17:52 +02:00
Nico Weber
cbdf4b575d Kernel: Move prekernel linker.ld into Arch subdirectories
This moves Kernel/Prekernel/linker.ld unchanged to
Kernel/Prekernel/Arch/aarch64 and Kernel/Prekernel/Arch/x86.
The aarch64 will change in a future commit.

No behavior change.
2021-09-27 10:17:52 +02:00
Andreas Kling
5bb2e6597a LibWeb: Preload resources hinted by <link rel="preload">
If a page is nice enough to give us some preload hints, we can tell
RequestServer to get started on downloading the resources right away,
instead of waiting until discovering them later on during parsing.
2021-09-27 02:07:55 +02:00
Andreas Kling
ed5c807c99 LibWeb: Allow passing a (String) body to XMLHttpRequest.send()
This patch implements the simplest form of send(body): strings.
2021-09-27 01:56:08 +02:00
Marco Cutecchia
194dc8b25d HackStudio: Support renaming files from the tree view 2021-09-27 01:20:48 +02:00
Marco Cutecchia
05630d2d5d LibGUI: Add 'on_rename_successful' callback to FileSystemModel 2021-09-27 01:20:48 +02:00
Nico Weber
5565db5aa1 Meta: Pass -serial stdio to qemu on aarch64
With this, `Meta/serenity.sh run aarch64` produces some output on
the terminal :^)
2021-09-26 23:14:01 +00:00
Nico Weber
54aabb07f9 Kernel: Add UART class for aarch64 2021-09-26 23:14:01 +00:00
Nico Weber
44c787e88b Kernel: Add Mailbox::set_clock_rate() 2021-09-26 23:14:01 +00:00
Andreas Kling
43d378940f LibWeb: Add DOMRect and Element.getBoundingClientRect()
This marks our entry into the Web::Geometry namespace, based on the
"Geometry" spec at https://drafts.fxtf.org/geometry/
2021-09-27 01:01:29 +02:00
Andreas Kling
0c63f0bf73 LibJS: Parse date strings like "Wed Apr 17 23:08:53 +0000 2019"
The ECMAScript spec says that Date parsing can support any number of
implementation-defined date formats. So let's support a format commonly
used on the web. And let Core::DateTime do the heavy lifting. :^)
2021-09-26 23:42:27 +02:00
Brian Gianforcaro
0f76e6e149 Meta: Fix typo in release sonar-scanner version
The version is 4.6.2.2472, I had a typo when I committed the previous
change to update the version.
2021-09-26 21:29:39 +00:00
Andreas Kling
7c6f229ec0 LibWeb: Make navigator.onLine always true for now
Some pages refuse to load if they think we are offline, so let's say
we're online. :^)
2021-09-26 19:14:19 +02:00