Commit graph

14422 commits

Author SHA1 Message Date
Nico Weber
7db765bb73 LibGfx: Put debug output in PNGLoader behind PNG_DEBUG 2020-11-29 21:28:44 +01:00
Andreas Kling
d0636291fe LibWeb: Resolve percentage width/height of inline-block boxes
Percentage lengths cannot be to_px()'ed directly, we have to resolve
them against a reference (the containing block) first.

Fixes #4248.
2020-11-29 21:27:41 +01:00
Linus Groh
eea7cabdbc LibRegex: Use match_ordinary_characters() in ECMA262Parser::parse_atom()
Otherwise we would only match TokenType::Char, making all of these invalid:

- /foo,bar/
- /foo\/bar/
- /foo=bar/
- /foo-bar/
- /foo:bar/

Fixes #4243.
2020-11-29 20:35:52 +01:00
AnotherTest
1279d2256c Terminal: Allow the user to configure the maximum history size
Closes #4238.
2020-11-29 20:32:45 +01:00
AnotherTest
5c8b48053e LibVT: Make terminal scrollback max size configurable 2020-11-29 20:32:45 +01:00
AnotherTest
158fe9d9ca LibRegex: Allow syntax characters (except ']') without escapes in classes
e.g. `[:]`
2020-11-29 20:32:10 +01:00
AnotherTest
b45f3ea0f8 Userland: Implement -I/-a (binary-mode) and -i (insensitive) for grep
This fixes #4195 and closes #4196.
2020-11-29 20:32:10 +01:00
AnotherTest
129a58a2e5 LibCore: Do not try to null-terminate a ByteBuffer in read_line()
That's just silly :)
Also fix that one use of read_line() which assumes it will
null-terminated in mount.cpp (this would've blown up if the IODevice was
at EOF and had a line with the same size as max_size).
2020-11-29 20:32:10 +01:00
AnotherTest
c6ca8534a6 AK: Export ShouldChomp::NoChomp too
It's much more elegant to say 'should_chomp ? Chomp : NoChomp' than to
say 'if (should_chomp) ...(..., Chomp) else ...(...)'.
2020-11-29 20:32:10 +01:00
Andreas Kling
2d9d883274 LibJS: Add a basic implementation of String.prototype.substr() 2020-11-29 20:29:49 +01:00
Luke
5c911ad4b1 Meta: Add GitHub Actions workflow for Lagom with Fuzzers
There are cases where Lagom will build with GCC but not Clang.
This often goes unnoticed for a while as we don't often build with
Clang.

However, this is now important to test in CI because of the
OSS-Fuzz integration.

Note that this only tests the build, it does not run any tests.
Note that it also only builds LagomCore, Lagom and the fuzzers.
It does not build the other programs that use Lagom.
2020-11-29 20:22:56 +01:00
Luke
d7455018eb LibGfx: gamma_to_linear4 is not a valid constexpr on clang 10 and below
This is a hack which can be removed once GitHub Actions changes the
default version to clang 11.

This is apparently sometime in mid-December.

Note, clang-11 is not currently available on Ubuntu 20.04. However,
GitHub Actions uses 20.04, which probably means clang-11 will
become available around that time for all 20.04 users.
2020-11-29 20:22:56 +01:00
Luke
72abf3491b LibCrypto: Require intent parameter in CTR constructor
This was preventing clang from building.
2020-11-29 20:22:56 +01:00
Nico Weber
29e4dc7634 Lagom: Mention OSS-Fuzz in ReadMe
We added OSS-Fuzz integration in #4154, but documentation about it
is spread across several pull requests, IRC, and issues. Let's collect
the important bits in the ReadMe.
2020-11-29 20:22:09 +01:00
Nico Weber
1f22a59f9d LibGfx: Don't assert on files ending right before lzw_min_code_size
Not yet found by oss-fuzz, but I hit it a while ago when running
FuzzGIFLoader locally.
2020-11-29 20:21:30 +01:00
Nico Weber
86cec77eb5 LibGfx: skip zero-width frames
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27913
and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27873
2020-11-29 20:21:30 +01:00
Andreas Kling
2e4832c3da LibJS: Constructor function's "prototype" property should be writable
This matches other engines.
2020-11-29 19:49:27 +01:00
Andreas Kling
01c8765519 LibJS+LibWeb: Log JavaScript exceptions raised by web content
Instead of hiding JS exceptions raised on the web, we now print them to
the debug log. This will make it a bit easier to work out why some web
pages aren't working right. :^)
2020-11-29 16:50:32 +01:00
Andreas Kling
2dd03a4200 LibWeb: Abort event handling if underlying layout tree disappears
We didn't notice that the layout tree had disappeared after dispatching
a mousedown event, because we only checked EventHandler::layout_root()
which happily returned the *new* layout tree after a window.reload().

