Commit graph

24009 commits

Author SHA1 Message Date
Sam Atkins
776b1f4548 LibWeb: Make CSS::Selector reference counted
The end goal is to make the PseudoClass::not_selector be a Selector
instead of a String that is repeatedly re-parsed. But since Selector
contains a Vector of ComplexSelectors, which each have a Vector of
SimpleSelectors, it's probably a good idea to not be passing them
around by value anyway. :^)
2021-07-14 13:31:00 +02:00
Sam Atkins
8cae79cc8d LibWeb: Add 'PseudoElement' as a CSS SimpleSelector::Type
Same reasoning again! This is the last one.

While I was at it, I added the two remaining CSS2.2 pseudo-elements,
::first-line and ::first-letter. All 4 are handled in the new CSS
parser, including with the compatibility single-colon syntax. I have
not added support to the old parser.
2021-07-14 13:31:00 +02:00
Sam Atkins
4af7d41879 LibWeb: Add 'PseudoClass' as a CSS SimpleSelector::Type
Same reasoning as the previous commit.
2021-07-14 13:31:00 +02:00
Sam Atkins
96b2356cbb LibWeb: Add 'Attribute' as a CSS SimpleSelector::Type
Previously, SimpleSelectors optionally had Attribute-selector data
as well as their main type. Now, they're either one or the other,
which better matches the spec, and makes parsing and matching more
straightforward.
2021-07-14 13:31:00 +02:00
Sam Atkins
dadcb46344 LibWeb: Convert CSS Dump, Selector, & SelectorEngine to east const 2021-07-14 13:31:00 +02:00
Daniel Bertalan
cd55b817cf LibJS: Use AK::abs in TimeZone
This fixes a `-Wabsolute-value` warning emitted because of our use of
`abs()` on arguments of type `long long`.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
6821cd45ed Tests: Fix compile errors on Clang
Since Clang enables a couple of warnings that we don't have in GCC,
these were not caught before. Included fixes:

- Use correct printf format string for `size_t`
- Don't compare Nonnull(Ref|Own)Ptr` to nullptr
- Fix unsigned int& => unsigned long& conversion
2021-07-14 13:12:25 +02:00
Daniel Bertalan
a88f7c99fe LibC: Use our implementation of crti.o and crtn.o
We have had these for quite a while, but we didn't compile them, and
used GCC's version instead. Clang does not come with these, so we have
to provide our own implementation.

Our implementation follows what `musl` and `FreeBSD` do, so this should
work fine, even if documentation can hardly be found for them.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
7f2eb2f332 Meta: Remove obsolete -fconcepts CFLAG
The GCC documentation says that since it's officially a part of C++20,
this flag does nothing. Clang, however, does complain that it does not
recognize it, so it's better to just remove it.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
11a945a499 LibWeb: Add missing typeinfo include
This code worked with GCC because libstdc++ pulls in `type_info`'s
definition through the `cxxabi` header included by `AK/Demangle.h`.

In contrast, `libc++` only forward-declares it, so this code failed to
compile with it.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
ef40de9c6c Kernel: Don't mix AT&T and Intel ASM syntax in boot.S
The rest of the file is in AT&T syntax, so for the time being, I'll
switch these instructions to AT&T too to make Clang shut up.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
b847541ee8 Kernel: Allow passing null pointer to delete
The C++ standard says that it's legal to call the `delete` operator with
a null pointer argument, in which case it should be a no-op. I
encountered this issue when running a kernel that's compiled with Clang.
I assume this fact was used for some kind of optimization.
2021-07-14 13:12:25 +02:00
Daniel Bertalan
bb26cea291 WindowServer: Don't use GNU-style designator
Clang throws a fit when it encounters this code, since we already have
the standardized designated initializer syntax in C++20, which we should
use.
2021-07-14 13:12:25 +02:00
jakubiakdev
4a396dc7e8 Base+LibGUI: Add icon to the Rename action 2021-07-14 13:05:01 +02:00
x-yl
6b68f16f2c Meta: Change QEMU options in run.sh to use SPICE
If QEMU has the qemu_vdagent chardev (should be present in QEMU 6.1)
then we use that as the SPICE client.

If qemu_vdagent is not present, no SPICE client will be launched by
default because it makes the display a bit choppy.

