Commit graph

18813 commits

Author SHA1 Message Date
Timothy Flynn fc03f8d959 Base: Update cookie test page to set some attributes 2021-04-12 22:37:00 +02:00
Timothy Flynn cab2e2dded Browser: Process Expires cookie attribute 2021-04-12 22:37:00 +02:00
Timothy Flynn 2370efbea6 AK: Add a predicate variant of StringView::split_view 2021-04-12 22:37:00 +02:00
Gunnar Beutner 0497986572 LibC: Use dbgln() in strerror() and strsignal()
Printing error messages to stdout can have unintended side effects
depending on what the program is doing.
2021-04-12 22:34:07 +02:00
Gunnar Beutner 44486e8818 LibC: Turn CRASH() into a function and add noreturn attribute
This way CRASH() can be used in functions that are themselves
marked as noreturn.
2021-04-12 22:30:06 +02:00
Valtteri Koskivuori d5e1250061 WindowServer: Fix notification placement
No more top bar, no more extra padding. Spacing is equal on the top and
on the left, so it looks pretty tidy.
2021-04-12 18:11:43 +02:00
David Isaksson 73411ee181 Meta: Add .vim directory to .gitignore 2021-04-12 18:04:13 +02:00
RickySeverino 21ecd5b804 HackStudio: Allow users to drag and drop files into the editor 2021-04-12 18:03:55 +02:00
Idan Horowitz 2c93123daf Kernel: Replace process' regions vector with a Red Black tree
This should provide some speed up, as currently searches for regions
containing a given address were performed in O(n) complexity, while
this container allows us to do those in O(logn).
2021-04-12 18:03:44 +02:00
Idan Horowitz 497c759ab7 Kernel: Remove old region from process' regions vector before splitting
This does not affect functionality right now, but it means that the
regions vector will now never have any overlapping regions, which will
allow the use of balance binary search trees instead of a vector in the
future. (since they require keys to be exclusive)
2021-04-12 18:03:44 +02:00
Idan Horowitz f8a3da46fd AK: Implement IntrusiveRedBlackTree container
This container is similar to the RedBlackTree container, but instead of
transparently allocating tree nodes on insertion and freeing on removal
this container piggybacks on intrusive node fields in the stored class
2021-04-12 18:03:44 +02:00
Idan Horowitz e962254eb2 AK: Implement RedBlackTree container
This container is based on a balanced binary search tree, and as such
allows for O(logn) worst-case insertion, removal, and search, as well
as O(n) sorted iteration.
2021-04-12 18:03:44 +02:00
Tobias Christiansen c4a9f0db82 UserspaceEmulator: Improve detection of memory leaks
Previous a mallocation was marked as 'reachable' when any other
mallocation or memory region had a pointer to that mallocation. However
there could be the situation that two mallocations have pointers to each
other while still being unreachable from anywhere else. They would be
marked as 'reachable' regardless.

This patch replaces the old way of detemining whether a mallocation is
reachable by analyzing the dependencies of the different mallocations
using a graph-approach. Now mallocations are only reachable if pointed
to by other reachable mallocations or other memory regions.

