Commit graph

28143 commits

Author SHA1 Message Date
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
Andreas Kling
0ab31d8c84 LibWeb: Support simplest form of CSSStyleDeclaration.setProperty()
This patch adds the setProperty(name, value) API to CSSStyleDeclaration.
Setting an invalid or empty value will cause the property to be removed
from the declaration.

Note that this only works on mutable declarations (i.e element.style)
and not on resolved declarations (i.e window.getComputedStyle(element)).
2021-09-26 19:07:03 +02:00
Luke Wilde
e0e41116a4 LibWeb: Make WindowObject's prototype immutable
While I was implementing IDL special operations, I noticed that for
global platform objects (e.g. WindowObject), the IDL spec makes their
prototype immutable.

https://heycam.github.io/webidl/#platform-object-setprototypeof
2021-09-26 18:59:56 +02:00
Luke Wilde
f6b24a72ee LibWeb: Add support for HTMLOrSVGElement.dataset 2021-09-26 18:59:56 +02:00
Luke Wilde
37347cbcb6 LibWeb: Convert HTMLCollection to use IDL special operations 2021-09-26 18:59:56 +02:00
Luke Wilde
41ae0c0216 LibWeb: Add support for IDL legacy platform objects
A legacy platform object is a non-global platform object that
implements a special operation. A special operation is a getter, setter
and/or deleter. This is particularly used for old collection types,
such as HTMLCollection, NodeList, etc.

This will be used to make these spec-compliant and remove their custom
wrappers. Additionally, it will be used to implement collections that
we don't have yet, such as DOMStringMap.
2021-09-26 18:59:56 +02:00
Luke Wilde
e06762f312 LibJS: Make Object::ordinary_set_with_own_descriptor non-static
This needs to be accessible for implementing IDL legacy platform
objects.
2021-09-26 18:59:56 +02:00
Luke Wilde
27dfd0170e LibWeb: Implement Document.importNode 2021-09-26 18:59:19 +02:00
Andreas Kling
3252d984ae LibJS: Allow statements to have multiple labels
This is a curious thing that occurs more often than you'd think in
minified JavaScript:

    a: b: c: for (...) { ... break b; ... }
2021-09-26 18:24:19 +02:00
Linus Groh
ababcc5725 LibJS: Defer execution of switch default clause until after case clauses
When we encounter a default clause in a switch statement, we should not
execute it immediately, instead we need to wait until all case clauses
have been executed as a matching case clause can break from the
switch/case.

The code is nowhere close to the spec, so instead of fixing it properly
I just made it slightly worse, but correct. Needs a complete refactor at
some point.
2021-09-26 18:04:25 +02:00
Andreas Kling
a248ec63e3 LibWeb: Implement window.queueMicrotask(callback)
This API allows authors to schedule a serialized JS callback that will
get invoked at the next spec-allowed opportunity.
2021-09-26 14:39:14 +02:00
Andreas Kling
831fdcaabc LibWeb: Add the PageTransitionEvent interface and fire "pageshow" events
We now fire "pageshow" events at the appropriate time during document
loading (done by the parser.)

Note that there are no corresponding "pagehide" events yet.
2021-09-26 12:47:51 +02:00
Andreas Kling
508edcd217 LibWeb: Add a "page showing" flag to documents
This will be used to determine whether "pageshow" and "pagehide" events
are appropriate. We won't actually make use of it until we implement
more of history traversal and document unloading.
2021-09-26 12:47:51 +02:00
Andreas Kling
a2f77a2e39 LibWeb: Implement "update the current document readiness" from spec
The only difference from what we were already doing is that setting the
same ready state twice no longer fires a "readystatechange" event.
I don't think that could happen in practice though.
2021-09-26 12:47:51 +02:00
Andreas Kling
8496024756 LibWeb: Store HTML document ready state as an enum 2021-09-26 12:47:51 +02:00
Andreas Kling
c4ccbc5b83 LibWeb: Make unhandled JS exception stand out more in debug log
Let's log "unhandled exception" messages in red text so that they stand
out better among lots of other debug logging.
2021-09-26 12:47:51 +02:00
Rodrigo Tobar
5ae384fc33 LibELF: Indicate value of unimplemented dtag
For flags that are not mapped to a string this message prints DT_??,
which isn't really useful.
2021-09-26 12:45:55 +02:00
Rodrigo Tobar
a67e06184b LibC+LibELF: Add definitions for extra dtags
These are found in some libraries, and LibELF doesn't know how to handle
them, not even their name. Adding these definitions should at least help
readelf display information correctly, but more work is needed to
actually implement them.
2021-09-26 12:45:55 +02:00
Rodrigo Tobar
3efd7b458a LibELF+readelf: Remove duplicated dtag->string map
A copy of the same mapping was found both in LibELF and in the readelf
utility, which uses LibELF; keeping them both is redundant and removing
the duplicate saves (a bit of) space.
2021-09-26 12:45:55 +02:00
Nico Weber
93f62384f5 Base: Update man2/pipe.md after 5d180d1f99 2021-09-26 12:45:19 +02:00
Karol Kosek
1803c5966d ThemeEditor: Show currently opened theme path in the window title
You can open files since #9979, so let's show the path there
to distinguish open theme files more easily!
2021-09-26 12:44:51 +02:00
Nico Weber
fdc86ddae5 Kernel: Add a GPIO class for aarch64
This allows configuring the alternate pin functions and pin
pull up/down states, which is needed for using the UART.
2021-09-26 11:55:51 +02:00
Andreas Kling
5ac82efbe1 LibWeb: Mark event listeners generated by event handler attributes
We have to mark the EventListener objects so that we can tell them apart
from listeners added via the addEventListener() API.

This makes element.onfoo getters actually return the handler function.
2021-09-26 02:53:57 +02:00