Commit graph

24658 commits

Author SHA1 Message Date
Thomas Wagenveld
2002b7e2e3 Meta/run.sh: Allow for overriding of QEMU ethernet device type
You can set the SERENITY_ETHERNET_DEVICE_TYPE environment variable to
pick another device type (i.e. ne2k_pci). Defaults to e1000 as before.
2021-07-24 21:28:22 +02:00
Thomas Wagenveld
9b57c6a013 Kernel/NE2000: Harvest entropy from NE2000 interrupts 2021-07-24 21:28:22 +02:00
Thomas Wagenveld
e788bbdb55 Kernel/NE2000: Assume link status is up
Right now, NE2000 NICs don't work because the link is down by default
and this will never change. Of all the NE2000 documentation I looked
at I could not find a link status indicator, so just assume the link
is up.
2021-07-24 21:28:22 +02:00
Thomas Wagenveld
de2d5d6a7e Kernel/NE2000: Correct receive ring buffer wrap-around
next_packet_page points to a page, but was being compared to a byte
offset rather than a page offset when adjusting the BOUNDARY register
when the ring buffer wraps around.

Fixes #8327.
2021-07-24 21:28:22 +02:00
Karol Kosek
a1d0ad61a6 FileManager: Show an open icon for selected folder in tree view again
The original work was done in #2752
(deceb91c48 to be precise),
but unfortunately 2c772d1848 replaced
on_selection with on_selection_change, which caused the function
to never be executed, as it was reassigned a few lines below.
2021-07-24 21:13:22 +02:00
Luke
8956b5fb55 Mail: Make checking for headers in DataItem case insensitive
For example, the servers I tested this on sent "Subject" which matched
what I was checking for. However, some servers can send "SUBJECT" which
didn't match and would cause an assertion failure.
2021-07-24 19:03:43 +01:00
Luke
3948161c14 LibIMAP: Add a bunch of serialize_astring in command construction
These were putting the raw string values into the command, where they
should be astrings as per the grammar:
https://datatracker.ietf.org/doc/html/rfc3501#section-9
2021-07-24 19:03:43 +01:00
Egor Ananyin
6097578c59 Base: Add a test page for CSS opacity property 2021-07-24 22:02:28 +04:30
Egor Ananyin
f567414f65 LibWeb: Draw elements with opacity in a separate stacking context 2021-07-24 22:02:28 +04:30
Egor Ananyin
0e6ba6e1d3 LibWeb: Parse and store the opacity property 2021-07-24 22:02:28 +04:30
Egor Ananyin
495f69b76b LibWeb: Don't paint children stacking contexts inside the current one 2021-07-24 22:02:28 +04:30
Ali Mohammad Pur
faef523567 LibRegex: Make unclosed-at-eof brace quantifiers an error
Otherwise we'd just loop trying to parse it over and over again, for
instance in `/a{/` or `/a{1,/`.
Unless we're parsing in Annex B mode, which allows `{` as a normal
ExtendedSourceCharacter.
2021-07-24 20:52:43 +04:30
Ali Mohammad Pur
1dd1378159 LibRegex: Preserve the type of the match when clearing capture groups
Even though the contents are supposed to be reset, the type should stay
unchanged, as that's an assumption the engine is making.
2021-07-24 20:52:43 +04:30
Luke
f36607dc95 Meta: Add LibIMAP and Mail to the list of libraries and features 2021-07-24 20:11:28 +04:30
Luke
256c4ad0ca Base: Add man page for Mail
This is primarily used to give an example configuration file.
2021-07-24 20:11:28 +04:30
Luke
b716e902ba Mail: Add an e-mail application called Mail
This utilises LibIMAP and LibWeb to provide an e-mail client.

The only way currently to connect to a server and login is with a
config file. This config file should be stored in ~/.config/Mail.ini
Here is an example config file:
```
[Connection]
Server=email.example.com
Port=993
TLS=true

[User]
Username=test@example.com
Password=Example!1
```

Since this is stored in plaintext and uses a less secure login method,
I'd recommend not using this on your main accounts :^)

