Commit graph

4049 commits

Author SHA1 Message Date
Idan Horowitz
efe94d9040 LibWeb: Support parsing a URL relative to environment settings object 2022-11-15 21:48:19 +00:00
Idan Horowitz
f69c135796 LibWeb: Implement the 'Entry Realm/{settings,global} object' concepts 2022-11-15 21:48:19 +00:00
Idan Horowitz
c9f9fcd8fd LibWeb: Remove accidentally commited dbglns 2022-11-15 21:48:19 +00:00
Timothy Flynn
05f41382bb Userland: Properly define IPC::encode and IPC::decode specializations
In order to avoid the base encode/decode methods from being used (and
failing a static assertion), we must be sure to declare/define the
custom type implementations as template specializations.

After this, LibIPC is no longer sensitive to include order.
2022-11-15 13:25:51 -05:00
Timothy Flynn
8e624c8f6d LibWeb+WebContent+WebDriver: Implement Find Elements From Shadow Root 2022-11-15 11:55:36 +00:00
Timothy Flynn
6d9bd04233 LibWeb+WebContent+WebDriver: Implement Find Element From Shadow Root 2022-11-15 11:55:36 +00:00
Timothy Flynn
4d9fd5d190 LibWeb+WebContent+WebDriver: Implement Get Element Shadow Root 2022-11-15 11:55:36 +00:00
Timothy Flynn
cb91e6067c LibWeb+WebContent+WebDriver: Implement Get Active Element
Unfortunately, nothing ever calls DOM::Document::set_active_element at
the moment, so this will always return ErrorCode::NoSuchElement.
2022-11-15 11:55:36 +00:00
Itamar
8d65df935e LibWeb: Handle inset properties in style_value_for_property()
This adds support for the Top, Right, Bottom and Left CSS properties
in style_value_for_property().
2022-11-14 21:22:27 +00:00
Aliaksandr Kalenik
2675b9390b LibWeb: Parse unknown media type in media queries
Prevent media query parser from falling back into
MediaQuery::create_not_all() for queries with unknown media type.
With this change following test works correctly:
http://wpt.live/css/css-conditional/at-media-001.html
2022-11-14 16:08:35 +00:00
Aliaksandr Kalenik
7f527ddde3 LibWeb: Support device-height and device-width media query values 2022-11-14 16:08:35 +00:00
Aliaksandr Kalenik
93238edf8f LibWeb: Respect media attribute of style tag 2022-11-14 14:47:37 +00:00
Linus Groh
93c0c73b9e LibWeb: Implement XMLHttpRequest.withCredentials 2022-11-14 10:00:11 +00:00
Linus Groh
bfa378660b LibWeb: Add a clarifying comment to XHR::m_response_object
Trying to change this to a JS::Object didn't quite work, so let's add
a helpful comment instead.
2022-11-14 10:00:11 +00:00
Linus Groh
fb57500394 LibWeb: Use HeaderList from Fetch for XHR author request headers 2022-11-14 10:00:11 +00:00
Linus Groh
c8184d85c1 LibWeb: Rename XHR::{m_request_headers => m_author_request_headers} 2022-11-14 10:00:11 +00:00
Linus Groh
6e53dd8767 LibWeb: Rename XHR::{m_url => m_request_url} 2022-11-14 10:00:11 +00:00
Linus Groh
29a8414a05 LibWeb: Rename XHR::{m_method => m_request_method} 2022-11-14 10:00:11 +00:00
Linus Groh
338ada66fa LibWeb: Add spec comments and links to XHR members 2022-11-14 10:00:11 +00:00
Linus Groh
04eaff3bb4 LibWeb: Rename XHR's ReadyState / m_ready_state to just State / m_state
This is what the spec calls it.
2022-11-14 10:00:11 +00:00
Timothy Flynn
9fbc4138bb LibWeb: Define the route for the Fullscreen Window command
This was missed in 4eefa292df.
2022-11-14 00:05:15 +00:00
Moustafa Raafat
6ff9a88c3b LibWeb: Support animated backgrounds 2022-11-13 16:53:22 -07:00
Igor Pissolati
bfdb30c74a LibWeb: Implement bare-bones HTMLElement.dir 2022-11-13 16:37:09 -07:00
Igor Pissolati
de494ccf38 LibWeb: Implement window.location.origin 2022-11-13 16:37:09 -07:00
Timothy Flynn
5385cb1287 LibWeb+WebContentr+WebDriver: Move driver response wrapping to LibWeb
Success responses are meant to be wrapped in a JSON object with a single
"value" key. Instead of doing this in both WebContent and WebDriver, do
it once in LibWeb.
2022-11-13 16:41:07 +00:00
Timothy Flynn
4eefa292df LibWeb: Re-implement WebDriver endpoint handling within Web::WebDriver
This moves communication and route matching for WebDriver endpoints into
LibWeb. This is to reduce the amount of duplication required to create a
WebDriver implementation for Ladybird.

