Commit graph

10496 commits

Author SHA1 Message Date
Andreas Kling
3aca84a299 LibGfx: Use size_t for the Streamer offset and sizes 2020-06-10 18:59:58 +02:00
Andreas Kling
9c786cd7e0 LibWeb: Expand "background: url()" into "background-image: url()"
This gives us a yellow forehead on ACID2! :^)
2020-06-10 17:47:04 +02:00
Andreas Kling
ff6de8a169 AK: URL should urldecode data: URL payloads
Otherwise we can end up with percent-encoded nonsense in base64 data
which does not decode correctly.
2020-06-10 17:45:34 +02:00
Andreas Kling
2622ead6c6 LibWeb: Expand 2-part border-width shorthand CSS properties 2020-06-10 16:42:58 +02:00
Andreas Kling
7fe2f5f170 LibWeb: Apply style rules in order of specificity (kinda)
We now sort the matched rules by the specificity of the first selector
in them. This is not perfect, since a rule can have multiple selectors,
but it is a nice chin-related progression on ACID2. :^)
2020-06-10 16:42:36 +02:00
Andreas Kling
4e1939c635 LibWeb: Expand border-{top,right,bottom-left} CSS shorthand properties
This code is pretty rough, but it's something that will also improve
with the eventual new CSS parser.
2020-06-10 16:14:31 +02:00
Andreas Kling
2b489f492d Base: Put the ACID2 test on the browser bookmarks bar :^) 2020-06-10 16:14:09 +02:00
Andreas Kling
03da686aa2 LibWeb: Ignore backslashes (\) in attribute selectors
This makes us at least parse selectors like [foo=bar\ baz] correctly.
The current solution here is quite hackish but the real fix will come
when we implement a spec-compliant CSS parser.
2020-06-10 15:50:07 +02:00
Andreas Kling
65c4e5cacf LibWeb: Parse and match basic "contains" attribute selectors (~=) 2020-06-10 15:43:41 +02:00
Andreas Kling
a38a5d50ab LibWeb: Constrain block height by the max-height if specified 2020-06-10 15:29:11 +02:00
Andreas Kling
116cf92156 LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
2020-06-10 10:59:04 +02:00
Andreas Kling
656b01eb0f LibWeb: Rework the layout engine to use relative offsets
The box tree and line boxes now all store a relative offset from their
containing block, instead of an absolute (document-relative) position.

This removes a huge pain point from the layout system which was having
to adjust offsets recursively when something moved. It also makes some
layout logic significantly simpler.