This has been tested on Gmail and Outlook. For Gmail, you either have
to generate an app password if you have 2FA enabled, or enable access
from less secure apps in your account settings.
2021-07-24 20:11:28 +04:30
Luke
e80f8746b1 LibIMAP: Use try_parse_number instead of parse_number when parsing parts
This makes it so we can use Optional instead of relying on an error
number.
2021-07-24 20:11:28 +04:30
Luke
2c793d5935 LibIMAP: Make Section::parts unsigned 2021-07-24 20:11:28 +04:30
Luke
27644785f1 LibIMAP: Add method to get data out of BodyStructure 2021-07-24 20:11:28 +04:30
Luke
7e7c65abb6 Lagom/Fuzzers: Add fuzzer for the quoted printable decoder 2021-07-24 20:11:28 +04:30
Luke
a00b5fc7b7 Tests: Add tests for the quoted printable decoder 2021-07-24 20:11:28 +04:30
Luke
c63913b633 LibIMAP: Add quoted printable decoder
This is a very common encoding for e-mail. Gmail seems to encode all
HTML e-mail in it.
imap qp clang
2021-07-24 20:11:28 +04:30
Gunnar Beutner
cc0914ae58 Meta: Add Homebrew paths for macOS on M1 to the PATH env variable 2021-07-24 14:04:13 +02:00
Gunnar Beutner
12bfc7b3fc Toolchain+Ports: Ignore -arch on macOS M1 hosts
CMake specifies -arch arm64 for our toolchain. Unfortunately that's an
option GCC only understands when built for macOS. This causes the build
to fail.

I haven't been able to get CMake to not specify that option so this adds
a dummy option to GCC.
2021-07-24 14:04:13 +02:00
Lenny Maiorani
2cf4781d14 AK: Reimplement all_of in terms of find_if
Problem:
- Now that a generic free-function form of `find_if` is implemented
  the code in `all_of` is redundant.

Solution:
- Follow the "don't repeat yourself" mantra and make the code DRY by
  implementing `all_of` in terms of `find_if`.
- One tricky part is that since captures are not permitted in
  `constexpr` lambdas, the lambda created to negate the predicate
  needs to be created by a function which does not capture and takes
  the predicate at run-time instead. This allows `all_of` to continue
  to work in a `constexpr` context.
2021-07-24 13:11:13 +04:30
Gamerappa
497a9afaaf Hearts: Redesign the icon
This does not fix the issue where there's no indication for when
hearts are broken. But since the original icon for Hearts was
a placeholder. This should be better. :^)

