Commit graph

42593 commits

Author SHA1 Message Date
Gunnar Beutner
466000e05f Meta: Make YCM work when the current dir is not the root of the tree
Previously we'd incorrectly use a relative path for the compilation
database.
2022-10-30 23:57:25 +01:00
Gunnar Beutner
084fad2aca Meta: Remove debug code in the YCM config file 2022-10-30 23:57:25 +01:00
Zaggy1024
e20756f9f7 LibGUI: Update buttons' text/tooltips in Action::set_text
This allows Actions that change based on some state to update their
associated buttons' text and tooltips to match their new text. The
play/pause button in SoundPlayer (and VideoPlayer if it's merged)
will now change tooltips when the playback changes state, rather than
always displaying "Play (Space)".
2022-10-30 23:54:12 +01:00
Linus Groh
1de1d6423b LibWeb: Implement the fetch() method :^)
With so much infrastructure implemented, we can finally add the last
piece of this puzzle - the fetch() method itself!

This contains a few hundred lines of generated code as handling the
RequestInfo and RequestInfo parameter types manually is not feasible,
but we can't use the IDL definition as the Window object is handwritten
code at the moment.
It's neatly tucked away in Bindings/ and will be removed eventually.
2022-10-30 20:10:29 +00:00
Linus Groh
c8d121fa32 LibWeb: Implement most of the 'Fetching' AOs
This implements the following operations from section 4 of the Fetch
spec (https://fetch.spec.whatwg.org/#fetching):

- Fetch
- Main fetch
- Fetch response handover
- Scheme fetch
- HTTP fetch
- HTTP-redirect fetch
- HTTP-network-or-cache fetch (without caching)

It does *not* implement:

- HTTP-network fetch
- CORS-preflight fetch

Instead, we let ResourceLoader handle the actual networking for now,
which isn't ideal, but certainly enough to get enough functionality up
and running for most websites to not complain.
2022-10-30 20:10:29 +00:00
Linus Groh
4db85493e8 AK+Meta: Add WEB_FETCH_DEBUG macro 2022-10-30 20:10:29 +00:00
Linus Groh
32e0f0aec8 LibWeb: Require error message for Response::network_error()
There will be a lot of different cases where we'll return an error
response, and having a customized Promise rejection message seems quite
useful.

Note that this has to be distinct from the existing 'status message',
which is required to be empty in those cases.
2022-10-30 20:10:29 +00:00
Linus Groh
d8ebdef010 LibWeb: Partially implement 'relative high resolution time' AOs 2022-10-30 20:10:29 +00:00
Linus Groh
caa13bf41d LibWeb: Fix URL parsing in Response::location_url()
We need to use URLParser in order to provide a base URL. This makes it
work for the common case of `Location: /some/path`.
2022-10-30 20:10:29 +00:00
Linus Groh
fd042dce55 LibWeb: Actually extract Location header in Response::location_url() 2022-10-30 20:10:29 +00:00
Linus Groh
455aa34011 LibWeb: Partially implement 'Extract header (list) values' AOs
The header-specific ABNF rules are completely ignored for now, but we
can at least extract a single header value, which at least works for
simple cases like `Location`-based redirects.
2022-10-30 20:10:29 +00:00
Linus Groh
14e722617c LibWeb: Implement 'Queue a fetch task' AO 2022-10-30 20:10:29 +00:00
Linus Groh
6deb5ce9b5 LibWeb: Implement 'Default User-Agent value' AO 2022-10-30 20:10:29 +00:00
Linus Groh
5ee9feb9cf LibWeb: Implement 'Append a request Origin header' AO 2022-10-30 20:10:29 +00:00
Linus Groh
c93e6ea0d9 LibWeb: Implement 'Appropriate network error' AO 2022-10-30 20:10:29 +00:00
Linus Groh
361ab205fa LibWeb: Implement 'CORS check' / 'TAO check' AOs 2022-10-30 20:10:29 +00:00
Linus Groh
8db64a8704 LibWeb: Implement 'Is non-secure context' AO 2022-10-30 20:10:29 +00:00
Linus Groh
4baf0a4486 LibWeb: Implement 'Is secure context' AO 2022-10-30 20:10:29 +00:00
Linus Groh
5d86eae119 LibWeb: Implement 'fetch params' struct 2022-10-30 20:10:29 +00:00
Linus Groh
ba31547fa0 LibWeb: Implement container class for fetch algorithms 2022-10-30 20:10:29 +00:00
Linus Groh
dd5d3e2f4f LibWeb: Implement 'fetch controller' struct 2022-10-30 20:10:29 +00:00
Linus Groh
fef331a03f LibWeb: Implement 'fetch timing info' struct 2022-10-30 20:10:29 +00:00
Linus Groh
1f8ed8fca7 LibWeb: Implement 'connection timing info' struct 2022-10-30 20:10:29 +00:00
Linus Groh
cc6eaafe6b LibWeb: Implement 'Byte sequence as body' AO 2022-10-30 20:10:29 +00:00
Linus Groh
dcded8d39f LibWeb: Implement 'Safely extract BodyInit' AO 2022-10-30 20:10:29 +00:00
Linus Groh
1e1fbb93fb LibWeb: Implement 'Determine request’s Referrer' AO 2022-10-30 20:10:29 +00:00
Linus Groh
1e5cac9e9c LibWeb: Implement 'Strip url for use as a referrer' AO 2022-10-30 20:10:29 +00:00
Linus Groh
6c1a9b28f1 LibWeb: Implement 'Is url potentially trustworthy?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
d56a6eb508 LibWeb: Implement 'Is origin potentially trustworthy?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
58ad6de954 LibWeb: Implement 'Should response be blocked due to nosniff?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
7e46150a71 LibWeb: Implement 'Should response be blocked due to its MIME type?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
62228f0870 LibWeb: Implement 'Should request be blocked due to a bad port' AO 2022-10-30 20:10:29 +00:00
Linus Groh
7fd4c7b0c6 LibWeb: Implement 'host is domain' concept from the URL spec 2022-10-30 20:10:29 +00:00
Linus Groh
55315d72f7 LibWeb: Explain the use-URL-credentials flag
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/a388348
2022-10-30 14:51:58 +00:00
Linus Groh
d2deb8fa6d LibWeb: Add has-cross-origin-redirects flag to Fetch::Infra::Response
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/7c30987
2022-10-30 14:51:58 +00:00
Linus Groh
793a1f5994 LibWeb: Actually define Blob-to-ReadableStream conversion
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/4cd70cf
2022-10-30 14:48:32 +00:00
Linus Groh
b1968b8bed LibWeb: Make Fetch::Infrastructure::{Request,Response,HeaderList} GC'd
This is the way.

On a more serious note, there's no reason to keep adding ref-counted
classes to LibWeb now that the majority of classes is GC'd - it only
adds the risk of discovering some cycle down the line, and forces us to
use handles as we can't visit().
2022-10-30 11:30:23 +00:00
premek
63122d0276 Base: Add Houses, Safety pin emoji
🧷 - U+1F9F7 Safety Pin
🏘 - U+1F3D8 House Buildings
2022-10-29 23:49:21 +01:00
Xexxa
c2e2b9d2ae Base: Add more yak emoji
􌴤 - U+10CD24 Yakslow
􌴥 - U+10CD25 Buffyak
􌴦 - U+10CD26 Yaktrap
􌵪 - U+10CD6A Yakthink
􌵫 - U+10CD6B Hyperyakkie
2022-10-29 18:54:08 +01:00
Xexxa
35dbef9808 Base: Add more emoji
🧔‍♀️ - U+1F9D4 U+200D U+2640 WOMAN: BEARD
🧝‍♂️ - U+1F9DD U+200D U+2642 MAN ELF
🧗 - U+1F9D7 PERSON CLIMBING
🦕 - U+1F995 SAUROPOD
🦖 - U+1F996 T-REX
💱 - U+1F4B1 CURRENCY EXCHANGE
🌬️ - U+1F32C WIND FACE
2022-10-29 18:54:08 +01:00
Xexxa
a1ffb7a5d3 Base: Adjust size of emoji U+26A7
⚧️ - U+26A7 TRANSGENDER SYMBOL
2022-10-29 18:54:08 +01:00
Xexxa
dcad3ee05f Base: Add U+2264 and U+2265 to Katica Regular 12
2264-2265 https://www.unicode.org/charts/PDF/U2200.pdf
2022-10-29 18:54:08 +01:00
Linus Groh
de3e6cc75c LibWeb: Ensure dom_exception_to_throw_completion() always takes a VM
The combination of template + auto&& parameter + constexpr if statements
allowed one caller to pass in a GlobalObject, without the compiler
complaining.
2022-10-29 15:48:46 +01:00
Linus Groh
9cda0b2b2c LibWeb: Remove outdated forward declarations 2022-10-29 15:48:46 +01:00
Linus Groh
6ce08d3f75 LibWeb: Use StringView literals for all WebIDL::SimpleExceptions 2022-10-29 15:48:46 +01:00
Andreas Kling
14d4f227f2 LibWeb: Don't invalidate style when adding/removing empty style sheet
For whatever reason, web pages sometimes add and/or remove a completely
empty style sheet. When this happens, we don't need to invalidate the
document's style, since the outcome will be the same as before.
2022-10-29 15:16:57 +02:00
Andreas Kling
ba6a9318c3 LibWeb: Don't update style/layout in template contents owner documents
These helper documents don't actually get rendered, so computing style
and doing layout for them is a complete waste of work.
2022-10-29 15:16:57 +02:00
Andreas Kling
64d5d633cf LibWeb: Don't invalidate layout when setting .innerHTML on <template>
HTML template elements don't affect rendering, so invalidating the
entire document's layout after poking into a <template> was a huge waste
of work on template-heavy pages.
2022-10-29 15:16:57 +02:00
Andreas Kling
ba5e511dc1 LibWeb: Make layout-after-resize lazy (because why not)
There's no need to force a synchronous relayout after the viewport has
been resized. By making it lazy, we might be able to coalesce it with
other layout work.
2022-10-29 15:16:57 +02:00
Andreas Kling
c7489e7665 LibWeb: Don't invalidate style for entire document on Node insertion
Like for attribute changes, we now only invalidate the insertion parent
and all of its descendants. Again, this is very aggressive, but also
way less than doing the entire document.

Once we implement the CSS :has() selector, we'll need to become more
sophisticated about invalidation.
2022-10-29 15:16:57 +02:00