Commit graph

20063 commits

Author SHA1 Message Date
Ali Mohammad Pur
c7b60164ed LibCore: Don't use has_flag() with multiple flags (OpenMode::ReadWrite)
Fixes boot, regressed in a91a49337c.
2021-05-12 12:49:31 +02:00
Ali Mohammad Pur
1ae8775a1b LibCore+Everywhere: Move SeekMode out of IODevice 2021-05-12 11:00:45 +01:00
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
DolphinChips
422ef7904e Build: Add extlinux-image target to CMake 2021-05-12 09:25:03 +01:00
DolphinChips
5d4f521c9d Meta: Add script to build image with EXTLINUX bootloader 2021-05-12 09:25:03 +01:00
DolphinChips
c1775a908c Meta: Add EXTLINUX config 2021-05-12 09:25:03 +01:00
Tobias Christiansen
e7498bb918 LibWeb: Position the ListItemMarkers according to their width
Previously they were positioned with a fixed offset. However this lead
to wider markers with more than one character to collide with the
element itself.
Now the ListItemMarkerBox generates and stores the appropriate String
in its constructor and sets its own width according to that.
The ListItemBox then lays out the Marker taking this width into
account.
This also made the painting a lot easier since we don't generate the
needed Strings every time we repaint, just once.
2021-05-12 08:53:18 +01:00
Tobias Christiansen
a51cee748f LibWeb: Remove unused alphabet constants from ListItemMarkerBox
Why exactly the linter didn't whine about this is a mystery. These
constants aren't needed anymore since the functionality moved to
AK/String a while ago.
2021-05-12 08:53:18 +01:00
Timothy Flynn
1ec23f38ed LibWeb: Move clearing boxes below preceding floating boxes
When computing the y-position of a clearing element, use the height of
the border box of the associated floating elements.

This also extracts this block of code to a helper lambda since it is
used twice.
2021-05-12 08:50:20 +01:00
Gunnar Beutner
e9a8646d3e Ports: Add missing dependencies for openttd 2021-05-12 08:37:07 +01:00
Gunnar Beutner
83c78971e2 Ports: Fix building the libicu port
If you're on the new toolchain with std support already
you'd be unable to build libicu because <cmath> #undefs
some of the defines from <math.h> (e.g. isfinite).
2021-05-12 08:37:07 +01:00
Ali Mohammad Pur
8419ddb4d8 RequestServer: Only attempt to flush() on a timer
...instead of doing so immediately.
This makes RequestServer not spin as much when its client isn't fast
enough to empty the download pipe.
It also has the nice benefit of allowing multiple downloads to happen
at the same time without one blocking the other too much.
2021-05-12 08:36:58 +01:00
Ali Mohammad Pur
afa98fcb55 LibTLS: Always send the signature_algorithms extension
At some point since Sep 2018, OpenSSL added a ~~bug~~ feature that makes
the default set of signature algorithms defined in TLSv1.2 unusable
without reducing what they call the "security level", which caused
communication with servers using more recent versions of openssl to
fail with "internal error".
This commit makes LibTLS always send its supported sigalgs, making the
server not default to the insecure defaults, and thus enabling us to
talk to such servers.
2021-05-12 08:35:02 +01:00
Jagger De Leo
0ed46103ed Documentation: Add Alpine Linux build instructions 2021-05-12 08:30:02 +01:00
Linus Groh
0a329d2d70 LibJS: Make super() in catch block work
The TryStatement handler execution creates a new LexicalEnvironment
without a current function set, which we were not accounting for when
trying to get the super constructor while executing a SuperExpression.
This makes it work but isn't pretty - this needs some refactoring to be
close to the spec for that to happen.

Fixes #7045.
2021-05-11 23:31:30 +01:00
Linus Groh
d85b9fd5a0 LibJS: Bring back runtime validation of RegExp flags
This is a partial revert of commit 60064e2, which removed the validation
of RegExp flags during runtime and expected the parser to do that
exclusively - however this was not taking into account the RegExp()
constructor, which was subsequently crashing on invalid flags.

Also adds test for these constructor error cases, which were obviously
missing before.