A nice bonus is that this gets rid of a nested for_each_mallocation, so
the complexity of leak finding becomes linear instead of quadratic.
2021-04-12 18:02:16 +02:00
Egor Ananyin 86290c0e4e LibWeb: Set border width to zero if style is none 2021-04-12 17:47:59 +02:00
Egor Ananyin d5eb09adc2 LibWeb: Parse border-style correctly 2021-04-12 17:47:59 +02:00
Emil Engler b2a0552281 Documentation: Fix FreeBSD usage of the pkg command 2021-04-12 17:45:48 +02:00
thankyouverycool 102bb3b3d2 Base: Fix a few width/height oversights in Marieta
Corrects punctuation width and erroneous 'Q' width reset. Adjusts
height of double quote and '$'
2021-04-12 15:31:55 +02:00
Andreas Kling 767bd8cc88 WindowServer: Strip Alt-shortcut marker ('&') when measuring menu texts
We were including these markers when computing the sizes of menus,
causing them to get a little too much padding.
2021-04-12 15:24:17 +02:00
Peter Elliott fbbb4b3395 Ports: fallback to pro when curl is not installed 2021-04-12 14:06:24 +02:00
Peter Elliott f71102a474 Ports: Require less commands in .port_include.sh
- fallback to http with curl when https fails
- add --no-gpg-verification, which will skip gpg signature verification
2021-04-12 14:06:24 +02:00
Peter Elliott dcee024fee LibArchive: Support POSIX.1-1988 tar files
These old tar files didn't have magic numbers, so I've also added a checksum
check to TarInputStream::valid()
2021-04-12 14:06:24 +02:00
Peter Elliott a09421f1be Ports: Don't use getaddrinfo for curl
serenity's getaddrinfo is a stub, but curl detects it anyway, and uses
it instead of gethostbyname.
2021-04-12 14:06:24 +02:00
Peter Elliott 02a0feff1c Userland: Add nproc utility
nproc prints the number of processors on the system. Our ports system
uses it.
2021-04-12 14:06:24 +02:00
Peter Elliott eca20e92da Userland: Add support for -S to env command
- Refactor env to use Core::ArgsParser
- create symlink from /bin/env to /usr/bin/env for compatiability
2021-04-12 14:06:24 +02:00
Peter Elliott 938924f36d Meta: Add install-ports CMake target
install-ports copys the necessary files from Ports/ to /usr/Ports. Also
refactor the compiler and destiation variables from .port_include.sh
into .hosted_defs.sh. .hosted_defs.sh does not exists when ports are
built in serenity
2021-04-12 14:06:24 +02:00
Brendan Coles 9c3948ef3e Ports: Add Dialog 2021-04-12 11:24:31 +02:00
Stephan Unverwerth 8c80eb8870 LibJS: Memoize failed calls of try_parse_arrow_function_expression() 2021-04-12 11:24:09 +02:00
Brendan Coles 435bd841ee Ports: Add GNU libtool 2021-04-12 11:23:48 +02:00
Linus Groh da177c6517 LibJS: Make Errors fully spec compliant
The previous handling of the name and message properties specifically
was breaking websites that created their own error types and relied on
the error prototype working correctly - not assuming an JS::Error this
object, that is.

The way it works now, and it is supposed to work, is:

- Error.prototype.name and Error.prototype.message just have initial
  string values and are no longer getters/setters
- When constructing an error with a message, we create a regular
  property on the newly created object, so a lookup of the message
  property will either get it from the object directly or go though the
  prototype chain
- Internal m_name/m_message properties are no longer needed and removed

This makes printing errors slightly more complicated, as we can no
longer rely on the (safe) internal properties, and cannot trust a
property lookup either - get_without_side_effects() is used to solve
this, it's not perfect but something we can revisit later.

I did some refactoring along the way, there was some really old stuff in
there - accessing vm.call_frame().arguments[0] is not something we (have
to) do anymore :^)

Fixes #6245.
2021-04-12 09:38:57 +02:00
Linus Groh 6e9eb0a284 LibJS: Add Object::get_without_side_effects()
Similar to Value::to_string_without_side_effects() this is mostly a
regular object property lookup, but with the guarantee that it will be
side-effect free, i.e. no accessors or native property functions will
be called. This is needed when we want to access user-controlled object
properties for debug logging, for example. The specific use case will be
error objects which will soon no longer have internal name/message
properties, so we need to guarantee that printing an error, which may
already be the result of an exception, won't blow up in our face :^)
2021-04-12 09:38:57 +02:00
Luke 9ec4defdd2 LibWeb: Add Window.parent and fix Window.top attributes
This returns the parent frame of the current frame. If it's the
main frame, it returns itself.

Also fixes the attributes of Window.top, as they were accidentally
being passed in as the setter.

