Commit graph

34385 commits

Author SHA1 Message Date
Andreas Kling
3c108e20a7 PixelPaint: Run gml-format on FilterGallery.gml 2022-02-12 22:30:50 +01:00
Brian Gianforcaro
01cd838a4c Meta: Suppress rule V1076 in PVS-Studio Static Analysis
This rule attempts to flag invisible Unicode characters which would
potentially be used by an attacker to hide code that humans can't see.
https://pvs-studio.com/en/docs/warnings/v1076/

AKA the "Trojan Source" attack: https://arxiv.org/abs/2111.00169

Unfortunately our `LibUnicode` source code contains these hidden
characters as they are part of the Unicode character set that the
library exposes. So we have, and will always have 100s of false
positives.
2022-02-12 19:32:47 +02:00
Luke Wilde
d1c4a94659 LibWeb: Fix comparing current position to quote in Mime Type quote parse
Had a look over this with a fresh head and noticed I was comparing the
current lexer position to the quote character, oops!
2022-02-12 17:13:14 +00:00
Idan Horowitz
497dd5b354 LibWeb: Set response header cookies on redirects
Since we were previously relying on Document::set_cookie in order to
set cookies received as a 'Set-Cookie' response header, we would ignore
any response header cookies in redirect (status code 3xx) responses.

While this behaviour is not strictly enforced in the specification,
most major browsers do set cookies in redirect responses, and some
sites (e.g. Cookie Clicker) rely on this behaviour.

Since cookies are stored per-site and not per-document, this behaviour
is achieved by simply decoupling the cookie set mechanism from it.
2022-02-12 16:15:56 +00:00
Idan Horowitz
5e5b94a7ec LibWeb: Pass cookie string by reference in Document::set_cookie
This string is only taken by const reference internally, so there's no
point in forcing the callers to copy the string.
2022-02-12 16:15:56 +00:00
Idan Horowitz
721a4a0a67 LibWeb: Ignore Location headers unless the response status code is 3xx
As per RFC7231 the Location header field has different meanings for
different response status codes:
For 201 (Created) responses, the Location value refers to the primary
resource created by the request.
For 3xx (Redirection) responses, the Location value refers to the
preferred target resource for automatically redirecting the request.
2022-02-12 16:15:56 +00:00
Sam Atkins
a99d02e14d LibWeb: Add an enum for !important 2022-02-12 16:13:27 +00:00
Linus Groh
c08a52dd97 LibJS: Remove the name prefix for wrapped functions
This is a normative change in the ShadowRealm spec.

See: https://github.com/tc39/proposal-shadowrealm/commit/4ca634a
2022-02-12 16:06:37 +00:00
itskarudo
16aeb8b51d kill: Parse CLI arguments using Arguments.strings
The previous implementation used argv and LibC to parse arguments,
it now uses the Arguments.strings interface to do so.
2022-02-12 10:53:07 -05:00
itskarudo
500098c76d kill: Port to LibMain 2022-02-12 10:53:07 -05:00
Aatos Majava
c23d25d1de FileManager: Add F6 alternate shortcut to "location" action
This mirrors the behaviour in Browser.
2022-02-12 09:06:23 -05:00
Luke Wilde
28f0193d9b LibWeb: Decode XHR text with the specified charset in the MIME type
The MIME type can come from either the Content-Type header in the
response header list, or the overridden MIME type passed into
overrideMimeType()

This is required by Google Maps, which downloads blobs encoded
in x-user-defined format.
2022-02-12 12:53:28 +01:00
Luke Wilde
0e0f98a45e LibTextCodec: Add x-user-defined decoder
It's a pretty simple charset: the bottom 128 bytes (0x00-0x7F) are
standard ASCII, while the top 128 bytes (0x80-0xFF) are mapped to a
portion of the Unicode Private Use Area, specifically 0xF780-0xF7FF.

This is used by Google Maps for certain blobs.
2022-02-12 12:53:28 +01:00
Luke Wilde
835a344337 LibTextCodec: Add decoder function that overrides given decoder on BOM
This functions takes a user-provided decoder and will only use it if no
BOM is in the input.

