Commit graph

10868 commits

Author SHA1 Message Date
Andrew Kaster
3a4e121904 Browser: Add right-click context menu to tabs
Right clicking on a position in the PageView of a tab will open a
context menu with common actions like back, forward, reload, view
source and inspect DOM. :^)
2020-06-28 00:05:08 +02:00
Andrew Kaster
cc675cbe24 LibWeb: Add Page context menu request
Pages can request a context menu on right click. This is plumbed
through the PageClient.
2020-06-28 00:05:08 +02:00
Hüseyin ASLITÜRK
d28a824d4c
QuickShow: Fix for zooming with mouse wheel (#2650)
Fixes #2648.
2020-06-28 00:04:11 +02:00
Andreas Kling
8d2194bdbd LibWeb: Make DOM timers cancellable and stop leaking them
This patch adds a Web::Timer object that represents a single timer
registration made with window.setTimeout() or window.setInterval().
All live timers are owned by the DOM Window object.

The timers can be stopped via clearTimeout() or clearInterval().
Note that those API's are actually interchangeable, but we have to
support both.
2020-06-27 20:02:04 +02:00
Peter Elliott
e1aef94a40 Kernel: Make Random work on CPUs without rdrand
- If rdseed is not available, fallback to rdrand.
- If rdrand is not available, block for entropy, or use insecure prng
  depending on if user wants fast or good random.
2020-06-27 19:40:33 +02:00
devashish
1eb338ab71 LibGfx+JPGLoader: Fix decoding outside of LibWeb
The DC reset interval was initialized to garbage :)
2020-06-27 18:33:11 +02:00
devashish
58a5af1dcd LaunchServer: Associate JPEG files with QuickShow 2020-06-27 18:33:11 +02:00
AnotherTest
880c3fb83f Userland: Add a 'test' utility
This adds an incomplete implementation of the test util, missing some
user/group checks, and `-l STRING`.
It also symlinks '[' to 'test'.
2020-06-27 16:08:52 +02:00
AnotherTest
a6fd969d93 LibLine: Support multiline editing
This commit also updates Shell, which uses actual_rendered_length.
2020-06-27 15:39:03 +02:00
Kevin Meyer
22b20c381f LibWeb: Implement remaining missing tokenizer EOF cases 2020-06-27 13:27:10 +02:00
Hüseyin ASLITÜRK
b05fd9b15b Base: Test web page and images for PGM image file type 2020-06-27 13:01:27 +02:00
Hüseyin ASLITÜRK
dc5b73c43a LibGfx: Add PGM image file type support 2020-06-27 13:01:27 +02:00
Hüseyin ASLITÜRK
57ef3b27ec Base: Add PGM file type to QuickShow file type list 2020-06-27 13:01:27 +02:00
Hüseyin ASLITÜRK
0f7a651adc LibWeb: Add "image/x‑portable‑graymap" mime type for pgm file extension 2020-06-27 13:01:27 +02:00
Hüseyin ASLITÜRK
a8b0ad5cc6 LibGUI: Fix image preview size in FilePicker for large images
Image preview widget overflow to other widgets in FilePicker dialog when image is larger than 160px.  Also change the ImagePreview widget variable name for align to naming standards.
2020-06-27 12:57:30 +02:00
3541
4fa6301523 Kernel: Add g_cpu_supports_rdseed
CPUs which support RDRAND do not necessarily support RDSEED. This
introduces a flag g_cpu_supports_rdseed which is set appropriately
by CPUID. This causes Haswell CPUs in particular (and probably a lot
of AMD chips) to now fail to boot with #2634, rather than an illegal
instruction.

It seems like the KernelRng needs either an initial reseed call or
more random events added before the first call to get_good_random,
but I don't feel qualified to make that kind of change.
2020-06-27 12:57:03 +02:00
Kevin Meyer
ebbcef926a Base: Fix sendfd's man page return section 2020-06-27 11:50:31 +02:00
Andreas Kling
85ac7dc1b1 TextEditor: Add live preview for HTML documents :^)
This allows you to edit HTML and see the changes live. This feature is
possibly my favorite feature in the world right now.
2020-06-26 22:47:29 +02:00
Andreas Kling
8e6522d034 LibWeb: Implement some missing tokenizer cases for EOF handling 2020-06-26 22:47:07 +02:00
Andreas Kling
9d8565cf9a LibWeb: Add CanvasRenderingContext2D.rotate()
This is pretty limited since we don't have wholesale mapping through
the context transform, but we have to start somewhere. :^)
2020-06-26 18:27:12 +02:00
Andreas Kling
dc22e59a1a LibGfx: Teach AffineTransform how to rotate and multiply 2020-06-26 18:27:12 +02:00
Andreas Kling
ba76a72422 LibWeb: Skip over floating elements when collapsing margins
Two sibling blocks are not vertically adjacent if one is float:left
and the other is float:none. Respect this when collapsing margins.
2020-06-26 18:27:12 +02:00
Andreas Kling
62daa6f73c LibWeb: Add the 'float' CSS property to LayoutStyle
Note that we don't use the property for anything yet, as I'm still
wrapping my head around how to implement floats.
2020-06-26 18:27:12 +02:00
Matthew Olsson
53f1090b86 LibJS: run-test.sh emits test output if it is not "PASS"
Previously, debugging a test with console.log statements was impossible,
because it would just cause the test to fail with no additional output.
Now, if the output of a test is not "PASS", the output will be printed
under the line where the test failed.