This patch fixes that by verifying that the frame is still showing the
same DOM's layout tree after event dispatch.

Fixes #4224.
2020-11-29 16:43:12 +01:00
Andreas Kling
4ebb57298b LibWeb: Allow building partial layout trees
We can now build partial layout trees (this happens for example when an
element's "display" property is programmatically toggled from "none" to
something else.)
2020-11-29 16:23:12 +01:00
Andreas Kling
127274fd42 LibWeb: Tweak a comment in Layout::TreeBuilder for accuracy 2020-11-29 16:23:12 +01:00
Andreas Kling
e424e4749f LibWeb: Allow <svg> layout boxes to have children
We can't say that "no replaced boxes can have children", since that
breaks SVG. Instead, let each LayoutNode decide whether it's allowed
to have children.

Fixes #4223.
2020-11-29 16:23:12 +01:00
AnotherTest
1ecea2f105 Lagom: Add a Shell parser fuzzer 2020-11-29 16:22:44 +01:00
AnotherTest
e4bd5a5d69 Shell: Fix some at_end() bugs and use syntax errors instead of asserting
...in cases where the assert can be directly caused by user input.
2020-11-29 16:22:44 +01:00
devashish
4d7ba50dc7 JPGLoader: Move bogus JPEGs to a different directory 2020-11-29 16:22:04 +01:00
devashish
f107c70652 JPGLoader: Use HashMap instead of Vector for storing components
The JPEG spec allows component IDs to be chosen arbitrarily from the
interval [0, 255]. Storing components in a vector corrupts the decoder
when component IDs are not in the range 0-3. Normally, encoders don't
use IDs outside of that range because JPEG doesn't support more than
4 channels. But since there is a chance that a spec compliant JPEG
would have component IDs outside of [0-3], we should consider replacing
the vector, which enforces serial component access based on component
IDs, with a HashMap<u8, ComponentSpec>.
2020-11-29 16:22:04 +01:00
devashish
0b252c31b2 AK: Add missing GenericTraits<u8>
This enables us to use keys of type u8 in HashMaps.
2020-11-29 16:22:04 +01:00
Andreas Kling
d4b2e89875 LibWeb: Blocks can have non-block (but non-inline) parents
We were messing up the box tree for tables by hoisting cells up to
become children of the table row group (instead of the table row.)

Table rows are non-block boxes, and it's fine for them to have cell
(block) children.

Fixes #4225.
2020-11-29 12:51:54 +01:00
Linus Groh
9cdc16535c Meta: Add OSS-Fuzz badge to ReadMe.md
https://google.github.io/oss-fuzz/getting-started/new-project-guide/#status-badge