Set SERENITY_SPICE to override the default behavior and use your default
SPICE client.
2021-07-14 12:33:07 +02:00
x-yl
c8b13bd053 SpiceAgent: Support copying and pasting images 2021-07-14 12:33:07 +02:00
x-yl
d4bb6a1a1e SpiceAgent: Add a new spice agent service :^)
A SPICE agent communicates with the host OS to provide nifty features
like clipboard sharing :^)

This patch implements only plain-text clipboard sharing.

See: github.com/freedesktop/spice-protocol/blob/master/spice/vd_agent.h
2021-07-14 12:33:07 +02:00
x-yl
42c5df7256 Kernel: Fix inverted check in VirtIOConsolePort
We should really only try to open if we're closed. Oops :P
2021-07-14 12:33:07 +02:00
Tom
d7e5521a04 Kernel: Ignore subsequent calls to Process::die
It's possible that another thread might try to exit the process just
about the same time another thread does the same, or a crash happens.
Also, we may not be able to kill all other threads instantly as they
may be blocked in the kernel (though in this case they would get killed
before ever returning back to user mode. So keep track of whether
Process::die was already called and ignore it on subsequent calls.

Fixes #8485
2021-07-14 12:30:41 +02:00
Timothy
3cc0283eac LibCore: Convert File to east-const style 2021-07-14 14:35:16 +04:30
Timothy
068802d58d LibCore: Add File method to determine absolute path
This will generate absolute paths lexically rather than through a call
to realpath. The motivation for this is to generate absolute paths for
non-existent files in unveil calls, as realpath will not work if the
file does not exist.
2021-07-14 14:35:16 +04:30
Timothy
3ae64c7c3d LibCore: Add File method to determine current working directory 2021-07-14 14:35:16 +04:30
TheFightingCatfish
a3400798f8 Utilities: Add an implementation of 'comm'
Add an implementation of 'comm' -- compare files line by line
2021-07-14 14:13:25 +04:30
JJ Roberts-White
74f1f2b5e2 Piano: Add Play/Pause, Forward and Back buttons
Piano now has a toolbar allowing the playback to be paused,
or to be stepped forward or back a note.
2021-07-14 12:07:43 +04:30
Hendiadyoin1
54c005754a UserpaceEmulator: Handle possibly unaligned IO
We also should add some UB warnings for that in the future
2021-07-14 11:26:34 +04:30
Hendiadyoin1
d761c5024b AK: Generalize ByteReader
Also use it instead of CPU.h's possibly_unaligned_data interface
2021-07-14 11:26:34 +04:30
Hendiadyoin1
b98e741237 Tests: Change test-filtering mechanism
We have a new config argument to add space separated exclude regex'
This is separate from "NotTestsPattern", because these are still Tests,
although they are not supposed to be run by the runner

This also adds the test for a working UserspaceEmulator to the tests run
2021-07-14 11:26:34 +04:30
Hendiadyoin1
3cc59f6454 Tests: Rename write-oob
The "ue-" prefix makes it clearer that it should be run with the
UserspaceEmulator
2021-07-14 11:26:34 +04:30
Hendiadyoin1
bdde44a833 Tests: Assure that UE does not regress via ue ls 2021-07-14 11:26:34 +04:30
brapru
5b6d2644bc LibCore: Generate new passwd file by checking pw_name
LibCore::Account::generate_passwd_file should follow
generate_shadow_file by conditionally checking for the username.
Previously, usermod's set_uid changes would not reflect in the updated
passwd file as m_uid had already been changed to the updated value.
2021-07-14 08:06:30 +02:00
brapru
9b5a1b5036 Utilities: Implement usermod command
Previously there was no way to modify existing user accounts.
2021-07-14 08:06:30 +02:00
brapru
6ef6bd1ccb LibCore: Add setters for all user account properties 2021-07-14 08:06:30 +02:00
Joachim Le Fournis
1420549abf Ports: Add epsilon 15.5.0 2021-07-14 05:27:25 +02:00
Andreas Kling
c42807e3dc Kernel: Remove debug spam when PhysicalRegion::take_free_page() fails
We can have multiple PhysicalRegions (often the case when there is a
huge amount of RAM) so we really shouldn't print a debug message any
time someone tries to allocate from one. They will move on to another
region anyway.
2021-07-14 01:37:31 +02:00
Andreas Kling
5c24d18923 Kernel: Fix logic error in PhysicalRegion::contains()
This was incorrectly returning true for the address one byte past the
end of the region.
2021-07-14 01:37:19 +02:00
Andreas Kling
6cc1247395 Kernel: Cut allocation size for physical buddy bitmaps in half
We were allocating twice as much memory as we needed for these bitmaps
due to a silly typo. Found by tomuta trying to boot with 24 GiB of RAM.
2021-07-13 23:47:49 +02:00
pancake
eb7b755937 Ports: Add vlang weekly.2021.28 package 2021-07-13 23:30:59 +02:00
ForLoveOfCats
60713c5fcf KeyboardPreferenceLoader: Use correct default Num Lock config value 2021-07-13 23:25:07 +02:00
Liav A
11fe38346c Meta: Remove options of explicit command line runners in run script
Let's remove the qcmd and q35_cmd options and instead have a simple
"q35" run option. Specifiying the kernel command line was a neat trick
I personally used for many debug sessions, but it seems better to stick
to setting it internally in the kernel or modifying the shell
SERENITY_KERNEL_CMDLINE environment variable to do this.
2021-07-13 23:24:16 +02:00
Liav A
c92c944356 Meta: Tweak qemu run script to use pcie-root-ports
With this change, we use 6 PCIe root ports in the Q35 machine, and plug
the bochs-display device into one of those PCIe ports.
We plug the bochs-display as function 0 of that device, because
otherwise SeaBIOS and also the kernel will not detect its presence.
2021-07-13 23:24:16 +02:00
LuK1337
62c5a5351c LibGUI: Handle KeyDown when checking for Key_Escape in Dialog too
This makes 'escaping' the dialogs seem bit faster :^)
It also follows what RunWindow and probably others do.
2021-07-13 23:23:49 +02:00
Andreas Kling
d8ff46594a Kernel: Re-add accidentally removed friendship
PageDirectory and MemoryManager need to remain friends, for now..
2021-07-13 23:21:22 +02:00
Gunnar Beutner
2fc002f778 DynamicLoader: Add RELA support for self-relocations
GCC doesn't seem to rely on those to work, but Clang does.
2021-07-13 23:20:36 +02:00
Itamar
42eb06f045 LibCpp: Don't store entire ASTNode vector in each parser state
We previously stored the entire ASTNode vector in each parser state,
and this vector was copied whenever a state was loaded or saved.

