Commit Graph

3014 Commits

Author SHA1 Message Date
Gunnar Beutner
be4b20c14d LibC: Make <limits.h> compatible with GCC so that it doesn't install a fixed header
GCC installs a fixed version of the <limits.h> header as per https://gcc.gnu.org/onlinedocs/gcc/Fixed-Headers.html.
The fixed header doesn't include the target's <limits.h> which in turn means that some definitions (such as PATH_MAX)
aren't available. This change requires rebuilding the toolchain (Toolchain/BuildIt.sh).

This fixes the flatbuffers port.

The commit also removes some non-standard defines (U*_MIN) which don't appear to be used
anywhere. By definition they're always 0 though so they're not strictly necessary.
2021-04-11 09:51:20 +02:00
Brian Gianforcaro
988c23fff0 LibWeb: Add implementation of Node.compareDocumentPosition()
While looking into getting Duck Duck Go loading further in the
Browser, I noticed that it was complaining about the missing
method Node.compareDocumentPosition.

This change implements as much of the DOM spec as possible
with the current implementation of the DOM to date. The
implementation is validated by new tests in the Node.js.
2021-04-11 09:40:06 +02:00
Brian Gianforcaro
0f8932d7ab LibWeb: Connect existing implementation of Node::is_connected to JS.
I was looking at implementing something else, and saw this was low
hanging fruit, that brings the browser closer to standards conformance.

Add a basic test as well to validate it's implementation.
2021-04-11 09:40:06 +02:00
Gunnar Beutner
03ffdeb43a LibC: Provide macros for the <ctype.h> functions
These are required for the 'tr' port.
2021-04-11 01:18:02 +02:00
Gunnar Beutner
fe8b1a732e LibC: Include additional headers in <arpa/inet.h>
According to the Single UNIX Specification, Version 2 the <arpa/inet.h>
header may optionally include <netinet/in.h> and <inttypes.h>. This
helps with porting software like c-ray that expects this to be the case.
2021-04-11 01:18:02 +02:00
thankyouverycool
07627b3742 FontEditor: Add 'New Font' wizard to editor
Take a comfy guided tour through new font creation.
2021-04-11 01:16:34 +02:00
thankyouverycool
cdfa2614b9 FontEditor: Move menu bar into editor and tweak several widgets
Actions are now shared between menu bar and toolbar. Adds an edit
menu to complement toolbar actions. Glyphs are now passed as ints
instead of u8s; fixes Latin Extended+ glyphs failing to update in
real time on map. Converts weight and type to more human-readable
combo box lists. Selected glyph now scrolls into view on load.
2021-04-11 01:16:34 +02:00
thankyouverycool
c283429196 LibGfx: Add a count to FontTypes and a helper to return type names 2021-04-11 01:16:34 +02:00
thankyouverycool
25bd4b33a7 LibGUI: Move FontPickerWeightModel and helpers to their own header
Avoids maintaining multiple weight-name lists
2021-04-11 01:16:34 +02:00
Andreas Kling
d4d8d9ea0b LibGfx: Make sure draw_ui_text() paints underlines with text color
We shouldn't hard-code black here, then we won't respect the system
theme colors. :^)
2021-04-11 01:11:56 +02:00
Andreas Kling
a4992b5ece LibGUI+LibGfx: Collapse the '&' from Alt shortcuts in tooltip texts
Also resolve a FIXME about using GUI::Label auto-sizing since we're
changing this code and it simplifies what we're doing.

Fixes #6219.
2021-04-11 01:11:09 +02:00
Luke
ccd21614a3 LibJS: Replace Vector with MarkedValueList in RegExpPrototype::symbol_replace
Otherwise the GC won't be able to keep track of the stored values
and they may suddenly disappear from underneath us, thinking
they're not in use.

Fixes a crash when going to the Bootstrap website, where the first
replace call in jQuery caused a jump to a bogus address.
2021-04-11 00:32:59 +02:00
Andreas Kling
2146d22432 LibCore: Save errno before it gets clobbered in Core::IODevice::write() 2021-04-10 22:31:29 +02:00
Jelle Raaijmakers
06353077b7 LibGUI/ScrollBar: Only paint buttons as pressed when also hovered
Fixes #6185
2021-04-10 22:28:00 +02:00
Jelle Raaijmakers
f733b85957 LibTLS: Remove excessive CloseNotify logging 2021-04-10 21:05:00 +02:00
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
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
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