Commit Graph

1492 Commits

Author SHA1 Message Date
stelar7
55446172cb LibWeb: Add selector support to the new CSSParser
This is stolen from the old parser, but it seems to parse fine :^)
2021-04-30 08:52:36 +02:00
Gunnar Beutner
1dfa386d70 LibC: Add missing initialization for the FILE mutex 2021-04-30 08:21:08 +02:00
Gunnar Beutner
6adb0dbdba LibC: Implement fgetc_unlocked(), fread_unlocked() and getc_unlocked() 2021-04-29 23:12:05 +02:00
Gunnar Beutner
36ee8a8c25 LibC: Make rewind() ignore errors as it should
POSIX says that rewind() should ignore errors and reset the
stream's error indicator. So let's do that.
2021-04-29 23:12:05 +02:00
Gunnar Beutner
62ee003ef5 LibC: Make stdio thread-safe 2021-04-29 23:12:05 +02:00
Andreas Kling
3d4afe7614 Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which
of these words to use. Let's just choose one and use it everywhere. :^)
2021-04-29 22:23:52 +02:00
Andreas Kling
7ae7170d61 Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
Ali Mohammad Pur
ba294efd8e LibC: Fix validation logic error in construct_pwd()
Previously this would've always succeeded, even if a copy failed.
Oops...
2021-04-29 21:35:41 +02:00
Andreas Kling
695cdf7bc0 LibCore: Support Vector<String> positional arguments
We already supported Vector<char const*>, so let's add Vector<String>
as well. :^)
2021-04-29 11:10:06 +02:00
Tobias Christiansen
889e1d3db9 LibWeb: Add list-style-type: upper-latin and upper-alpha support 2021-04-29 10:43:33 +02:00
Tobias Christiansen
cb34775c83 LibWeb: Add list-style-type: lower-alpha and lower-latin support
They achieve the same, a list which markers are lowercase (latin)
characters.
2021-04-29 10:43:33 +02:00
Tobias Christiansen
7dd0fb0086 LibWeb: Conversion from number to bijective-base with alphabet.
This allows us to convert a number to a String given a bijective
(zero-less) alphabet.
So you count A,B,C,...,Y,Z,AA,AB,...

This was surprisingly very tricky!

