Commit graph

31760 commits

Author SHA1 Message Date
Conor Byrne
7c6fc79c23 Documentation: Recommend using Xcode's command line tools on macOS 2021-12-27 23:26:25 +01:00
Conor Byrne
cc1b2b95f7 HackStudio: Ask to create a non-existent directory when making a project
Previously, if the parent directory didn't exist when making a project,
it would say that the creation directory was 'invalid' which isn't
necessarily true.

This patch prompts the user to ask if they would like to create the
parent directory when creating a project, instead of treating it as an
'invalid' directory.
2021-12-27 23:20:54 +01:00
Sam Atkins
5d0851cb0e LibWeb: Use start_of_input_stream_twin() for is_valid_escape_sequence()
This means we can get rid of the hacks where we were peeking a code
point instead of getting the next one so that we could peek_twin()
later. Now, we follow the spec more closely. :^)
2021-12-27 22:56:08 +01:00
Sam Atkins
269a24d4ca LibWeb: Pass correct values to would_start_an_identifier()
Same as with would_start_a_number(), we were skipping a code point.
2021-12-27 22:56:08 +01:00
Sam Atkins
bb82ee5530 LibWeb: Pass correct values to would_start_a_number()
This fixes the crash that Luke found using Domato:
```css
. foo {
    mso-border-alt: solid  .-1pt;
}
```

The spec distinguishes between "If the next 3 code points would
start..." and "If the input stream starts with..." but we were treating
them the same way, skipping the first code point in the process.
2021-12-27 22:56:08 +01:00
Sam Atkins
981badb45f LibWeb: Add CSS::Tokenizer::start_of_input_stream_[twin|triplet]()
These correspond to "If the input stream starts with..." in the spec,
which up until now we were not handling correctly, which led to some fun
bugs.

As noted, reconsuming the input code point in order to read its value is
hacky, but works. Keeping track of the current code point in Tokenizer
would be nicer, when I'm feeling brave enough to mess with it!
2021-12-27 22:56:08 +01:00
Sam Atkins
8600d89407 LibCore+Services: Make TCPServer propagate errors 2021-12-27 22:00:01 +01:00
Sam Atkins
143f820c68 TelnetServer: Port to LibMain
This is only a very basic change, since the fallible function calls are
all inside the `on_ready_to_accept` callback.
2021-12-27 22:00:01 +01:00
Sam Atkins
98c8eca70c EchoServer: Port to LibMain 2021-12-27 22:00:01 +01:00
Sam Atkins
289cf8d7ef LibCore: Add ErrorOr wrappers to socket syscalls
These are all pretty simple so I thought I would add them all in one go:

- socket()
- bind()
- listen()
- accept()
- accept4()
- connect()
- shutdown()
- send()
- sendmsg()
- sendto()
- recv()
- recvmsg()
- recvfrom()
- getsockopt()
- setsockopt()
- getsockname()
- getpeername()
- socketpair()
2021-12-27 22:00:01 +01:00
Sam Atkins
1fba221b46 LibJS: Implement console.time/timeLog/timeEnd() methods 2021-12-27 21:44:07 +01:00
Sam Atkins
2f3e24d71e LibWeb: Add rudimentary styling to <details> and <summary> 2021-12-27 21:44:07 +01:00
Sam Atkins
d702678d16 LibJS+WebContent+Browser+js: Implement console.group() methods
This implements:
- console.group()
- console.groupCollapsed()
- console.groupEnd()

In the Browser, we use `<details>` for the groups, which is not actually
implemented yet, so groups are always open.

