Commit Graph

27913 Commits

Author SHA1 Message Date
brapru
b5f812d11d LibVT: Add movemouse support for triple click
When moving the mouse after a triple click, the selected buffer does not
maintain the whole line selection. This patch will allow triple click
highlighting to hold the whole line selection.
2021-09-19 20:28:09 +04:30
brapru
7a673f5aa3 LibVT: Keep track of the buffer postiion on mousedown events 2021-09-19 20:28:09 +04:30
Nico Weber
697e6ccb89 Kernel: Add a Mailbox class for aarch64
As a demo, query the firmware version. `Meta/serenity.sh gdb aarch64`
can be used to observe that qemu puts 0x548E1 in x0 in response
to this mailbox message.
2021-09-19 17:45:59 +02:00
Nico Weber
d0b9c7a20b Kernel: Add a MMIO class for aarch64
It doesn't do anything yet except figure out the peripheral base
address.

Very likely belongs in Kernel, not Prekernel, eventually.
2021-09-19 17:45:59 +02:00
Nico Weber
3a24eb323f Kernel: Use new halt() for all our halting needs in aarch64 Prekernel 2021-09-19 17:45:59 +02:00
Nico Weber
0319aa315a Kernel: Add __stack_chk_fail to aarch64 Prekernel init
This is needed for some functions with local variables. We'll grow
such a function soon.
2021-09-19 17:45:59 +02:00
Andreas Kling
58f6bf8a4d CrashReporter: Add some margin around the backtrace & register views 2021-09-19 17:25:52 +02:00
Kenneth Myhra
177765642e Ports/glib: Remove patch 0008-add-missing-macro-IN6_IS_ADDR_V4MAPPED
Since we now have the 'IN6_IS_ADDR_V4MAPPED' macro in LibC this patch
is no longer needed.
2021-09-19 15:53:43 +02:00
Kenneth Myhra
c7422dcef7 LibC: Declare IN6_IS_ADDR_V4MAPPED correctly
When using the IN6_IS_ADDR_V4MAPPED macro in Serenity's LibC it would
fail when compiling with the error message:
'invalid type argument of '->''.

This patch corrects the macro so that e.g. GLib port can compile again.
2021-09-19 15:53:43 +02:00
Andreas Kling
e649144a90 LibWeb: Replace ScriptExecutionContext::interpreter() with realm()
Here goes another step towards Document not having a JS::Interpreter.
2021-09-19 15:39:40 +02:00
Andreas Kling
7a6ad1b19c LibWeb: Use an enumerator macro for XMLHttpRequestEventTarget accessors 2021-09-19 15:08:01 +02:00
Andreas Kling
ee8a1a9b3f LibWeb: Keep XMLHttpRequest alive while handling load/error events
A weakly held XHR object is not guaranteed to remain alive after
running arbitrary JavaScript, so let's make sure we take a strong
reference in the ResourceLoader callbacks here.
2021-09-19 15:02:27 +02:00
Andreas Kling
398a95c3c9 LibWeb: Remove unnecessary WeakPtr creation in XMLHttpRequest::send() 2021-09-19 14:59:02 +02:00
Andreas Kling
57f3535c4a LibWeb: Remove duplicated event handler attribute code in WebSocket
This functionality is now inherited from EventTarget, so we can simply
remove the whole thing in WebSocket. :^)
2021-09-19 13:44:58 +02:00
Andreas Kling
51b33b5678 LibWeb: Implement basic retargeting of body/frameset event handlers
The HTML spec tells has some special rules for <body> and <frameset>
elements' onfoo event handler attributes. In some cases, the implicitly
generated event listeners should end up on the relevant global object
instead of the element itself.

