Commit graph

10496 commits

Author SHA1 Message Date
Ewan
0609a85166 Docs: Correct wording on CMake downloads 2020-06-17 15:08:47 +02:00
Ewan
92eed96265 Docs: Spell CMake correctly in BuildInstructions 2020-06-17 15:08:47 +02:00
Nico Weber
9abafa2d1c LibC: Make setgid() definition protoype match declaration 2020-06-17 15:08:17 +02:00
Sergey Bugaev
edef6ccff5 Userland: Compliment the user when running su(1) :^) 2020-06-17 15:02:03 +02:00
Sergey Bugaev
8ecac16c03 Base+Meta: Rename the wheel group to goodboys :^) 2020-06-17 15:02:03 +02:00
Sergey Bugaev
c39045b222 Userland: Improve cat(1)
* Port it to Core::ArgsParser - even though it doesn't support any options
  at the moment, it's nice to handle --help and reject other options;
* Accept "-" to mean stdin;
* Make sure to write out all data that we read, looping if needed;
* Detect Useless Uses of Cat and print a cute warning :^)
2020-06-17 15:02:03 +02:00
Sergey Bugaev
6fcce077bb Userland: Fix a crash in chown(1) 2020-06-17 15:02:03 +02:00
Sergey Bugaev
153bfe5683 Userland: Fix wc(1)
This fixes a bug in how wc(1) would not consider certain things to be words,
and removes the unused "character" counter (the "bytes" counter is what's used
for `wc -c`).
2020-06-17 15:02:03 +02:00
Sergey Bugaev
e0d0d52455 Kernel: Use symbolic constants for file modes
This fixes a bug where the mode of a FIFO was reported as 001000 instead
of 0010000 (you see the difference? me nethier), and hopefully doesn't
introduce new bugs. I've left 0777 and similar in a few places, because
that is *more* readable than its symbolic version.
2020-06-17 15:02:03 +02:00
Sergey Bugaev
fd985b1f48 Base: Document readlink(1) and readlink(2) :^) 2020-06-17 15:02:03 +02:00
Sergey Bugaev
b6a4c450d1 Userland: Add readlink(1) 2020-06-17 15:02:03 +02:00
Sergey Bugaev
363b7351b8 FileManager: Use Core::File::read_link() 2020-06-17 15:02:03 +02:00
Sergey Bugaev
0674d9362b LibGUI: Use Core::File::read_link() 2020-06-17 15:02:03 +02:00
Sergey Bugaev
eb7af00152 Userland: Use Core::File::read_link() 2020-06-17 15:02:03 +02:00
Sergey Bugaev
d89843f96f LibCore: Add File::read_link() :^)
This is a convenient wrapper around readlink() that hides away the details
of buffers and buffer sizes, and simply returns a String. The best part is it
doesn't rely on PATH_MAX :D

It comes in two versions, for Serenity, where we can pass non-null-terminated
strings to syscalls, and where sys$readlink() returns the total link size, and
for other systems, where we have to copy out the string, and always have to do
two syscalls.
2020-06-17 15:02:03 +02:00
Sergey Bugaev
47d83800e1 Kernel+LibC: Do not return -ENAMETOOLONG from sys$readlink()
That's not how readlink() is supposed to work: it should copy as many bytes
as fit into the buffer, and return the number of bytes copied. So do that,
but add a twist: make sys$readlink() actually return the whole size, not
the number of bytes copied. We fix up this return value in userspace, to make
LibC's readlink() behave as expected, but this will also allow other code
to allocate a buffer of just the right size.

Also, avoid an extra copy of the link target.
2020-06-17 15:02:03 +02:00
Andreas Kling
35329400b8 AK: Implement a slightly better FlyString::operator==(String)
This was showing up in Browser profiles, which is silly, so write a new
version that doesn't create a temporary String object.

