Commit graph

16564 commits

Author SHA1 Message Date
Ben Wiederhake
cc89606ba8 Everywhere: Remove unnecessary headers 3/4
Arbitrarily split up to make git bisect easier.

These unnecessary #include's were found by combining an automated tool (which
determined likely candidates) and some brain power (which decided whether
the #include is also semantically superfluous).
2021-02-08 18:03:57 +01:00
Ben Wiederhake
fa2b5ca6f6 Everywhere: Remove unnecessary headers 2/4
Arbitrarily split up to make git bisect easier.

These unnecessary #include's were found by combining an automated tool (which
determined likely candidates) and some brain power (which decided whether
the #include is also semantically superfluous).
2021-02-08 18:03:57 +01:00
Ben Wiederhake
c9bb887c55 Everywhere: Remove unnecessary headers 1/4
Arbitrarily split up to make git bisect easier.

These unnecessary #include's were found by combining an automated tool (which
determined likely candidates) and some brain power (which decided whether
the #include is also semantically superfluous).

My favorite #include:

    #include "Applications/Piano/Music.h" // You can't have too much music in life!
2021-02-08 18:03:57 +01:00
Ben Wiederhake
0a2304ba05 Everywhere: Fix weird includes 2021-02-08 18:03:57 +01:00
Ben Wiederhake
6e9fa350bc Fuzz: Remove unused FuzziliJS header 2021-02-08 18:03:57 +01:00
Ben Wiederhake
7961e09c29 Everywhere: Add semantically-missing includes
For example, FindInFilesWidget.h mentions GUI::TableView, but did not include
it. On the other hand, all source files that include FindInFilesWidget.h
also include TableView.h, so the issue is only cosmetical.
2021-02-08 18:03:57 +01:00
Ben Wiederhake
667b417d9f AK: remove unused and uninteresting return value
The return value is always be 'count', even in the case of 0.

Note that the return value of TypedTransfer::copy() is likewise uninteresting,
but apparently it is beig used. Hence this patch does not touch it.
2021-02-08 18:03:57 +01:00
Ben Wiederhake
71219b8a1d Documentation: QtCreator and <syscall.h> 2021-02-08 18:03:57 +01:00
Ben Wiederhake
897d3d78b9 Documentation: Update QtCreator includes for Debug.h
Including 'Build/' is unfortunate, but this seems to be what everyone does,
short of creating a symlink/hardlink from /AK/Debug.h to /Build/AK/Debug.h.

This feels like a crutch, but it's a better crutch than having a workaround
that could easily break or corrupt commits (i.e., the symlinks).
2021-02-08 18:03:57 +01:00
Luke
3e723ec177 LibTTF: Check if the given offset plus offset table size would overflow
If it does overflow, it would think there was enough data to read in
table information, when there isn't. This would cause read buffer
overflows when reading in the table information.

Found by: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29338&sort=-opened&can=1&q=proj%3Aserenity
2021-02-08 18:01:41 +01:00
Linus Groh
83c29bd8d7 LibJS: Don't assume match for each capture group in RegExp.prototype.exec()
This was not implementing the following part of the spec correctly:

    27. For each integer i such that i ≥ 1 and i ≤ n, do
        a. Let captureI be ith element of r's captures List.
        b. If captureI is undefined, let capturedValue be undefined.

Expecting a capture group match to exist for each of the RegExp's
capture groups would assert in Vector's operator[] if that's not the
case, for example:

    /(foo)(bar)?/.exec("foo")

Append undefined instead.

Fixes #5256.
2021-02-08 18:01:23 +01:00
Tom
1d843c46eb Kernel: KResultOr can use the same storage as the object for the error
Since it can only hold either an object or an error code, we can share
the same storage to hold either.
2021-02-08 18:00:38 +01:00
Linus Groh
79bab28f5e LibWeb: Implement Element.getElementsBy{Tag,Class}Name()
Just like the Document variants, but using the given Element as
for_each_in_subtree_of_type() root.
2021-02-08 17:59:04 +01:00
Linus Groh
2a38f008bf LibWeb: Make getElementsByClassName() case-insensitive in quirks mode
From https://dom.spec.whatwg.org/#concept-getelementsbyclassname:

    The comparisons for the classes must be done in an ASCII case-
    insensitive manner if root’s node document’s mode is "quirks", and
    in an identical to manner otherwise.
2021-02-08 17:59:04 +01:00
Linus Groh
5a9094a70a LibWeb: Make getElementsByTagName() case-insensitive for HTML elements
From https://dom.spec.whatwg.org/#concept-getelementsbytagname:

    2. Otherwise, if root’s node document is an HTML document, return a
       HTMLCollection rooted at root, whose filter matches the following
       descendant elements:

       * Whose namespace is the HTML namespace and whose qualified name
         is qualifiedName, in ASCII lowercase.

       * Whose namespace is not the HTML namespace and whose qualified
         name is qualifiedName.
2021-02-08 17:59:04 +01:00
Tom
27a395d964 Kernel: Fix KResultOr copy-move from itself case
If move-assigning from itself we shouldn't do anything.
2021-02-07 23:02:57 +01:00
Tom
b22740c08e Kernel: Use KResultOr::release_value in Process::create_kernel_thread
This should avoid an unneccessary reference bump.
2021-02-07 22:25:15 +01:00
Tom
f74e31c74d Kernel: Change KResultOr::take_value to use move semantics
This may be more light weight than copying the object.
2021-02-07 22:25:15 +01:00
Andreas Kling
ad42d873e5 Kernel: Remove ancient unused Scheduler::beep() declaration 2021-02-07 20:45:09 +01:00
Andreas Kling
0d8262cbab Kernel: Remove a handful of unused things from Thread 2021-02-07 20:26:53 +01:00
Andreas Kling
2ec8b4e177 Kernel: Don't allocate kernel stack twice per thread :^) 2021-02-07 20:13:51 +01:00
Andreas Kling
33c7017f6e LibGUI: Add missing "final" in TextEditor 2021-02-07 19:32:40 +01:00
Andreas Kling
b466ede1ea Kernel: Make sure we can allocate kernel stack before creating thread
Wrap thread creation in a Thread::try_create() helper that first
allocates a kernel stack region. If that allocation fails, we propagate
an ENOMEM error to the caller.

This avoids the situation where a thread is half-constructed, without a
valid kernel stack, and avoids having to do messy cleanup in that case.
2021-02-07 19:27:00 +01:00
Andreas Kling
5c45b0d32d Kernel: Combine Thread::backtrace() and backtrace_impl() into one 2021-02-07 19:27:00 +01:00
Andreas Kling
fd3eca3acc Kernel: Add initializer for Thread::m_tss 2021-02-07 19:27:00 +01:00
Andreas Kling
5c1c82cd33 Kernel: Remove unused function Process::backtrace() 2021-02-07 19:27:00 +01:00
Andreas Kling
b1813e5dae Kernel: Remove some unused declarations from Process 2021-02-07 19:27:00 +01:00
Brian Gianforcaro
489fe9b66a Meta: Fix path to kernel binary in debug-kernel.sh
This appears to have been broken since the migration to cmake.
2021-02-07 19:13:10 +01:00
Andreas Kling
50308f6fda Shell: Move Shell syntax highlighter LibShell 2021-02-07 17:07:33 +01:00
Andreas Kling
ddbf20ecf6 LibSyntax+LibGUI+LibJS: Move JS syntax highlighter to LibJS
This is a little bit messy but the basic idea is:

Syntax::Highlighter now has a Syntax::HighlighterClient to talk to the
outside world. It mostly communicates in LibGUI primitives that are
available in headers, so inlineable.

GUI::TextEditor inherits from Syntax::HighlighterClient.

This let us to move GUI::JSSyntaxHighlighter to JS::SyntaxHighlighter
and remove LibGUI's dependency on LibJS.
2021-02-07 16:56:02 +01:00
Andreas Kling
22baa5e64f LibGfx: Make Palette::color(ColorRole) inline 2021-02-07 16:53:39 +01:00
Andreas Kling
767ff06f56 LibGfx: Make Color(NamedColor) inline and constexpr 2021-02-07 16:51:17 +01:00
Andreas Kling
43c7d7d285 LibSyntax: Move GUI::Highlighter to Syntax::Highlighter in LibSyntax
This is a move towards dropping more LibGUI dependencies.
2021-02-07 15:15:10 +01:00
Andreas Kling
ff2438e0ce LibGUI+LibCpp: Move C++ syntax highlighter to LibCpp
This makes LibGUI not depend on LibCpp.
2021-02-07 14:40:36 +01:00
Andreas Kling
b1f1f5afcf DynamicLoader: Remove unnecessary math functions
These are provided by libgcc.
2021-02-07 14:21:53 +01:00
AnotherTest
6985b4008a LibLine: Place the search editor prompt at the right line after ^L
...as the search editor prompt has to always stay after the main prompt preview.
2021-02-07 13:12:56 +01:00
AnotherTest
3a231c00aa LibLine: Close the search editor when it's interrupted
Fixes #5233.
2021-02-07 13:12:56 +01:00
AnotherTest
5204c9062c Shell: Make history index values not fitting in i32 a syntax error
A continuation of e3ec759.
Also found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30405
2021-02-07 13:12:56 +01:00
DragonAlex98
885974fc3c
WindowServer: Don't close menu when clicking on item with submenu (#5239)
When clicking on a menu item with a submenu, don't close the menu.
2021-02-07 12:28:42 +01:00
Brian Gianforcaro
d107cabf5d Ports: Fix linking of the stress-ng port 2021-02-07 12:16:37 +01:00
Andreas Kling
0eac44af49 LibWeb: Don't assert on <colgroup> & friends
Let's just construct a placeholder BlockBox layout node for now.

Fixes #5081.
2021-02-07 11:47:33 +01:00
Andreas Kling
796c31a52b LibWeb: Reorganize Element::create_layout_node() into a switch
This allows us to see which CSS::Display types are not yet handled.
2021-02-07 11:40:42 +01:00
Andreas Kling
e6712fcd82 LibWeb: Use any_of() for DOM::Element::has_class() 2021-02-07 11:35:26 +01:00
Andreas Kling
7c6de80e81 AK: Publish AK::any_of by default 2021-02-07 11:35:08 +01:00
Andreas Kling
330c3fcb59 LibWeb: Use move semantics for QualifiedName more often 2021-02-07 11:20:15 +01:00
Andreas Kling
10420dee7e LibGfx: Fix global-buffer-overflow in interlaced GIF decode
Regressed with 57e10eadac and immediately
caught by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30507
2021-02-07 11:18:55 +01:00
Andreas Kling
0c66e53544 LibWeb: Honor font sizes specified by CSS
Instead of trying to coerce them into some font size we think we might
have, let's just honor the request and do our best to find a font.
2021-02-07 10:57:07 +01:00
Andreas Kling
3620a6e054 LibJS: Function must mark its home object 2021-02-07 10:57:07 +01:00
Brian Gianforcaro
c95d48c8d6 Kernel: KUBSAN implementation of returns-nonnull-attribute
This didn't find anything in the current source.
2021-02-07 10:22:03 +01:00
Andreas Kling
57e10eadac LibGfx: Don't reject valid GIF animations with interlaced frames
We were returning early from the deinterlacing loop after the very last
pass, but we should just let the outer loop finish and return instead.

This makes the Netscape animation on https://timmorgan.dev work. :^)
2021-02-07 01:21:42 +01:00