Every box can still find its absolute position by walking its chain
of containing blocks and accumulating the translation from the root.
This is currently what we do both for rendering and hit testing.
2020-06-10 10:46:57 +02:00
Andreas Kling
e836f09094 LibWeb: Fix parser interpreting """ as "&quot"
There was a logic mistake in the entity parser that chose the shorter
matching entity instead of the longer. Fix this and make the entity
lists constexpr while we're here.
2020-06-10 10:34:28 +02:00
Andreas Kling
43951f18e7 LibGfx: Add FloatSize::to_int_size() 2020-06-10 08:49:41 +02:00
Andreas Kling
28dcef4757 LibWeb: Add LayoutTableRowGroup to implement display: table-row-group 2020-06-09 21:53:16 +02:00
Andreas Kling
b4d4d6b32a LibWeb: Add some iteration helpers to LayoutNode
- for_each_child_of_type<T>
- previous_sibling_of_type<T>
2020-06-09 21:13:16 +02:00
Sergey Bugaev
f2d40ac2b2 Base: Document new SystemServer abilities 2020-06-09 21:12:34 +02:00
Sergey Bugaev
701994bfd1 SystemServer: Add support for accepting socket connections :^)
You can now ask SystemServer to not only listen for connections on the socket,
but to actually accept them, and to spawn an instance of the service for each
client connection. In this case, it's the accepted, not listening, socket that
the service processes will receive using socket takeover.

This mode obviously requires the service to be a multi-instance service.
2020-06-09 21:12:34 +02:00
Sergey Bugaev
ac4c2f890f SystemServer: Add support for multi-instance services
For this kind of services, there's no single PID of a running instance;
there may be multiple, or no instances of the service running at any time.
No keepalive functionality is available in this mode, since "alive" doesn't
make sense for multi-instance services.

At the moment, there's no way to actually create multiple instances of
a service; this is going to be added in the next commit.
2020-06-09 21:12:34 +02:00
Sergey Bugaev
31b025fcfc Kernel: Allow sys$accept(address = nullptr) 2020-06-09 21:12:34 +02:00
Nico Weber
33d6d640d3
Ports: Use keyserver.ubuntu.com as .sig keyserver (#2535)
Increases the number of successfully building ports from
27 to 36 (of 56) on my system.
2020-06-09 21:10:00 +02:00
Andreas Kling
a85506009f LibC: Don't assert on unknown mode character in fopen()
Just carry on with some debug log whining.
Gets rid of one dropbear patch. :^)
2020-06-08 21:57:13 +02:00
Andreas Kling
c88ea2f54a LibC: Add nanosleep() wrapper around clock_nanosleep(CLOCK_REALTIME)
Gets rid of one dropbear patch. :^)
2020-06-08 21:53:41 +02:00
Andreas Kling
57b6f51137 LibC: Add IPPORT_RESERVED and IPPORT_USERRESERVED
Gets rid of one dropbear patch. :^)
2020-06-08 21:50:45 +02:00
Andreas Kling
5448a670c0 Base: Symlink /dev/urandom to /dev/random
Some software expects to find /dev/urandom so we might as well provide.
Gets rid of one dropbear patch. :^)
2020-06-08 21:42:33 +02:00
Andreas Kling
3ee1b3cbd4 LibC: Add ws_xpixel and ws_ypixel members to struct winsize
This matches what other systems have, although we don't use them.
Gets rid of one dropbear patch. :^)
2020-06-08 21:40:22 +02:00
Stephen Gregoratto
53d4c7e207
Ports: Add editline library (#2532) 2020-06-08 21:38:13 +02:00
Andreas Kling
883dc9260d LibWeb: Unbreak favicon notifications after Page refactoring
Favicon updates now get plumbed from FrameLoader to the PageClient.
2020-06-08 21:35:31 +02:00
Andreas Kling
e04d68a03a LibWeb: Remove unnecessary on_foo hooks from Frame
Frame can just call through the PageClient instead of using hooks.
2020-06-08 21:31:53 +02:00
Andreas Kling
5042e560ef LibJS: Make more Interpreter functions take a GlobalObject& 2020-06-08 21:25:16 +02:00
Andreas Kling
053863f35e LibJS: Interpreter::this_value() => this_value(GlobalObject&)
Once the Interpreter has no global object attached to it, we have to
provide it everywhere.
2020-06-08 21:12:20 +02:00
Andreas Kling
25f2a29d84 LibJS: Pass GlobalObject& to AST node execute() functions
More work towards supporting multiple global objects.
2020-06-08 21:12:20 +02:00
Andreas Kling
92392398a2 LibWeb: Add Page abstraction between PageView and main Frame
* A PageView is a view onto a Page object.
* A Page always has a main Frame (root of Frame tree.)
* Page has a PageClient. PageView is a PageClient.

The goal here is to allow building another kind of view onto
a Page while keeping the rest of LibWeb intact.
2020-06-08 21:12:20 +02:00
Linus Groh
5072d4e02d LibJS+js: Support getting last value from "_" variable
The interpreter now has an "underscore is last value" flag, which makes
Interpreter::get_variable() return the last value if:

- The m_underscore_is_last_value flag is enabled
- The name of the variable lookup is "_"
- The result of that lookup is an empty value

That means "_" can still be used as a regular variable and will stop
doing its magic once anything is assigned to it.

Example REPL session:

> 1
1
> _ + _
2
> _ + _
4
> _ = "foo"
"foo"
> 1
1
> _
"foo"
> delete _
true
> 1
1
> _
1
>
2020-06-08 14:01:31 +02:00
Sergey Bugaev
89004a3a40 LibCore: Make sure to disable notifiers when closing a socket
RefPtr<Notifier> doesn't work quite like it appears to, since the notifier
is also a "child" of the socket, in Core::Object sense. Thus we have to both
remove it from the parent (socket) and drop the additional RefPtr<Notifier> for
it to actually go away.

A proper fix for this would be to untangle parent-child relashionship from
refcounting and inspectability.

This fixes use-after-close of client file descriptors in IPC servers.
2020-06-08 13:58:32 +02:00
Sergey Bugaev
bb19eb8f23 IPCCompiler: Properly handle stream read errors
If we exhaust the buffer stream, the reads appear to succeed, but the stream
itself panics when we later attempt to drop it. To prevent it, we check for
errors explicitly.
2020-06-08 13:58:32 +02:00
Sergey Bugaev
fc481552f5 LibIPC+LibGfx+IPCCompiler: Drop some unused includes 2020-06-08 13:58:32 +02:00
Andreas Kling
affc479e83 LibJS+LibWeb: Remove a bunch of calls to Interpreter::global_object()
Objects should get the GlobalObject from themselves instead. However,
it's not yet available during construction so this only switches code
that happens after construction.

To support multiple global objects, Interpreter needs to stop holding
on to "the" global object and let each object graph own their global.
2020-06-08 12:25:45 +02:00
Andreas Kling
ff8bb962b6 LibJS: Always keep a reference to the global object in Shape
We need to move towards supporting multiple global objects, which will
be a large refactoring. To keep it manageable, let's do it in steps,
starting with giving Object a way to find the GlobalObject it lives
inside by asking its Shape for it.
2020-06-08 12:15:58 +02:00
Andreas Kling
10aebabf0b LibJS: BigInts and Symbols values are cells and the GC needs this info
Make Value::is_cell() return true for BigInts and Symbols. This makes
all the tests pass when running run-tests.sh -g (GC after every alloc.)
2020-06-08 12:08:51 +02:00
Matthew Olsson
4e33fbdb67 LibJS: Add interpreter exception checks 2020-06-08 09:57:29 +02:00
Hüseyin ASLITÜRK
f306ddb78b Userland: Remove keymap app from system
We have new KeyboardSettings application and it supports both GUI and CLI.
2020-06-08 09:28:18 +02:00
Hüseyin ASLITÜRK
ddeb0ab1ad Applications: Add new KeyboardSettings application
GUI application to manage Keyboard settings.
2020-06-08 09:28:18 +02:00
Hüseyin ASLITÜRK
57a99015a1 Base: Add Keyboard application icons 2020-06-08 09:28:18 +02:00
Hüseyin ASLITÜRK
eba285bdb8 Base: Move DisplaySettings app to Settings menu 2020-06-08 09:28:18 +02:00
AnotherTest
0fe3b0dbaf functrace: Output colors only when stdout is a tty 2020-06-08 09:27:51 +02:00
AnotherTest
2714bba3f0 Shell: Highlight redirections 2020-06-08 09:27:51 +02:00
AnotherTest
07c070745f ls: Emit plain text when output is not a tty 2020-06-08 09:27:51 +02:00
Matthew Olsson
bc1c556755 LibJS: Move regex logic to main Lexer if statement
This prevents a regex such as /=/ from lexing into TokenType::SlashEquals,
preventing the regex logic from working.
2020-06-08 09:18:27 +02:00
Matthew Olsson
cc7462daeb LibJS: Properly consume escaped backslash in regex literal 2020-06-08 09:18:27 +02:00