> Once your project has started building, we’d love it if you added our
> badge in your project’s README. This allows you to see bugs found by
> your OSS-Fuzz integration at a glance.
2020-11-29 12:27:27 +01:00
Linus Groh
b5b4c50913 LibMarkdown: Only consider "!" a special character when followed by "["
Fixes #4220.
2020-11-29 10:45:00 +01:00
Lenny Maiorani
a34939bcd5
Tests/Kernel: Remove redundant if (#4111)
Problem:

- If `fork()` fails the system tries to call `execl()`. That will
  either succeed and replace the running process image or it will fail
  and it needs to try again. The `if` is redundant because it will
  only be evaluated if `execl()` fails.

Solution:
- Remove the `if`.
2020-11-29 10:41:02 +01:00
Brendan Coles
b9bbf377d6 AudioServer: Mixer: limit max volume to 100 2020-11-29 10:15:36 +01:00
AnotherTest
ee548ca5b9 Userland: Make mv capable of moving multiple files
Closes #4188.
2020-11-29 10:14:43 +01:00
Linus Groh
6a37285d93 Lagom: Add Regex fuzzers 2020-11-29 09:29:26 +01:00
Linus Groh
cbe4595ec2 LibRegex: Fix clang build errors 2020-11-29 09:29:26 +01:00
Linus Groh
3ac7fb9f6c LibJS: Disallow 'with' statement in strict mode 2020-11-28 20:33:41 +01:00
Andreas Kling
42b1b36eb4 LibJS: Run clang-format on WithScope.h 2020-11-28 17:36:38 +01:00
Andreas Kling
1fad95fec5 LibJS: Add a basic unit test for the "with" statement 2020-11-28 17:16:48 +01:00
Andreas Kling
9de6443ab7 LibJS: Add basic support for "with" statements
with statements evaluate an expression and put the result of it at the
"front" of the scope chain. This is implemented by creating a WithScope
object and placing it in front of the VM's current call frame's scope.
2020-11-28 17:16:48 +01:00
Andreas Kling
c3fe9b4df8 LibJS: Add a scope object abstraction
Both GlobalObject and LexicalEnvironment now inherit from ScopeObject,
and the VM's call frames point to a ScopeObject chain rather than just
a LexicalEnvironment chain.

This gives us much more flexibility to implement things like "with",
and also unifies some of the code paths that previously required
special handling of the global object.

There's a bunch of more cleanup that can be done in the wake of this
change, and there might be some oversights in the handling of the
"super" keyword, but this generally seems like a good architectural
improvement. :^)
2020-11-28 17:16:48 +01:00
Andreas Kling
e1bbc7c075 LibJS: Make JS::Value constructors take const cell pointers
Taking non-const cell pointers is asking for trouble, since passing e.g
a "const Object*" to Value(Object*) will actually call Value(bool),
which is most likely not what you want.
2020-11-28 17:16:48 +01:00
Andreas Kling
d617120499 LibJS: Parse "with" statements :^) 2020-11-28 17:16:48 +01:00
Andreas Kling
98f2da9834 LibJS: Rename Cell::visit_children() => Cell::visit_edges()
The GC heap is really a graph of cells, so "children" didn't quite feel
appropriate here.
2020-11-28 17:16:48 +01:00
Andreas Kling
97a05ac9ac LibJS: Allow Shape without a global object
It would be nice to be able to cache some shapes globally in the VM,
but then they can't be tied to a specific global object. So let's just
get rid of the requirement that shapes are tied to a global object.
2020-11-28 17:16:48 +01:00
Linus Groh
d66087ac2f LibGUI/FileIconProvider: Initialize s_filetype_image_icon
This was accidentally removed in 1c90321.
Fixes #4125.
2020-11-28 17:16:33 +01:00
Linus Groh
149b54e26f LibJS: Remove quotes from RegExpCompileError message
They look a bit out of place, especially for multi-line error messages.
2020-11-28 16:46:25 +01:00
Linus Groh
7615649fdf LibRegex: Remove trailing newline from error_string() 2020-11-28 16:46:25 +01:00
Linus Groh
ca8e5b0791 LibRegex: Don't print error message in Regex constructor
It should be up to the caller to decide what to do when parsing of the
pattern fails.
2020-11-28 16:46:25 +01:00
Sergey Bugaev
952c0dc2a0 Userland: Implement find -name clause
Closes https://github.com/SerenityOS/serenity/issues/4191
2020-11-28 14:28:58 +01:00
Andreas Kling
1abda05d38 LibGUI: Make GUI::Dialogs non-minimizable by default 2020-11-28 10:26:05 +01:00