Empty output will have a special message attached to it -- useful when
a test author has forgotten to include `console.log("PASS")` at the end
of a test.
2020-06-26 12:40:07 +02:00
Andreas Kling
981f403287 IRCClient: Remove duplicate <div> wrapper around colored messages 2020-06-26 11:59:04 +02:00
theazgra
6a401a9bde LibWeb: Remove duplicate if branch in fragment parsing.
I noticed in the video the duplicate `if` check. This commit removes
the duplicated branch.
2020-06-26 11:58:53 +02:00
Andreas Kling
6293d1a13c LibWeb+Browser: Remove old HTML parser :^)
The new parser is now used everywhere and it's working pretty well!
2020-06-26 00:53:25 +02:00
Andreas Kling
6c783dbf62 IRCClient: Use Web::Element::set_inner_html()
Instead of invoking the (old) fragment parser directly.
2020-06-26 00:53:25 +02:00
Andreas Kling
92d831c25b LibWeb: Implement fragment parsing and use it for Element.innerHTML
This patch implements most of the HTML fragment parsing algorithm and
ports Element::set_inner_html() to it. This was the last remaining user
of the old HTML parser. :^)
2020-06-26 00:53:25 +02:00
Andreas Kling
eb33021d65 LibWeb: Tolerate quoted HTTP Content-Type encodings 2020-06-26 00:53:25 +02:00
Andreas Kling
edf0aacda4 LibWeb: Add Document.getElementsByTagName() 2020-06-26 00:53:25 +02:00
Andreas Kling
200481efb2 LibJS: to_string_without_side_effects() should handle NativeProperty 2020-06-26 00:53:25 +02:00
Andreas Kling
ee4cf0bc69 LibWeb: Let's not pass "%u" to String() and expect something to happen 2020-06-26 00:53:25 +02:00
Linus Groh
54835689c9 Travis: Limit notifications to SerenityOS/serenity repo 2020-06-25 21:11:01 +02:00
Peter Elliott
af0b2d1d86 Kernel: Harvest randomness from various drivers
Random now gets entropy from the following drivers:
- KeyboardDevice
- PATAChannel
- PS2MouseDevice
- E1000NetworkAdapter
- RTL8139NetworkAdapter

Of these devices,  PS2MouseDevice and PATAChannel provide the vast
majority of the entropy.
2020-06-25 21:05:40 +02:00
Peter Elliott
2e8cfe5435 LibCrypto: Add CTR cipher mode
Kernel: Changed fortuna implementation to use CTR mode instead of
manually implementing a counter.
2020-06-25 21:05:40 +02:00
Peter Elliott
0f32155fa4 Kernel: Replace existing random implementation with Fortuna 2020-06-25 21:05:40 +02:00
Peter Elliott
f2d51f13a6 Kernel: Implement the Fortuna PRNG algorithm 2020-06-25 21:05:40 +02:00
Peter Elliott
3de32f0a55 LibCrypto: Add missing <AK/StringView.h> include 2020-06-25 21:05:40 +02:00
Andreas Kling
ebf326a98c LibWeb: Fix build after Specificity.h removal 2020-06-25 20:59:00 +02:00
Andreas Kling
4f7c7bbb09 LibWeb: Treat all HTTP 4xx codes as errors 2020-06-25 17:19:29 +02:00
Andreas Kling
505b133fda LibWeb: Don't allow more than one color sub-value in CSS 'background' 2020-06-25 16:55:43 +02:00
Andreas Kling
3fefc7f3e9 LibWeb: Tweak CSS parser to swallow backslash-escaped characters
This isn't the correct way of doing this, but at least it allows the
parsing to progress a bit further in some cases.
2020-06-25 16:52:38 +02:00
Andreas Kling
49dd4b7e8a LibWeb: Compress specificity into a 32-bit unsigned int
Instead of storing the three-part specificy for every selector,
just mash them together into a 32-bit value instead.
This saves both space and time, and matches the behavior of other
browser engines.
2020-06-25 16:43:49 +02:00
Andreas Kling
8be74ea65c LibWeb: Percentage 'height' should sometimes behave as 'auto'
Something like "height: 50%" is equivalent to "height: auto" unless the
containing block has explicitly specified height.
2020-06-25 16:04:57 +02:00
Andreas Kling
afebbd1cd7 LibWeb: Serialize Length::Type::Percentage with a "%" suffix
"10 percentage" looked rather silly. :^)
2020-06-25 15:53:23 +02:00
Andreas Kling
f650f18bd2 LibWeb: Make scroll-to-anchor zone in on the element's padding box
That seems to be what other engines do. This is a bit hackish but we'll
soon have to redo scroll-to-anchor anyway for the multi-process model.
2020-06-25 15:53:23 +02:00
Andreas Kling
bab0143bb2 LibWeb: Place normal-flow blocks relative to non-absolute siblings
We could previously place a box next to a preceding sibling with
position:fixed, which is wrong since fixed-position elements are taken
out of the normal flow.
2020-06-25 15:53:23 +02:00
Andreas Kling
b2f54be514 LibWeb: Draw the margin and padding boxes around the inspected node
When highlighting a node in the inspector, we now paint three overlays:

- The content box (magenta)
- The padding box (cyan)
- The margin box (yellow)

This makes it a lot easier to debug layout issues.
2020-06-25 15:53:23 +02:00
Andreas Kling
8f92ed957b LibWeb: Iterating more on placement of absolutely positioned elements 2020-06-25 15:53:23 +02:00