Commit graph

9332 commits

Author SHA1 Message Date
Andreas Kling
68abc103f7 ProtocolServer: Report success after stopping a download 2020-05-05 23:56:20 +02:00
Andreas Kling
588e18721d Browser: Add a simple context menu for hyperlinks
This only has "Open" and "Open in new tab" for now. :^)
2020-05-05 22:42:50 +02:00
Andreas Kling
f32989a3e7 LibWeb: Add hook when context menu is requested by right-clicking link 2020-05-05 22:42:21 +02:00
Andreas Kling
1061127ca7 LibGfx: Add missing FloatRect function implementations
These are just clones of the Rect equivalents.
2020-05-05 18:53:34 +02:00
Andreas Kling
fc5d0a1bd2 LibJS: Switch objects to unique shape after 100 property additions
At that point, it seems unlikely that the shape is gonna be shared with
other objects, and we avoid getting stuck holding a big bag of shapes.
2020-05-05 18:49:45 +02:00
Andreas Kling
e73ad78ba6 LibWeb: Add support for "display: inline-block"
This display type is implemented using a LayoutBlock that is_inline().
Basically it behaves like a block internally, and its children are laid
out in the normal block layout fashion. Externally however, it behaves
like an atomic inline-level box.

Layout of inline-block boxes happens in three stages:

1. The outer dimensions of the block are computed during the recursive
   normal layout pass. We skip positioning, but lay out children.

2. Later on, during line layout in the *containing block*, the inline
   block now contributes a linebox fragment. When linebox fragments are
   positioned, we learn the final position of the inline block. That's
   when we set the inline block's position.

3. We re-layout the inline block's children once again. This is done to
   make sure they end up in the right position. The layout tree doesn't
   use relative offsets, so after we position the inline block in (2),
   its children will not have its positions updated. Relayout moves
   all children of inline blocks to the right place.

This is a rather naive approach but it does get the basic behavior into
place so we can iterate on it. :^)
2020-05-05 16:18:28 +02:00
Linus Groh
0a1ecbec48 LibMarkdown: Escape HTML entities in text 2020-05-05 16:18:11 +02:00
Linus Groh
fc3d16d664 LibMarkdown: Use escape_html_entities() from AK/String 2020-05-05 16:18:11 +02:00
Andreas Kling
b7339745d0 LibGfx: Add a naive "rgba(r,g,b,a)" color parser
It's not very whitespace tolerant but it works.
2020-05-05 15:50:28 +02:00
Andreas Kling
8a40294f42 LibWeb: Turn some HTML entities into nicer text in the parser 2020-05-05 15:50:28 +02:00
Andreas Kling
6676f2c259 LibWeb: Don't emit a simple selector if nothing was consumed 2020-05-05 15:50:28 +02:00
Andreas Kling
493cbb7956 LibWeb: Fall back to LayoutInline for any unrecognized CSS display
Let's at least try to keep going and see what we can render.
2020-05-05 15:50:28 +02:00
Andreas Kling
d677d23da1 LibWeb: Make the URL encoding function a little less copy-happy 2020-05-05 15:50:28 +02:00
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