Commit graph

18503 commits

Author SHA1 Message Date
AnotherTest a6e4482080 AK+Everywhere: Make StdLibExtras templates less wrapper-y
This commit makes the user-facing StdLibExtras templates and utilities
arguably more nice-looking by removing the need to reach into the
wrapper structs generated by them to get the value/type needed.
The C++ standard library had to invent `_v` and `_t` variants (likely
because of backwards compat), but we don't need to cater to any codebase
except our own, so might as well have good things for free. :^)
2021-04-10 21:01:31 +02:00
Linus Groh d8d16dea95 LibWeb: Add a basic implementation of Document.createEvent()
This is a legacy function providing a way of constructing events without
using their constructors exposed on the global object.
We don't have many of the events it supports yet, nor can we throw a
DOMException from it, so that's two FIXMEs for later.
2021-04-10 21:00:04 +02:00
Linus Groh 9d2635d94b LibWeb: Support nullable EventListener parameters in WrapperGenerator
The internal C++ function will now receive a RefPtr<EventListener> for
'EventListener?' and a NonnullRefPtr<EventListener> for 'EventListener'.

Examples of this are addEventListener() and removeEventListener(), which
both have nullable callback parameters.
2021-04-10 21:00:04 +02:00
Linus Groh 2172e51246 LibJS: Implicitly break for..in loop if the RHS result is nullish
This implements the missing step 6a of 14.7.5.6 ForIn/OfHeadEvaluation:

    a. If exprValue is undefined or null, then
        i. Return Completion { [[Type]]: break, [[Value]]: empty, [[Target]]: empty }.

In other words, this should just do nothing instead of throwing during
the undefined to object coercion:

    for (const x in undefined);
2021-04-10 21:00:04 +02:00
Linus Groh 9cd010167a LibJS: Implement Object.create() 2021-04-10 21:00:04 +02:00
Linus Groh da8a35a79e LibJS: Implement Object.defineProperties() 2021-04-10 21:00:04 +02:00
Linus Groh 275da6fcc9 LibJS: Update Object::define_accessor() to take both getter and setter
This replaces the current 'function plus boolean indicating the type'
API, which makes it easier to set both getter and setter at once.
This was already possible before but required two calls of this
function, which wasn't intuitive:

    define_accessor(name, getter, true, ...);
    define_accessor(name, setter, false, ...);

Which now becomes:

    define_accessor(name, getter, setter, ...);
2021-04-10 21:00:04 +02:00
Linus Groh ec62783af9 LibJS: Let Object::delete_property() return a bool, not Value
Just like the various define_property functions, this should return a
bool directly and let the caller deal with wrapping it in a Value, if
necessary.
2021-04-10 21:00:04 +02:00
Linus Groh 4788c94d34 LibJS: Remove superfluous exception check from get_own_property_descriptor()
Accessing elements of the storage Vector can't throw.
2021-04-10 21:00:04 +02:00
Andreas Kling d0813be65a LibGUI: Ignore right-clicks on HeaderViews
This prevents right-clicking a column header from making it appear
depressed right before the context menu is shown.
2021-04-10 16:50:43 +02:00
Andreas Kling 6f5f9e6567 Calendar: Alt shortcuts and book title capitalization in menus 2021-04-10 16:11:48 +02:00
Andreas Kling 5d609e408b Calculator: Alt shortcuts and book title capitalization in menus 2021-04-10 16:09:23 +02:00
Andreas Kling 8e74c9dbb6 Calculator: Add a separator line between the menu and the main UI 2021-04-10 16:08:14 +02:00
Andreas Kling 3bca395190 Profiler: Alt shortcuts and book title capitalization in menus 2021-04-10 15:55:34 +02:00
Andreas Kling ff52a0f90b Profiler: Don't change window title based on last enabled option
This behavior was bizarre and only highlighted whichever setting
was the last one to be activated.
2021-04-10 15:54:12 +02:00
Andreas Kling 53ed30a9f5 QuickShow: Alt shortcuts and book title capitalization in menus 2021-04-10 14:58:48 +02:00
Andreas Kling 9288e64179 PixelPaint: Add icon and keyboard shortcut for the "New Image" action 2021-04-10 14:58:48 +02:00
Andreas Kling 4e56e9fa2a PixelPaint: Alt shortcuts and book title capitalization in menus 2021-04-10 14:58:48 +02:00
Andreas Kling 095979dbcd FontEditor: Alt shortcuts and book title capitalization in menus 2021-04-10 14:58:48 +02:00
Jelle Raaijmakers 55d9f36dae LibTLS: Convert some #ifs to dbgln_if() 2021-04-10 14:45:14 +02:00
Jelle Raaijmakers 7d5995f08c LibTLS: Support empty SNI data in ServerHello
According to RFC6066, empty extension_data for an SNI extension is
absolutely one of the possibilities - so let's support this instead of
spamming the debug log.
2021-04-10 14:45:14 +02:00
Andreas Kling 48eb58230b LibGUI: List directories before files in FileSystemModel
Instead of mixing directories and files, sorting a FileSystemModel by
the Name column will now give you all the directories first, followed
by all the files.
2021-04-10 13:58:13 +02:00
AnotherTest c128b3fd91 LibRegex: Remove 'ReadDigitFollowPolicy' as it's no longer needed
Thanks to @GMTA: 1b071455b1 (r49343474)
2021-04-10 12:10:45 +02:00
Andreas Kling 642b428793 Ext2FS: Support reading from file holes
It's perfectly valid for ext2 inodes to have blocks with index 0.
It means that no physical block was allocated for that area of an inode
and we should treat it as if it's filled with zeroes.

