Commit graph

18586 commits

Author SHA1 Message Date
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
Timothy Flynn
e54837add5 Browser+LibWeb: Add hooks for getting and setting cookies 2021-04-11 18:24:34 +02:00
Timothy Flynn
f0cdb2bf50 Browser: Initial cookie storage implementation
This adds storage for cookies that maye be set via 'document.cookie' in
JavaScript or the Set-Cookie HTTP header. For now, it parses only the
name-value pair from a set-cookie line, but does not parse optional
attributes.

Currently, storage is ephemeral and only survives for the lifetime of
the Browser instance.
2021-04-11 18:24:34 +02:00
Timothy Flynn
59e47c3b11 Base: Add test page for document.cookie 2021-04-11 18:24:34 +02:00
setepenre
fe8cefa7c1 ls: ls will print directory name when listing multiple directories 2021-04-11 18:16:46 +02:00
Linus Groh
433a23cfde LibJS: Fix array hole and string object indexing prototype indirection
This fixes two cases of indexed access (array holes, out-of-bounds
string object access) where we would not follow the prototype chain and
incorrectly return undefined:

    // Should be "a", returned undefined
    Object.setPrototypeOf([,], ["a"])[0]

    // Should be "a", returned undefined
    Object.setPrototypeOf(new String(""), new String("a"))[0]

The actual fix is simple, instead of returning early if the requested
index is past the string's length or within the indexed properties size
but has no value, we just continue the prototype chain traversal and get
correct behaviour from that.
2021-04-11 18:15:47 +02:00
Brendan Coles
72fbf26dd6 Network: Add network.png 32x32 icon 2021-04-11 17:53:53 +02:00
Andreas Kling
54cd8dfc4d LibWeb+WebContent: Support image context menus in OOPWV
You can now right-click images in web content and get a context menu.
2021-04-11 16:49:25 +02:00
Andreas Kling
e43fba0c58 SystemMonitor: Add tab with detailed state to process properties window
This is done using a wrapper model that transforms all the information
about a single process in the ProcessModel and turns it into a 2-column
table model with only that process in it.
2021-04-11 13:24:59 +02:00
Andreas Kling
a78ea2c0b2 SystemMonitor: Add a little header to the process properties window
Show a larger (32x32) version of the executable icon and the process
name + PID above the various property tabs.
2021-04-11 12:52:42 +02:00
Andreas Kling
1c52dc86ee SystemMonitor: Simplify executable icon lookup in ProcessModel 2021-04-11 12:52:42 +02:00
Andreas Kling
a2686f9bec LibGUI: Avoid unnecessary Gfx::Bitmap cloning in FileIconProvider 2021-04-11 12:52:42 +02:00
Andreas Kling
0c02dfcad5 LibGUI: Add convenient helpers for getting the sibling of a ModelIndex 2021-04-11 12:52:42 +02:00
Brian Gianforcaro
10d9a8db71 Base: Fix run-tests-and-shutdown.sh output in CI testing mode.
The missing newline made the output look weird, as it was jumbled
up next to the standard QEMU boot output instead of below it.
2021-04-11 12:50:33 +02:00
Brian Gianforcaro
dc98c417ca LibGUI: Remove an unused AK/Debug.h include 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
c4226ca646 LibWeb: Remove trailing ';' from WrapperGenerator functions. 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
7db74a6b3e AK: Annotate StringBuilder functions as [[nodiscard]] 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
23454cab46 AK: Annotate WeakPtr functions as [[nodiscard]] 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
56ab0da6a4 AK: Annotate Trie functions as [[nodiscard]] 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
75e7c780e7 AK: Annotate StringView functions as [[nodiscard]] 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
28e40e22c0 AK: Annotate IntrusiveList functions as [[nodiscard]] 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
0593fa4dcb AK: Annotate HashTable functions as [[nodiscard]] 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
15b94ec1fd AK: Make HashTable with capacity constructor explicit 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
a8671ec166 AK: Annotate HashMap functions with [[nodiscard]] 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
eaa9ec9b5d AK: Annotate DoublyLinkedList functions with [[nodiscard]] 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
5165661799 AK: Annotate Checked functions with [[nodiscard]] 2021-04-11 12:50:33 +02:00
Brian Gianforcaro
b6726df828 Ports: Fix Ports/README.md to match lint rule 2021-04-11 11:15:22 +02:00
Andreas Kling
251018676f Everywhere: Update references from ReadMe.md => README.md 2021-04-11 10:52:25 +02:00