There are a whole bunch of these and long-term it would be nice to find
a way to share all the very similar logic instead of duplicating it.
2020-06-16 19:19:30 +02:00
Andreas Kling
6242e029ed LibWeb: Make Element::tag_name() return a const FlyString&
The more generic virtual variant is renamed to node_name() and now only
Element has tag_name(). This removes a huge amount of String ctor/dtor
churn in selector matching.
2020-06-16 19:09:14 +02:00
Hüseyin ASLITÜRK
ea1ebe8662 QuickShow: Add reset zoom action to toolbar
When zoom reset also reset pan origin
2020-06-16 14:42:18 +02:00
Hüseyin ASLITÜRK
bf3d98012a QuickShow: Switch to full screen mode on double click
More respect to user behavior on image viewers :)
2020-06-16 14:42:18 +02:00
Hüseyin ASLITÜRK
016fc9c133 Base: Add a new icon for zoom reset 2020-06-16 14:42:18 +02:00
Ewan
6a567e1191 Docs: Add comment about required cmake version
Toolchain/BuiltIt.sh expected a version of cmake which
apt did not provide for my system. Added note of the
expected version and where to find a newer version.
2020-06-16 13:54:47 +02:00
Dominik Madarász
7e2cf4be4b
Docs: Update FreeBSD instructions (#2510)
ginstall should not be symlinked to install globally. The actual issue
of having GNU coreutils prefixed with `g` and not being picked up by
CMake can be fixed on CMake level as noted here:
https://github.com/SerenityOS/serenity/issues/2234#issuecomment-629754194
2020-06-16 13:31:11 +02:00
Hüseyin ASLITÜRK
df8fd4e8c8 Test: Fix json parse test from unicode string 2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
00edc89288 Kernel: TTY:VirtualConsole, replace character attribute with code_point 2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
7abca30f41 LibVT: Replace u8 type to u32 for code point
Replace KeyEvent text attribute usage with code_point.
2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
53227f400c LibGUI: Replace text attribute on KeyEvent with code_point attribute 2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
0aad21fff2 AK: JsonParser, replace char type to u32 for code point 2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
174987f930 Kernel: Replace char and u8 data types to u32 for code point
Remove character property from event and add code_point property.
2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
1887e35dc8 KeyboardMapper: Replace char data type to u32 for code point 2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
2f7e5a5e40 WindowServer: Replace character with code point
Replace u8 data type width u32. Remove character property from event and add code_point property for represent UTF-8 character.
2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
25e14911c5 LibKeyboard: Replace char data type to u32 for code point 2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
cfaed04464 Base: Typo correction in trq.json 2020-06-16 13:15:17 +02:00
Nico Weber
d81ac80aba LibC: Declare pthread_sigmask() in signal.h.
That's where it's supposed to be declared.
2020-06-16 09:34:00 +02:00
Hüseyin ASLITÜRK
0799835e15 LibGUI: Use new Bitmap::is_path_a_supported_image_format method 2020-06-15 22:42:23 +02:00
Hüseyin ASLITÜRK
3a903babee QuickShow: Use new Bitmap::is_path_a_supported_image_format method 2020-06-15 22:42:23 +02:00
Hüseyin ASLITÜRK
56158a4281 LibGfx: Add a new Bitmap::is_path_a_supported_image_format() method
Move the image file detection code to the File class to prevent code duplication.
2020-06-15 22:42:23 +02:00
Kevin Meyer
17aa917073 LibGUI: Don't update cursor, if visual data out-of-date
This fixes https://github.com/SerenityOS/serenity/issues/2498
A nullptr dereference was caused by the visual data beeing out of sync
with the line data, due to a deferred recompute.
2020-06-15 22:32:18 +02:00
Kevin Meyer
e0f4fdc9b4 AK: Assert non-empty Utf32View, when initialized with non-zero length
This was useful in debugging a nullptr dereference, which was happening
through later, but was caused by this inconsistent initialization.
2020-06-15 22:32:18 +02:00
Andreas Kling
49cd03be95 LibWeb: Fix broken parsing of </form> during "in body" insertion 2020-06-15 20:31:19 +02:00
Andreas Kling
9bb4020195 LibWeb: Don't load stylesheets with rel="alternate"
We're not supposed to load these by default. Alternate stylesheets can
be offered in a menu or something, if the user is interested.
2020-06-15 20:31:18 +02:00
Andreas Kling
2f26d4c6a1 LibWeb: Fix broken parsing of </select> during "in select" insertion 2020-06-15 19:57:20 +02:00
Andreas Kling
17d26b92f8 LibWeb: Just ignore <script> elements that failed to load the script
We're never gonna be able to run them if we can't load them so just
let it go.
2020-06-15 18:37:48 +02:00
Andreas Kling
84f8c91a6f LibWeb: Use the URL encoder from AK instead of rolling a custom one 2020-06-15 17:56:00 +02:00
Andreas Kling
d883607e8f LibWeb: Force a full relayout if an element's CSS display changes
Not doing this was causing the wrong kind of LayoutNode to stay around
even though we had the final "display" value.
2020-06-15 17:56:00 +02:00
Andreas Kling
308c3ccc44 LibWeb: Allow block children of inlines
Hey, why not. We did all the hard work for display:inline-block already
and now we can just allow this.

This makes <a><h1>Hello friends!</h1></a> work :^)
2020-06-15 17:56:00 +02:00
Andreas Kling
96da15a8a4 LibWeb: Respect CSS z-index property while painting
To support z-ordering when painting, the layout tree now has a parallel
sparse tree of stacking contexts. The rules for which layout boxes
establish a stacking context are a bit complex, but the intent is to
encapsulate the decision making into establishes_stacking_context().

When we paint, we start from the ICB (LayoutDocument) who always has a
StackingContext and then paint the tree of StackingContexts where each
node has its children sorted by z-index.

This is pretty crude, but gets the basic job done. Note that this does
not yet support hit testing; hit testing is still done using a naive
treewalk from the root.
2020-06-15 17:56:00 +02:00
Andreas Kling
ce3260c6bf LibWeb: Layout nodes without own style can't be absolutely positioned
The only layout nodes that don't have their own style are LayoutText
(they inherit the style from their parent element since text cannot
be styled by CSS.)

However, it never makes sense for text nodes to have absolute position
so don't claim it.
2020-06-15 17:56:00 +02:00
Nico Weber
9825f7792b LibC: Add truncate().
Implemented in user space for now.
2020-06-15 17:34:52 +02:00
Andreas Kling
246e0e47ec LibWeb: Make the specificity sort comparator a bit more readable 2020-06-14 22:09:35 +02:00