This patch implements the first part of that behavior.
2021-09-19 13:08:30 +02:00
Andreas Kling
5fbd0c5ea0 LibWeb: Add DOM::Document::is_active()
This is a spec concept that means a document is the associated document
of its browsing context's active window.
2021-09-19 13:08:30 +02:00
Tobias Christiansen
79c2762a0d LibWeb: Flexbox: Use maximum size of container as available size
This previously wouldn't work well with flex-grow.
2021-09-19 13:07:53 +02:00
Eric Seifert
edbc5489a8 Kernel: Add support for O_NONBLOCK in pipe syscall
While working on a port, I saw a pipe creation fail due to missing
nonblock support in pipe syscall.
2021-09-19 12:20:16 +02:00
Sahan Fernando
2e079c6d69 Kernel/VirtIO: Remove lazy allocation of VirtIO::Device BAR regions
This fixes a Kernel Panic where the lazy allocation triggers inside an
ISR and grabs a mutex, which isn't allowed when interrupts are
disabled. This also fixes a bug where the mapping for VirtIO device
BARs is never allocated. #9876
2021-09-19 11:46:09 +03:00
Andreas Kling
6b03d18d95 LibWeb: Add event handler attributes to XMLHttpRequestEventTarget
This patch adds the following event handler attributes to XHR's
EventTarget base class:

- onloadstart
- onprogress
- onabort
- onerror
- onload
- ontimeout
- onloadend
2021-09-19 01:43:27 +02:00
Andreas Kling
dc8707527f LibWeb: Implement XMLHttpRequest.onreadystatechange 2021-09-19 01:43:27 +02:00
Andreas Kling
824be02cb0 LibWeb: Move onfoo attribute handling to EventTarget
This logic was kept in the GlobalEventHandlers mixing for sharing
between Document and HTMLElement, but there are other interfaces who
need to support `onfoo` attribute event listeners as well.
2021-09-19 01:43:27 +02:00
thankyouverycool
ae59d8a728 LibGfx: Paint replacement character, 0xFFFD, for unknown glyphs
Note: most systems now use a font's .notdef character for unknown
glyphs (commonly the tofu box) and reserve 0xFFFD for encoding
errors. Until Serenity supports tofu, 0xFFFD is a preferable, if
deprecated, alternative to '?' to reduce ambiguity.
2021-09-19 00:58:59 +02:00
thankyouverycool
41ce6d0cd0 Tests: Conform font tests to new font format 2021-09-19 00:58:59 +02:00
thankyouverycool
dc65535b7c FontEditor: Add new tools to navigate code points
Visible glyphs can now be cycled through, or a code point specified
and jumped to directly.
2021-09-19 00:58:59 +02:00
thankyouverycool
a486415f03 FontEditor: Update editor to handle new font format
The editor now unmasks fonts on load, mapping their glyphs to the
complete unicode character set, and masks them upon saving to
reduce disk space. This is a naive approach in terms of memory
usage and can be improved but whose immediate goal is to allow
editing any glyph without concern for range allocation.
2021-09-19 00:58:59 +02:00
thankyouverycool
9bcfdfc03b Base: Convert fonts to new header format
Type has been replaced with a bit mask size whose value corresponds
to the number of u8 ranges of 256 characters per bit. Given 0x110000
possible glyphs in Unicode 13.0, its maximum size is currently 544
and can be expanded if needed.

Adds the 0xFFFD replacement character to Csilla/KaticaRegular fonts
and fixes dozens of alignment errors in the Latin character sets.
2021-09-19 00:58:59 +02:00
thankyouverycool
bb592aef8a LibGfx: Extend Unicode support for BitmapFonts
Removes the concept of Type enumeration in favor of a bitmask which
represents 544 potential byte ranges of 256 characters per bit,
supporting the current unicode code point set (0x0000-0x10FFFF).
Range positions are indexed in a vector for code point lookup and
conversion.