Fixes #6139.
2021-04-10 11:09:43 +02:00
Andreas Kling b5b38d372c Ext2FS: Clarify error handling in Ext2FSInode::read_bytes() somewhat 2021-04-10 10:58:19 +02:00
Andreas Kling 19fb62dd15 WindowServer: Alt shortcuts and book title capitalization in menus
Specifically, in window menus. :^)
2021-04-10 10:29:42 +02:00
Andreas Kling 27b2c6f440 HackStudio: Alt shortcuts and book title capitalization in menus 2021-04-10 10:19:25 +02:00
Samuel Klein 392d9e94f0
Documentation: Improve wording around build directory location (#6168) 2021-04-10 09:34:11 +02:00
AnotherTest 1b071455b1 LibRegex: Treat brace quantifiers with invalid contents as literals
Fixes #6208.
2021-04-10 09:16:03 +02:00
AnotherTest 25d336bc27 LibRegex: Take the regex as a const reference in print_bytecode() 2021-04-10 09:16:03 +02:00
AnotherTest e9279d1790 LibRegex: Allow a '?' suffix for brace quantifiers
This fixes another compat point in #6042.
2021-04-10 09:16:03 +02:00
AnotherTest 8d7bcc2476 LibRegex: Give ByteCode a copy ctor and and a move assignment operator
Previously all move assignments were actually copies. oops.
2021-04-10 09:16:03 +02:00
Andreas Kling 192e2d5d50 LibVT: Update TerminalWidget after double-click selection
Previously we had to wait for the cursor to blink before we actually
got to see what got selected from double-clicking.
2021-04-10 00:11:10 +02:00
Andreas Kling 088ae37541 LibGUI: Reflow+update TextEditor widget after ruler visibility change 2021-04-10 00:09:44 +02:00
Andreas Kling 58106f57de LibGUI: Remove 2px of vertical space around FilePicker common places
The extra margin is not needed with the new "Tray" look. :^)
2021-04-09 23:58:04 +02:00
Andreas Kling 42ec6718f2 Base+LibGUI: Add an familiar-looking icon for the desktop directory 2021-04-09 23:45:21 +02:00
Andreas Kling 2de1f32433 LibGUI: Yet another FilePicker UI tweak
Make sure the "Look in:" label is vertically centered within its
corresponding location box.
2021-04-09 23:09:52 +02:00
Andreas Kling 8db4819271 LibGUI: Allow navigating into symlinked directories in FilePicker
If you double-click on a symlink to a directory while browsing with
a FilePicker, you most likely want to open the directory the symlink
points to, not open the symlink itself. So let's do that. :^)
2021-04-09 23:04:04 +02:00
Andreas Kling bcd05e199b LibGUI: Fix uniform TabWidget tabs bleeding outside the widget
The last uniform-sized tab button would bleed outside the tab bar area
due to us not taking the bar margin into account.
2021-04-09 22:30:41 +02:00
Andreas Kling 1029069ad6 Browser: Add a separator line below the menu while in multi-tab mode 2021-04-09 22:23:32 +02:00
Andreas Kling c8ff507534 LibGUI: Add TabWidget::on_tab_count_change hook 2021-04-09 22:23:14 +02:00
Andreas Kling 2aaf12e9cd LibGUI: More tweaks for the FilePicker UI layout 2021-04-09 21:53:43 +02:00
Andreas Kling da7dbc116e LibGUI: Use "Tray" look & feel for the common locations frame :^) 2021-04-09 21:53:43 +02:00
Andreas Kling 11bea5d633 LibGfx+Base: Add Tray/TrayText theme colors and Gfx::ButtonStyle::Tray
A "Tray" is a sunken container area for widgets. The first intended
client of this style is the GUI::FilePicker's common locations frame.

Thanks to @nvella for coming up with the term "Tray" :^)
2021-04-09 21:53:43 +02:00
Andreas Kling e34238945d Browser: Add more Alt shortcuts to menu actions 2021-04-09 21:53:43 +02:00
Andreas Kling 3e43b1f173 LibGUI: Tweak FilePickerDialog UI layout 2021-04-09 21:53:43 +02:00
Jelle Raaijmakers db321db5f4 LibRegex: Parse \0 as a zero-byte instead of 0x30 ("0")
This was causing some regexes to trip up. Fixes #6202.
2021-04-09 21:53:14 +02:00
Andreas Kling 2c94c9fa7f SystemMonitor: Add Alt shorcuts to menu actions 2021-04-09 17:10:30 +02:00
Andreas Kling 9945135f66 Browser: Add Alt shortcuts to menu actions 2021-04-09 17:08:49 +02:00
Andreas Kling c6c0ec9403 FileManager: Add Alt shortcuts to menu actions 2021-04-09 17:08:49 +02:00