Commit graph

10895 commits

Author SHA1 Message Date
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
Andreas Kling
ee1c241be9 LibWeb: Update the border metrics of absolutely positioned boxes
We were neglecting to populate the border parts of BoxModelMetrics for
absolutely positioned block descendants.
2020-06-25 15:53:23 +02:00
Andreas Kling
232e41a238 LibWeb: Remove empty trailing line boxes
Sometimes we end up with an empty line box at the bottom of a block.
Instead of worrying about this in all the places we split into lines,
just remove the trailing box (if any) after splitting is finshed.
2020-06-25 15:53:23 +02:00
Andreas Kling
58f76ed11f LibWeb: Avoid some redundant resolution of padding values during layout
Padding is not affected by the width constraining algorithm, so we can
just resolve it up front.
2020-06-25 15:53:23 +02:00
Linus Groh
afcfea2001 LibJS: Handle "receiver" argument in Reflect.{get,set}() 2020-06-25 15:51:47 +02:00
Sergey Bugaev
f08aa6324e Base: Mention that sendfd & recvfd were introduced in plan9port 2020-06-25 15:49:04 +02:00
Sergey Bugaev
6efbbcd4ba Kernel: Port mounts to reference inodes directly
...instead of going through their identifiers. See the previous commit for
reasoning.
2020-06-25 15:49:04 +02:00
Sergey Bugaev
df66c28479 Kernel: Deemphasize inode identifiers
These APIs were clearly modeled after Ext2FS internals, and make perfect sense
in Ext2FS context. The new APIs are more generic, and map better to the
semantics exported to the userspace, where inode identifiers only appear in
stat() and readdir() output, but never in any input.

This will also hopefully reduce the potential for races (see commit c44b4d61f3).

Lastly, this makes it way more viable to implement a filesystem that only
synthesizes its inodes lazily when queried, and destroys them when they are no
longer in use. With inode identifiers being used to reference inodes, the only
choice for such a filesystem is to persist any inode it has given out the
identifier for, because it might be queried at any later time. With direct
references to inodes, the filesystem will know when the last reference is
dropped and the inode can be safely destroyed.
2020-06-25 15:49:04 +02:00
Andreas Kling
c689be0dbc Base: Add "sendfd" and "recvfd" promises to pledge(2)
And as it turns out, these are not even extensions! :^)
2020-06-25 10:58:37 +02:00
Andreas Kling
55a22b50c9 Base: Fix wording in recvfd(2)
recvfd() returns a *non-negative* integer on success. 0 is a valid fd.
2020-06-25 10:58:37 +02:00
Andreas Kling
28bfd73b68 Kernel: Minor cleanups in sendfd/recvfd
Applying some nice suggestions by @bugaevc. :^)
2020-06-25 10:58:37 +02:00
AnotherTest
d1d01897a3 Terminal: Ignore cell background when visual beep is active
Fixes #2621
2020-06-25 10:57:58 +02:00
Andreas Kling
1a7ccc1569 Base: Add man pages for recvfd(2) and sendfd(2) :^) 2020-06-24 23:08:18 +02:00
Andreas Kling
d4195672b7 Kernel+LibC: Add sys$recvfd() and sys$sendfd() for fd passing
These new syscalls allow you to send and receive file descriptors over
a local domain socket. This will enable various privilege separation
techniques and other good stuff. :^)
2020-06-24 23:08:09 +02:00
Andreas Kling
cd02144a06 Base: Update motd since it was a little outdated :^) 2020-06-24 22:55:45 +02:00
Andreas Kling
8960c6f8fe LibWeb: Use the cached white-space from LayoutStyle in text_for_style() 2020-06-24 21:44:11 +02:00
Andreas Kling
440b4ece22 LibWeb: Move border width and color into LayoutStyle
To make this possible, I also had to give each LayoutNode a Document&
so it can resolve document-specific colors correctly. There's probably
ways to avoid having this extra member by resolving colors later, but
this works for now.
2020-06-24 19:43:27 +02:00
Andreas Kling
4b2ac34725 LibWeb: Move the offset, margin and padding boxes into LayoutStyle 2020-06-24 18:06:21 +02:00
Andreas Kling
6b334e02e6 LibWeb: Move white-space into LayoutStyle 2020-06-24 18:06:21 +02:00
Andreas Kling
bc178ee743 LibWeb: Add CSS::Display enum and StyleProperties::display()
The display property is not interesting after we've built the layout
tree, so we don't have to move it into LayoutStyle.
2020-06-24 18:06:21 +02:00
Andreas Kling
5d86305a72 LibWeb: Move height, min-height and max-height into LayoutStyle 2020-06-24 16:49:51 +02:00
Andreas Kling
ec466c0385 LibWeb: Move min-width and max-width into LayoutStyle 2020-06-24 16:49:51 +02:00
Andreas Kling
ecacab8618 LibWeb: Move width into LayoutStyle
This patch also adds the ability for Length to contain percentage
values. This is a little off-spec, but will make storing and dealing
with lengths a lot easier.

To resolve a Length to a px-or-auto Length, there are now helpers
for that. After calling them, you no longer have to think about
em, rem, %, and such things.
2020-06-24 16:49:51 +02:00
Andreas Kling
959464fce4 LibWeb: Move position and text-align to LayoutStyle 2020-06-24 16:49:51 +02:00