In doing so, this introduces some cleanup of WebDriver handling. Routes
are now a compile-time array, and matching a route is nearly free of
allocations (we still allocate a Vector for parsed parameters). This
implementation also makes heavier use of TRY semantics to propagate
errors into one handler.
2022-11-13 16:41:07 +00:00
Timothy Flynn
cb4b9108d1 LibWeb+WebDriver: Move the timeouts configuration object to LibWeb 2022-11-11 22:03:23 +00:00
Timothy Flynn
fce9fcf154 LibWeb: Add a string-to-same-site-attribute converter 2022-11-11 18:02:04 +00:00
Nico Weber
0175b5c584 LibWeb: Merge latest mimesniff spec update
Merges https://github.com/whatwg/mimesniff/commit/e589fcb71196,
an editorial change...that fixes a comment typo!
2022-11-11 12:13:09 +00:00
Timothy Flynn
40b9d248be LibWeb: Implement screenshot painting inside Web::WebDriver
This will allow for implementing the screenshot action closer to the
spec, as we can now use HTMLCanvasElement to encode the bitmap, and
capture the screenshot on the animation frame loop.
2022-11-11 11:36:07 +00:00
Kenneth Myhra
8f0fdef856 LibWeb: Remove unused type XMLHttpRequestBodyInit 2022-11-11 00:39:12 -07:00
Kenneth Myhra
d11d26ef91 LibWeb: Implement support for DOM::Document in XHR::send()
Co-authored-by: Linus Groh <mail@linusgroh.de>
2022-11-11 00:39:12 -07:00
Timothy Flynn
941bc47538 LibWeb: Define method to check if an attribute is a boolean attribute 2022-11-10 17:02:11 +00:00
Timothy Flynn
21c1494ac5 LibWeb: Define a few missing attribute names
These are specifically boolean attributes that will be referred to in
following commits.
2022-11-10 17:02:11 +00:00
Timothy Flynn
15916e5c14 LibWeb: Implement the element location strategies in Web::WebDriver 2022-11-10 13:10:16 +00:00
Linus Groh
a2a4ad3b9d LibWeb: Fix typo in BodyInitOrReadableBytes type alias 2022-11-09 22:38:03 +00:00
Nico Weber
6911c5545c Everywhere: Fix a few comment typos 2022-11-09 16:00:32 +00:00
Andreas Kling
bc807466f9 LibWeb: Finish half-written comment in abspos height calculation
Apparently I forgot to write the whole comment in the previous commit,
8a87f4fa20.
2022-11-09 16:16:10 +01:00
Andreas Kling
8a87f4fa20 LibWeb: Try to compute height for abspos elements before inside layout
This can resolve height early in some cases, notably this kind of setup:

    position: absolute;
    top: 0px;
    bottom: 0px;

By resolving height before inside layout, descendants of the abspos
element can resolve automatic and relative vertical lengths against it.

This makes the Discord UI occupy the whole window instead of looking
"shrink-to-fit".
2022-11-09 15:48:08 +01:00
Andreas Kling
5e996b461c LibWeb: Actually assign solved value for left in abspos width case 1 2022-11-09 15:48:08 +01:00
Timothy Flynn
2d5381fd91 LibWeb: Add a flag to track when a browsing context has been discarded 2022-11-08 19:58:34 -05:00
Timothy Flynn
8ae10ba0fd LibWeb+WebDriver: Add an IPC-transferable Web::WebDriver::Response class
This is essentially an ErrorOr<JsonValue, Web::WebDriver::Error> class.
Unfortunately, that ErrorOr would not be default-constructible, which is
required for the generated IPC classes. So this is a thin wrapper around
a Variant<JsonValue, Web::WebDriver::Error> to emulate ErrorOr.
2022-11-08 19:58:34 -05:00
Timothy Flynn
0246abec80 LibWeb+WebDriver: Move WebDriverError to Web::WebDriver::Error
This is to prepare for WebContent becoming the WebDriver client.
2022-11-08 19:58:34 -05:00
Luke Wilde
fd6bb41519 LibWeb: Apply the current transform in CRC2D.stroke()
This makes the Google Docs spelling and grammar squiggles appear in the
correct position.
2022-11-08 18:47:31 +00:00
Nico Weber
d09b5e8484 Everywhere: Clean up "in in" comment typos
Includes fetch editorial update
https://github.com/whatwg/fetch/commit/3cafbdfc39250!
2022-11-08 15:09:08 +00:00
Gunnar Beutner
892186d058 LibWeb: Pick the correct DOM node for mouse-move events
This makes hovering over the link in the following HTML snippet work,
i.e. the tooltip is shown and the link target is shown at the bottom
of the browser window:

<html lang="en"><head><style>
.site-link{display:inline-block}
.site-link:before{content:"derp"}
.site-link::after{content:"";display:block}
</style></head><body><a class="site-link" href="#"
title="Tooltip, maybe!"></a>
2022-11-08 11:47:44 +01:00
MacDue
7e21fe61b4 LibWeb: Paint repeating-conic-gradient()s
Shares the same machinery as linear-gradient()s so this is quite easy.
2022-11-07 13:13:22 +00:00
MacDue
2c2b9fb1d7 LibWeb: Parse repeating-conic-gradient()s 2022-11-07 13:13:22 +00:00
Luke Wilde
bee4df7bfb LibWeb: Skip hit testing a line box fragment if it has no container
The container appears to be null for certain elements such as the
"update your browser" box when clicking on the document during certain
parts of loading. Skipping it works fine, but should obviously be
fixed, so it prints a debug output when this happens.
2022-11-07 14:10:41 +01:00
Luke Wilde
11ede565a8 LibWeb: Fire a keypress event after firing a keydown event
In Google Docs with our user agent string, this is the event it listens
for to insert characters into the document.
2022-11-07 14:10:41 +01:00