Commit Graph

19564 Commits

Author SHA1 Message Date
Andreas Kling
def1f1444a WindowServer: Move configuration file to /etc/WindowServer.ini
This was in the /etc/WindowServer/ directory which had nothing else in
it, so let's just get rid of the directory and move this up one step.
2021-04-29 22:16:18 +02:00
Tom
b88b19272e WindowServer: Fix alpha hit-test accessing out-of-bounds pixels
It's possible that the backing store hasn't been updated yet, so
when performing an alpha hit-test make sure the bitmap actually
contains it.

Fixes #6731
2021-04-29 21:51:41 +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
Brian Gianforcaro
a8765fa673 Kernel: Harden sys$select Vector usage against OOM.
Theoretically the append should never fail as we have in-line storage
of FD_SETSIZE, which should always be enough. However I'm planning on
removing the non-try variants of AK::Vector when compiling in kernel
mode in the future, so this will need to go eventually. I suppose it
also protects against some unforeseen bug where we we can append more
than FD_SETSIZE items.
2021-04-29 20:31:15 +02:00
Brian Gianforcaro
0ca668f59c Kernel: Harden sys$munmap Vector usage against OOM.
Theoretically the append should never fail as we have in-line storage
of 2, which should be enough. However I'm planning on removing the
non-try variants of AK::Vector when compiling in kernel mode in the
future, so this will need to go eventually. I suppose it also protects
against some unforeseen bug where we we can append more than 2 items.
2021-04-29 20:31:15 +02:00
Brian Gianforcaro
569c5a8922 Kernel: Harden sys$purge Vector usage against OOM.
sys$purge() is a bit unique, in that it is probably in the systems
advantage to attempt to limp along if we hit OOM while processing
the vmobjects to purge. This change modifies the algorithm to observe
OOM and continue trying to purge any previously visited VMObjects.
2021-04-29 20:31:15 +02:00
Brian Gianforcaro
b3096276bb Kernel: Harden sys$poll Vector usage against OOM. 2021-04-29 20:31:15 +02:00
Brian Gianforcaro
119b7be249 Kernel: Harden sys$execve Vector usage against OOM. 2021-04-29 20:31:15 +02:00
Brian Gianforcaro
454d2fd42a Kernel: Harden sys$readv / sys$writev Vector usage against OOM. 2021-04-29 20:31:15 +02:00
Brian Gianforcaro
cd29eb7867 Kernel: Harden sys$sendmsg / sys$recvmsg Vector usage against OOM. 2021-04-29 20:31:15 +02:00
Gunnar Beutner
6288ae2c37 Kernel: Add a CMake flag to enable LTO for the kernel 2021-04-29 20:26:36 +02:00
Gunnar Beutner
55ae52fdf8 Kernel: Enable building the kernel with -flto
GCC with -flto is more aggressive when it comes to inlining and
discarding functions which is why we must mark some of the functions
as NEVER_INLINE (because they contain asm labels which would be
duplicated in the object files if the compiler decides to inline
the function elsewhere) and __attribute__((used)) for others so
that GCC doesn't discard them.
2021-04-29 20:26:36 +02:00
Gunnar Beutner
b861259098 Meta: Ensure the tap device is removed before trying to create it again
Sometimes the tap device isn't destroyed depending on how the script
exits. Running the script again then fails to create the device
again.
2021-04-29 20:26:13 +02:00
Ali Mohammad Pur
4c40151160 Shell: Implement formatting for Heredocs 2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
c5c6161406 Base: Describe heredocs in Shell's manpage 2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
d70f25bbe5 Shell: Add some tests for heredocs 2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
3048274f5e Shell: Add support for heredocs
Closes #4283.
Heredocs are implemented in a way that makes them feel more like a
string (and not a weird redirection, a la bash).
There are two tunables, whether the string is dedented (`<<-` vs `<<~`)
and whether it allows interpolation (quoted key vs not).
To the familiar people, this is how Ruby handles them, and I feel is the
most elegant heredoc syntax.
Unlike the oddjob that is bash, heredocs are treated exactly as normal
strings, and can be used _anywhere_ where a string can be used.
They are *required* to appear in the same order as used after a newline
is seen when parsing the sequence that the heredoc is used in.
For instance:
```sh
echo <<-doc1 <<-doc2 | blah blah
contents for doc1
doc1
contents for doc2
doc2
```
The typical nice errors are also implemented :^)
2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
7c8d39e002 Shell: Do not assume that all parts of a node are enclosed in the node
For instance, heredocs are made of two parts, and the second part is not
within the bounds of the first one.
2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
cf4935e806 Shell: Avoid position push/pop when checking for next_is()
This operation is not a rule and cannot produce nodes.
2021-04-29 20:25:56 +02:00
Ali Mohammad Pur
0d742557c6 Shell: Allow Syntax errors to be mutated while parsing
Some nodes (such as heredocs) cannot be validated immediately, so the
entire tree will need to be revalidated if we don't allow mutating
syntax errors.
2021-04-29 20:25:56 +02:00
Andreas Kling
39369f1da6 Utilities: Use Vector<String> positional arguments in some places
There are more places we can use these, I just picked some that felt
like they improved the code.
2021-04-29 11:28:01 +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
64d7a8b7aa Tests: Convert LibC exec unit test to be LibTest based. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
8d8535f297 Tests: Convert LibC mktemp tests to be LibTest based. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
2cef015528 LibTest: Add EXPECT_NE(..) test assertion. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
adcd56473c Tests: Enable Spreadsheet unit tests so they actually build 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
7a0d7525f1 Build: Simplify LibGfx test's CMakeLists.txt with serenity_test(..)
Now that everything is LibTest based, we can just use the normal
pattern of iterating + serenity_test(..).
2021-04-29 10:37:26 +02:00
Brian Gianforcaro
a8835b2d8f Tests: Convert LibGfx font handling test to be LibTest based. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
6b5bbf9464 Tests: Convert LibGfx image decoder test to be LibTest based. 2021-04-29 10:37:26 +02:00
Brian Gianforcaro
d2b4ea69ab Tests: Rename LibGfx painter benchmark to denote it's not a test. 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
Idan Horowitz
33fdd402b5 Meta: Increase fconstexpr-steps for Clang Lagom builds
Clang's default constexpr-steps limit is 1048576, which is not enough
for LibGfx's generation of the unicode bidirectional class lookup table
while GCC doesn't have any limit at all, so this patch increases the
limit to an arbitrarily larger value.
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
bebdf24329 Meta: Add note to CONTRIBUTING.md about pointless GitHub comments 2021-04-29 10:34:02 +02:00
Andreas Kling
910edb1e0c Meta: Simplify & clarify CONTRIBUTING.md somewhat
Also remove the feature policy section, since it was mostly fluff.
It was nice fluff, but made the document less focused.
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
2f1ee91b3e Ports: Make Super Mario work with GCC 11 2021-04-29 10:33:44 +02:00
Gunnar Beutner
19064eaaca Toolchain: Update the binutils patch file to match the port
Previously the toolchain's binutils would not have been able to
build binaries on 32-bit host systems (not that this would be
much of an issue nowadays) because one of the #ifdefs was in
the wrong place.

I moved the #ifdef in the port's patch and this now updates
the toolchain's patch file to match the port's patch.
2021-04-29 10:33:44 +02:00
Gunnar Beutner
797cb8858a Ports: Update binutils to version 2.36.1
Otherwise linking fails when building object files with
DWARF 5 symbols.
2021-04-29 10:33:44 +02:00
Gunnar Beutner
77087780a2 Ports: Remove duplicate configopts var 2021-04-29 10:33:44 +02:00
Gunnar Beutner
669676b635 Ports: Build fix for gcc when building the port with gcc 11.1.0 2021-04-29 10:33:44 +02:00
Gunnar Beutner
d2a5d76b54 Ports: Use SHA256 for the gcc port
This updates the way we verify signatures for the gcc
port because we were previously downloading the keychain
from the mirror which defeats the point of doing signature
checks.
2021-04-29 10:33:44 +02:00
Gunnar Beutner
c861195557 Userland: Fix new GCC warnings 2021-04-29 10:33:44 +02:00
Gunnar Beutner
8cd62b5780 Toolchain+Ports: Update GCC to version 11.1.0 2021-04-29 10:33:44 +02:00