Required by Web Platform Tests.
2021-04-12 09:01:08 +02:00
Timothy Flynn e0f9ed01c7 Browser: Process Secure and HttpOnly cookie attributes 2021-04-12 08:57:44 +02:00
Timothy Flynn db24186309 Browser: Process Path cookie attribute 2021-04-12 08:57:44 +02:00
Timothy Flynn 3d53af354e Browser: Process Domain cookie attribute 2021-04-12 08:57:44 +02:00
Timothy Flynn a554676008 Browser: Process Max-Age cookie attribute
Note: the default expiry time should be the "the latest representable
date". However, DateTime::from_timestamp(NumericLimits<time_t>::max())
isn't feasible due to the for-loops in LibC's time_to_tm. So instead,
this just sets the date to the maxium year.
2021-04-12 08:57:44 +02:00
Timothy Flynn d610aeb5da Browser: Parse cookie attribute name-value pairs
Implements the remainder of the parsing algorithm of RFC-6265 Section
5.2 to extract optional attributes. The attribute values are not
processed.
2021-04-12 08:57:44 +02:00
thankyouverycool 198c4fd7f2 Serendipity: Paint theme agnostic banner
And remove temporary welcome-banner.png. Fixes invisible text in
dark themes.
2021-04-12 08:56:06 +02:00
thankyouverycool 4366cb469b Base: Add new sans serif font Marieta
Liza's younger, slightly better proportioned sister
2021-04-12 08:56:06 +02:00
thankyouverycool 1de4ed8ca1 Serendipity: Don't modify tip frame palette
Fixes illegible tip text
2021-04-12 08:56:06 +02:00
AnotherTest 5a14f7ea2f LibRegex: Generate a 'Compare' op for empty character classes
Otherwise it would match zero-length strings.
Fixes #6256.
2021-04-12 08:54:58 +02:00
AnotherTest 7c98a6be17 LibHTTP: Handle running out of input between chunk body and ending CRLF
Fixes an issue where LibHTTP would incorrectly detect an end of stream
when it runs out of TLS application data between the chunk body and its
ending CRLF.
2021-04-12 08:36:21 +02:00
Andreas Kling d7f947b7ca Meta: Add a link to the SerenityOS Discord server in README.md 2021-04-11 22:04:13 +02:00
tuqqu 5438879277 LibJS: Removed a fixme in a test of BigInt.prototype.valueOf 2021-04-11 20:51:58 +02:00
Tim Waterhouse 4d81d868c7 AK: Update LexicalPath::relative_path to work for '/' prefix
If the prefix path is just a slash the LexicalPath was removing too many
characters. Now only remove an extra character if the prefix is not just
the root path.
2021-04-11 19:19:49 +02:00
Luke 83d2c3f2f5 LibWeb: Move element_child_count to ParentNode and add its IDL attribute
I initially had it in Node just because, but then saw it was part of
ParentNode in the spec.
2021-04-11 18:32:42 +02:00
Luke fc9abee84b LibWeb: Add Event.initEvent
Used by YouTube after creating an event with Document.createEvent
2021-04-11 18:27:52 +02:00
Luke 8da14bf880 LibWeb: Add support for optional default values and optional bools in IDL
Fixed the DOMException constructor as it had the default value version
commented out.
2021-04-11 18:27:52 +02:00
Tom Needham ad4a4ba1c6
Ports: Add Port for the yasm assembler (#6149)
This is a required dependency for many libraries.
2021-04-11 18:25:26 +02:00
Timothy Flynn 4152f807bc LibWeb: Store cookies sent via the Set-Cookie HTTP header
Note: HTTP response headers are currently stored in a hash map, so the
Set-Cookie entry will only appear once here.
2021-04-11 18:24:34 +02:00
Timothy Flynn 1ef48d50ff LibWeb+WebContent: Hook document.cookie to the backend cookie storage 2021-04-11 18:24:34 +02:00