In the REPL, groups are non-interactive, but still indent any output.
This looks weird since the console prompt and return values remain on
the far left, but this matches what Node does so it's probably fine. :^)
I expect `console.group()` is not used much outside of browsers.
2021-12-27 21:44:07 +01:00
Sam Atkins
ff5e07d718 LibJS+WebContent+js: Bring console.trace() to spec
The spec very kindly defines `Printer` as accepting
"Implementation-specific representations of printable things such as a
stack trace or group." for the `args`. We make use of that here by
passing the `Trace` itself to `Printer`, instead of having to produce a
representation of the stack trace in advance and then pass that to
`Printer`. That both avoids the hassle of tracking whether the data has
been html-encoded or not, and means clients don't have to implement the
whole `trace()` algorithm, but only the code needed to output the trace.
2021-12-27 21:44:07 +01:00
Sam Atkins
ce694490f3 LibJS+WebContent+js: Bring console.assert() to spec 2021-12-27 21:44:07 +01:00
Sam Atkins
9b78e287b0 LibJS+WebContent+js: Bring console.clear() to spec
This is identical to before, since we don't have "group stacks" yet, but
clear() now uses ThrowCompletionOr.
2021-12-27 21:44:07 +01:00
Sam Atkins
834ced82d4 LibJS+WebContent+js: Bring console.count[Reset]() to spec
The `CountReset` log level is displayed as a warning, since the message
is always to warn that the counter doesn't exist. This is also in line
with the table at https://console.spec.whatwg.org/#loglevel-severity
2021-12-27 21:44:07 +01:00
Sam Atkins
260836135a LibJS+WebContent+js: Reimplement console.log() and friends to spec
This implements the Logger and Printer abstract operations defined in
the console spec, and stubs out the Formatter AO. These are then used
for the "output a categorized log message" functions.
2021-12-27 21:44:07 +01:00
Sam Atkins
fd7163b125 WindowServer: Stop trying to close windows that are already destroyed 2021-12-27 21:27:16 +01:00
Sam Atkins
a330a070d4 WindowServer: Use is_internal() instead of checking if the client exists 2021-12-27 21:27:16 +01:00
Linus Groh
1298c27ca9 LibWeb: Implement CanvasRenderingContext2D.isContextLost()
Note that we don't implement the "context lost steps" yet, so this will
always return the initial value (false).
2021-12-27 16:43:23 +01:00
Linus Groh
2576af5db1 LibWeb: Implement CanvasRenderingContext2D.reset() 2021-12-27 16:43:23 +01:00
Linus Groh
3e0e965f24 LibWeb: Implement CanvasRenderingContext2D.restore() 2021-12-27 16:43:23 +01:00
Linus Groh
7d435b5ada LibWeb: Implement CanvasRenderingContext2D.save() 2021-12-27 16:43:23 +01:00
Linus Groh
6d50ff71de LibWeb: Encapsulate canvas drawing state in a struct
This will allow us to easily add copies of the relevant canvas drawing
state to a stack, and likewise replace the current drawing  state with
an entry from that stack.
2021-12-27 16:43:23 +01:00
Linus Groh
b32893eb54 LibWeb: Let canvas {fill,stroke}Style default to black, not transparent
I don't know if the original author simply missed this or thought the
default color of Gfx::Color is black, but this meant that drawing on a
canvas without explicitly setting a fillStyle or strokeStyle first would
be drawn in transparent color and therefore be invisible.

In the spec this is indicated by a small comment in the IDL definition:

    attribute ... strokeStyle; // (default black)
    attribute ... fillStyle; // (default black)