Fixes #7042.
2021-05-11 22:47:14 +01:00
Linus Groh
431782bcd6 LibJS/Tests: Add details for toThrowWithMessage() expectation error 2021-05-11 22:41:35 +01:00
Idan Horowitz
ce86026ac6 LibWeb: Add a maximum redirects limit to FrameLoader
This prevents the browser from crashing when trying to load an infinite
redirects loop. The chosen limit is based on the fetch specification:
"If request's redirect count is twenty, return a network error."
2021-05-11 21:41:48 +01:00
miere43
84800a5b4f Base: Add :nth-last-child test document 2021-05-11 21:17:16 +01:00
miere43
c4bd4cbd76 LibWeb: Implement :nth-last-child pseudo-class 2021-05-11 21:17:16 +01:00
Vladislav Vorobev
e87eaa3991 Documentation: Fix broken link to Meta/Lagom/ReadMe.md 2021-05-11 20:35:17 +01:00
Luke
c5c9494f48 LibJS: Use u64 instead of u32 in NumberPrototype::to_string
Update to #7033
Partial fix for #7034 (just ups the range to about 2 ** 54 before
losing precision)
2021-05-11 18:29:55 +01:00
Luke
2ff03ecfa8 LibJS: Make number parts unsigned in NumberPrototype::to_string
Fixes #3931
2021-05-11 17:29:37 +01:00
sin-ack
ecbe17fb11 LibLine+Shell: Add dirty history flag and use it
This patch adds a new flag called history_dirty to Line::Editor that is
set when history is added to but written.  Applications can leverage
this flag to write history only when it changes.  This patch adds an
example usage of this functionality to Shell, which will now only save
the history when it is dirty.
2021-05-11 17:26:30 +01:00
Timothy Flynn
227ccfc61a LibWeb: Paint an element's foreground before painting its children
The current implementation is missing the emphasized text of the
following rule in the painting order spec:

    7. Otherwise: *first for the element*, then for all its in-flow,
       non-positioned, block-level descendants in tree order...