We don't actually need to store the whole nodes list in each state
because a new state can only add new nodes to this list, and won't
mutate existing nodes.

It would suffice to only hold a vector of the nodes that were created
while parsing in the current state to keep a reference to them.

This reduces the time it takes on my machine for the c++ language
server to handle a file that #includes <LibGUI/Widget.h> from ~4sec to
~0.7sec.
2021-07-13 23:20:09 +02:00
Itamar
eb6a15d52b LibCpp: Only store error messages for the main parser state
There's no need to store parser error messages for states with
depth > 0, as they will eventually be popped from the states stack and
their error messages will never be displayed to the user.

Profiling shows that this change reduces the % of backtraces that
contain the store_state & load_state functions from ~95% to ~70%.

Empirically this change reduces the time it takes on my machine for the
c++ language server to handle a file that #includes <LibGUI/Widget.h>
from ~14sec to ~4sec.
2021-07-13 23:20:09 +02:00
Gunnar Beutner
2c41e89d08 LibDebug: Implement symbolication for x86_64 2021-07-13 23:19:33 +02:00
Gunnar Beutner
567fa4b2f0 LibDebug: Fix spelling mistake 2021-07-13 23:19:33 +02:00
Gunnar Beutner
4cf24c6ba2 Userland: Prefer using ARCH() over __LP64__ 2021-07-13 23:19:33 +02:00
Andreas Kling
de4ba1f39b Kernel: Remove some friendships and make some classes non-copy/moveable 2021-07-13 23:19:00 +02:00
Andreas Kling
424afdd72b Kernel: Remove some unnecessary includes in VM/Physical* 2021-07-13 23:11:06 +02:00