Commit graph

9119 commits

Author SHA1 Message Date
DexesTTP
d1a9afa7cd Help: Clicking on link changes the treeview selection
Fixes #1259
2020-05-05 14:27:51 +02:00
Linus Groh
055e955a1c LibWeb: Recognise :focus pseudo-class
It's still only a dummy as LibWeb doesn't have focused elements yet, but
at least now we don't treat "selector:focus" as just "selector".

This fixes an issue on google.com which was mostly grey - coming from
some menu item focus styles :^)
2020-05-05 13:16:33 +02:00
DexesTTP
f3cff4c677 SystemMonitor: Replace details with message when process isn't accessible
In addition to being less surprising, this sets up some groundwork for #1676
2020-05-05 12:49:18 +02:00
Andreas Kling
5c12f3fef0 js: Tighten up ReplConsoleClient::trace() a little bit
Remove a bunch of unnecessary String copying.
2020-05-05 11:49:14 +02:00
Andreas Kling
e4b9cf9b6c AK: Some FlyString improvements
We're now clever enough to notice when we're constructing a FlyString
from a String that is actually already a FlyString. :^)
2020-05-05 11:26:03 +02:00
AnotherTest
2a29e668bd LibTLS: Try to disambiguate errors in case of failure
Not particularly helpful, but better than nothing.
2020-05-05 11:20:42 +02:00
Shadowfacts
fcd922f7b1 LibWeb: Add basic URL encoder for individual values and param lists 2020-05-05 11:19:38 +02:00
Shadowfacts
7f538ea7eb LibWeb: When creating form action URL, only include value for the submit
that was used to submit the form
2020-05-05 11:19:38 +02:00
Shadowfacts
5c46741be8 LibHTTP: Actually include query parameters when serializing raw request 2020-05-05 11:19:38 +02:00
Shadowfacts
4d5dc5950a LibWeb: Improve <form> submit method handling
The spec defines the only valid methods to be get, post, and dialog.
Post and dialog are currently unhandled and do nothing, any other value
(or no value specified) is defined by the spec to use the get method.
2020-05-05 11:19:38 +02:00
Linus Groh
72d2bd56ce LibJS: Implement modulo assignment operator (%=) 2020-05-05 11:12:27 +02:00
Linus Groh
a2e1f1a872 LibJS: Implement exponentiation assignment operator (**=) 2020-05-05 11:12:27 +02:00
Linus Groh
3e754a15d4 LibJS: Implement bitwise assignment operators (&=, |=, ^=) 2020-05-05 11:12:27 +02:00
Linus Groh
8e4301dea6 LibJS: Add test for assignment operators 2020-05-05 11:12:27 +02:00
Sergey Bugaev
69c23aaedb ProtocolServer: Use unveil() 2020-05-05 11:07:06 +02:00
Sergey Bugaev
983e541584 Base: Fix a typo 2020-05-05 11:07:06 +02:00
AnotherTest
155853afb2 LibHTTP: Unify and generalise response handling logic 2020-05-05 11:04:06 +02:00
Itamar
3dd0f755d0 HackStudio: Show local variables in the debugger
We now have a Debug Information tab, which displays the variables in
the current scope in a tree view.
2020-05-05 11:01:36 +02:00
Itamar
09ac22b37f HackStudio: Take scrolling into consideration when painting breakpoints
Also, we now scroll to the currently executed line when execution is
paused in the debugger.
2020-05-05 11:01:36 +02:00
Itamar
c5eb20d0cc LibDebug: Parse DWARF information entries
We can now iterate the tree structure of the DIEs, access attribute
values and parse some very basic DWARF expressions.
2020-05-05 11:01:36 +02:00
Itamar
2cafc36d9c LibC: Remove ASSERT_NOT_REACHED in getrusage
The gcc port was hitting that assertion for some reason.

