Commit graph

18746 commits

Author SHA1 Message Date
Gunnar Beutner
a44ddc4793 LibPthread: Don't hold sem->mtx after sem_wait()/sem_trywait()
Semaphores with values greater than one didn't work because whoever
called sem_wait() first held the semaphore's mutex until a matching
sem_post() call.

Other callers then wouldn't be able to acquire the semaphore even
if the semaphore's value was still greater than zero at that point.
2021-04-15 09:31:49 +02:00
Gunnar Beutner
32794e00a1 LibPthread: Improve error handling for the semaphore functions
This patch makes sure we're propagating errors to the caller.
2021-04-15 09:31:49 +02:00
Gunnar Beutner
98403eccb0 LibPthread: Ensure we're not overflowing the semaphore's value 2021-04-15 09:31:49 +02:00
Brendan Coles
62ced35346 Ports: Use ftpmirror.gnu.org mirror server for GNU ports 2021-04-15 09:30:42 +02:00
Nicholas-Baron
b2c952a6fa Base: Add documentation for get_process_name
`set_process_name` has a getter pair (which it links to); lets document it.

Solves #6007.
2021-04-15 09:01:11 +02:00
Timothy Flynn
b6093ae2e3 LibJS: Implement String.prototype.substr according to the spec
Fixes #6325

The JavaScript on the HTML Spec site that caused the crash is:
    window.location.hash.substr(1)

Of course, window.location.hash can be the empty string. The spec allows
for calling substr(1) on an empty string, but our partial implementation
wasn't handling it properly.
2021-04-15 08:38:19 +02:00
Idan Horowitz
bc9cd55da4 Browser+LibWeb: Add support for spoofing the browser user agent
This is helpful when testing certain sites like twitter.com which
display differently based on the user agent.
2021-04-14 23:06:32 +02:00
Idan Horowitz
aab99d5945 LibWeb: Implement the CanvasRenderingContext2D::rect path method
This method adds a rectangle to the current 2D path.
2021-04-14 23:01:23 +02:00
Idan Horowitz
4c0937225e LibWeb: Make CanvasRenderingContext2D::fill's fillRule argument optional
As defined by the specification (and used by the website i am testing):
interface mixin CanvasDrawPath {
  undefined fill(optional CanvasFillRule fillRule = "nonzero");
}
2021-04-14 23:01:23 +02:00
Idan Horowitz
0a580ef891 LibWeb: Request repaint on canvas path finalizaiton via fill/stroke
Since these were not requesting a repaint the drawn path was not being
rendered until a repaint was forced in some other way (window resize).
2021-04-14 23:01:23 +02:00
Idan Horowitz
b7c3f046f7 LibGfx: initialize winding number to 1 for NonZero winding rules
Since we first check the winding number and only then update it, fills
for "Rectangle-like" (made up of 2 parallel segments) paths would draw
nothing when filled by NonZero winding rules. (Fix by alimpfard)
2021-04-14 23:01:23 +02:00
Gunnar Beutner
d96354f58e Ports: Remove obsolete patch for the oksh port
The patch is not necessary anymore and breaks the build
now that LibC has isblank.
2021-04-14 22:43:53 +02:00
Gunnar Beutner
f62f6c2b37 Ports: Add missing dependency for the gnupg port 2021-04-14 22:43:27 +02:00
Gunnar Beutner
2ef7e757ad Ports: Enable audio for the Super-Mario port
According to @Baitinq the original port crashed with audio enabled.
I suspect that this was because the SDL2 headers didn't match between
the host and target system. Now that we properly use target's headers
this is no longer an issue so I enabled audio:

https://www.youtube.com/watch?v=ZTFvrcpZjY8
2021-04-14 22:43:13 +02:00
Linus Groh
51a5427419 LibJS: Improve Reference::get() TypeError message for nullish base
"ToObject on null or undefined" is useless.
"Cannot get property 'foo' of undefined" isn't.
2021-04-14 22:37:12 +02:00
Linus Groh
73a92c79b8 LibJS: Use reference in MemberExpression::execute()
This was basically duplicated code.
2021-04-14 22:37:12 +02:00
daniel eliad
b96c205c98 Tests: fixed test-crypto wrong argument order that failed -
run-tests-and-shutdown.sh
2021-04-14 22:33:50 +02:00
Brian Gianforcaro
a973b22359 Kernel: Suppress maybe-uninitialized' warning s_syscall_table in gcc-10.3.0 2021-04-14 21:49:54 +02:00
Brian Gianforcaro
8d70bead20 Build: Update toolchain include path to gcc 10.3.0 2021-04-14 21:49:54 +02:00
Brian Gianforcaro
73fab93ef5 Toolchain: Update to the latest gcc release 10.3.0
10.3.0 is a bugfix release, with 178 bugs fixed.
See: https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=10.3
2021-04-14 21:49:54 +02:00
Brian Gianforcaro
5d59affc18 Toolchain: Update binutils to version to latest 2.36.1 release
This updates binutils to the latest release. It looks like some
lines where shuffled around, so I had to fixup out patch to
apply cleanly again.
2021-04-14 21:49:54 +02:00
Brendan Coles
d65e74bffa Ports: Add emu2 DOS emulator 2021-04-14 21:48:55 +02:00
Gunnar Beutner
6ac7d946be Ports: Don't export the DESTDIR variable by default
Exporting DESTDIR interferes with cmake-based ports:

Install the project...
-- Install configuration: ""
-- Up-to-date: /home/gunnar/serenity/Build/i686/Root/home/gunnar/serenity/Build/i686/Root/usr/lib/libSDL2.a
-- Up-to-date: /home/gunnar/serenity/Build/i686/Root/home/gunnar/serenity/Build/i686/Root/usr/lib/libSDL2-2.0.a
-- Up-to-date: /home/gunnar/serenity/Build/i686/Root/home/gunnar/serenity/Build/i686/Root/usr/lib/libSDL2main.a
-- Up-to-date: /home/gunnar/serenity/Build/i686/Root/home/gunnar/serenity/Build/i686/Root/usr/lib/cmake/SDL2/SDL2Targets.cmake
2021-04-14 21:46:20 +02:00
Gunnar Beutner
b02f215ca7 Ports: Remove obsolete patch for tr
The tr port had its own ctype functions. With the recent LibC
changes these are no longer necessary.
2021-04-14 21:46:20 +02:00
Gunnar Beutner
f0b34277bb Ports: Fix building the mrsh port 2021-04-14 21:46:20 +02:00
Gunnar Beutner
1e1de4a542 LibC: Use __inline_isascii() in isascii() 2021-04-14 21:46:20 +02:00
Gunnar Beutner
3df7f868e8 LibC: Add support for isblank() 2021-04-14 21:46:20 +02:00
Gunnar Beutner
097901818e Ports: Fix building the dash port 2021-04-14 21:46:20 +02:00
Gunnar Beutner
80af81bab6 Ports: Fix building the nano port 2021-04-14 21:46:20 +02:00
Gunnar Beutner
86189bd93b Ports: Link libarchive against pcre because the system's libregex doesn't support re_nsub 2021-04-14 21:46:20 +02:00
Gunnar Beutner
97471030e7 Ports: Add port for pcre 2021-04-14 21:46:20 +02:00
Gunnar Beutner
f5ccecacc5 Ports: Remove obsolete _SC_CLK_TCK patch for hatari 2021-04-14 21:46:20 +02:00
Gunnar Beutner
75d774ba29 LibC: Add missing macro for _SC_CLK_TCK 2021-04-14 21:46:20 +02:00
Gunnar Beutner
27befa6595 Ports: Fix building the ninja port
The build failed because the main symbol has hidden visibility.
2021-04-14 21:46:20 +02:00
Gunnar Beutner
509c5c6577 Ports: Add nethack 2021-04-14 21:46:20 +02:00
Gunnar Beutner
5a4206ef2e LibC: Turn regex_t and regmatch_t into typedefs
According to POSIX.1-2001 these should be anonymous structs with
a typedef.
2021-04-14 21:46:20 +02:00
Gunnar Beutner
546fa8cfb5 LibC: Change return type for sleep() to unsigned int
According to POSIX.1-2001 the return type should be unsigned int.
2021-04-14 21:46:20 +02:00
Gunnar Beutner
6a808d96b5 Ports: Add port for libicu
I was trying to port openttd which I ultimately gave up on because
too much of the C++ standard library's functionality is missing at this
point. The libicu library was a dependency for that.

In its current state the libicu port is not thread-safe because of
missing functionality in the C++ standard library (mainly std::mutex,
std::condition_variable, etc.).
2021-04-14 21:46:20 +02:00
Gunnar Beutner
28b3c8bc1d Port: Support running some configure/build commands with the host toolchain
This is useful for ports which depend on running tools on the host system.
In this case we can build the port twice - once for the host and once for
the target system.
2021-04-14 21:46:20 +02:00
Gunnar Beutner
9e9b508390 Ports: Fix building SDL2_ttf when X11 headers are installed on the host system 2021-04-14 21:46:20 +02:00
Gunnar Beutner
8874b4b4fe Ports: Make sure pkg-config only picks up packages from the target 2021-04-14 21:46:20 +02:00
Andreas Kling
d8787e0e12 Chess: Alt shortcuts and book title capitalization in menus 2021-04-14 21:32:37 +02:00
Andreas Kling
cfe7f6fe50 Pong: Alt shortcuts in top-level menus 2021-04-14 21:25:02 +02:00
Andreas Kling
8529053ffe 2048: Alt shortcuts and book title capitalization in menus 2021-04-14 21:25:02 +02:00
Timothy Flynn
858ba11aef Browser: Respect the HttpOnly flag when storing cookies 2021-04-14 16:07:46 +02:00
Timothy Flynn
c00760c5f9 Browser+LibWeb+WebContent: Track the source of document.cookie requests
To implement the HttpOnly attribute, the CookieJar needs to know where a
request originated from. Namely, it needs to distinguish between HTTP /
non-HTTP (i.e. JavaScript) requests. When the HttpOnly attribute is set,
requests from JavaScript are to be blocked.
2021-04-14 16:07:46 +02:00
Timothy Flynn
7193e518d1 Browser+LibWeb: Move the cookie structure into LibWeb 2021-04-14 16:07:46 +02:00
Timothy Flynn
c2d38abe6f Browser+LibWeb: Move cookie parser into LibWeb
This moves the cookie parsing steps out of CookieJar into their own file
inside LibWeb. It makes sense for the cookie structures to be in LibWeb
for a couple reasons:

1. There are some steps in the spec that will need to partially happen
   from LibWeb, such as the HttpOnly attribute.
2. Parsing the cookie string will be safer if it happens in the OOP tab
   rather than the main Browser process. Then if the parser blows up due
   to a malformed cookie, only that tab will be affected.
3. Cookies in general are a Web concept not specific to a browser.
2021-04-14 16:07:46 +02:00
Idan Horowitz
7702a3fe29 Meta: Increase discord notification's check interval to 100 seconds
Since our tests usually take at least 10 minutes theres no point in
checking every 10 seconds, and github was starting to complain about
the very high API usage.
2021-04-14 14:57:37 +02:00
Idan Horowitz
ba77b40808 LibJS: Implement the encode/decodeURI(Component) family of functions
These are generally useful and in particular needed for twitter.com
2021-04-14 13:30:10 +02:00