Fixes #7373
2021-07-24 07:30:47 +02:00
Liav A
3645861f31 Kernel: Put a note about the unconditional unblanking of bochs-display
This removes the FIXME note and explains why it's not so bad to do this.
2021-07-24 01:42:10 +02:00
Gunnar Beutner
3c1797c42d Solitaire: Use AK::get_random_uniform() instead of rand()/srand() 2021-07-24 01:40:51 +02:00
Gunnar Beutner
58d1e46628 Spider: Use AK::get_random_uniform() instead of rand()/srand()
This also has the added benefit that after a restart we don't get the
same random numbers all the time because we forgot to initialize the
RNG with srand().
2021-07-24 01:40:51 +02:00
Gunnar Beutner
807b79d89e Spider: Avoid reallocations for Vectors when possible 2021-07-24 01:40:51 +02:00
Gunnar Beutner
d76b42599e Hearts: Avoid reallocations for Vectors when possible 2021-07-24 01:40:51 +02:00
Gunnar Beutner
5201c17d9b Hearts: Use AK::get_random_uniform() instead of rand()/srand() 2021-07-24 01:40:51 +02:00
Phoenix
1621311d73 GML Playground: Add Vim emulation 2021-07-24 01:13:42 +02:00
Tobias Christiansen
78757845bb Base: Add a test page for CSS 'calc()' values 2021-07-24 03:02:07 +04:30
Tobias Christiansen
9c65c10245 LibWeb: Add calc() resolution to CSS::Length
This patch finally adds the actual calculation that goes into calc()
expressions. When the resolution of a Length that is a calculated value
the parsed CalculatedStyleValue gets traversed and appropriate values
get calculated.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
20667dfff5 LibWeb: Plumb calculated StyleValues into CSS::Length
This is a bit hackish, but this way the existance of the calc()
becomes transparent to the user who just wants a Length and doesn't
care where it came from.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
328afa32c6 LibWeb: Add the parsing to the calc() handling
This patch adds the parsing of previously tokenized calc() expressions
into the CSS-Parser. The tokens are processed into a complete
CalculatedStyleValue.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
e3b68039bf LibWeb: Move type derivation of CSS::Length into seperate function
That way this can (and will) be used in other places.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
7a4c8e0b76 LibWeb: Add tokenization of calc expression
Here the first step in understanding a calc() expression is taken:
Finding the start of an expression  and tokenizong it.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
f8bf6ae911 LibWeb: Add CalculatedStyleValue to the CSS StyleValues
This adds the CalculatedStyleValue and all the structs needed to work
with the calc() expressions.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
14640692b7 LibWeb: Use Length::resolved() in FlexFormattingContext
It brew it's own tea resolving undefined and percentages. Let's use the
API already in place rather to keep it flexible.
2021-07-24 03:02:07 +04:30
Timothy Flynn
8c2b8fd001 LibJS: Remove UTF-8 RegExpExec and AdvanceStringIndex overrides
All interested parties are now UTF-16 capable, so these are unused.
2021-07-23 23:06:57 +01:00
Timothy Flynn
5a8f870594 LibJS: Implement RegExp.prototype [ @@replace ] with UTF-16 code units
This also converts the GetSubstitution abstract operation take its input
strings as UTF-16 now that all callers are UTF-16 capable. This means
String.prototype.replace (and replaceAll) no longer needs UTF-8 and
UTF-16 copies of these strings.
2021-07-23 23:06:57 +01:00
Timothy Flynn
ee7b04f7bb LibJS: Implement RegExp.prototype [ @@split ] with UTF-16 code units 2021-07-23 23:06:57 +01:00
Timothy Flynn
66c31a0c07 LibJS: Implement RegExp.prototype [ @@search ] with UTF-16 code units 2021-07-23 23:06:57 +01:00
Timothy Flynn
2c023157e9 LibJS: Implement RegExp.prototype [ @@match ] with UTF-16 code units 2021-07-23 23:06:57 +01:00
Timothy Flynn
b1ea9c20b0 LibJS: Implement RegExp.prototype.{exec,test} with UTF-16 code units
This converts RegExpExec to perform matching with UTF-16 strings. As a
very temporary stop-gap, this adds overloads to RegExpExec and friends
for both UTF-8 and UTF-16 strings. This is only needed until the rest
of RegExp.prototype is UTF-16 capable.

This also addresses a FIXME regarding code point index correction in
RegExpExec when the Unicode flag is set.
2021-07-23 23:06:57 +01:00
Timothy Flynn
a0c19deb80 LibJS: Implement RegExpCreate/RegExpInitialize closer to the spec
RegExpInitialize specifies how the pattern string should be created
before passing it to [[RegExpMatcher]]. Rather than passing it as-is,
the string should be converted to code points and back to a "List" (if
the Unicode flag is present), or as a "List" of UTF-16 code units.
Further. the spec requires that we keep both the original pattern string
and this parsed string in the RegExp object.

The caveat is that the LibRegex parser further requires any multi-byte
code units to be escaped (as "\unnnn"). Otherwise, the code unit is
recognized as individual UTF-8 bytes.
2021-07-23 23:06:57 +01:00
Timothy Flynn
345ef6abba LibRegex: Support ECMA-262 Unicode escapes of the form "\u{code_point}"
When the Unicode flag is set, regular expressions may escape code points
by surrounding the hexadecimal code point with curly braces, e.g. \u{41}
is the character "A".

When the Unicode flag is not set, this should be considered a repetition
symbol - \u{41} is the character "u" repeated 41 times. This is left as
a TODO for now.
2021-07-23 23:06:57 +01:00
Timothy Flynn
0e6375558d AK+LibRegex: Partially implement case insensitive UTF-16 comparison
This will work for ASCII code points. Unicode case folding will be
needed for non-ASCII.
2021-07-23 23:06:57 +01:00