This ensures the foreground is painted for the current element before
descending into its children.
2021-05-11 18:03:21 +02:00
Linus Groh
ecdb6a11b7 Base: Add Magnifier.af 2021-05-11 18:01:55 +02:00
Linus Groh
8afcd22900 Magnifier: Make window resizable
Instead of having the window non-resizable, it now defaults to a frame
size of 200 x 200 pixels but is user-resizable. The shown screenshot
updates its size accordingly. :^)
Sometimes we might need a larger view, or a non-square shape.
2021-05-11 18:01:55 +02:00
Luke
1c1b106f6c LibWeb: Make Element::tag_name return the HTML uppercased qualified name
I forgot to change tag_name when this was added.
Also makes html_uppercased_qualified_name return a const reference.
2021-05-11 18:01:36 +02:00
Luke
56d7d28d41 LibWeb: Expose Element.{prefix,localName} 2021-05-11 18:01:36 +02:00
Ali Mohammad Pur
d42d984a2d GLTeapot: Use glGenLists() a bit to demonstrate that it works 2021-05-11 14:09:17 +01:00
Ali Mohammad Pur
720d21411b LibGL: Implement glGenLists and a few friends
This commit implements glGenLists(), glNewList(), glDeleteLists(), and
glCallList().
The 'compiled' records are implemented as a vector of member function
pointers and tuples containing their arguments, and a mechanism is
implemented to allow the recorded calls to copy-capture values from the
time of the call; this is currently only used with glLoadMatrix.
2021-05-11 14:09:17 +01:00
Ali Mohammad Pur
02de813950 AK: Add a Tuple implementation
Please don't use this outside of metaprogramming needs, *please*.
2021-05-11 14:09:17 +01:00
Ali Mohammad Pur
4fdbac236d AK/Variant: Deduplicate the contained types
This allows the construction of `Variant<int, int, int>`.
While this might not seem useful, it is very useful for making variants
that contain a series of member function pointers, which I plan to use
in LibGL for glGenLists() and co.
2021-05-11 14:09:17 +01:00
Ali Mohammad Pur
3038b6b7dc AK: Avoid the use of typeinfo in Variant
typeid() and RTTI was a nice clutch to implement this, but let's move
away from the horrible slowness and implement variants using type
indices for faster variants.
2021-05-11 14:09:17 +01:00
Gunnar Beutner
659c22e17e Ports: Add missing dependency for vim
The vim port links against gettext when it's available so we
should add it as a dependency in the package.sh script.
2021-05-11 13:13:08 +01:00
Gunnar Beutner
6e2d59b49f Ports: Link gettext against libpthread
Apparently libintl uses pthread_cond_broadcast() so let's make sure
that we link it against libpthread so we don't call libc's pthread
stubs.
2021-05-11 13:13:08 +01:00
Andreas Kling
c68dfcf19f Base: Remove unused icons from the removed Visual Builder app 2021-05-11 11:24:58 +02:00
Umar Haroon
53e1ee2cb7 2048: Added Redo Support 2021-05-11 10:22:27 +01:00
Ali Mohammad Pur
a527256356 Shell: Add an option to autosave history every N ms
...and set it to 10 seconds by default.
2021-05-11 10:19:07 +01:00
Valtteri Koskivuori
4d01183f5c Userland: Implement a magnifier app
This utility is useful for making sure those UI elements are pixel
perfect. A simple 2x/4x magnification around the mouse cursor, shown in
a window.
2021-05-11 10:18:29 +01:00
Valtteri Koskivuori
4864ef9440 WindowServer: Add Optional<Gfx::IntRect> argument to get_screen_bitmap()
This way, we can optionally specify a region of the display to capture.
Defaults to entire screen if no rectangle is given.
2021-05-11 10:18:29 +01:00
Valtteri Koskivuori
cb74f7992a LibGfx: Implement Bitmap::cropped()
This cuts a region of a bitmap specified by the provided Gfx::IntRect
and returns it. Areas outside of the bounds of the original bitmap are
filled in with black.
2021-05-11 10:18:29 +01:00
SViN24
e60c0d675e
strace: Write output to stderr instead of stdout (#7016)
Fixes #7014.
2021-05-11 09:56:28 +02:00
Gunnar Beutner
0ab37dbd03 LibELF: Propagate ELF image validation errors to the caller
With this fixed dlopen() no longer crashes when given an invalid
ELF image and instead returns an error code that can be retrieved
with dlerror().

Fixes #6995.
2021-05-10 21:27:11 +02:00
Gunnar Beutner
461acda76f LibELF: Don't use assignments in return statements
Sure, this saves a couple of characters, but it's probably not
the best style.
2021-05-10 21:27:11 +02:00
Gunnar Beutner
9909a3f015 Ports: Remove obsolete patch for flatbuffers
The patch is not neccessary anymore, in fact it breaks the build
now because we have those functions in the std namespace.
2021-05-10 20:39:19 +02:00
Gunnar Beutner
22ebd754d3 Kernel: Fix loading ELF images without PT_INTERP
Previously we'd try to load ELF images which did not have
an interpreter set with an incorrect load offset of 0, i.e. way
outside of the part of the address space where we'd expect either
the dynamic loader or the user's executable to reside.

This fixes the problem by using get_load_offset for both executables
which have an interpreter set and those which don't. Notably this
allows us to actually successfully execute the Loader.so binary:

courage:~ $ /usr/lib/Loader.so
You have invoked `Loader.so'. This is the helper program for programs
that use shared libraries. Special directives embedded in executables
tell the kernel to load this program.

This helper program loads the shared libraries needed by the program,
prepares the program to run, and runs it. You do not need to invoke
this helper program directly.
courage:~ $
2021-05-10 20:39:08 +02:00
Sergey Bugaev
d8faafef14 Userland: Implement paste --watch mode
You can now watch the clipboard for changes and run a command each time
the clipboard contents change like this:

$ paste --watch some command here

The command will be spawned each time the clipboard contents change. It
can read the clipboard contents from its stdin, and CLIPBOARD_STATE
environment variable will be set to "data" if there is data to be read,
or to "nil"/"clear" if the clipboard has been cleared.
2021-05-10 19:09:53 +01:00
Sergey Bugaev
93a1b88965 Userland: Implement copy --clear
You can now clear the clipboard using copy(1) like this:

$ copy --clear
2021-05-10 19:09:53 +01:00
Sergey Bugaev
f15f03376b LibGUI: Add Clipboard::clear()
Does exactly what it says on the tin :^)
2021-05-10 19:09:53 +01:00