Commit Graph

9728 Commits

Author SHA1 Message Date
Ali Mohammad Pur
29acb7fcf8 LibCore: Add a Socket::set_idle() API that turns the notifiers on/off
When a socket's user doesn't need it to be active, but wants to keep it
open, the socket's notifiers should not be enabled to avoid hogging the
CPU with effectively useless notifications.
This API can be used to disable said notifiers until the user needs the
notifications.
2021-10-04 15:31:26 +02:00
Ali Mohammad Pur
830b0e8f2d LibHTTP: Treat EOF on a non-Finished state as an error 2021-10-04 15:31:26 +02:00
Tobias Christiansen
873e95cb6a LibWeb: Flexbox: Care more about cross-axis margins
Auto margins are still not supported at all, but this is a good start
into supporting margins on flex items.
The way cross-before (top for row, left for column) is handled is very
naive.
2021-10-04 13:59:28 +02:00
Tobias Christiansen
9af85881f5 LibWeb: Flexbox: Take parents' specified main size into account
Previously, if the parent of the container had a definite main size, it
would've been disregarded when calculating the main size of the
container if it had no definite size and neither min- nor max-main-size
constraints.
This patch fixes that behavior by additionally checking whether the main
size is not only not constrained but also infinite.
2021-10-04 13:35:36 +02:00
Ali Mohammad Pur
fdd2d49c5b LibHTTP: Ignore empty reads on chunk boundaries 2021-10-04 13:06:03 +02:00
Ali Mohammad Pur
3564e4eff1 LibHTTP: Consider a job failed if its body fails decompression
Our previous behaviour of treating the original invalid compressed body
as the decompressed response is quite silly, if the headers and response
doesn't match up, the job has failed.
2021-10-04 13:06:03 +02:00
Andreas Kling
643e2dec2c LibWeb: Make WindowObject::clear_interval() call correct function
This was incorrectly calling DOM::Window::clear_timeout(). In practice,
these functions are interchangeable, but let's have things looking
correct regardless.
2021-10-04 12:13:25 +02:00
Tim Schumacher
7af7fc8c16 Everywhere: Fix more Copyright header inconsistencies 2021-10-04 11:10:09 +01:00
Ali Mohammad Pur
e112e6620f LibCore: Allow reads smaller than the buffered data size in IODevice
This restriction doesn't make much sense, a user should be free to
consume the buffered data with as small a max_size as they desire.
This fixes a possible RequestServer spin when talking to HTTP servers.
2021-10-04 11:00:44 +02:00
Linus Groh
7ee3432ab6 LibWeb: Add basic support for script string argument to setInterval()
Instead of passing a function it is also possible to pass a string,
which is then evaluated as a classic script.
2021-10-04 09:54:24 +01:00
Linus Groh
9f4ac38f08 LibWeb: Add basic support for script string argument to setTimeout()
Instead of passing a function it is also possible to pass a string,
which is then evaluated as a classic script.

This means we now support the following example from the "timer
initialization steps", step 16 - except that it runs the timers in
reverse order, so the `log` result is `"TWO ONE "`.

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timer-initialisation-steps

    var log = '';
    function logger(s) { log += s + ' '; }

    setTimeout({ toString: function () {
      setTimeout("logger('ONE')", 100);
      return "logger('TWO')";
    } }, 100);
2021-10-04 09:54:24 +01:00
Linus Groh
32b620c62d LibJS: Convert atomic_compare_exchange_impl() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
74e29fa60b LibJS: Convert perform_atomic_operation() to ThrowCompletionOr 2021-10-04 09:52:15 +01:00
Linus Groh
f95560b21a LibJS: Convert atomic_read_modify_write() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
6cef1dfa6d LibJS: Convert validate_atomic_access() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
12ac2338aa LibJS: Convert validate_integer_typed_array() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
253d9a38d1 LibJS: Convert typed_array_create() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
04ff12740c LibJS: Convert initialize_typed_array_from_list() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
d551e0e55e LibJS: Convert init_typed_array_from_array_like() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
8e3957767e LibJS: Convert init_typed_array_from_typed_array() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
7f86c32d62 LibJS: Convert init_typed_array_from_array_buffer() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
3655aee543 LibJS: Convert validate_typed_array() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
d7d73f9100 LibJS: Convert to_property_descriptor() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
2f42675ebd LibJS: Convert ordinary_set_with_own_descriptor() to ThrowCompletionOr 2021-10-04 09:52:15 +01:00
Linus Groh
3b59a4577d LibJS: Convert define_properties() to ThrowCompletionOr 2021-10-04 09:52:15 +01:00
Linus Groh
0a49a2db60 LibJS: Convert set_immutable_prototype() to ThrowCompletionOr 2021-10-04 09:52:15 +01:00
Andreas Kling
a7b1c7eb16 LibWeb: Don't send a request body in XMLHttpRequest GET or HEAD 2021-10-04 00:06:48 +02:00
Andreas Kling
0cb4d48283 LibJS: Remove unused ExecutionContext::arguments_object 2021-10-03 23:58:21 +02:00
Andreas Kling
f8354c5503 LibWeb+Browser: Disable Same-Origin Policy by default for now
Until we have CORS preflight checks working, this is only getting in the
way of testing and I have to disable it manually all the time.
2021-10-03 23:39:07 +02:00
Andreas Kling
573955be7f LibWeb: Basic support for location.replace(url)
This is not entirely to spec, but gets the basic job done.
2021-10-03 23:36:56 +02:00
Linus Groh
37784a85c0 LibWeb: Run clang-format on HTMLAreaElement.cpp 2021-10-03 21:40:37 +01:00
Linus Groh
1f7068ace9 LibJS: Remove unused TemporaryChange include from Object.cpp 2021-10-03 21:40:07 +01:00
Andreas Kling
ba0c907a6f LibWeb: Make the URL.port setter return after assigning the empty string
This matches the spec ("3. Otherwise, ...")
2021-10-03 21:31:46 +02:00
Andreas Kling
a7a3f41f67 LibWeb: Implement the HTMLHyperlinkElementUtils mixin
This is used by HTMLAnchorElement and HTMLAreaElement to share
functionality related to their href attribute.
2021-10-03 21:31:46 +02:00
Linus Groh
e5b8544762 LibJS: Convert enumerable_own_property_names() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
3af559ee8a LibJS: Convert test_integrity_level() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
ed5a9aa038 LibJS: Convert set_integrity_level() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
3be26f56db LibJS: Convert has_own_property() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
f38a5957bf LibJS: Convert has_property() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
a29b7a3ec7 LibJS: Convert delete_property_or_throw() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
fe86b04b42 LibJS: Convert define_property_or_throw() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
ebf57df431 LibJS: Convert create_non_enum_data_p_or_throw() to ThrowCompletionOr
The actual name is a bit longer, but you know what I mean :^)
2021-10-03 20:14:03 +01:00
Linus Groh
364dd42fc8 LibJS: Convert create_data_property_or_throw() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
bb2499cd7a LibJS: Convert create_method_property() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
fb443b3fb4 LibJS: Convert create_data_property() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
1d45541278 LibJS: Convert Object::set() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
b7e5f08e56 LibJS: Convert Object::get() to ThrowCompletionOr
To no one's surprise, this patch is pretty big - this is possibly the
most used AO of all of them. Definitely worth it though.
2021-10-03 20:14:03 +01:00
Linus Groh
9b6c09e2c4 LibJS: Convert is_extensible() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
fa2ac5b759 LibJS: Convert ordinary_to_primitive() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-03 20:14:03 +01:00
Linus Groh
867b19affb LibJS: Convert install_error_cause() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00