This patch fixes it.
2020-05-05 11:01:36 +02:00
AnotherTest
0a55679de4 LibWeb: Add canvas.quadraticCurveTo()
Also adds a test, and removes debug spam ™️
2020-05-05 09:21:07 +02:00
AnotherTest
9f3f98d4c0 LibGfx: Add Painter::draw_quadratic_bezier_curve()
Also adds a QuadraticBezierCurveTo mode to Gfx::Path
2020-05-05 09:21:07 +02:00
Emanuele Torre
73a7a589c2 js: Customise the behaviour of JS::Console with ReplConsoleClient
This also makes our JavaScript tests not fail.
2020-05-05 09:15:16 +02:00
Emanuele Torre
e91ab0cb02 LibJS: Implement ConsoleClient
Now, you can optionally specify a ConsoleClient, to customise the
behaviour of the LibJS Console.

To customise the console, create a new ConsoleClient class that inherits
from JS::ConsoleClient and override all the abstract methods.

When Console::log() is called, if Console has a ConsoleClient,
ConsoleClient::log() is called instead.

These abstract methods are Value(void) functions: you can return a Value
which will be returned by the JavaScript function which calls that
method, in JavaScript.
2020-05-05 09:15:16 +02:00
Emanuele Torre
bc7ed4524e LibJS: Add some helpers and use them to re-implement Console functions
Also add const overloads for some getters.

Also const-qualify Interpreter::join_arguments().
2020-05-05 09:15:16 +02:00
Emanuele Torre
92815f313a AK: run clang-format on PrintfImplementation.h 2020-05-05 09:15:16 +02:00
Emanuele Torre
8bd9f7e50e LibJS: run clang-format on all the files 2020-05-05 09:15:16 +02:00
Emanuele Torre
30519c22f6 LibJS: Re-implement console functions as wrappers around Console methods
Console methods are now Value(void) functions.

JavaScript functions in the JavaScript ConsoleObject are now implemented
as simple wrappers around Console methods.

This will make it possible for LibJS users to easily override the
default behaviour of JS console functions (even their return value!)
once we add a way to override Console behaviour.
2020-05-05 09:15:16 +02:00
Emanuele Torre
73bead5ae9 LibJS: Move join_args() in Interpreter
It can be useful outside of Runtime/ConsoleObject.cpp.
join_args() => Interpreter::join_arguments()
2020-05-05 09:15:16 +02:00
Emanuele Torre
046f9cf115 LibJS: Remove ConsoleMessage from LibJS
We don't need to store the past messages in LibJS.
We'll implement a way to let LibJS users expand the vanilla Console.
2020-05-05 09:15:16 +02:00
Andreas Kling
7dd49047f3 keymap: Fix crash introduced by 637ecdb
Just because a Vector has some inline capacity doesn't mean we can put
data at offsets < Vector::size().

Fixes #2104.
2020-05-05 00:12:51 +02:00
Linus Groh
454c1e6bbe LibJS: Implement rest parameters 2020-05-04 23:30:52 +02:00
Andreas Kling
9df71afdb3 LibWeb: Respect the <input size> attribute a bit more :^)
We now use the size attribute to determine the width of a text input.
2020-05-04 22:43:00 +02:00
Andreas Kling
0d2beddc74 LibWeb: Plumb the full HtmlView viewport rect down into the engine
Previously we would use the "content rect" as the viewport rect, which
could sometimes be smaller than the actual viewport rect as the content
size was based on the box geometry of the root layout node.

This fixes an issue on google.com where we would not render the main
logo image since it was "outside" the viewport. The root layout size
is currently very wrong on google.com but that's a separate issue. :^)
2020-05-04 22:35:29 +02:00
Andreas Kling
d3de2b7de5 LibWeb: Don't assert when trying to rebuild a single-node layout tree
This merely postpones dealing with partial layout tree rebuilds for a
while longer.
2020-05-04 22:34:14 +02:00
Andreas Kling
6886c6efa6 LibWeb: Don't generate a layout node for <input type="hidden"> 2020-05-04 22:33:49 +02:00
Andreas Kling
8fae4ee931 LibGUI: Add ScrollableWidget::viewport_rect_in_content_coordinates() 2020-05-04 22:33:20 +02:00
Sergey Bugaev
718271c9df Base: Document unveil(2)
Also, escape underscores in chroot_with_mount_flags.
2020-05-04 21:44:50 +02:00
Sergey Bugaev
183fa98214 LibMarkdown: Support multi-line list items
You can now continue one list item across several lines, as long as you indent
it the same as the first line of the item. For example:

* This is the first item,
  which spans multiple lines.
* This is the second item, which also has some
  *emphasis* in it.
2020-05-04 21:44:50 +02:00
Linus Groh
d4bfcea570 LibJS: Add indentation to sections in SwitchCase::dump()
This now matches the output of

Program
  (Variables)
    ...
  (Children)
    ...

or

FunctionDeclaration 'foo'
  (Parameters)
    ...
  (Body)
    ...

etc.

Also don't print each consequent statement index, it doesn't add any
value.
2020-05-04 21:42:47 +02:00
mattco98
adb4accab3 LibJS: Add template literals
Adds fully functioning template literals. Because template literals
contain expressions, most of the work has to be done in the Lexer rather
than the Parser. And because of the complexity of template literals
(expressions, nesting, escapes, etc), the Lexer needs to have some
template-related state.

When entering a new template literal, a TemplateLiteralStart token is
emitted. When inside a literal, all text will be parsed up until a '${'
or '`' (or EOF, but that's a syntax error) is seen, and then a
TemplateLiteralExprStart token is emitted. At this point, the Lexer
proceeds as normal, however it keeps track of the number of opening
and closing curly braces it has seen in order to determine the close
of the expression. Once it finds a matching curly brace for the '${',
a TemplateLiteralExprEnd token is emitted and the state is updated
accordingly.

When the Lexer is inside of a template literal, but not an expression,
and sees a '`', this must be the closing grave: a TemplateLiteralEnd
token is emitted.

The state required to correctly parse template strings consists of a
vector (for nesting) of two pieces of information: whether or not we
are in a template expression (as opposed to a template string); and
the count of the number of unmatched open curly braces we have seen
(only applicable if the Lexer is currently in a template expression).

TODO: Add support for template literal newlines in the JS REPL (this will
cause a syntax error currently):

    > `foo
    > bar`
    'foo
    bar'
2020-05-04 16:46:31 +02:00
Andreas Kling
2fdeb464f7 Meta: Add a basic "issue policy" to CONTRIBUTING.md 2020-05-04 13:49:15 +02:00
Andreas Kling
a75af443d4 LibX86: Simplify "register index to string" functions a bit 2020-05-04 13:49:15 +02:00
Andreas Kling
57b2b96a67 LibX86: Remove accidental camelCase in some names 2020-05-04 13:49:15 +02:00
Ben Wiederhake
b80ad2d791 MouseDemo: Add menu, using the new icon :^) 2020-05-04 09:58:14 +02:00
Ben Wiederhake
fe178b6234 SystemMenu+MouseDemo: Add menu entry and nice icons 2020-05-04 09:58:14 +02:00
Nathan Lanza
f4e6c4c6f0
Kernel: Use Multiboot macros instead of magic constants (#2090)
MUTLIBOOT_FRAMEBUFFER_TYPE_{RGB,EGA_TEXT} are defined in the Multiboot.h
header. Use those definitions instead of hard-coding 1 and 2.
2020-05-04 09:52:04 +02:00
Devashish
f22c973ba3 Meta: Add configuration for setting up project in CLion
This commit adds a CMakeLists.txt file that will be used by CLion to
configure the project and documentation explaining the steps to follow.
Configuring CLion this way enables important features like code
completion and file search. The configuration isn't perfect. There are
source files for which CLion cannot pick up the headers and asks to
manually include them from certain directories. But for the most part,
it works all right.
2020-05-04 09:50:45 +02:00
Ben Wiederhake
f09a8f8a6e sysctl: Permit 'sysctl -a' invocation
The point of '-a' is to list all keys.
It is counter-intuitive to require the user to then
supply a specific key additionally.
2020-05-04 09:41:43 +02:00