If there is a BOM, it will ignore the given decoder and instead decode
the input with the appropriate Unicode decoder for the detected BOM.

This is only to be used where it's specifically needed, for example XHR
uses this for compatibility with deployed content. As such, it has an
obnoxious name to discourage usage.
2022-02-12 12:53:28 +01:00
Luke Wilde
94965ba28d LibTextCodec: Add BOM sniffer
This takes the input and sniffs it for a BOM. If it has the UTF-8 or
UTF-16BE BOM, it will return their respective decoder. Currently we
don't have a UTF-16LE decoder, so it will assert TODO if it detects
a UTF-16LE BOM. If there is no recognisable BOM, it will return no
decoder.
2022-02-12 12:53:28 +01:00
Luke Wilde
4ccade42b7 LibWeb: Implement XMLHttpRequest.overrideMimeType
This allows you to ignore the Content-Type returned by the server and
always parse the content as if it's the given MIME type.

This will currently be used for allowing you to override the charset
of text responses.
2022-02-12 12:53:28 +01:00
Luke Wilde
8cfeca5261 LibWeb: Implement spec-compliant MIME type struct and parser
This will be used by XHR to extract the Content-Type MIME type to
retrieve the charset.
2022-02-12 12:53:28 +01:00
Itamar
2903c47ba0 Utilities: Add update-cpp-test-results utility
This is a small utility that updates the target tests results for the
LibCpp parser and preprocessor regression tests.

It's handy to run after changing something in the output of either the
parser or the preprocessor.
2022-02-12 11:45:15 +00:00
snooze
e9d3f3793c PixelPaint: Add a preview in FilterGallery
Now FilterGallery shows the preview of the currently selected filter
applied on the currently active layer
2022-02-12 12:21:35 +01:00
Ali Mohammad Pur
44cf3ac60f Ports: Add a citron port
This disables the GC, so the REPL doesn't run, but basic programs do
work.
2022-02-12 12:16:59 +01:00
Ali Mohammad Pur
ae68d1f865 strace: Add a chdir formatter 2022-02-12 12:16:59 +01:00
Ali Mohammad Pur
b0efca5742 Ports: Add a sparsehash port 2022-02-12 12:16:59 +01:00
Ali Mohammad Pur
18f68d1aea LibC: Stub out fmemopen() 2022-02-12 12:16:59 +01:00
Ali Mohammad Pur
aaa52da97d Ports: Add a pre_install hook 2022-02-12 12:16:59 +01:00
Ali Mohammad Pur
99f9860854 LibPthread: Add PTHREAD_CANCELED
This is just the expected return value of pthread_join() when it fails.
2022-02-12 12:16:59 +01:00
serenitydev
8c29cc879d LibWeb: Add support for 'arraybuffer' message types on WebSockets 2022-02-12 12:16:02 +01:00
Liav A
32053e8f25 Kernel: Increase attempts count when waiting before doing i8042 IO
Apparently on VirtualBox the keyboard device refused to complete the
reset sequence. With longer delays and more attempts before giving up,
it seems like the problem is gone.
2022-02-12 12:04:31 +01:00
Liav A
0881a7be8d Kernel: Increase delay and attempts count when checking i8042 existence 2022-02-12 12:04:31 +01:00
Itamar
506c13d143 HackStudio: Put the Build directory inside the Serenity repository
Previously, the build directory for building serenity components was a
temporary directory in /tmp which was generated whenever a different
serenity component was built.

Instead of doing that, Hack Studio now simply uses the Build/ directory
inside the Serenity repository, similar to what is done in host builds.