Co-authored-by: Lynn <lynn@foldr.moe>
2021-09-19 00:58:59 +02:00
thankyouverycool
4540c1ffab TextEditor: Show total character and word count without selection 2021-09-19 00:21:37 +02:00
thankyouverycool
46043b71cb LibGUI: Add number_of_words() to TextEditors
Returns the total number of words in a document.
2021-09-19 00:21:37 +02:00
Karol Kosek
aa06012249 Meta: Add my new serenityos.org email to .mailmap :^) 2021-09-18 23:58:23 +02:00
Idan Horowitz
e00ca10283 LibJS: Convert ListFormat AOs to ThrowCompletionOr 2021-09-18 22:59:15 +03:00
Idan Horowitz
e65aeee67d LibJS: Convert DisplayNames AOs to ThrowCompletionOr 2021-09-18 22:59:15 +03:00
Idan Horowitz
768009e005 LibJS: Convert NumberFormat AOs to ThrowCompletionOr 2021-09-18 22:59:15 +03:00
Przemysław R. Kusiak
c6e23e45c5 Kernel: Let MouseDevice and KeyboardDevice write method return EINVAL
Currently, writing anything to `/dev/mouse0` or `/dev/keyboard0` causes
the Kernel to panic. The reason for this is that
`[Mouse,Keyboard]Device::write` always returns 0, which is explicitly
prohibited by `VERIFY` macro in `Process::sys$write`.  The fix seems
trivial; `write` should return EINVAL instead (as is the case with, for
example, `KCOVDevice`).
2021-09-18 22:57:42 +03:00
Tobias Christiansen
6e1f6bd684 LibWeb: Add transform: translateY() support
This is very naive.
2021-09-18 21:53:37 +02:00
Tobias Christiansen
9ebfafafbe LibWeb: Add transform property to the system
This patch adds parsing support as well as all the needed stuctures all
over LibWeb to pass Transformations around.
2021-09-18 21:53:37 +02:00
Andreas Kling
74b88a8156 LibWeb: Implement window.location.port
This returns the port of the current document's URL. :^)
2021-09-18 21:48:44 +02:00
Idan Horowitz
407cf04884 LibJS: Convert get_number_option() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz
6d3de03549 LibJS: Convert default_number_option() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz
b9c7a629f8 LibJS: Convert coerce_options_to_object() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz
d0e5fc4576 LibJS: Convert supported_locales() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz
de9785b71b LibJS: Convert Intl::get_option() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Idan Horowitz
3758e65293 LibJS: Convert canonicalize_locale_list() to ThrowCompletionOr 2021-09-18 22:21:15 +03:00
Linus Groh
5426901521 Ports: Update Python to 3.10.0rc2
Released on 2021-09-07.
https://www.python.org/downloads/release/python-3100rc2/
2021-09-18 21:20:18 +02:00
Brian Gianforcaro
c5cdb6eb4c LibDebug: Dont copy an AbbreviationEntry every time we retrieve a value
These API's are used in a variety of ways when building the die cache.
Each AbbreviationEntry has vector and other members, so avoid copying
it at all costs.
2021-09-18 21:05:13 +02:00
Brian Gianforcaro
952441943f LibDebug: Avoid short lived allocations in DIE::for_each_child
This algorithm is both iterative and recursive, so allocating on every
recursion, or when iterating each child is extremely costly.

Instead allow the on stack DIE to be re-initialized so it can be reused.
2021-09-18 21:05:13 +02:00
Andreas Kling
19c492e976 LibWeb: Avoid unnecessary padded_rect() call in Box::paint()
We were computing the padded rect of the box during every paint phase,
despite only needing it in the Overlay phase.

Since this is an expensive call, let's take care not to make it
unnecessarily.
2021-09-18 20:07:38 +02:00
Andreas Kling
76bafe5542 LibJS: Always inline two hot (and trivial) functions in JS::Lexer
This improves parsing time on a large chunk of JS by ~5%.
2021-09-18 19:54:24 +02:00
Andreas Kling
33f038ba7a LibJS: Add fast failure path to try_parse_labelled_statement()
If the next token isn't a TokenType::Colon (:), this can't possibly be a
labelled statement, so we can fail before having to save_state().

This improves parsing time on a large chunk of JS by ~12.5%.
2021-09-18 19:54:24 +02:00