I'm starting to question whether Gfx::Color actually *should* have a
default constructor.
2021-12-27 16:43:23 +01:00
Linus Groh
6faaee2bc8 LibWeb: Fix copy/paste typo in CanvasRenderingContext2D::stroke_style()
This returned the fill style, not the stroke style!
2021-12-27 16:43:23 +01:00
Jesse Buhagiar
ca093f442c LibSoftGPU: Mark wrap_clamp as [[maybe_unused]]
This was breaking the fuzzer build becaues the function is not used
if the `CLAMP_DEPRECATED_BEHAVIOR` constexpr is not `true` during
compile time.
2021-12-27 15:08:19 +02:00
Ben Wiederhake
d9af659a12 Meta: Add link to awesome new meta-project from main website :^) 2021-12-27 15:06:39 +02:00
Rummskartoffel
ab2c5eebec Help: Fix memory leak given ambiguous man page title on command line
Given a command line with an ambiguous man page title, such as `$ Help
uname`, Help would find and try to open all matching pages, leading to
bad behavior such as a memory leak, flickering scrollbars, and
eventually a crash due to OOM. This commit fixes the issue by making
Help only open one page on startup.
2021-12-27 12:01:31 +01:00
Jelle Raaijmakers
b3672236bd Ports: Add Tux Racer
The patches take care of a port from SDL1 to SDL2 and replace the
keyboard mapping logic, which will otherwise take a whopping 16 GiB of
memory to run.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
02647fd485 Ports: Add Mesa GLU
This is a dependency for Tux Racer, and is compiled against Serenity's
LibGL.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
f856f49edb LibSoftGPU: Clamp to edge instead of border
According to the Khronos FAQ on texture edge sampling, the `GL_CLAMP`
option was never implemented in hardware and as such, it was
deprecated. A lot of applications and games depend on `GL_CLAMP` not
really meaning `GL_CLAMP` but `GL_CLAMP_TO_EDGE`, so we introduce an
option to toggle this behavior at compile-time.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
d9ea1fe4c9 LibGL: Implement GL_QUAD_STRIP
It seems like we can render this with `GL_TRIANGLE_STRIP`. This makes
the track marks in Tux Racer work.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
7833f25f8f LibGL: Remove stubbed border from glTexImage2D
Providing anything else than `border == 0` is deprecated and should
result in an invalid value error.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
b2e75929f4 LibGL: Implement GL_LINEAR_MIPMAP_NEAREST support 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
ccf6769d95 LibGL: Stub more API calls
These stubs are largely implemented the same: their API is exposed, but
they print to the debug console and sometimes `TODO()`. These changes
allow GLU and Tux Racer to build.

Methods stubbed:

* `glTexImage1D`
* `glTexImage3D`
* `glTexCoord2d(v)`
* `glNormalPointer`
* `glTexGen(d|f|i)`
* `glTexGenfv`
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
abecff1766 LibGL: Stub lots of map-related methods
This adds stubs for `glMap(1|2)(d|f)`, `glMapGrid(1|2)(d|f)`,
`glEvalCoord(1|2)(d|f)`, `glEvalMesh(1|2)` and `glEvalPoint(1|2)`.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
dae63352a3 LibGL: Implement glGetTexLevelParameteriv 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
d83702cb92 LibGL: Implement glRectf and glRecti 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
4a36d6b439 LibGL: Implement glMultMatrixd 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
60fa921daa LibGL: Fix GL_TRIANGLE_STRIP rendering only half its triangles
According to the documentation, we should switch around vertices every
other triangle to prevent front-face culling from removing them.

This allows Tux in Tux Racer to render correctly.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
b455e6ca0d LibGL: Stub glClear support for stencil buffer
Previously, if the client supplied `GL_STENCIL_BUFFER_BIT`, `glClear`
would return an error. Since it is a valid parameter, we now continue
and report that this parameter is unimplemented instead.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
688adba1a8 LibGL: Uncrash glMaterialf on invalid input
We should handle this in the context.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
9e9e1c7634 LibGL: Implement glColor3/4dv 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
3883b42764 LibGL: Stub GL_(UN)PACK_* context parameters
Libraries like GLU depend on their memory initialization by requesting
these parameters, so if we do not support them, segfaults will occur.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
70c6907546 LibGL: Add glext.h and lots of new defines in gl.h
These constants are used by GLU and Tux Racer.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
2ce73b31b6 LibGL: Extract platform types to glplatform.h 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
ce37c138b4 Ports: Compile SDL2_mixer with libmodplug support 2021-12-27 11:58:43 +01:00
Daniel Bertalan
dbdb6abdb9 Ports/libuv: Fix build failure due to missing statfs() function
In 43c27e8, I mistakenly deleted the patch that removed calls to the
statfs() function, which we do not have. This made building the port
with a clean source tree fail.

This commit changes `libuv` to use our statvfs() function instead.
2021-12-27 02:02:03 -08:00