This makes it so we don't re-build when switching back and forth between
different components.
It also makes it easier to inspect the build products.
2022-02-12 11:51:48 +01:00
Lady Gegga
83688d0610 Base: Add Cypro-Minoan characters to font Katica Regular 10
12F90-12FF2 https://www.unicode.org/charts/PDF/U12F90.pdf
2022-02-12 11:51:32 +01:00
Itamar
8bb4d46676 HackStudio: Only query token information if semantic highlighting is on 2022-02-12 11:24:32 +01:00
Guilherme Gonçalves
a456759d7a LibWeb: Ignore malformed at-rules in CSS parser
Fixes #12405.
2022-02-12 11:24:17 +01:00
electrikmilk
dece108f9a PixelPaint: Implement IconBag to organize icons
Implement IconBag method of organizing menubar icons from Browser.
2022-02-12 11:24:00 +01:00
DerpyCrabs
29078d4d53 LibWebSocket: Don't try to send empty payload inside of frame
According to RFC 6455 sections 5.5.2-5.5.3 Ping and Pong frames
can have empty "Application data" that means payload can be of size 0.
This change fixes failed "buffer.size()" assertion inside
of Core::Stream::write_or_error by not trying to send empty payload
in WebSocket::send_frame.
2022-02-12 11:12:43 +01:00
DerpyCrabs
e379147f64 LibHTTP: Make reason phrase of HTTP response's status line optional
According to rfc2616 section 6.1 the text of reason phrase is not
defined and can be replaced by server.
Some servers (for example http://linux.org.ru) leave it empty.
This change fixes parsing of HTTP responses with empty reason phrase.
2022-02-12 02:56:17 +03:30
Gaven Rendell
78ef608a6b Documentation: Add coreutils dep to Alpine Linux build instructions
`build-image-qemu.sh` depends on GNU's version of `du`:

43d706a29e/Meta/build-image-qemu.sh (L47-L48)

Alpine Linux doesn't use that version by default.
2022-02-11 23:24:25 +00:00
Wesley Moore
849f849905 LibHTTP: Remove redundant can_read_without_blocking call
When entering the InBody state LibHTTP performs a
can_read_without_blocking check, which is duplicated immediately
afterwards. This initial call is removed.
2022-02-12 02:53:57 +03:30
Wesley Moore
12ff5c9bfd LibHTTP: Remove attempt to read extra line after response headers
When LibHTTP encountered the blank line between the headers and the body
in a HTTP response it made a call the m_socket->can_read_line(). This
ultimately tried to find a newline in the stream. If the response body
was small and did not contain a new line then the request would hang.

The call to m_socket->can_read_line() is removed so that the code is
able to progress into the body reading loop.
2022-02-12 02:53:57 +03:30
Andreas Kling
2925725c9a Meta: Add Tim Flynn to list of project maintainers :^) 2022-02-11 22:24:10 +01:00
Andreas Kling
63345c4dfc LibWeb: Rename Layout::Box absolute rect helpers
- padded_rect() -> absolute_padding_box_rect()
- bordered_rect() -> absolute_border_box_rect()
2022-02-11 21:57:56 +01:00
Andreas Kling
9a92236a24 LibWeb: Remove unused functions from Layout::Box 2022-02-11 21:57:39 +01:00
Sam Atkins
9dcc752bcf LibWeb: Clear the path of a SVGPathElement if the attribute changes
Otherwise, modifying the `d` attribute would not cause any visual
changes to the path.
2022-02-11 21:38:27 +01:00
Sam Atkins
44b64cb8b0 LibWeb: Make SVG AttributeParser::parse_path_data() static
This is mostly a style thing, but it matches the other APIs.
2022-02-11 21:38:27 +01:00
Sam Atkins
ab440b3e50 LibWeb: Use StringView instead of String in SVG::AttributeParser
This saves copying the string data, since the AttributeParser is always
temporary.
2022-02-11 21:38:27 +01:00
Sam Atkins
2fad940b0b LibWeb: Add SVG <polygon> element and test case :^) 2022-02-11 21:38:27 +01:00
Sam Atkins
116a1f485c LibWeb: Add SVG <polyline> element and test case :^) 2022-02-11 21:38:27 +01:00
Sam Atkins
17912330c4 LibWeb: Add SVG <line> element and test case :^) 2022-02-11 21:38:27 +01:00
Sam Atkins
3a1a35ef8f LibWeb: Add SVG <ellipse> element and test case :^) 2022-02-11 21:38:27 +01:00
Sam Atkins
21bdcee3c3 LibWeb: Add SVG <circle> element and test case :^) 2022-02-11 21:38:27 +01:00
Sam Atkins
1dde6a0a2b LibWeb: Add SVG <rect> element and test case :^) 2022-02-11 21:38:27 +01:00