This allows the ListItemMarker to be displayed with different (simple)
alphabets in the future.
2021-04-29 10:43:33 +02:00
Tobias Christiansen
0983cd9243 LibWeb: Add list-style-type: decimal-leading-zero support
This doesn't exactly do what you would think from its name: It surely
adds an extra leading zero to the front of a number, but only if the
number is less than 10. CSS is weird sometimes.
2021-04-29 10:43:33 +02:00
Brian Gianforcaro
2cef015528 LibTest: Add EXPECT_NE(..) test assertion. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
8ae3191ab5 Tests: Unify LibC tests to single location.
In a1720eed2a I added this new test,
but missed that there were already some "unit tests" for LibC over
in Userland/Tests/LibC. So lets unify these two locations.
2021-04-29 10:37:26 +02:00
Brian Gianforcaro
cf0640c870 Build: Remove unused ${REGEX_SOURCES} from the tests CMakeLists.txt 2021-04-29 10:37:26 +02:00
Idan Horowitz
115b445dab LibGfx: Add basic support for bidirectional text rendering
This adds a *very* simplified version of the UNICODE BIDIRECTIONAL
ALGORITHM (https://www.unicode.org/reports/tr9/), that can render most
bidirectional text but also produces awkward results in a large amount
of edge cases, and as such, this should probably be replaced with a
fully spec compliant implementation at some point.
2021-04-29 10:36:23 +02:00
Andreas Kling
357a455b5c iLibC: Fix some missed camelCase => snake_case 2021-04-29 10:34:02 +02:00
Andreas Kling
d3e7529297 LibWeb: Move Layout::TextNode whitespace collapse to separate function 2021-04-29 10:34:02 +02:00
Gunnar Beutner
c861195557 Userland: Fix new GCC warnings 2021-04-29 10:33:44 +02:00
Holden Green
18a641f3f8 Implemented llabs() in stdlib.h/cpp. 2021-04-29 09:34:27 +02:00
Holden Green
4ce17721e3 LibC: added a bunch of macros in inttypes.h for use in formating strings being passed to sscanf. 2021-04-29 09:34:27 +02:00
Justin
e6401d65bd Kernel: Add MSG_PEEK support for the IPv4Socket
This commit will add MSG_PEEK support, which allows a package to be
seen without taking it from the buffer, so that a subsequent recv()
without the MSG_PEEK flag can pick it up.
2021-04-29 08:09:53 +02:00
Gunnar Beutner
9bcdbe205b LibDebug: Implement support for AttributeDataForm::ImplicitConst
While symbolicating a crash dump for UserspaceEmulator I came across
another data form we didn't support.

ImplicitConst encodes a LEB128 value in the abbreviation record
rather than - like all other values - in the .debug_info section.
2021-04-29 08:02:52 +02:00
Mart G
d96aae32ef LibGUI: Fix issue where buttons with a menu sometimes stayed depressed
When a Button has a menu, the AbstractButton behaviour will now not
be used in the mousemove_event. This was already the case for
mousedown_event.

Why only sometimes?
Normally the presence of the menu prevents mousemove_events from being
delivered to the button. But the menu doesn't spawn immediately. So
sometimes mousemove events got through to the AbstractButton after the
menu was told to spawn but before it appeared. This caused the
m_being_pressed field of AbstractButton to be set to true. But there
was never a mouseup_event because the menu got those instead.
2021-04-29 01:01:39 +02:00
Linus Groh
45f97e577e Userland: Fix two misaligned copyright headers 2021-04-29 00:59:26 +02:00
Linus Groh
649d2faeab Everywhere: Use "the SerenityOS developers." in copyright headers
We had some inconsistencies before:

- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."

I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.

By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
2021-04-29 00:59:26 +02:00
Linus Groh
5459c744f1 Everywhere: Add missing comma between copyright year and name 2021-04-29 00:59:26 +02:00
Gunnar Beutner
d0a7547537 LibDebug: Implement support for AttributeDataForm::{UData,LineStrP} 2021-04-28 23:10:48 +02:00
Gunnar Beutner
d2f0984fef LibDebug: Implement support for DWARF 5 line programs 2021-04-28 23:10:48 +02:00
Gunnar Beutner
6b4448b623 LibDebug: Implement support for DWARF 5 compilation unit headers 2021-04-28 23:10:48 +02:00
Gunnar Beutner
a3f2af49f9 LibDebug: Move UnitHeader32 out of the LineProgram class 2021-04-28 23:10:48 +02:00
Gunnar Beutner
ea6fdad88b LibDebug: Move get_attribute_value to the DwarfInfo class 2021-04-28 23:10:48 +02:00
Idan Horowitz
edfe81b1ee LibC: static_assert that all malloc size classes have an alignment of 8
This will help prevent issues like the one fixed by #6703 from
happening again.
2021-04-28 19:57:06 +02:00
Gunnar Beutner
ae5ee2220c LibC: Make sure malloc() returns addresses that have an alignment of 8 2021-04-28 14:26:56 +02:00
Gunnar Beutner
aa792062cb Kernel+LibC: Implement the socketpair() syscall 2021-04-28 14:19:45 +02:00
Jean-Baptiste Boric
91def742a4 LibM: Fix INFITITY to float
POSIX mandates it.
2021-04-27 23:06:16 +02:00
Jean-Baptiste Boric
8d95bd8418 LibThread: Fix int to pointer conversion 2021-04-27 23:06:16 +02:00
Jean-Baptiste Boric
7d84f09e7e Userland: Move non-standard math constants from math.h 2021-04-27 23:06:16 +02:00
Jean-Baptiste Boric
9aa44fa36c LibIPC: Add missing errno.h include 2021-04-27 23:06:16 +02:00
Jean-Baptiste Boric
b3e070b2f3 Userland: Move HOST_NAME_MAX to limits.h
POSIX mandates its definition there.
2021-04-27 23:06:16 +02:00
Andreas Kling
504d622864 LibWeb: Remove unnecessary temporary Vector in text layout
Now that we have Layout::TextNode::ChunkIterator, we don't need to
accumulate all the chunks in a vector before dividing them into lines.
2021-04-27 19:11:59 +02:00
Andreas Kling
37e29a630b LibWeb: Minor cleanup tweak in TextNode::split_into_lines_by_rules()
Merge an unnecessarily nested branch with its parent.
2021-04-27 19:11:59 +02:00
Andreas Kling
5074aaea69 LibWeb: Refactor Layout::TextNode splitting into a chunk iterator
Creating a ChunkIterator allows you to iterate over the text in a
Layout::TextNode at your leisure by calling next() when you want
another chunk.

This is one of many steps towards improving inline layout.
2021-04-27 19:11:59 +02:00
Paul Berg
03d8ee1082 VimEditingEngine: allow selection of the endline character
This patch fixes the visual selection of endline characters in the
VimEditingEngine. When the visual mode is disabled and the cursor
is located on the endline character, it is shifted back to the last
character of the line.
2021-04-27 19:05:16 +02:00
Brian Gianforcaro
a9df58d7b2 LibTest: Add FAIL() macro allow tests to force failure with message. 2021-04-27 17:58:11 +02:00
sin-ack
ace2c337dc VimEditingEngine: Handle arrow, Home/End and Page keys
This patch adds handling of the arrow, Home/End, and PageUp/PageDown
keys to the Vim emulation mode.  Home acts as 0, End acts as $, arrow
keys act as their HJKL variants, and PageUp/Down behaves as you would
expect.

This patch also moves the default handling of the aforementioned keys
to insert mode, since regular EditingEngine semantics are more
appropriate there.
2021-04-27 13:10:10 +02:00
Jelle Raaijmakers
d1f33ec795 LibPthread: Use realtime clock for futex_wait()
If we get an absolute time passed to one of the pthread_*wait methods,
this is not an absolute monotonic time but rather an absolute wall
time. This means that we also need to pass FUTEX_CLOCK_REALTIME to the
futex syscall to ensure we're not using the monotonic clock.
2021-04-27 09:19:55 +02:00
sin-ack
d6dc81874d EditingEngine: Split selection from movement functions
This patch moves selection updates outside movement functions in
EditingEngine.  Previously, movement functions would automatically
update the selection based on whether the Shift key was pressed down
during movement.  However, not all EditingEngine subclasses want that;
VimEditingEngine being a good example (because all selection is handled
in visual mode).

Therefore, this patch moves all selection updating to
EditingEngine::on_key().  Subclasses wishing to provide custom movement
and selection semantics should override it (and VimEditingEngine already
does).
2021-04-27 09:03:38 +02:00
Jelle Raaijmakers
83dfc4aa46 LibGUI/Window: Do not reset mouse cursor on show()
Window::m_cursor already has ::None as its default value, so let's not
overwrite its value if it was set to something else.
2021-04-27 08:58:13 +02:00