Commit graph

24568 commits

Author SHA1 Message Date
Linus Groh
73a9d2ec32 LibIMAP: Replace abuse of String::matches() with == in the parser
matches() is for globs. These are not globs.
2021-07-24 22:22:41 +01:00
Linus Groh
ddd11b98d9 LibIMAP: Add and use Parser::consume_until_end_of_line() 2021-07-24 22:22:41 +01:00
Linus Groh
8e8d1383b7 LibIMAP: Clean up Parser.h a bit
Move members after methods, remove useless parameter names ('x', 's'),
more sensible method grouping.
2021-07-24 22:22:41 +01:00
Linus Groh
8c05b4e137 LibIMAP: Rename IMAP::Parser::{parse => consume}_while()
This isn't parsing anything.
2021-07-24 22:22:41 +01:00
Tobias Christiansen
6502d79240 Base: Add test page for box-shadow 2021-07-24 22:16:48 +02:00
Tobias Christiansen
5471c87246 LibWeb: Add box-shadow rendering
This patch adds the box-shadow rendering to Boxes. We do parse the
blur-radius of a box-shadow but we don't use it for now as the Filter
in the system don't seem quite powerful enough yet to handle that.
2021-07-24 22:16:48 +02:00
Tobias Christiansen
281689e1fa LibWeb: Parse box-shadow in the DeprecatedCSSParser
This adds support for box-shadows to the DeprecatedCSSParser. When it
encounters a box-shadow property, the following syntaxes can get parsed:
- box-shadow: <offset_x> <offset_y> <color>
- box-shadow: <offset_x> <offset_y> <blur_radius> <color>

There is other possible data following the property, but those aren't
supported for now.
2021-07-24 22:16:48 +02:00
Tobias Christiansen
f1bdaafcf6 LibWeb: Make box-shadow known throughout the CSS subsystem
This patch spreads box-shadows around:
- The Values important to box-shadows are stored in a BoxShadowData
  struct
- StyleProperties knows how to construct such a struct from a
  BoxShadowStyleValue and a Node knows how to ask for it
- CalculatedValues contain BoxShadowData and expose them
2021-07-24 22:16:48 +02:00
Tobias Christiansen
36e6f559c5 LibWeb: Add box-shadow as a known ValueID 2021-07-24 22:16:48 +02:00
Tobias Christiansen
2fdae3b0ca LibWeb: Add BoxShadowStyleType as a CSS StyleType
This new StyleType stores values related to box-shadows, since they
consist of multiple parts that isn't just a shorthand for other
properties.
2021-07-24 22:16:48 +02:00
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