The `WebViewId` name is a lot more descriptive these days to the casual
reader, so I think we can go ahead and finish the rename.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This makes it much faster to traverse over the slot descendants of
a shadow root, which is a fairly costly part of "assign slottables to a tree".
This reduces the time it takes for the results to load on wpt.fyi from
over 3 minutes to about 5 seconds.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
One of the callers was only used for an assert, and it was passing an
inline size argument to a parameter expecting a block size, so it wasn't
making much sense anyways.
Just inline the code into the other caller, and for consistency remove
the assert for replaced elements too.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Don't run scripts in document that don't have a browsing context
For confirmation that this is correct, refer to the note under
Step 3 of https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Adds support for min-content, max-content, fit-content and stretch on
the min and max cross size properties of a flex item.
With one exception: when resolving the main sizes, transferred cross
minimums and maximums will still ignore keywords.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
We were ignoring `table-layout: fixed` both for `inline-size: auto` and
`inline-size: max-content`. However, the CSSWG resolved that fixed table
layout should be triggered except when `inline-size` is `auto`.
https://github.com/w3c/csswg-drafts/issues/10937#issuecomment-2669150397
Blink has already adopted this change, and they modified the WPT
`/css/css-tables/fixed-layout-2.html` accordingly. Here I'm doing some
further cosmetic cleanups to the test.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Two floats with `width: 50%` each should fit on the same line,
and four floats with `width: 25%` each should fit on the same line.
That's even if the containing block width, expressed in layout units,
cannot be divided by 2 or 4.
This test checks cases that are tricky for browsers where 1 pixel
are either 60, 64 or 100 layout units.
It passes on other browsers but fails on Servo because of #34665.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Add doc comments to RequestBuilder fields/methods
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement Request::cryptographic_nonce_metadata
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement HTMLOrSVGElement::nonce
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Set request cryptographic nonce metadata for link elements
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Set request's cryptographic nonce when fetching scripts
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Forward request nonce to rust-content-security-policy
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Allow domain-like as URL location input
Before this patch, domain with subdomain (e.g. book.servo.org) won't be
treated as URL location.
This patch retifies that by adding Firefox's location bar behavior:
- book.servo.org is URL location
- book.servo.org. is URL location
- .book.servo.org is not URL location
Fixes#35754.
Signed-off-by: Kafji <k@kafji.net>
* Chain location input interpretation attempts
Signed-off-by: Kafji <k@kafji.net>
---------
Signed-off-by: Kafji <k@kafji.net>
Previously, the devtools didn't know about
<iframe>s. They either ignored messages coming from
iframes or crashed.
This reverts https://github.com/servo/servo/pull/34032
and then filters out non-tab globals in the "listTabs"
message to the root actor.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* support CSS `will-change`
* update wpt-test result
* Enable css-will-change test
* Update css-will-change test results
* Check transformable before will-change; update wpt-results
* Solve merge conflict
* Update Cargo.toml and Cargo.lock
* Mark new failing test-cases
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* layout: Fix behavior of `transform-style: preserve-3d`
This makes `transform-style: preserve-3d` establish a containing block
for all descendants, as specified here:
<https://drafts.csswg.org/css-transforms-2/#transform-style-property>
Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
* layout: Check for transformable elements
Adds a new `is_transformable` helper method and use this in several other
methods, including the methods for whether the fragment establishes a
new stacking context or a containing block for all descendants.
Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
* Use generic green square reference for reftest.
Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
* layout: Fix stacking context & containing block checks.
Only the computed value of `transform-style` should be used to determine
whether the element establishes a stacking context and/or a containing
block, not the used value.
Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
* Update clip-no-stacking-context test expectation to pass.
Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
---------
Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
This patch exposes a servo internal DOM API that is only made available to about:
pages on the navigator object to request memory reports. The about:memory page itself is
loaded like other html resources (eg. bad cert, net error) and makes use of this new API.
On the implementation side, notable changes:
- components/script/routed_promise.rs abstracts the setup used to fulfill a promise when the
work needs to be routed through the constellation. The goal is to migrate other similar
promise APIs in followup (eg. dom/webgpu/gpu.rs, bluetooth.rs).
- a new message is added to request a report from the memory reporter, and the memory reporter
creates a json representation of the set of memory reports.
- the post-processing of memory reports is done in Javascript in the about-memory.html page,
providing the same results as the current Rust code that outputs to stdout. We can decide
later if we want to remove the current output.
Signed-off-by: webbeef <me@webbeef.org>