profile
viewpoint

harfbuzz/harfbuzz 1437

HarfBuzz text shaping engine

Frozen-Flask/Frozen-Flask 636

Freezes a Flask application into a set of static files.

binast/binjs-ref 387

Reference implementation for the JavaScript Binary AST format

rust-threadpool/rust-threadpool 316

A very simple thread pool for parallel task execution

kuchiki-rs/kuchiki 273

(朽木) HTML/XML tree manipulation library for Rust

linebender/skribo 245

A Rust library for low-level text layout.

Flask-FlatPages/Flask-FlatPages 231

Provides flat static pages to a Flask application

lifthrasiir/rust-encoding 201

Character encoding support for Rust

Kozea/cairocffi 174

CFFI-based cairo bindings for Python.

Kozea/Flask-WeasyPrint 101

Make PDF in your Flask app with WeasyPrint

pull request commentservo/servo

Remove support for energy and heartbeats profiling

Updated unit tests for removed parameters.

@bors-servo r=jdm

SimonSapin

comment created time in 5 hours

push eventservo/servo

Simon Sapin

commit sha b282bd3a441ce9a87c5cb4bddb0ce949afd5919b

Remove support for heartbeats profiling

view details

push time in 5 hours

pull request commentservo/servo

Reduce scope of generic code in script

@bors-servo r+

jdm

comment created time in 8 hours

Pull request review commentservo/servo

Reduce scope of generic code in script

 impl<T: DomObject + PartialEq> PartialEq<T> for MutDom<T> {     } } +#[cfg(debug_assertions)]+pub(crate) fn assert_in_script() {+    debug_assert!(thread_state::get().is_script());+}++#[cfg(debug_assertions)]+pub(crate) fn assert_in_layout() {+    debug_assert!(thread_state::get().is_layout());+}++#[cfg(not(debug_assertions))]+pub(crate) fn assert_in_layout() {}++#[cfg(not(debug_assertions))]+fn assert_in_script() {}

Those #[cfg] attributes and separate function definitions look redundant. The expansion of debug_assert! (instead of assert!) is if false { … } when debug_assertions is not enabled, which is easy for the optimizer to eliminate.

jdm

comment created time in 8 hours

Pull request review commentservo/servo

Reduce scope of generic code in script

 mod dummy { pub use self::dummy::LIVE_REFERENCES;  /// A pointer to a Rust DOM object that needs to be destroyed.-pub struct TrustedReference(*const libc::c_void);+struct TrustedReference(*const libc::c_void); unsafe impl Send for TrustedReference {}  impl TrustedReference {-    fn new<T: DomObject>(ptr: *const T) -> TrustedReference {+    /// Creates a new TrustedReference from a pointer to a value that impements DOMObject.+    /// This is not enforced by the type system to reduce duplicated generic code,+    /// which is acceptable since this method is internal to this module.+    unsafe fn new(ptr: *const libc::c_void) -> TrustedReference {         TrustedReference(ptr as *const libc::c_void)

Nit: this as conversion can now be removed

jdm

comment created time in 8 hours

pull request commentrust-lang/rust

Stabilize the backtrace feature.

and they could override these hooks differently, just as they override unwinding and alloc hooks already.

We don’t offer a stable interface for overriding the unwinding implementation like we do the global allocator. I’m not sure we ever will, or should. (The available options are: contribute upstream to add support for your target, or use Nightly with a fork of the standard library.) I think backtraces are closer to unwinding than allocators in this regard. Or are there different backtrace implementations with different strategies and trade-offs, like mimalloc v.s. jemalloc?

withoutboats

comment created time in 9 hours

issue commentservo/rust-url

Opt-in feature flag to support the W3C standard

Isn’t that the expected result?

$ curl -sSI https://08.08.08.08 | head -n2
curl: (6) Could not resolve host: 08.08.08.08
$ curl -sSI https://8.8.8.8 | head -n2
HTTP/2 30
location: https://dns.google/

Firefox and Chromium behave similarly.

aledomu

comment created time in 9 hours

pull request commentrust-lang/rust

Stabilize the backtrace feature.

It would require the type definition in libcore to be decoupled from the actual implementation using some indirection like Box<dyn BacktraceImpl>, except more hacking since libcore cannot use Box either. (Possibly with raw pointers and an ad-hoc vtable that includes a destructor that does Box deallocation.)

withoutboats

comment created time in 9 hours

issue commentservo/rust-url

Opt-in feature flag to support the W3C standard

For what it’s worth the URL parser doesn’t error when the IPv4 parser does, but considers the host name to be a domain name:

fn main() {
    dbg!(url::Url::parse("https://08.08.08.08/").unwrap().host());
}

(Playground)

[src/main.rs:2] url::Url::parse("https://08.08.08.08/").unwrap().host() = Some(
    Domain(
        "08.08.08.08",
    ),
)
aledomu

comment created time in 10 hours

issue commentservo/rust-url

Opt-in feature flag to support the W3C standard

W3C does not have a specification for URLs. The closest is https://www.w3.org/TR/url/ , which used to be a copy / snapshot of https://url.spec.whatwg.org/ republished there for administrative reasons. It has been retracted since.

RFC 3986 is publish by the IETF and has no relationship with W3C.

Implementing IETF RFCs has been a non-goal for rust-url. Issues more specific than "might cause some problems" can be discussed on a case-by-case basis.

As to being less ambiguous, that is not my experience. IETF RFCs tend to specify grammars but leave it as an exercise to readers to decide what implementation should do when encountering inputs that do not match. This can lead to interoperability issues. https://url.spec.whatwg.org/ on the other hand has well-defined error handling.

aledomu

comment created time in 10 hours

pull request commentrust-lang/rust

Stabilize the backtrace feature.

Thanks for the write-up! The one thing I would add is trait impls to the list of stabilized APIs. impl Display for Backtrace in particular is important since (as far as I can tell) it is the expected way to do anything useful with a Backtrace.

withoutboats

comment created time in 11 hours

pull request commentservo/servo

Remove support for energy and heartbeats profiling

Fixed both and squashed

SimonSapin

comment created time in 12 hours

push eventservo/servo

Simon Sapin

commit sha 0abe90647f4548d0e35c8d9107b81e45ea739226

Remove support for energy profiling

view details

Simon Sapin

commit sha 79d363ae0033bc004c04d4c05e614d0c3fa8f877

Remove support for heartbeats profiling

view details

push time in 12 hours

PR opened servo/servo

Remove support for energy and heartbeats profiling

Both are disabled by default (energy at compile-time, heartbeats with a run-time option). Neither is tested of CI. Neither has been used in a long time. They might have Undefined Behavior: https://github.com/servo/servo/issues/26550#issuecomment-634238098. They each depend on a mostly-unmaintained C library. The thread-safety expectation of those libraries are unknown.

+9 -1342

0 comment

23 changed files

pr created time in 14 hours

create barnchservo/servo

branch : energy

created branch time in 14 hours

pull request commentservo/servo

Add Layout 2020 box tree support for Flexbox, behind a pref

@bors-servo r=nox

SimonSapin

comment created time in 15 hours

push eventservo/servo

Gregory Terzian

commit sha ed688fe2c1fe004f6c4007bb08dc792a6ab6bcac

add mechanism to join on service- and dedicated-worker threads

view details

Gregory Terzian

commit sha 947fa8bbb7195861a1d719422b0e961eda857eaf

add a control chan to workers, use to signal shutdown

view details

Gregory Terzian

commit sha 517473924405655e6c9dbecdd8301a9932b5289c

turn serviceworker event-loop back on

view details

Gregory Terzian

commit sha 6f34b52e3999da7bf345cdc5e8b9ce8752b499f5

properly shutdown dedicated workers when the owning scope shuts-down

view details

Gregory Terzian

commit sha f4d258d6742ad1898aa97f24010d5c14891b9083

remove messagaging and worker infra on workerscope exits

view details

dependabot-preview[bot]

commit sha 2342b616805b5481020b0a291f0a71c403b036f4

Bump harfbuzz-sys from 0.3.3 to 0.3.4 Bumps [harfbuzz-sys](https://github.com/servo/rust-harfbuzz) from 0.3.3 to 0.3.4. - [Release notes](https://github.com/servo/rust-harfbuzz/releases) - [Commits](https://github.com/servo/rust-harfbuzz/commits/harfbuzz-sys-v0.3.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha 647d070e8c9e442d9cdedce4926e953d060b0f1b

Bump arrayref from 0.3.5 to 0.3.6 Bumps [arrayref](https://github.com/droundy/arrayref) from 0.3.5 to 0.3.6. - [Release notes](https://github.com/droundy/arrayref/releases) - [Commits](https://github.com/droundy/arrayref/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha 9dc6045bb633c9da4d04c41d72f52a373f420765

Bump xdg from 2.1.0 to 2.2.0 Bumps [xdg](https://github.com/whitequark/rust-xdg) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/whitequark/rust-xdg/releases) - [Commits](https://github.com/whitequark/rust-xdg/compare/v2.1.0...v2.2.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha 4e7400f809c69c3088714f956ec4d53ade89f546

Bump tokio-current-thread from 0.1.6 to 0.1.7 Bumps [tokio-current-thread](https://github.com/tokio-rs/tokio) from 0.1.6 to 0.1.7. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Changelog](https://github.com/tokio-rs/tokio/blob/tokio-0.1.7/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-current-thread-0.1.6...tokio-0.1.7) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha 0197a58a852d1972a51b47f29f322330a0af678b

Bump gstreamer-base-sys from 0.8.0 to 0.8.1 Bumps gstreamer-base-sys from 0.8.0 to 0.8.1. Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

bors-servo

commit sha e452570be0f01adc9ad6cd38ee58705b6a3f3812

Auto merge of #26763 - servo:dependabot/cargo/harfbuzz-sys-0.3.4, r=jdm Bump harfbuzz-sys from 0.3.3 to 0.3.4 Bumps [harfbuzz-sys](https://github.com/servo/rust-harfbuzz) from 0.3.3 to 0.3.4. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/servo/rust-harfbuzz/commits/harfbuzz-sys-v0.3.4">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=harfbuzz-sys&package-manager=cargo&previous-version=0.3.3&new-version=0.3.4)](https://dependabot.com/compatibility-score/?dependency-name=harfbuzz-sys&package-manager=cargo&previous-version=0.3.3&new-version=0.3.4) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha 948dd7379618e85269227a3e37c76a091c85a966

Auto merge of #26764 - servo:dependabot/cargo/arrayref-0.3.6, r=jdm Bump arrayref from 0.3.5 to 0.3.6 Bumps [arrayref](https://github.com/droundy/arrayref) from 0.3.5 to 0.3.6. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/droundy/arrayref/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=arrayref&package-manager=cargo&previous-version=0.3.5&new-version=0.3.6)](https://dependabot.com/compatibility-score/?dependency-name=arrayref&package-manager=cargo&previous-version=0.3.5&new-version=0.3.6) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha 0bdc44824d100db2e8c4efcf3c12fab01861b5cc

Auto merge of #26765 - servo:dependabot/cargo/xdg-2.2.0, r=jdm Bump xdg from 2.1.0 to 2.2.0 Bumps [xdg](https://github.com/whitequark/rust-xdg) from 2.1.0 to 2.2.0. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/whitequark/rust-xdg/commit/f404ae631b30f5fcb191f9fb65ff206721379d16"><code>f404ae6</code></a> Bump version.</li> <li><a href="https://github.com/whitequark/rust-xdg/commit/090afef2509d746e48d6bfa9b2e1ef6dc4564448"><code>090afef</code></a> Add methods to iterate over matching config/data files (<a href="https://github-redirect.dependabot.com/whitequark/rust-xdg/issues/20">#20</a>)</li> <li><a href="https://github.com/whitequark/rust-xdg/commit/a1c9249f78a5395c2ee3dc8688a03c59fe9afe2a"><code>a1c9249</code></a> Treat redox as an *nix OS explicitly.</li> <li><a href="https://github.com/whitequark/rust-xdg/commit/e083a1d1d847f7638150012e4ab751051cb45a4e"><code>e083a1d</code></a> Fix copy/paste errors.</li> <li>See full diff in <a href="https://github.com/whitequark/rust-xdg/compare/v2.1.0...v2.2.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=xdg&package-manager=cargo&previous-version=2.1.0&new-version=2.2.0)](https://dependabot.com/compatibility-score/?dependency-name=xdg&package-manager=cargo&previous-version=2.1.0&new-version=2.2.0) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha ff3d5c5125d0bcd048d88e761e02e5ff5a4dc23c

Auto merge of #26628 - gterzian:shutdown_workers, r=asajeffrey Improve worker shutdown <!-- Please describe your changes on the following line: --> FIX #26548 FIX #25212 and also a step towards https://github.com/servo/servo/issues/26502 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

view details

Kunal Mohan

commit sha 1d4efb48ba904aab93ebad3a2892aed46444088f

Implement GPURenderPassEncoder Add webidls for GPURenderPassEncoder and GPURenderEncoderBase and implement relevant methods.

view details

Warren Fisher

commit sha 2da07ed164b71c679813b4c319a6e069a2910b25

Reduce code duplication. Move some of CodegenRust.py to htmlconstructor.rs

view details

Kunal Mohan

commit sha 3b5ede153d61c2c033326b5df2417e3757dba17b

Update wgpu-core and wgpu-types

view details

bors-servo

commit sha d6751d3068447458b12bbe17dd70737eec241d97

Auto merge of #26766 - servo:dependabot/cargo/tokio-current-thread-0.1.7, r=jdm Bump tokio-current-thread from 0.1.6 to 0.1.7 Bumps [tokio-current-thread](https://github.com/tokio-rs/tokio) from 0.1.6 to 0.1.7. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/tokio-rs/tokio/blob/tokio-0.1.7/CHANGELOG.md">tokio-current-thread's changelog</a>.</em></p> <blockquote> <h1>0.1.7 (June 6, 2018)</h1> <ul> <li>Add <code>Runtime::block_on</code> for concurrent runtime (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/391">#391</a>).</li> <li>Provide handle to <code>current_thread::Runtime</code> that allows spawning tasks from other threads (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/340">#340</a>).</li> <li>Provide <code>clock::now()</code>, a configurable source of time (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/381">#381</a>).</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/tokio-rs/tokio/commit/8d8c895a1c97198e9461c4e01098f9c73ce626fe"><code>8d8c895</code></a> Remove <code>tokio-codec</code> dependency from <code>tokio</code> (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/397">#397</a>)</li> <li><a href="https://github.com/tokio-rs/tokio/commit/dba5c27296bbba014cfb1aef088593bbff373fa7"><code>dba5c27</code></a> Bump version to v0.1.7 (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/396">#396</a>)</li> <li><a href="https://github.com/tokio-rs/tokio/commit/db620b42ec8330ed33996edd7ce00d61ad947a4b"><code>db620b4</code></a> Another attempt at abstracting <code>Instant::now</code> (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/381">#381</a>)</li> <li><a href="https://github.com/tokio-rs/tokio/commit/9013ed9bd4ed91d496042726b331b5f417adb00b"><code>9013ed9</code></a> Fix description of BlockingError as io::Error (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/384">#384</a>)</li> <li><a href="https://github.com/tokio-rs/tokio/commit/06325fa63b456069a7003b4fbf2dc1ac980c9a44"><code>06325fa</code></a> Bump tokio-uds to v0.2.0 (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/395">#395</a>)</li> <li><a href="https://github.com/tokio-rs/tokio/commit/0d41ba7a08e3e2224d1972b78f12e9f510bea433"><code>0d41ba7</code></a> Implement a Send Handle for the single-threaded Runtime (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/340">#340</a>)</li> <li><a href="https://github.com/tokio-rs/tokio/commit/c07a7b26d31cce4ef40c51cca4048a7b5230250d"><code>c07a7b2</code></a> Cleanup FramedParts in new tokio-codec (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/394">#394</a>)</li> <li><a href="https://github.com/tokio-rs/tokio/commit/f723d100871e025e4bdd2f47397c9b089e666ce0"><code>f723d10</code></a> Create tokio-codec (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/360">#360</a>)</li> <li><a href="https://github.com/tokio-rs/tokio/commit/3d7263d3a0b73ab35d63b45a6524bde7251851e8"><code>3d7263d</code></a> Implement Runtime::block_on using oneshot (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/391">#391</a>)</li> <li><a href="https://github.com/tokio-rs/tokio/commit/9caec1c15d66a7919818cf99db639574cfba67a1"><code>9caec1c</code></a> Remove futures2 crate (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/380">#380</a>)</li> <li>Additional commits viewable in <a href="https://github.com/tokio-rs/tokio/compare/tokio-current-thread-0.1.6...tokio-0.1.7">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=tokio-current-thread&package-manager=cargo&previous-version=0.1.6&new-version=0.1.7)](https://dependabot.com/compatibility-score/?dependency-name=tokio-current-thread&package-manager=cargo&previous-version=0.1.6&new-version=0.1.7) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha 7758d4ff620930464ec1c500fd018eac15e37af6

Auto merge of #25432 - warren-fisher:HTMLConstructor, r=jdm Extract some of CGClassConstructHook to utils.rs <!-- Please describe your changes on the following line: --> Moving some of the functionality from the massive tripled quoted string in CGClassConstructHook in `components/script/dom/bindings/codegen/CodegenRust.py` to `components/script/dom/bindings/utils.rs`. Must be made unsafe because of UnwrapObjectDynamic and other functions. Added imports as necessary as well, as well as cleaning up using test-tidy. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #25395 (GitHub issue number if applicable) <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because the issue says so <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

view details

bors-servo

commit sha f78ced25001ad8fa96e6ad94e7adf4ea7b7e7c89

Auto merge of #26767 - servo:dependabot/cargo/gstreamer-base-sys-0.8.1, r=jdm Bump gstreamer-base-sys from 0.8.0 to 0.8.1 Bumps gstreamer-base-sys from 0.8.0 to 0.8.1. [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=gstreamer-base-sys&package-manager=cargo&previous-version=0.8.0&new-version=0.8.1)](https://dependabot.com/compatibility-score/?dependency-name=gstreamer-base-sys&package-manager=cargo&previous-version=0.8.0&new-version=0.8.1) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

push time in 15 hours

pull request commentservo/servo

Add Layout 2020 box tree support for Flexbox, behind a pref

This PR adds a FlexLevel variant to the LayoutBox enum. PR https://github.com/servo/servo/pull/26741 which landed in the meantime added code that matches on LayoutBox. So the merge does not conflict but fails to compile.

The fix is straightforward:

<details>

    fixup! Flex items in the box tree

diff --git components/layout_2020/flow/root.rs components/layout_2020/flow/root.rs
index 61f6ca888b..79285767d3 100644
--- components/layout_2020/flow/root.rs
+++ components/layout_2020/flow/root.rs
@@ -10,6 +10,7 @@ use crate::display_list::stacking_context::{
 };
 use crate::dom_traversal::{iter_child_nodes, Contents, NodeExt};
 use crate::element_data::LayoutBox;
+use crate::flexbox::FlexLevelBox;
 use crate::flow::construct::ContainsFloats;
 use crate::flow::float::FloatBox;
 use crate::flow::inline::InlineLevelBox;
@@ -119,6 +120,7 @@ impl BoxTree {
         enum UpdatePoint {
             AbsolutelyPositionedBlockLevelBox(ArcRefCell<BlockLevelBox>),
             AbsolutelyPositionedInlineLevelBox(ArcRefCell<InlineLevelBox>),
+            AbsolutelyPositionedFlexLevelBox(ArcRefCell<FlexLevelBox>),
         }
 
         fn update_point<'dom, Node>(
@@ -188,6 +190,16 @@ impl BoxTree {
                         },
                         _ => return None,
                     },
+                    LayoutBox::FlexLevel(flex_level_box) => match &*flex_level_box.borrow() {
+                        FlexLevelBox::OutOfFlowAbsolutelyPositionedBox(_)
+                            if box_style.position.is_absolutely_positioned() =>
+                        {
+                            UpdatePoint::AbsolutelyPositionedFlexLevelBox(
+                                flex_level_box.clone(),
+                            )
+                        },
+                        _ => return None,
+                    },
                 };
             Some((primary_style.clone(), display_inside, update_point))
         }
@@ -217,6 +229,12 @@ impl BoxTree {
                                 out_of_flow_absolutely_positioned_box,
                             );
                     },
+                    UpdatePoint::AbsolutelyPositionedFlexLevelBox(flex_level_box) => {
+                        *flex_level_box.borrow_mut() =
+                            FlexLevelBox::OutOfFlowAbsolutelyPositionedBox(
+                                out_of_flow_absolutely_positioned_box,
+                            );
+                    },
                 }
                 return true;
             }

</details>

SimonSapin

comment created time in 15 hours

pull request commentservo/servo

Add Layout 2020 box tree support for Flexbox, behind a pref

@bors-servo r=nox

SimonSapin

comment created time in 16 hours

push eventservo/servo

dependabot-preview[bot]

commit sha d11dad9696146698bfa6d32e6afa546e4379d658

Bump gstreamer-webrtc-sys from 0.8.0 to 0.8.1 Bumps gstreamer-webrtc-sys from 0.8.0 to 0.8.1. Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha 8971f03ccd91ea23d6d82ff31efd38a5171fd068

Bump block-buffer from 0.7.0 to 0.7.3 Bumps [block-buffer](https://github.com/RustCrypto/utils) from 0.7.0 to 0.7.3. - [Release notes](https://github.com/RustCrypto/utils/releases) - [Commits](https://github.com/RustCrypto/utils/compare/block-buffer-v0.7.0...block-buffer-v0.7.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha b325dbd94cd1859554df83270c57b0474e66d775

Bump gstreamer-player from 0.15.3 to 0.15.5 Bumps gstreamer-player from 0.15.3 to 0.15.5. Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha 41ce3a70ed762cf5d1a459de407865f6d7c2884c

Bump gfx-backend-dx12 from 0.5.3 to 0.5.4 Bumps [gfx-backend-dx12](https://github.com/gfx-rs/gfx) from 0.5.3 to 0.5.4. - [Release notes](https://github.com/gfx-rs/gfx/releases) - [Changelog](https://github.com/gfx-rs/gfx/blob/master/CHANGELOG.md) - [Commits](https://github.com/gfx-rs/gfx/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha a9d623d3eda1c5b3e137df2fb325670e38c64a54

Bump gstreamer-video-sys from 0.8.0 to 0.8.1 Bumps gstreamer-video-sys from 0.8.0 to 0.8.1. Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha a24abea4aed710af60dd5ab124d968e4d1ced135

Bump dtoa-short from 0.3.0 to 0.3.2 Bumps [dtoa-short](https://github.com/upsuper/dtoa-short) from 0.3.0 to 0.3.2. - [Release notes](https://github.com/upsuper/dtoa-short/releases) - [Commits](https://github.com/upsuper/dtoa-short/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

bors-servo

commit sha e98398bea798c0cd990e480b4de14bda3b5034e5

Auto merge of #26751 - servo:dependabot/cargo/dtoa-short-0.3.2, r=jdm Bump dtoa-short from 0.3.0 to 0.3.2 Bumps [dtoa-short](https://github.com/upsuper/dtoa-short) from 0.3.0 to 0.3.2. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/upsuper/dtoa-short/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=dtoa-short&package-manager=cargo&previous-version=0.3.0&new-version=0.3.2)](https://dependabot.com/compatibility-score/?dependency-name=dtoa-short&package-manager=cargo&previous-version=0.3.0&new-version=0.3.2) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

WPT Sync Bot

commit sha 7f8c29593fe7663e4de8069edf5d8b7042db50d2

Update web-platform-tests to revision fd60ba25a0726dfea59024d8143240b355c46a55

view details

bors-servo

commit sha 06103eb94ab4480996c3d7deed5ceb8fbce983aa

Auto merge of #26744 - servo:dependabot/cargo/gstreamer-webrtc-sys-0.8.1, r=jdm Bump gstreamer-webrtc-sys from 0.8.0 to 0.8.1 Bumps gstreamer-webrtc-sys from 0.8.0 to 0.8.1. [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=gstreamer-webrtc-sys&package-manager=cargo&previous-version=0.8.0&new-version=0.8.1)](https://dependabot.com/compatibility-score/?dependency-name=gstreamer-webrtc-sys&package-manager=cargo&previous-version=0.8.0&new-version=0.8.1) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha 6a1cb940bf3b21c694b026755e78dbc9d02d7539

Auto merge of #26745 - servo:dependabot/cargo/block-buffer-0.7.3, r=jdm Bump block-buffer from 0.7.0 to 0.7.3 Bumps [block-buffer](https://github.com/RustCrypto/utils) from 0.7.0 to 0.7.3. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/RustCrypto/utils/commit/6ab1bbf4c9f580576e44079bd95cadf49220e575"><code>6ab1bbf</code></a> block-buffer v0.7.3</li> <li><a href="https://github.com/RustCrypto/utils/commit/edab714932ef445b25ce7015741cd7282f0d0751"><code>edab714</code></a> Make block-buffer minimal-versions correct (<a href="https://github-redirect.dependabot.com/RustCrypto/utils/issues/23">#23</a>)</li> <li><a href="https://github.com/RustCrypto/utils/commit/3cdecb4bd8c651dc0e03005ecd4dcbdd401044a4"><code>3cdecb4</code></a> Relaxed restrictions on padding buffer size. See <a href="https://github-redirect.dependabot.com/RustCrypto/utils/issues/20">#20</a> (<a href="https://github-redirect.dependabot.com/RustCrypto/utils/issues/21">#21</a>)</li> <li><a href="https://github.com/RustCrypto/utils/commit/969ed331330188ef11754f4c8b6c01513926bc4c"><code>969ed33</code></a> hex-literal license files. closes <a href="https://github-redirect.dependabot.com/RustCrypto/utils/issues/18">#18</a></li> <li><a href="https://github.com/RustCrypto/utils/commit/1f9655532f53cfd639718174b47ce02299c8c4f4"><code>1f96555</code></a> hex-literal v0.1.3</li> <li><a href="https://github.com/RustCrypto/utils/commit/7f8eb536ecb0606df930cc96bcbea5a3647462ab"><code>7f8eb53</code></a> Removes unnecessary backtick from hex-literal doc (<a href="https://github-redirect.dependabot.com/RustCrypto/utils/issues/16">#16</a>)</li> <li><a href="https://github.com/RustCrypto/utils/commit/fd52602520735fcd640f044ff7f6796bcb757e21"><code>fd52602</code></a> comment out input2 method</li> <li><a href="https://github.com/RustCrypto/utils/commit/9ae69ae6dda897f92c7d8a81ad4cf2c1a77d45ac"><code>9ae69ae</code></a> opaque-debug v0.2.2</li> <li><a href="https://github.com/RustCrypto/utils/commit/5276f2015b69fa05b939a237b9ca31788e16d423"><code>5276f20</code></a> update/add license information</li> <li><a href="https://github.com/RustCrypto/utils/commit/088c596b0076bb5d84ded9c43a79d1086d969f5c"><code>088c596</code></a> add input2 method to block-buffer</li> <li>Additional commits viewable in <a href="https://github.com/RustCrypto/utils/compare/block-buffer-v0.7.0...block-buffer-v0.7.3">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=block-buffer&package-manager=cargo&previous-version=0.7.0&new-version=0.7.3)](https://dependabot.com/compatibility-score/?dependency-name=block-buffer&package-manager=cargo&previous-version=0.7.0&new-version=0.7.3) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

Simon Sapin

commit sha 4d0a9d8e917ee2b04d83722d84156bb4329f72a0

Move most of `SequenceWriter::write_item` to non-generic functions The size of LLVM IR for the `style` crate is reduced by ~1.5% (27k lines out of 1.8M) CC https://github.com/servo/servo/issues/26713

view details

skrzyp1

commit sha ee6906443f9c60c60e38e6f6daaeb585fa886540

reading unminified scripts from disk

view details

Josh Matthews

commit sha 96698779ccdddcf87175db46c379a380317ad48a

dom: Remove unnecessary generic from private_from_proto_check_static.

view details

Josh Matthews

commit sha 1feeb23514118926098f6fab219f38fc22e8f9d7

dom: Extract non-generic code from Root::new.

view details

bors-servo

commit sha 07369c4c681da3d72755fac14124c81136c2b636

Auto merge of #26711 - skrzyp1:unminify-store-get, r=jdm Support replacing external scripts with local copies from disk <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #26456(GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

view details

bors-servo

commit sha 850fcc0a22fdca4bff98a006fbf419882f59259d

Auto merge of #26746 - servo:dependabot/cargo/gstreamer-player-0.15.5, r=jdm Bump gstreamer-player from 0.15.3 to 0.15.5 Bumps gstreamer-player from 0.15.3 to 0.15.5. [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=gstreamer-player&package-manager=cargo&previous-version=0.15.3&new-version=0.15.5)](https://dependabot.com/compatibility-score/?dependency-name=gstreamer-player&package-manager=cargo&previous-version=0.15.3&new-version=0.15.5) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha f16f2921ce86353daa43ab310b6f3b1f55bb7fec

Auto merge of #26750 - servo:dependabot/cargo/gstreamer-video-sys-0.8.1, r=jdm Bump gstreamer-video-sys from 0.8.0 to 0.8.1 Bumps gstreamer-video-sys from 0.8.0 to 0.8.1. [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=gstreamer-video-sys&package-manager=cargo&previous-version=0.8.0&new-version=0.8.1)](https://dependabot.com/compatibility-score/?dependency-name=gstreamer-video-sys&package-manager=cargo&previous-version=0.8.0&new-version=0.8.1) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha a619346d8b886d8c08f82aebe3a7bf5d46e17b32

Auto merge of #26748 - servo:dependabot/cargo/gfx-backend-dx12-0.5.4, r=jdm Bump gfx-backend-dx12 from 0.5.3 to 0.5.4 Bumps [gfx-backend-dx12](https://github.com/gfx-rs/gfx) from 0.5.3 to 0.5.4. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/gfx-rs/gfx/blob/master/CHANGELOG.md">gfx-backend-dx12's changelog</a>.</em></p> <blockquote> <h3>backend-dx12-0.5.4 (29-05-2020)</h3> <ul> <li>fix detection of integrated gpus</li> <li>fix UB in <code>compile_shader</code></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/gfx-rs/gfx/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=gfx-backend-dx12&package-manager=cargo&previous-version=0.5.3&new-version=0.5.4)](https://dependabot.com/compatibility-score/?dependency-name=gfx-backend-dx12&package-manager=cargo&previous-version=0.5.3&new-version=0.5.4) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha f2401400866d43e8fd2a4bc1543b887d707212ac

Auto merge of #26756 - servo:write_item, r=jdm Move most of `SequenceWriter::write_item` to non-generic functions The size of LLVM IR for the `style` crate is reduced by ~1.5% (27k lines out of 1.8M) CC https://github.com/servo/servo/issues/26713

view details

Josh Matthews

commit sha 8b2eda4717675ca1989c3bae2fe23f5ba7f32c8d

Remove intermittent failure.

view details

push time in 17 hours

pull request commentservo/servo

Reconstruct the box tree incrementally in some case

@bors-servo r+

nox

comment created time in 17 hours

Pull request review commentservo/servo

Reconstruct the box tree incrementally in some case

 impl BoxTree {             canvas_background: CanvasBackground::for_root_element(context, root_element),         }     }++    pub fn update<'dom, Node>(context: &LayoutContext, mut dirty_node: Node) -> bool+    where+        Node: 'dom + Copy + LayoutNode<'dom> + Send + Sync,+    {+        enum UpdatePoint {+            AbsolutelyPositionedBlockLevelBox(ArcRefCell<BlockLevelBox>),+            AbsolutelyPositionedInlineLevelBox(ArcRefCell<InlineLevelBox>),+        }++        fn update_point<'dom, Node>(+            node: Node,+        ) -> Option<(Arc<ComputedValues>, DisplayInside, UpdatePoint)>+        where+            Node: NodeExt<'dom>,+        {+            if !node.is_element() {+                return None;+            }++            if node.type_id() == LayoutNodeType::Element(LayoutElementType::HTMLBodyElement) {+                // This can require changes to the canvas background.+                return None;+            }++            // Don't update unstyled nodes.+            let data = node.get_style_and_layout_data()?;++            // Don't update nodes that have pseudo-elements.+            let element_data = data.style_data.element_data.borrow();+            if !element_data.styles.pseudos.is_empty() {+                return None;+            }++            let layout_data = data.layout_data.borrow();+            if layout_data.pseudo_before_box.borrow().is_some() {+                return None;+            }+            if layout_data.pseudo_after_box.borrow().is_some() {+                return None;+            }++            let primary_style = element_data.styles.primary();+            let box_style = primary_style.get_box();++            if !box_style.position.is_absolutely_positioned() {+                return None;+            }++            let display_inside = match Display::from(box_style.display) {+                Display::GeneratingBox(DisplayGeneratingBox::OutsideInside { inside, .. }) => {+                    inside+                },+                _ => return None,+            };++            let update_point =+                match &*AtomicRef::filter_map(layout_data.self_box.borrow(), Option::as_ref)? {+                    LayoutBox::DisplayContents => return None,+                    LayoutBox::BlockLevel(block_level_box) => match &*block_level_box.borrow() {+                        BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(_)+                            if box_style.position.is_absolutely_positioned() =>+                        {+                            UpdatePoint::AbsolutelyPositionedBlockLevelBox(block_level_box.clone())+                        },+                        _ => return None,+                    },+                    LayoutBox::InlineLevel(inline_level_box) => match &*inline_level_box.borrow() {+                        InlineLevelBox::OutOfFlowAbsolutelyPositionedBox(_)+                            if box_style.position.is_absolutely_positioned() =>+                        {+                            UpdatePoint::AbsolutelyPositionedInlineLevelBox(+                                inline_level_box.clone(),+                            )+                        },+                        _ => return None,+                    },+                };+            Some((primary_style.clone(), display_inside, update_point))+        }++        loop {

As discussed on Matrix, this iterator is not available on wrapper types for DOM types in layout. They could be added, but no need to block this PR on that.

nox

comment created time in 17 hours

issue commentserde-rs/serde

derive(Deserialize) generates a lot of code for a many-variant enum

Right, that’s what I meant.

@dtolnay The offending function is a method of the Visitor trait, which (looking at the code generated by derive with --pretty=expanded) is passed to https://docs.rs/serde/1.0.111/serde/trait.Deserializer.html#tymethod.deserialize_enum which is documented as a "hint". Is it possible to give fewer hints to serde and have the serialization still based on integers? (Even if slightly less efficient)

SimonSapin

comment created time in 18 hours

delete branch servo/servo

delete branch : shmem

delete time in 18 hours

PR closed servo/servo

Make to_shmem Gecko-only S-needs-rebase

As suggested in https://github.com/servo/servo/issues/26713#issuecomment-638185219

+640 -682

7 comments

102 changed files

SimonSapin

pr closed time in 18 hours

pull request commentservo/servo

Make to_shmem Gecko-only

Correct, this is about reducing compile times. I would expect the linker to remove functions that are never called. (Maybe even without LTO? IIRC with --gc-sections is the default in rustc.)

I hadn’t considered the indirect impact on sync as you explained it on Matrix (mozilla-central contributors accidentally breaking the Servo configuration more often as it diverges more).

to_shmem_slice_ptr does show up in https://github.com/servo/servo/issues/26713#issuecomment-638112283 but with only 0.4% of IR lines in libscript. This is probably not worth the downside, so closing.

SimonSapin

comment created time in 18 hours

pull request commentrust-lang/rust

Add documentation for boxed slice from pointer+len

Only saying “when all you have are a pointer and a length” is incomplete at best, possibly misleading. For the proposed code to be correct the caller must ensure:

  • The pointer points to the start of a heap allocation that was allocated with the standard library’s global allocator
  • The length "fits" the layout of the allocation
  • Values must be initialized and valid
  • Ownership is transferred to Box, the pointer must not be used afterwards.

Really, I think the proper response to "how to create a boxed slice from a pointer and a length" is to ask "How did you come to be in this situation? Is this really what you want to do?". Unfortunately https://github.com/rust-lang/rust/issues/46331 does not provide this context. (And is a multi-years old bug whose submitter appears not to be involved anymore.)

I think it would be good to discuss boxed slices in docs, but this premise is not a good starting point IMO. Vec::into_boxed_slice is probably a much more common way to make one. Correct usage of Box::from_raw is almost always paired with Box::into_raw, when discussing those we can mention that they work even if T: !Sized.

poliorcetics

comment created time in a day

pull request commentservo/servo

Run only a supported set of WPT test types by default.

Oh I hadn’t realized. Does --no-default-test-types by itself run nothing? If not, could/should we make it so?

jdm

comment created time in a day

Pull request review commentrust-lang/rust

Add documentation for boxed slice from pointer+len

 mod prim_array {} /// x[1] = 7; /// assert_eq!(x, &[1, 7, 3]); /// ```+///+/// It is also possible to put a slice in a box, when all you have are a pointer+/// and a length: `Box::from_raw(slice::from_raw_parts_mut(ptr, len) as *mut [u8])`.

I’m not sure if there’s any issue with this proposed code, but Box::from_raw(ptr::slice_from_raw_parts_mut(ptr, len)) avoids going through &mut [_], we could recommend that instead.

poliorcetics

comment created time in a day

pull request commentservo/servo

Run only a supported set of WPT test types by default.

Sorry to nit pick :) This description is better but --no-default-test-types sounds like it runs fewer test types, but it runs more. How about --all-test-types?

jdm

comment created time in a day

Pull request review commentservo/servo

Run only a supported set of WPT test types by default.

 def create_parser_wpt():                         help="Servo's JSON logger of unexpected results")     parser.add_argument('--always-succeed', default=False, action="store_true",                         help="Always yield exit code of zero")+    parser.add_argument('--no-default-test-types', default=False, action="store_true",+                        help="Run the default set of test types provided by wptrunner"),

Default in this case refers to […] when this flag is not present.

In that case, the flag’s description "run the default set" is wrong since setting the flag makes a different set be used than the one called default.

Unless the "by wptrunner" (as opposed to mach) means that it intentionally refers to a different set. In this case, it’s not great to use the same word "default" to refer to two different sets in the flag’s name and its description.

jdm

comment created time in a day

Pull request review commentservo/servo

Run only a supported set of WPT test types by default.

 def create_parser_wpt():                         help="Servo's JSON logger of unexpected results")     parser.add_argument('--always-succeed', default=False, action="store_true",                         help="Always yield exit code of zero")+    parser.add_argument('--no-default-test-types', default=False, action="store_true",+                        help="Run the default set of test types provided by wptrunner"),

The name and description of this flag seem contradictory

jdm

comment created time in a day

issue commentserde-rs/serde

derive(Deserialize) generates a lot of code for a many-variant enum

This doesn’t seem ideal in terms of run-time cost

SimonSapin

comment created time in a day

pull request commentservo/servo

Reconstruct the box tree incrementally in some case

(rustfmt is unhappy)

nox

comment created time in a day

Pull request review commentservo/servo

Reconstruct the box tree incrementally in some case

 impl BoxTree {             canvas_background: CanvasBackground::for_root_element(context, root_element),         }     }++    pub fn update<'dom, Node>(context: &LayoutContext, mut dirty_node: Node) -> bool+    where+        Node: 'dom + Copy + LayoutNode<'dom> + Send + Sync,+    {+        enum UpdatePoint {+            AbsolutelyPositionedBlockLevelBox(ArcRefCell<BlockLevelBox>),+            AbsolutelyPositionedInlineLevelBox(ArcRefCell<InlineLevelBox>),+        }++        fn update_point<'dom, Node>(+            node: Node,+        ) -> Option<(Arc<ComputedValues>, DisplayInside, UpdatePoint)>+        where+            Node: NodeExt<'dom>,+        {+            if !node.is_element() {+                return None;+            }++            if node.type_id() == LayoutNodeType::Element(LayoutElementType::HTMLBodyElement) {+                // This can require changes to the canvas background.+                return None;+            }++            // Don't update unstyled nodes.+            let data = node.get_style_and_layout_data()?;++            // Don't update nodes that have pseudo-elements.+            let element_data = data.style_data.element_data.borrow();+            if !element_data.styles.pseudos.is_empty() {+                return None;+            }++            let layout_data = data.layout_data.borrow();+            if layout_data.pseudo_before_box.borrow().is_some() {+                return None;+            }+            if layout_data.pseudo_after_box.borrow().is_some() {+                return None;+            }++            let primary_style = element_data.styles.primary();+            let box_style = primary_style.get_box();++            if !box_style.position.is_absolutely_positioned() {+                return None;+            }++            let display_inside = match Display::from(box_style.display) {+                Display::GeneratingBox(DisplayGeneratingBox::OutsideInside { inside, .. }) => {+                    inside+                },+                _ => return None,+            };++            let update_point =+                match &*AtomicRef::filter_map(layout_data.self_box.borrow(), Option::as_ref)? {+                    LayoutBox::DisplayContents => return None,+                    LayoutBox::BlockLevel(block_level_box) => match &*block_level_box.borrow() {+                        BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(_)+                            if box_style.position.is_absolutely_positioned() =>+                        {+                            UpdatePoint::AbsolutelyPositionedBlockLevelBox(block_level_box.clone())+                        },+                        _ => return None,+                    },+                    LayoutBox::InlineLevel(inline_level_box) => match &*inline_level_box.borrow() {+                        InlineLevelBox::OutOfFlowAbsolutelyPositionedBox(_)+                            if box_style.position.is_absolutely_positioned() =>+                        {+                            UpdatePoint::AbsolutelyPositionedInlineLevelBox(+                                inline_level_box.clone(),+                            )+                        },+                        _ => return None,+                    },+                };+            Some((primary_style.clone(), display_inside, update_point))+        }++        loop {

Or even replace the loop with dirty_node.inclusive_ancestors().find(update_point)?

nox

comment created time in a day

Pull request review commentservo/servo

Reconstruct the box tree incrementally in some case

 impl BoxTree {             canvas_background: CanvasBackground::for_root_element(context, root_element),         }     }++    pub fn update<'dom, Node>(context: &LayoutContext, mut dirty_node: Node) -> bool+    where+        Node: 'dom + Copy + LayoutNode<'dom> + Send + Sync,+    {+        enum UpdatePoint {+            AbsolutelyPositionedBlockLevelBox(ArcRefCell<BlockLevelBox>),+            AbsolutelyPositionedInlineLevelBox(ArcRefCell<InlineLevelBox>),+        }++        fn update_point<'dom, Node>(+            node: Node,+        ) -> Option<(Arc<ComputedValues>, DisplayInside, UpdatePoint)>+        where+            Node: NodeExt<'dom>,+        {+            if !node.is_element() {+                return None;+            }++            if node.type_id() == LayoutNodeType::Element(LayoutElementType::HTMLBodyElement) {+                // This can require changes to the canvas background.+                return None;+            }++            // Don't update unstyled nodes.+            let data = node.get_style_and_layout_data()?;++            // Don't update nodes that have pseudo-elements.+            let element_data = data.style_data.element_data.borrow();+            if !element_data.styles.pseudos.is_empty() {+                return None;+            }++            let layout_data = data.layout_data.borrow();+            if layout_data.pseudo_before_box.borrow().is_some() {+                return None;+            }+            if layout_data.pseudo_after_box.borrow().is_some() {+                return None;+            }++            let primary_style = element_data.styles.primary();+            let box_style = primary_style.get_box();++            if !box_style.position.is_absolutely_positioned() {+                return None;+            }++            let display_inside = match Display::from(box_style.display) {+                Display::GeneratingBox(DisplayGeneratingBox::OutsideInside { inside, .. }) => {+                    inside+                },+                _ => return None,+            };++            let update_point =+                match &*AtomicRef::filter_map(layout_data.self_box.borrow(), Option::as_ref)? {+                    LayoutBox::DisplayContents => return None,+                    LayoutBox::BlockLevel(block_level_box) => match &*block_level_box.borrow() {+                        BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(_)+                            if box_style.position.is_absolutely_positioned() =>+                        {+                            UpdatePoint::AbsolutelyPositionedBlockLevelBox(block_level_box.clone())+                        },+                        _ => return None,+                    },+                    LayoutBox::InlineLevel(inline_level_box) => match &*inline_level_box.borrow() {+                        InlineLevelBox::OutOfFlowAbsolutelyPositionedBox(_)+                            if box_style.position.is_absolutely_positioned() =>+                        {+                            UpdatePoint::AbsolutelyPositionedInlineLevelBox(+                                inline_level_box.clone(),+                            )+                        },+                        _ => return None,+                    },+                };+            Some((primary_style.clone(), display_inside, update_point))+        }++        loop {

Nit: can this be a for loop over dirty_node.inclusive_ancestors()?

nox

comment created time in 2 days

Pull request review commentservo/servo

Make to_shmem Gecko-only

 macro_rules! ns {  /// A Gecko namespace is just a wrapped atom. #[derive(-    Clone,

Good point. Amended.

SimonSapin

comment created time in a day

push eventservo/servo

Simon Sapin

commit sha caf4cc6b198b36962fbfe6965ae19c51005a3a47

Make to_shmem Gecko-only As suggested in https://github.com/servo/servo/issues/26713#issuecomment-638185219

view details

push time in a day

issue openedserde-rs/serde

derive(Deserialize) generates a lot of code for a many-variant enum

One of the top functions in the output of cargo llvm-lines for Servo’s script crate (https://github.com/servo/servo/issues/26713) is this:

  Lines           Copies         Function name
  -----           ------         -------------
  6982790 (100%)  177169 (100%)  (TOTAL)
[…]
    47048 (0.7%)       4 (0.0%)  <keyboard_types::key::_IMPL_DESERIALIZE_FOR_Key::<impl serde::de::Deserialize for keyboard_types::key::Key>::deserialize::__Visitor as serde::de::Visitor>::visit_enum

That function code is generated by serde_derive for this enum: https://docs.rs/keyboard-types/0.5.0/keyboard_types/enum.Key.html

This enum has 286 variants so some code size is expected, but 47k lines still seems like a lot. Is there something we can do to reduce it?

The enum has one Character(String) variant, and all others variants are unit variants (without fields). This is only a random guess but would the generated code be simpler/smaller if the enum only had unit variants? (With the String case moved to a separate type)

CC @pyfisch, author of the keyboard-types crate

created time in a day

PR opened servo/servo

Make to_shmem Gecko-only

As suggested in https://github.com/servo/servo/issues/26713#issuecomment-638185219

+656 -697

0 comment

107 changed files

pr created time in a day

create barnchservo/servo

branch : shmem

created branch time in a day

pull request commentservo/servo

Add Layout 2020 box tree support for Flexbox, behind a pref

Failures are legit, I messed up the cfg for serialization of display: inline-table. Pushed a fixup commit for easier review, I’ll squash it before landing.

I’ve also pushed other commits for sprinkling some rayon on.

SimonSapin

comment created time in 2 days

push eventservo/servo

Simon Sapin

commit sha 6620c3a2ff4760e63eb7bfe1a58b802281428abf

Owned `ServoArc<ComputedValues>` in `TraversalHandler`

view details

Simon Sapin

commit sha 54846fd06500e8cab2b8fc3fadadf3e0d28a4be5

Parallelize flex item boxes construction

view details

Simon Sapin

commit sha 68a8bb3151b0de82147dc41bdd73bec12fe89269

fixup! Layout 2020 skeleton for `display: flex`, behind a pref

view details

push time in 2 days

pull request commentrust-lang/rust

Make `RawVec::grow` mostly non-generic.

I understand it’s not easy, and I’m sure this PR has already improved things. I was wondering how reasonable 165 lines sounds, but maybe the easiest would be to look at those lines and see what they do.

nnethercote

comment created time in 2 days

issue commentservo/servo

Investigate possibly-pathological amounts of LLVM IR with cargo-llvm-lines

This was with nightly-2020-05-15 (pinned with a rust-toolchain file in the repo). After upgrading to nightly-2020-06-03 (still on ea491b41174edd03c3ee08fe29046c33b96b0406) try_fold is still in the top 30 but not as high. Total lines are cuts by ~1.3% in style, ~1.1% in script. Results in that order:

  Lines           Copies        Function name
  -----           ------        -------------
  1735957 (100%)  49485 (100%)  (TOTAL)
    48317 (2.8%)   3127 (6.3%)  core::ptr::drop_in_place
    29013 (1.7%)    227 (0.5%)  cssparser::parser::Parser::parse_entirely
    27457 (1.6%)    359 (0.7%)  core::result::Result<T,E>::map
    22608 (1.3%)    395 (0.8%)  cssparser::parser::Parser::try_parse
    22237 (1.3%)    337 (0.7%)  core::result::Result<T,E>::unwrap_or_else
    19920 (1.1%)    322 (0.7%)  core::option::Option<T>::map
    18414 (1.1%)     99 (0.2%)  alloc::raw_vec::RawVec<T,A>::grow_amortized
    15914 (0.9%)      1 (0.0%)  style::properties::animated_properties::AnimationValue::from_declaration
    15753 (0.9%)    217 (0.4%)  core::result::Result<T,E>::map_err
    14788 (0.9%)     88 (0.2%)  cssparser::parser::parse_until_before
    12979 (0.7%)    108 (0.2%)  core::iter::traits::iterator::Iterator::try_fold
    12257 (0.7%)    128 (0.3%)  <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::spec_extend
    11845 (0.7%)    117 (0.2%)  <core::iter::adapters::zip::Zip<A,B> as core::iter::adapters::zip::ZipImpl<A,B>>::next
    11669 (0.7%)    128 (0.3%)  alloc::vec::Vec<T>::extend_desugared
    11566 (0.7%)    135 (0.3%)  core::iter::traits::iterator::Iterator::fold
    11515 (0.7%)    940 (1.9%)  core::mem::manually_drop::ManuallyDrop<T>::new
    10556 (0.6%)    116 (0.2%)  style_traits::values::SequenceWriter<W>::write_item
    10296 (0.6%)    143 (0.3%)  core::alloc::layout::Layout::array
     9100 (0.5%)     65 (0.1%)  alloc::raw_vec::RawVec<T,A>::shrink
     9009 (0.5%)     99 (0.2%)  alloc::raw_vec::RawVec<T,A>::allocate_in
     8250 (0.5%)    125 (0.3%)  alloc::raw_vec::RawVec<T,A>::current_memory
     8187 (0.5%)    157 (0.3%)  core::ptr::swap_nonoverlapping_one
     8055 (0.5%)      1 (0.0%)  <style::properties::animated_properties::AnimationValue as style::values::animated::Animate>::animate
     7756 (0.4%)     71 (0.1%)  cssparser::parser::parse_nested_block
     7677 (0.4%)     57 (0.1%)  to_shmem::to_shmem_slice_ptr
     7603 (0.4%)     39 (0.1%)  <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
     7076 (0.4%)    155 (0.3%)  alloc::alloc::box_free
  Lines           Copies         Function name
  -----           ------         -------------
  6982790 (100%)  177169 (100%)  (TOTAL)
   173950 (2.5%)   15107 (8.5%)  core::ptr::drop_in_place
   149393 (2.1%)    6558 (3.7%)  core::ops::function::FnOnce::call_once
   120632 (1.7%)    1004 (0.6%)  <<&mut bincode::de::Deserializer<R,O> as serde::de::Deserializer>::deserialize_tuple::Access<R,O> as serde::de::SeqAccess>::next_element_seed
    98495 (1.4%)    1599 (0.9%)  core::option::Option<T>::map
    80351 (1.2%)    1167 (0.7%)  core::result::Result<T,E>::map
    50703 (0.7%)    6052 (3.4%)  core::ops::function::FnOnce::call_once{{vtable.shim}}
    47838 (0.7%)      67 (0.0%)  script::dom::bindings::htmlconstructor::html_constructor
    47048 (0.7%)       4 (0.0%)  <keyboard_types::key::_IMPL_DESERIALIZE_FOR_Key::<impl serde::de::Deserialize for keyboard_types::key::Key>::deserialize::__Visitor as serde::de::Visitor>::visit_enum
    44777 (0.6%)     605 (0.3%)  std::thread::local::LocalKey<T>::try_with
    43842 (0.6%)     639 (0.4%)  core::result::Result<T,E>::map_err
    43288 (0.6%)     288 (0.2%)  <&mut bincode::de::Deserializer<R,O> as serde::de::Deserializer>::deserialize_enum::<impl serde::de::EnumAccess for &mut bincode::de::Deserializer<R,O>>::variant_seed
    39618 (0.6%)     213 (0.1%)  alloc::raw_vec::RawVec<T,A>::grow_amortized
    34494 (0.5%)     846 (0.5%)  alloc::alloc::box_free
    33909 (0.5%)     597 (0.3%)  crossbeam_channel::context::Context::with::{{closure}}
    33556 (0.5%)     636 (0.4%)  core::result::Result<T,E>::expect
    32729 (0.5%)     546 (0.3%)  core::result::Result<T,E>::unwrap_or_else
    32543 (0.5%)     634 (0.4%)  core::ptr::swap_nonoverlapping_one
    31734 (0.5%)     387 (0.2%)  <*const T as core::fmt::Pointer>::fmt
    31652 (0.5%)     772 (0.4%)  script::dom::bindings::root::Root<T>::new
    28944 (0.4%)     116 (0.1%)  <<script_traits::webdriver_msg::_IMPL_DESERIALIZE_FOR_WebDriverScriptCommand::<impl serde::de::Deserialize for script_traits::webdriver_msg::WebDriverScriptCommand>::deserialize::__Visitor as serde::de::Visitor>::visit_enum::__Visitor as serde::de::Visitor>::visit_seq
    26092 (0.4%)      92 (0.1%)  <<script_traits::_IMPL_DESERIALIZE_FOR_ConstellationControlMsg::<impl serde::de::Deserialize for script_traits::ConstellationControlMsg>::deserialize::__Visitor as serde::de::Visitor>::visit_enum::__Visitor as serde::de::Visitor>::visit_seq
    25341 (0.4%)     629 (0.4%)  core::result::Result<T,E>::unwrap
    25278 (0.4%)     383 (0.2%)  script::dom::bindings::root::Root<script::dom::bindings::root::MaybeUnreflectedDom<T>>::reflect_with
    25180 (0.4%)       4 (0.0%)  <keyboard_types::code::_IMPL_DESERIALIZE_FOR_Code::<impl serde::de::Deserialize for keyboard_types::code::Code>::deserialize::__Visitor as serde::de::Visitor>::visit_enum
    24877 (0.4%)     200 (0.1%)  core::iter::traits::iterator::Iterator::try_fold
    24713 (0.4%)     329 (0.2%)  core::option::Option<T>::map_or
    22338 (0.3%)     146 (0.1%)  hashbrown::raw::RawTable<T>::find
SimonSapin

comment created time in 2 days

pull request commentrust-lang/rust

Make `RawVec::grow` mostly non-generic.

In https://github.com/servo/servo/issues/26713#issuecomment-638084412 grow_amortized introduced in this PR is still near the top of cargo llvm-lines, for two of Servo’s largest crates. Dividing by the "copies" column shows that each monomophization takes 165 lines of IR.

I really don’t have a good sense of scale, does that sound like a lot? Given “we want it to be as small as possible” in the code comment.

nnethercote

comment created time in 2 days

issue commentservo/servo

Investigate possibly-pathological amounts of LLVM IR with cargo-llvm-lines

Results on commit ea491b41174edd03c3ee08fe29046c33b96b0406, after a couple of improvements have landed.

style

  Lines           Copies        Function name
  -----           ------        -------------
  1758126 (100%)  50159 (100%)  (TOTAL)
    49182 (2.8%)   3235 (6.4%)  core::ptr::drop_in_place
    31355 (1.8%)    285 (0.6%)  core::iter::traits::iterator::Iterator::try_fold
    29013 (1.7%)    227 (0.5%)  cssparser::parser::Parser::parse_entirely
    27457 (1.6%)    359 (0.7%)  core::result::Result<T,E>::map
    24168 (1.4%)    395 (0.8%)  cssparser::parser::Parser::try_parse
    22237 (1.3%)    337 (0.7%)  core::result::Result<T,E>::unwrap_or_else
    20440 (1.2%)    330 (0.7%)  core::option::Option<T>::map
    16335 (0.9%)     99 (0.2%)  alloc::raw_vec::RawVec<T,A>::grow_amortized
    15914 (0.9%)      1 (0.0%)  style::properties::animated_properties::AnimationValue::from_declaration
    15753 (0.9%)    217 (0.4%)  core::result::Result<T,E>::map_err
    15140 (0.9%)     88 (0.2%)  cssparser::parser::parse_until_before
    12257 (0.7%)    128 (0.3%)  <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::spec_extend
    11845 (0.7%)    117 (0.2%)  <core::iter::adapters::zip::Zip<A,B> as core::iter::adapters::zip::ZipImpl<A,B>>::next
    11669 (0.7%)    128 (0.3%)  alloc::vec::Vec<T>::extend_desugared
    11515 (0.7%)    940 (1.9%)  core::mem::manually_drop::ManuallyDrop<T>::new
    10556 (0.6%)    116 (0.2%)  style_traits::values::SequenceWriter<W>::write_item
    10296 (0.6%)    143 (0.3%)  core::alloc::layout::Layout::array
     9100 (0.5%)     65 (0.1%)  alloc::raw_vec::RawVec<T,A>::shrink
     9009 (0.5%)     99 (0.2%)  alloc::raw_vec::RawVec<T,A>::allocate_in
     8250 (0.5%)    125 (0.2%)  alloc::raw_vec::RawVec<T,A>::current_memory
     8187 (0.5%)    157 (0.3%)  core::ptr::swap_nonoverlapping_one
     8055 (0.5%)      1 (0.0%)  <style::properties::animated_properties::AnimationValue as style::values::animated::Animate>::animate
     8040 (0.5%)     71 (0.1%)  cssparser::parser::parse_nested_block
     7677 (0.4%)     57 (0.1%)  to_shmem::to_shmem_slice_ptr
     7609 (0.4%)    148 (0.3%)  core::iter::traits::iterator::Iterator::fold
     7603 (0.4%)     39 (0.1%)  <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
     7076 (0.4%)    155 (0.3%)  alloc::alloc::box_free

drop_in_place being high indicates we have many types with destructors. I expect this won’t change without a significant redesign of Stylo.

Functions from cssparser likely inline their callbacks, and we do have a lot of code for CSS properties and values parsing. I tried making some of cssparser less generic but the impact was very low, indicating that the callbacks are likely most of the code.

I wonder what uses Iterator::try_fold so much. (Note that multiple other iterator methods are implemented on top of try_fold. For example. This is because some iterator types like Chain can implement internal (callback-based) iteration more efficiently than external (based on next) iteration.)

script

  Lines           Copies         Function name
  -----           ------         -------------
  7059278 (100%)  179594 (100%)  (TOTAL)
   174753 (2.5%)   15200 (8.5%)  core::ptr::drop_in_place
   149393 (2.1%)    6558 (3.7%)  core::ops::function::FnOnce::call_once
   120632 (1.7%)    1004 (0.6%)  <<&mut bincode::de::Deserializer<R,O> as serde::de::Deserializer>::deserialize_tuple::Access<R,O> as serde::de::SeqAccess>::next_element_seed
   102005 (1.4%)    1653 (0.9%)  core::option::Option<T>::map
    86102 (1.2%)     769 (0.4%)  core::iter::traits::iterator::Iterator::try_fold
    80351 (1.1%)    1167 (0.6%)  core::result::Result<T,E>::map
    50703 (0.7%)    6052 (3.4%)  core::ops::function::FnOnce::call_once{{vtable.shim}}
    47838 (0.7%)      67 (0.0%)  script::dom::bindings::htmlconstructor::html_constructor
    47048 (0.7%)       4 (0.0%)  <keyboard_types::key::_IMPL_DESERIALIZE_FOR_Key::<impl serde::de::Deserialize for keyboard_types::key::Key>::deserialize::__Visitor as serde::de::Visitor>::visit_enum
    44777 (0.6%)     605 (0.3%)  std::thread::local::LocalKey<T>::try_with
    43842 (0.6%)     639 (0.4%)  core::result::Result<T,E>::map_err
    43288 (0.6%)     288 (0.2%)  <&mut bincode::de::Deserializer<R,O> as serde::de::Deserializer>::deserialize_enum::<impl serde::de::EnumAccess for &mut bincode::de::Deserializer<R,O>>::variant_seed
    35145 (0.5%)     213 (0.1%)  alloc::raw_vec::RawVec<T,A>::grow_amortized
    34494 (0.5%)     846 (0.5%)  alloc::alloc::box_free
    33996 (0.5%)     636 (0.4%)  core::result::Result<T,E>::expect
    33909 (0.5%)     597 (0.3%)  crossbeam_channel::context::Context::with::{{closure}}
    32729 (0.5%)     546 (0.3%)  core::result::Result<T,E>::unwrap_or_else
    32543 (0.5%)     634 (0.4%)  core::ptr::swap_nonoverlapping_one
    31734 (0.4%)     387 (0.2%)  <*const T as core::fmt::Pointer>::fmt
    31652 (0.4%)     772 (0.4%)  script::dom::bindings::root::Root<T>::new
    28944 (0.4%)     116 (0.1%)  <<script_traits::webdriver_msg::_IMPL_DESERIALIZE_FOR_WebDriverScriptCommand::<impl serde::de::Deserialize for script_traits::webdriver_msg::WebDriverScriptCommand>::deserialize::__Visitor as serde::de::Visitor>::visit_enum::__Visitor as serde::de::Visitor>::visit_seq
    26107 (0.4%)     634 (0.4%)  core::result::Result<T,E>::unwrap
    26092 (0.4%)      92 (0.1%)  <<script_traits::_IMPL_DESERIALIZE_FOR_ConstellationControlMsg::<impl serde::de::Deserialize for script_traits::ConstellationControlMsg>::deserialize::__Visitor as serde::de::Visitor>::visit_enum::__Visitor as serde::de::Visitor>::visit_seq
    25278 (0.4%)     383 (0.2%)  script::dom::bindings::root::Root<script::dom::bindings::root::MaybeUnreflectedDom<T>>::reflect_with
    25180 (0.4%)       4 (0.0%)  <keyboard_types::code::_IMPL_DESERIALIZE_FOR_Code::<impl serde::de::Deserialize for keyboard_types::code::Code>::deserialize::__Visitor as serde::de::Visitor>::visit_enum
    24713 (0.4%)     329 (0.2%)  core::option::Option<T>::map_or
    22338 (0.3%)     146 (0.1%)  hashbrown::raw::RawTable<T>::find
SimonSapin

comment created time in 2 days

issue commentxi-editor/druid

Roadmap for 3D

The biggest win for the compositor is scrolling of otherwise static content.

I think another scenario where this Firefox work had significant impact is video playback

raphlinus

comment created time in 2 days

issue commentw3c/csswg-drafts

[css-text] What are the language-defined segment breaks for HTML?

https://html.spec.whatwg.org/multipage/parsing.html#preprocessing-the-input-stream says that the input of the HTML parser must go through https://infra.spec.whatwg.org/#normalize-newlines which replaces CRLF and lone CR with LF. But the way this is written is all about moving code points around, it doesn’t attribute them much meaning.

https://html.spec.whatwg.org/#newlines defines a "newline" term

Newlines in HTML may be represented either as U+000D CARRIAGE RETURN (CR) characters, U+000A LINE FEED (LF) characters, or pairs of U+000D CARRIAGE RETURN (CR), U+000A LINE FEED (LF) characters in that order.

Presumably "in HTML" there means before preprocessing.

I think it ends up defaulting

Having normative spec based on defaulting, on the absence of a definition that says to do otherwise, is what I think is not great. As an implementer I don’t feel confident that there is indeed no such definition for HTML, rather than I failed to find it.

SimonSapin

comment created time in 2 days

pull request commentservo/servo

Remove unnecessary generics from low-level script code

Nice!

@bors-servo r+

jdm

comment created time in 2 days

PR opened servo/servo

Move most of `SequenceWriter::write_item` to non-generic functions

The size of LLVM IR for the style crate is reduced by ~1.5% (27k lines out of 1.8M)

CC https://github.com/servo/servo/issues/26713

+43 -25

0 comment

1 changed file

pr created time in 2 days

push eventservo/servo

Simon Sapin

commit sha 4d0a9d8e917ee2b04d83722d84156bb4329f72a0

Move most of `SequenceWriter::write_item` to non-generic functions The size of LLVM IR for the `style` crate is reduced by ~1.5% (27k lines out of 1.8M) CC https://github.com/servo/servo/issues/26713

view details

push time in 2 days

create barnchservo/servo

branch : write_item

created branch time in 2 days

PR opened servo/servo

Add Layout 2020 box tree support for Flexbox, behind a pref

CC https://github.com/servo/servo/issues/26639

Layout support will come in future PRs. This one generates a zero-size fragment with no content.

+326 -20

0 comment

11 changed files

pr created time in 2 days

issue openedw3c/csswg-drafts

[css-text] What are the language-defined segment breaks for HTML?

https://drafts.csswg.org/css-text/#white-space

Except where specified otherwise, White space processing in CSS affects only the document white space characters: spaces (U+0020), tabs (U+0009), and segment breaks.

https://drafts.csswg.org/css-text/#segment-break

CSS does not define document segmentation rules. Segments can be separated by a particular newline sequence (such as a line feed or CRLF pair), or delimited by some other mechanism, such as the SGML RECORD-START and RECORD-END tokens. For CSS processing, each document language–defined segment break and each line feed (U+000A) in the text is treated as a segment break, which is then interpreted for rendering as specified by the white-space property.

I understand that CSS wants to build abstractions in order to potentially support any document language, but making it the responsibility of those languages to specifically hook into those abstractions is not great as they might… not.

CTRL+F for "segment break" in the single-page version of https://html.spec.whatwg.org/ does not find anything. Does this mean that HTML does not have any language-specific segment break?

If css-text is not the right place to define this normatively it’d be helpful to point this out in a note.

created time in 2 days

issue commentservo/servo

<pre> shouldn't render a final trailing newline

It also happens with other kinds of forced line breaks. At most one trailing break is removed/ignored.

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/8163

<p>hello</p>
<p>hello<br></p>
<p>hello<br><br></p>
<style>p { border: solid
jdm

comment created time in 2 days

issue commentservo/servo

<pre> shouldn't render a final trailing newline

I look some more, but the first thing I tried is the same happens with <div> + white-space: pre instead of <pre>. This excludes anything at the HTML parser level and indicates that this is happening at the CSS layout level.

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/8160

jdm

comment created time in 3 days

issue openedw3c/csswg-drafts

[css-flexbox] Prose about white space characters links to the white-space property

https://drafts.csswg.org/css-flexbox/#flex-items

However, if the entire sequence of child text runs contains only white space (i.e. characters that can be affected by the white-space property) it is instead not rendered (just as if its text nodes were display:none).

The first link is to https://www.w3.org/TR/CSS2/text.html#white-space-prop which is for the white-space property in CSS2. It doesn’t (directly) define a set of characters. Should this link go to https://drafts.csswg.org/css-text/#white-space instead?

created time in 3 days

issue commentrust-lang/wg-allocators

Replace `MemoryBlock` with `NonNull<[u8]>`

(Note that using a union like slice_from_raw_parts does is equivalent to using transmute, but is more compatible with const fn.)

SimonSapin

comment created time in 3 days

issue commentrust-lang/wg-allocators

Replace `MemoryBlock` with `NonNull<[u8]>`

It’s not an optimization. There isn’t an extra level of pointer indirection that was magically removed. It’s just what it means to have T= [u8] (note: not T = &[u8]) in NonNull<T> or *mut T or *const T or &T.

SimonSapin

comment created time in 3 days

issue commentrust-lang/rust

repr(packed) allows invalid unaligned loads

Yes, rust-bindgen and anything else that uses https://crates.io/crates/quote to generate source code will have that code all in one line. rust-bindgen then attempts to run rustfmt on that code by default, maybe that’s not available in the Crater environment?

huonw

comment created time in 3 days

issue commentrust-lang/wg-allocators

Replace `MemoryBlock` with `NonNull<[u8]>`

I took time at https://github.com/rust-lang/wg-allocators/issues/61#issuecomment-636997729 to make a detailed explanation of the exact same facts and reasoning, arriving at the same conclusion. It seems I failed to get something across :/

SimonSapin

comment created time in 3 days

issue commentrust-lang/wg-allocators

Replace `MemoryBlock` with `NonNull<[u8]>`

Any user following the NonNull and slice APIs would now know to access fields using non_null.as_ref().as_ptr(), hence two levels of indirection. Comparatively, someone using MemoryBlock would only have one layer of indirection when accessing ptr (as the MemoryBlock instance will be in memory).

You’re using "levels of indirection" to count the number of method calls in a Rust expression, whereas my earlier comment used it to to count the number of pointer that can be followed in a "chain" (u8 has zero, NonNull<[u8]> has one like &[u8], and &mut &[u8] has two, etc.) These are completely different concepts.

As others have mentioned, some of these methods do type conversion but effectively do nothing at run-time. In the compiled assembly, &[u8] and *mut [u8] and NonNull<[u8]> are all indistinguishable from each other.

SimonSapin

comment created time in 3 days

issue commentrust-lang/wg-allocators

Replace `MemoryBlock` with `NonNull<[u8]>`

The premise of this proposal is that adding a new struct adds API surface and therefore complexity. In this case this may not be necessary since the language already has an equivalent type. Adding conversion impls does not really help there.

A typedef adds less API surface than a struct, but I’m not sure what is the point of it existing.

The repr(C) argument is valid but it feels weak in my opinion:

  • What is the intended use case, exactly? On the implementer side of AllocRef, when wrapping an existing C allocator it would usually already have a C API that is idiomatic there, so MemoryBlock would not be part of FFI. On the caller side, Result is not repr(C) so you’ll need some Rust code anyway that manipulates the return values to deal with the error case. Adding something there to extract a thin pointer and a size separately does not seem terrible to me.
  • Do you intend to manually write C headers? As far as I understand https://crates.io/crates/cbindgen works by parsing source code, so it cannot generate bindings for types defined outside of your crate
  • There is not much precedent for public repr(C) structs with public fields in the standard library. (std::os::linux::raw::stat is deprecated, std::raw::TraitObject is unstable and will likely be removed)
SimonSapin

comment created time in 3 days

issue commentrust-lang/wg-allocators

Replace `MemoryBlock` with `NonNull<[u8]>`

Ok I think there is some confusion here due to our collective inconsistent use of the word "slice" to mean sometimes [u8] and sometimes &[u8]. If we try to be consistent we can come of with some definitions:

  • u8 is an 8-bit byte. Its size_of is 1.
  • For any type T, &T is a shared reference to T.
  • For any type T, &mut T is an exclusive reference to T.
  • For any type T, *mut T is a (raw, mutable) pointer to T.
  • For any type T, NonNull<T> is a non-null pointer to T.
  • For any type U, [U] is a slice of U. It doesn’t have a size_of, it is a dynamically-sized type. In today’s Rust (without https://rust-lang.github.io/rfcs/1909-unsized-rvalues.html) DSTs cannot be used (on the stack) in local variables, return values, or parameters without some indirection.

All kinds of references and pointers to a given type T have the same representation: the memory address of the T value together with optional metadata, and the same size_of:

  • If T is statically-sized (implements the Sized trait), there is no metadata and size_of is 8 on x86-64. We call the representation a "thin" pointer, by opposition to…
  • If T is dynamically-sized, the representation of the pointer/reference includes metadata which which we can derive the size of the value at run-time. We call this a "wide" or "fat" pointer.
    • For T = [U] in particular, the metadata is the number of elements in the slice. size_of for &[U] is 16 on x86-64. The two component (data address and metadata) are apparent in the signature of std::slice::from_raw_parts.

All of these can be combined in almost any way:

  • With T = u8, &u8 is a reference to a byte, *mut u8 a pointer to a byte.
  • With T = [U]. &[U] is a reference to a slice (of something). *mut [U] is a pointer to a slice.
  • With T = [U] and U = u8, NonNull<[u8]> is a non-null pointer to a slice of bytes.
  • Adding more indirection, &mut &[u8] is an exclusive reference to a shared reference of bytes.

Once upon a time (before Rust 1.0 I think?) dynamically-sized types did not exist in the language. [U] was not a valid type on its own. Instead, &[U] and &mut [U] were special cases, two of the basic types in the language. At the time it made sense to call them a slice and a mutable slice respectively, because they were the only two ways to have any kind of slice. *mut [U] was not a valid type.

Today still we tend to casually refer for example to &[u8] as a slice of bytes. This is in part for this historical reason, in part because repeating "reference to slice" all the time gets annoying. So the term by itself is ambiguous, and we should try to make the number of levels of indirection clear based on context.

this communicates something completely different to the end user. Namely:

"You are returned a slice (aka a pointer to memory plus a size)" vs "You are returned a mutable pointer to a slice"

Honestly I’m not sure which of these two is MemoryBlock and which is NonNull<[u8]>.

If we assume my definitions above, your description "a pointer to memory plus a size" makes it clear that you mean "casual" use of the word slice, with one level of indirection rather than zero. (Zero levels would be a [u8] DST which cannot be a return type.)

And "a mutable pointer to a slice" fits *mut [U], again with one level of indirection. So to me, your two descriptions are roughly the same.

Intuitively that would make me believe that I still need to follow a pointer to get the actual address of the memory block.

That would be two levels of indirection like &&[u8] or NonNull<*mut [u8]>, but that’s not the case here.

To some extent I think we can help clear this confusion with more docs and teaching, but it’s a fair point that raw (pointers to) slices *mut [U] and NonNull<[U]> are somewhat uncommon in Rust and so people may not be familiar with them. This is a downside compared to MemoryBlock that you can click on in rustdoc and see the struct definition with two fields.

SimonSapin

comment created time in 3 days

issue commentservo/servo

Insufficient synchronization in servo_arc can lead to data race

@weisunding This is a two year old bug marked as fixed by a code change. If there is still a related issue today, could you please file a new bug with a more detailed explanation? I don’t fully understand the message you’re quoting…

RalfJung

comment created time in 4 days

issue commentrust-lang/wg-allocators

Replace `MemoryBlock` with `NonNull<[u8]>`

@Wodann Sorry, I don’t understand what your point is.

the apparent equality between MemoryBlock and NonNull<[u8]>, but semantically they are not the same

How they semantically not the same? They both describe a region of memory by its starting address and size/length.

we should imo hide the implementation (potentially behind a AllocSlice type)

That’s mostly just another name for MemoryBlock. The point of this proposal is that we wouldn’t need to introduce a new type.


@petertodd The problem with returning a pointer to something that has size_of() == 0 like ! or () is that calling .offset(…) silently gives you the same pointer back.

As to returning a size, yes as your edit says it’s to allow the allocator to return more than requested. If I ask for 100 bytes, jemalloc will usually return 128 bytes.

As to whether returning a size should be part of the "default" APIs, that was proposed in https://github.com/rust-lang/wg-allocators/issues/17#issuecomment-585241852 and off-topic for this thread. This thread discusses how to represent a size together with a pointer, assuming we want to include it.

SimonSapin

comment created time in 4 days

issue commentservo/servo

Enforcing formatting of TOML files

This could be integrated with ./mach test-tidy for checking and ./mach fmt for auto-formatting. As long as the latter makes the former pass, I think it’s fine to add formatting checks.

atouchet

comment created time in 4 days

pull request commentservo/servo

More Cargo.toml updates

Stating that a PR contains only formatting changes and no meaningful change would be useful information

atouchet

comment created time in 4 days

pull request commentservo/servo

Show the real commit hash for `./servo --version`, not the bundle hash

I would not be in favor:

  • Like the build script, this is another kind of work-around that we’d have to maintain
  • The proper fix is coming to rustc + cargo
  • The consequences of this bug are extremely mild: CI (including Nightly builds) is not affected since it only builds once, and for local builds made by contributors the output of --version is not that important in my opinion.
camelid

comment created time in 4 days

pull request commentservo/servo

Show the real commit hash for `./servo --version`, not the bundle hash

@bors-servo try=linux

camelid

comment created time in 4 days

pull request commentservo/servo

Show the real commit hash for `./servo --version`, not the bundle hash

It looks like mach sets the GIT_INFO environment variable, and components/config/lib.rs uses option_env!("GIT_INFO") to read it. rustc knows about this, but apparently Cargo doesn’t.

We could potentially fix this by adding a build script that prints cargo:rerun-if-env-changed=GIT_INFO: https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorerun-if-env-changedname

The problem is that this seems to disable the default dependency tracking: https://github.com/rust-lang/cargo/issues/4587 so we’d need to also print cargo:rerun-if-changed=lib.rs and similarly for each source file. And that code could easily get out of sync with the actual set of source files.

However there is ongoing work in rustc https://github.com/rust-lang/rust/pull/71858 to expose data about dependencies on environment variables. Cargo can eventually read that data and do the right thing.

So, given that this will be fixed upstream eventually, I think it’s not worth doing the build script work-around. In the meantime you can run touch components/config/lib.rs to force a rebuild.

camelid

comment created time in 4 days

pull request commentservo/servo

More Cargo.toml updates

@atouchet In future PRs, could you write a few words in the PR title or description about what the updates are? Thanks!

atouchet

comment created time in 4 days

issue commentrust-lang/rust

Implement likely/unlikely intrinsic (tracking issue for RFC 1131)

@matklad Almost all macros expand to Rust code. (I think macro_rules and asm are the two special cases?) likely is about providing information to the compiler that doesn’t have an "expanded" Rust code representation, so it fits an attribute much better in my opinion. Attributes also allow extensions like #[likely(probability = 0.5)].

@pickfire It sounds like you’re looking for Profile Guided Optimization. It can be useful as well, but it’s not completely a replacement for source annotations since it’s harder to deploy and not deterministic.

nikomatsakis

comment created time in 5 days

pull request commentservo/servo

Show the real commit hash for `./servo --version`, not the bundle hash

Rigth, this line

https://community-tc.services.mozilla.com/tasks/HdD7jA0MSSiXnhRyEJti6A/runs/0/logs/https%3A%2F%2Fcommunity-tc.services.mozilla.com%2Fapi%2Fqueue%2Fv1%2Ftask%2FHdD7jA0MSSiXnhRyEJti6A%2Fruns%2F0%2Fartifacts%2Fpublic%2Flogs%2Flive.log#L462

Shows that the error happens with Python 3.

We’re in the middle of the transition https://github.com/servo/servo/issues/23607, so IIRC most of mach needs to support both 2.x and 3.x at the moment.

git_commit_subject is the result of subprocess.check_output and so a byte string. In 2.x those are freely interchangeable with Unicode strings as long as the contents is ASCII. "Shallow version of commit " is a Unicode string in 3.x. You can make it a byte string (in both) by adding a b prefix before the opening quote. An similarly for the ' ' string passed to split in the next non-comment line.

camelid

comment created time in 5 days

issue commentservo/servo

repo bundles make git hash in nightly versions useless

Good point, I forgot this message was included :)

jdm

comment created time in 5 days

issue commentservo/servo

dependencies: registry vs git

@jdm Shouldn’t we eventually remove those surfman overrides? Either publish appropriate versions to crates.io, or switch everything to using git URLs in [dependencies].

I feel there isn’t a good reason to land uses of [patch] in master when we control all repositories and crates involved.

mikedilger

comment created time in 5 days

pull request commentservo/servo

Show the real commit hash for `./servo --version`, not the bundle hash

@bors-servo try=linux

camelid

comment created time in 5 days

issue closedrust-lang/rust

ICE in _match.rs:1184:21 when building "gfx-backend-metal" on Nightly

We are seeing a new ICE on macOS/Nightly: https://github.com/gfx-rs/wgpu-native/runs/700057380

Meta

rustc 1.45.0-nightly (9310e3bd4 2020-05-21)

Backtrace:

2020-05-22T15:48:09.2856440Z thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/librustc_mir_build/hair/pattern/_match.rs:1184:21
2020-05-22T15:48:09.2859080Z stack backtrace:
2020-05-22T15:48:09.4938590Z    0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
2020-05-22T15:48:09.4942910Z    1: core::fmt::write
2020-05-22T15:48:09.4952680Z    2: std::io::Write::write_fmt
2020-05-22T15:48:09.4953030Z    3: std::panicking::default_hook::{{closure}}
2020-05-22T15:48:09.5054570Z    4: std::panicking::default_hook
2020-05-22T15:48:09.5155760Z    5: rustc_driver::report_ice
2020-05-22T15:48:09.5172590Z    6: std::panicking::rust_panic_with_hook
2020-05-22T15:48:09.5173000Z    7: rust_begin_unwind
2020-05-22T15:48:09.5173420Z    8: core::panicking::panic_fmt
2020-05-22T15:48:09.5173790Z    9: core::panicking::panic_bounds_check
2020-05-22T15:48:09.5174910Z   10: rustc_mir_build::hair::pattern::_match::Fields::replace_with_fieldpats
2020-05-22T15:48:09.5175400Z   11: rustc_mir_build::hair::pattern::_match::PatStack::specialize_constructor
2020-05-22T15:48:09.5175790Z   12: rustc_mir_build::hair::pattern::_match::is_useful_specialized
2020-05-22T15:48:09.5176130Z   13: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
2020-05-22T15:48:09.5176540Z   14: rustc_mir_build::hair::pattern::_match::is_useful
2020-05-22T15:48:09.5176870Z   15: rustc_mir_build::hair::pattern::_match::is_useful
2020-05-22T15:48:09.5177250Z   16: rustc_mir_build::hair::pattern::_match::is_useful
2020-05-22T15:48:09.5177670Z   17: rustc_mir_build::hair::pattern::_match::is_useful_specialized
2020-05-22T15:48:09.5178050Z   18: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
2020-05-22T15:48:09.5178420Z   19: rustc_mir_build::hair::pattern::_match::is_useful
2020-05-22T15:48:09.5178750Z   20: rustc_mir_build::hair::pattern::check_match::check_not_useful
2020-05-22T15:48:09.5179140Z   21: <rustc_mir_build::hair::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr
2020-05-22T15:48:09.5179540Z   22: <rustc_mir_build::hair::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr
2020-05-22T15:48:09.5179930Z   23: rustc_mir_build::hair::pattern::check_match::check_match
2020-05-22T15:48:09.5180310Z   24: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_match>::compute
2020-05-22T15:48:09.5180700Z   25: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
2020-05-22T15:48:09.5181080Z   26: rustc_data_structures::stack::ensure_sufficient_stack
2020-05-22T15:48:09.5181460Z   27: rustc_query_system::query::plumbing::get_query_impl
2020-05-22T15:48:09.5181780Z   28: rustc_query_system::query::plumbing::ensure_query_impl
2020-05-22T15:48:09.5182150Z   29: rustc_session::utils::<impl rustc_session::session::Session>::time
2020-05-22T15:48:09.5182740Z   30: rustc_session::utils::<impl rustc_session::session::Session>::time
2020-05-22T15:48:09.5183130Z   31: rustc_interface::passes::analysis
2020-05-22T15:48:09.5183510Z   32: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
2020-05-22T15:48:09.5184600Z   33: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
2020-05-22T15:48:09.5184980Z   34: rustc_query_system::query::plumbing::get_query_impl
2020-05-22T15:48:09.5185360Z   35: rustc_middle::ty::context::tls::enter_global
2020-05-22T15:48:09.5185690Z   36: rustc_interface::interface::run_compiler_in_existing_thread_pool
2020-05-22T15:48:09.5186050Z   37: scoped_tls::ScopedKey<T>::set
2020-05-22T15:48:09.5186410Z   38: rustc_ast::attr::with_globals
2020-05-22T15:48:09.5186760Z note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2020-05-22T15:48:09.5187040Z 
2020-05-22T15:48:09.5187400Z error: internal compiler error: unexpected panic
2020-05-22T15:48:09.5187710Z 
2020-05-22T15:48:09.5188010Z note: the compiler unexpectedly panicked. this is a bug.
2020-05-22T15:48:09.5188330Z 
2020-05-22T15:48:09.5189640Z note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2020-05-22T15:48:09.5190010Z 
2020-05-22T15:48:09.5190810Z note: rustc 1.45.0-nightly (9310e3bd4 2020-05-21) running on x86_64-apple-darwin
2020-05-22T15:48:09.5191130Z 
2020-05-22T15:48:09.5191900Z note: compiler flags: -C embed-bitcode=no -C debuginfo=2 --crate-type lib
2020-05-22T15:48:09.5192280Z 
2020-05-22T15:48:09.5192600Z note: some of the compiler flags provided by cargo are hidden
2020-05-22T15:48:09.5192870Z 
2020-05-22T15:48:09.5193200Z query stack during panic:
2020-05-22T15:48:09.5193530Z #0 [check_match] processing `soft::Own::own_render`
2020-05-22T15:48:09.5194200Z #1 [analysis] running analysis passes on this crate
2020-05-22T15:48:09.5194640Z end of query stack
2020-05-22T15:48:09.5521870Z error: could not compile `gfx-backend-metal`.

closed time in 5 days

kvark

Pull request review commentrust-lang/rust

from_u32_unchecked: check validity, and fix UB in Wtf8

 impl char {         }     } }++#[inline]+fn len_utf8(code: u32) -> usize {+    if code < MAX_ONE_B {+        1+    } else if code < MAX_TWO_B {+        2+    } else if code < MAX_THREE_B {+        3+    } else {+        4+    }+}++/// Encodes a raw u32 value as UTF-8 into the provided byte buffer,+/// and then returns the subslice of the buffer that contains the encoded character.+///+/// Unlike `char::encode_utf8`, this method also handles codepoints in the surrogate range.+/// (Creating a `char` in the surrogate range is UB.)+/// The result is valid [generalized UTF-8] but not valid UTF-8.+///+/// [generalized UTF-8]: https://simonsapin.github.io/wtf-8/#generalized-utf8+///+/// # Panics+///+/// Panics if the buffer is not large enough.+/// A buffer of length four is large enough to encode any `char`.+#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]+#[doc(hidden)]+#[inline]+pub fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] {+    let len = len_utf8(code);+    match (len, &mut dst[..]) {+        (1, [a, ..]) => {+            *a = code as u8;+        }+        (2, [a, b, ..]) => {+            *a = (code >> 6 & 0x1F) as u8 | TAG_TWO_B;+            *b = (code & 0x3F) as u8 | TAG_CONT;+        }+        (3, [a, b, c, ..]) => {+            *a = (code >> 12 & 0x0F) as u8 | TAG_THREE_B;+            *b = (code >> 6 & 0x3F) as u8 | TAG_CONT;+            *c = (code & 0x3F) as u8 | TAG_CONT;+        }+        (4, [a, b, c, d, ..]) => {+            *a = (code >> 18 & 0x07) as u8 | TAG_FOUR_B;+            *b = (code >> 12 & 0x3F) as u8 | TAG_CONT;+            *c = (code >> 6 & 0x3F) as u8 | TAG_CONT;+            *d = (code & 0x3F) as u8 | TAG_CONT;+        }+        _ => panic!(+            "encode_utf8: need {} bytes to encode U+{:X}, but the buffer has {}",+            len,+            code,+            dst.len(),+        ),+    };+    &mut dst[..len]+}++/// Encodes a raw u32 value as UTF-16 into the provided `u16` buffer,+/// and then returns the subslice of the buffer that contains the encoded character.+///+/// Unlike `char::encode_utf16`, this method also handles codepoints in the surrogate range.+/// (Creating a `char` in the surrogate range is UB.)+///+/// # Panics+///+/// Panics if the buffer is not large enough.+/// A buffer of length 2 is large enough to encode any `char`.+#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]+#[doc(hidden)]+#[inline]+pub fn encode_utf16_raw(mut code: u32, dst: &mut [u16]) -> &mut [u16] {+    // SAFETY: each arm checks whether there are enough bits to write into+    unsafe {+        if (code & 0xFFFF) == code && !dst.is_empty() {+            // The BMP falls through (assuming non-surrogate, as it should)

I think this parenthesis should be removed. No surrogate is a valid assumption for char::encode_utf16 but not here. Encoding a surrogate code point as a single 16-bit code unit is the desired behavior.

RalfJung

comment created time in 5 days

Pull request review commentrust-lang/rust

from_u32_unchecked: check validity, and fix UB in Wtf8

 impl char {         }     } }++#[inline]+fn len_utf8(code: u32) -> usize {+    if code < MAX_ONE_B {+        1+    } else if code < MAX_TWO_B {+        2+    } else if code < MAX_THREE_B {+        3+    } else {+        4+    }+}++/// Encodes a raw u32 value as UTF-8 into the provided byte buffer,+/// and then returns the subslice of the buffer that contains the encoded character.+///+/// Unlike `char::encode_utf8`, this method can be called on codepoints in the surrogate range.

Good point.

This function codes a code point in generalized UTF-8. For surrogate code points, the resulting byte sequence is not well-formed UTF-8 and therefore not valid str. The return type should be changed to &mut [u8] and the from_utf8_unchecked call moved to char::encode_utf8.

RalfJung

comment created time in 5 days

issue commentrust-lang/rust

OsString::from_wide (in Windows OsStringExt) is unsound

That or copy encode_utf8_raw into wtf8.rs. I find them both not great, so meh.

RalfJung

comment created time in 6 days

issue closedservo/servo

Tracking: upgrade to nightly-2020-05-26

Blocked on:

  • [x] Installing the llvm-tools-preview component https://github.com/servo/servo/issues/26645#issuecomment-633829852, https://github.com/servo/servo/pull/26662
  • [x] Handling syn::Type::Group in derive_common::cg::map_type_params https://github.com/servo/servo/pull/26662
  • [x] rustfmt being available https://github.com/rust-lang/rust/issues/72232
  • [x] ICE in gfx-backend-metal https://github.com/servo/servo/issues/26648, https://github.com/rust-lang/rust/issues/72467
  • [x] Upgrade parking-lot to 0.10 https://github.com/servo/servo/issues/26644, https://github.com/servo/servo/pull/26646. Work around: disable its nightly feature (which enables hardware lock elision)
  • [x] Exhaustiveness check regression https://github.com/rust-lang/rust/issues/72476. Work around:
    --- ports/glutin/headed_window.rs
    +++ ports/glutin/headed_window.rs
    @@ -543,10 +543,14 @@ impl WindowMethods for Window {
     
             #[cfg(target_os = "linux")]
             return match native_context {
    -            NativeContext::Default(NativeContext::Default(native_context)) =>
    -                PlayerGLContext::Egl(native_context.egl_context as usize),
    -            NativeContext::Default(NativeContext::Alternate(native_context)) =>
    -                PlayerGLContext::Egl(native_context.egl_context as usize),
    +            NativeContext::Default(d) => match d {
    +                NativeContext::Default(native_context) => {
    +                    PlayerGLContext::Egl(native_context.egl_context as usize)
    +                },
    +                NativeContext::Alternate(native_context) => {
    +                    PlayerGLContext::Egl(native_context.egl_context as usize)
    +                },
    +            },
                 NativeContext::Alternate(_) => unimplemented!(),
             };
     
    @@ -574,10 +578,10 @@ impl WindowMethods for Window {
     
             #[cfg(target_os = "linux")]
             return match native_connection {
    -            NativeConnection::Default(NativeConnection::Default(conn)) =>
    -                NativeDisplay::Egl(conn.0 as usize),
    -            NativeConnection::Default(NativeConnection::Alternate(conn)) =>
    -                NativeDisplay::X11(conn.x11_display as usize),
    +            NativeConnection::Default(d) => match d {
    +                NativeConnection::Default(conn) => NativeDisplay::Egl(conn.0 as usize),
    +                NativeConnection::Alternate(conn) => NativeDisplay::X11(conn.x11_display as usize),
    +            }
                 NativeConnection::Alternate(_) => unimplemented!(),
             };
    
  • [x] TokenTree regression affecting syn https://github.com/rust-lang/rust/issues/72608. Better work around: updating syn to 1.0.26: https://github.com/rust-lang/rust/issues/72608#issuecomment-634204306, https://github.com/dtolnay/syn/pull/832. Work around:
    --- components/canvas_traits/webgl.rs
    +++ components/canvas_traits/webgl.rs
    @@ -932,7 +932,10 @@ macro_rules! gl_enums {
                #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf)]
                #[derive(PartialEq, Serialize)]
                #[repr(u32)]
    -            pub enum $name { $($variant = $mod::$constant,)+ }
    +            pub enum $name { $(
    +                // FIXME https://github.com/rust-lang/rust/issues/72608
    +                $variant = { use $mod::$constant; $constant },
    +            )+ }
    
    

closed time in 6 days

SimonSapin

issue commentservo/servo

Tracking: upgrade to nightly-2020-05-26

https://github.com/rust-lang/rust/pull/72671 and https://github.com/rust-lang/rust/pull/72506 landed yesterday, fixing the remaining blockers. https://community-tc.services.mozilla.com/tasks/groups/G-mDKoxPROqJOjPiEkjBgw is green (enough) with today’s Nightly without any code change (beyond https://github.com/servo/servo/pull/26662), so closing.

SimonSapin

comment created time in 6 days

issue commentrust-lang/rust

ICE in _match.rs:1184:21 when building "gfx-backend-metal" on Nightly

I confirm that https://github.com/servo/servo/issues/26648 does not appear to reproduce in today’s Nightly (with https://github.com/rust-lang/rust/pull/72506).

kvark

comment created time in 6 days

issue commentrust-lang/rust

OsString::from_wide (in Windows OsStringExt) is unsound

The Wtf8 type contains a (generalized-UTF-8-encoded) sequence of code point (including potentially surrogates) that doesn’t form a surrogate pair. push_code_point_unchecked doesn’t check for surrogate pairs.

CodePoint::to_char is a public method that is documented as returning a scalar value, therefore excluding all surrogates.

That made me assume the author was aware that surrogates in char are UB.

Ok I looked into it, there are three different people involved.

The original code in 2014 was YOLO transmute https://github.com/SimonSapin/rust-wtf8/blob/76e023dfd56eef27ce36108a0182c156ededde2e/src/lib.rs#L164-L171

Later in 2014, https://github.com/SimonSapin/rust-wtf8/commit/8a42f9e7c33bb2a4b36b9b7cbd3df7293d5f2059 moved to duplicating logic instead.

In 2015, PR https://github.com/rust-lang/rust/pull/21488 which first imported WTF-8 support in libstd deduplicated that logic by adding a core::char::encode_utf8_raw function that takes u32. (I knew that approach sounded familiar…)

In 2016, PR https://github.com/rust-lang/rust/pull/32204 changed the signature of char::encode_utf8 and in passing removed encode_utf8_raw. It made wtf8.rs use char::from_u32_unchecked + char::encode_utf8 instead, presumably in the middle of updating many callers other.

RalfJung

comment created time in 6 days

issue commentrust-lang/rust

OsString::from_wide (in Windows OsStringExt) is unsound

By the way, the docs at https://doc.rust-lang.org/std/char/fn.from_u32_unchecked.html#safety feel insufficient:

Safety

This function is unsafe, as it may construct invalid char values.

For a safe version of this function, see the from_u32 function.

Which values are invalid?


Similarly, https://doc.rust-lang.org/std/char/index.html and https://doc.rust-lang.org/std/primitive.char.html say that char represents Unicode Scalar values, but I couldn’t find it documented anywhere that constructing an out of range char is Undefined Behavior rather than "merely" a logic bug.

Is this specified elsewhere?

What is the closest we have to a written down normative resource that specifies what is or isn’t UB in the the Rust language? (For APIs I assume this is the responsibility of their respective doc-comments.)

RalfJung

comment created time in 6 days

issue commentrust-lang/rust

OsString::from_wide (in Windows OsStringExt) is unsound

I would classify the priority of this bug as low.

Although this call to char::from_u32_unchecked is UB, I expect Miri checking for it explicitly is the only case where that has any consequence in today’s implementation:

  • char::encode_utf8 behaves as expected (for the purpose of WTF-8) in the surrogate range and does not exploit this UB
  • The "layout" of char in rustc excludes values beyond char::MAX but not surrogates:

https://github.com/rust-lang/rust/blob/0e9e4083100aa3ebf09b8f1ace0348cb37475eb9/src/librustc_middle/ty/layout.rs#L505-L508

RalfJung

comment created time in 6 days

issue commentrust-lang/rust

OsString::from_wide (in Windows OsStringExt) is unsound

0xD800..0xDC00 is excluded from Unicode scalar values a.k.a. char, but it’s fine as a Unicode code point.

I think this bug is not in the contract of push_code_point_unchecked (which is private anyway) but in its implementation, namely going through char. The fix is to either duplicate the logic of char::encode_utf8 into wtf8.rs, or (to avoid duplication) move that logic to a new function in libcore that takes a u32 parameter and that is called by both Wtf8::push_code_point_unchecked and char::encode_utf8. This function would need to be public because wtf8.rs is in a different crate, but it should be prema-unstable and #[doc(hidden)].

RalfJung

comment created time in 6 days

push eventservo/servo

Bastien Orivel

commit sha 97eaea4e6801c674127af28168c4dc165a61c173

Remove influxDB support for profile It's apparently unused. Influent is unmaintained. Let's remove it

view details

Josh Matthews

commit sha 4fec98722158e9816a4b3f83c7f6e38abcc5fa50

Fix output of test-tidy with duplicated packages.

view details

dependabot-preview[bot]

commit sha ef46ca44f21b858b883fe6fe69a3d275720e177f

Bump brotli from 3.1.5 to 3.3.0 Bumps [brotli](https://github.com/dropbox/rust-brotli) from 3.1.5 to 3.3.0. - [Release notes](https://github.com/dropbox/rust-brotli/releases) - [Commits](https://github.com/dropbox/rust-brotli/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha 6544db8376cd3f6314b2c1d6f9d38152cf8d692e

Bump metal from 0.17.0 to 0.17.1 Bumps [metal](https://github.com/gfx-rs/metal-rs) from 0.17.0 to 0.17.1. - [Release notes](https://github.com/gfx-rs/metal-rs/releases) - [Commits](https://github.com/gfx-rs/metal-rs/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

Mohammad Amin Sameti

commit sha 0b84208a0b54d96ebd784b345f07509c0e020977

Add void packages to mach bootstrap

view details

dependabot-preview[bot]

commit sha 04e1516452f5af1e5e6c1444fe07271024751680

Bump wayland-protocols from 0.21.4 to 0.21.13 Bumps [wayland-protocols](https://github.com/smithay/wayland-rs) from 0.21.4 to 0.21.13. - [Release notes](https://github.com/smithay/wayland-rs/releases) - [Changelog](https://github.com/Smithay/wayland-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/smithay/wayland-rs/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha d4d41b1c397669963e548349586d16174cbd9ca2

Bump net2 from 0.2.33 to 0.2.34 Bumps [net2](https://github.com/deprecrated/net2-rs) from 0.2.33 to 0.2.34. - [Release notes](https://github.com/deprecrated/net2-rs/releases) - [Commits](https://github.com/deprecrated/net2-rs/compare/0.2.33...0.2.34) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

dependabot-preview[bot]

commit sha 7eb8294426463992be7993d35d485c80b9108d69

Bump color_quant from 1.0.0 to 1.0.1 Bumps [color_quant](https://github.com/PistonDevelopers/color_quant) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/PistonDevelopers/color_quant/releases) - [Commits](https://github.com/PistonDevelopers/color_quant/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

view details

WPT Sync Bot

commit sha 68953a4264c82d997c37a9f716c169d0625d57aa

Update web-platform-tests to revision b577b1f9580a61524cde099a7763edb96c810faa

view details

dylni

commit sha 3160e62b8ad8a6ab29289151b58d91d31326e578

Fix undefined behavior in `energymon::init`

view details

bors-servo

commit sha f374cb11057215c4b36e6d4807a26fddb900a90e

Auto merge of #26598 - servo:dependabot/cargo/metal-0.17.1, r=jdm Bump metal from 0.17.0 to 0.17.1 Bumps [metal](https://github.com/gfx-rs/metal-rs) from 0.17.0 to 0.17.1. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/gfx-rs/metal-rs/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=metal&package-manager=cargo&previous-version=0.17.0&new-version=0.17.1)](https://dependabot.com/compatibility-score/?dependency-name=metal&package-manager=cargo&previous-version=0.17.0&new-version=0.17.1) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha 8b65c22304dfeb86e0ab2fe16e548358d3646f77

Auto merge of #26600 - servo:dependabot/cargo/brotli-3.3.0, r=jdm Bump brotli from 3.1.5 to 3.3.0 Bumps [brotli](https://github.com/dropbox/rust-brotli) from 3.1.5 to 3.3.0. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/dropbox/rust-brotli/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=brotli&package-manager=cargo&previous-version=3.1.5&new-version=3.3.0)](https://dependabot.com/compatibility-score/?dependency-name=brotli&package-manager=cargo&previous-version=3.1.5&new-version=3.3.0) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

Kunal Mohan

commit sha dd04716b852471ba75e4bf44ced0e2d481e99ab2

Add GPUSampler to WebGPU implementation Add dom_struct and webidl for GPUSampler, implement GPUDevice.createSampler() method.

view details

atouchet

commit sha 5f56093d87711c68fc8cab133251853c8b4ed12c

More Cargo.toml updates

view details

bors-servo

commit sha 4294c306e62a219a1161b96c8a6070b2f0e3bc02

Auto merge of #26634 - servo:dependabot/cargo/wayland-protocols-0.21.13, r=jdm Bump wayland-protocols from 0.21.4 to 0.21.13 Bumps [wayland-protocols](https://github.com/smithay/wayland-rs) from 0.21.4 to 0.21.13. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/Smithay/wayland-rs/blob/master/CHANGELOG.md">wayland-protocols's changelog</a>.</em></p> <blockquote> <h1>Change Log</h1> <h2>Unreleased</h2> <h2>0.26.6 -- 2020-05-23</h2> <h4>Bugfixes</h4> <ul> <li>[cursor] Update <code>xcursor</code> to <code>0.3</code>, fixing a few cursor-related bugs.</li> </ul> <h2>0.26.5 -- 2020-05-21</h2> <h4>Bugfixes</h4> <ul> <li>[client] Fix a deadlock when dispatching &amp; reading event queues conccurently from different threads when using the rust implementation of the protocol.</li> <li>[cursor] Don't panic if <code>load_cursor</code> fails to find the requested cursor</li> <li>[cursor] Fix buffer content endianness</li> <li>[cursor] Use <code>xcursor</code> for parsing cursor files</li> </ul> <h2>0.26.4 -- 2020-05-01</h2> <h4>Bugfixes</h4> <ul> <li>[cursor] Fix FreeBSD build</li> </ul> <h2>0.26.3 -- 2020-04-22</h2> <p><em>Technical release due to crates.io issues.</em></p> <h2>0.26.2 -- 2020-04-22</h2> <h4>Bugfixes</h4> <ul> <li>[cursor] Properly assign internal buffers to filters.</li> </ul> <h2>0.26.1 -- 2020-04-22</h2> <h4>Additions</h4> <ul> <li>[cursor] Introduce helper functions <code>Cursor::image_count()</code>, <code>CursorImageBuffer::delay</code>, <code>CursorImageBuffer::hotspot()</code> and <code>CursorImageBuffer::dimensions()</code> to access metadata of cursor images.</li> </ul> <h2>0.26.0 -- 2020-04-22</h2> <h4>Breaking Changes</h4> <ul> <li>The minimum supported Rust version is now 1.41.0</li> <li><code>wayland-cursor</code> is now fully implemented in Rust</li> </ul> </tr></table> ... (truncated) </blockquote> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/smithay/wayland-rs/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=wayland-protocols&package-manager=cargo&previous-version=0.21.4&new-version=0.21.13)](https://dependabot.com/compatibility-score/?dependency-name=wayland-protocols&package-manager=cargo&previous-version=0.21.4&new-version=0.21.13) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha 12532fd07de3f7c98c636cf8ba312a0584f2500f

Auto merge of #26635 - servo:dependabot/cargo/net2-0.2.34, r=jdm Bump net2 from 0.2.33 to 0.2.34 Bumps [net2](https://github.com/deprecrated/net2-rs) from 0.2.33 to 0.2.34. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/deprecrated/net2-rs/commit/1e915300a495b47f20e93d9b67e1740e84a339a7"><code>1e91530</code></a> Release v0.2.34</li> <li><a href="https://github.com/deprecrated/net2-rs/commit/89945ebc27f3dbbc7782269aae40651f143bde55"><code>89945eb</code></a> Make cargo packaging explicit</li> <li><a href="https://github.com/deprecrated/net2-rs/commit/fe62962c1b843778887970197779c11498648b7b"><code>fe62962</code></a> Clean up trailing whitespace</li> <li><a href="https://github.com/deprecrated/net2-rs/commit/67ec2c12116d71d89f4111730c40e0f0c6e1168c"><code>67ec2c1</code></a> Update URLs in Cargo.toml</li> <li><a href="https://github.com/deprecrated/net2-rs/commit/24f41cbb7368a47a7c536cd8ec0667ad98aef301"><code>24f41cb</code></a> Add support for illumos target</li> <li><a href="https://github.com/deprecrated/net2-rs/commit/3350e3819adf151709047e93f25583a5df681091"><code>3350e38</code></a> Update README</li> <li><a href="https://github.com/deprecrated/net2-rs/commit/4d3e46872a333d2452008dc74ca95b87898cd894"><code>4d3e468</code></a> Silence try!() deprecation warnings</li> <li><a href="https://github.com/deprecrated/net2-rs/commit/15a82b17eeb1b00e802a2674967f2686685000aa"><code>15a82b1</code></a> Configure GitHub Actions for CI</li> <li><a href="https://github.com/deprecrated/net2-rs/commit/eda403f03033b58560d81b821f0df822f50cde4d"><code>eda403f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/deprecrated/net2-rs/issues/84">#84</a> from rylev/wasi-scaffold</li> <li><a href="https://github.com/deprecrated/net2-rs/commit/60cb366efe8b780ce24213aa026392c6645d3353"><code>60cb366</code></a> Change wrong cfg</li> <li>Additional commits viewable in <a href="https://github.com/deprecrated/net2-rs/compare/0.2.33...0.2.34">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=net2&package-manager=cargo&previous-version=0.2.33&new-version=0.2.34)](https://dependabot.com/compatibility-score/?dependency-name=net2&package-manager=cargo&previous-version=0.2.33&new-version=0.2.34) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha 95a818e26234455eade8fd33e72089c706d0d8d7

Auto merge of #26630 - kunalmohan:gpu-sampler, r=jdm Add GPUSampler to WebGPU implementation Add dom_struct and webidl for GPUSampler, implement GPUDevice.createSampler() method. <!-- Please describe your changes on the following line: --> r?@kvark --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

view details

bors-servo

commit sha 641eb362e8c0ca6034f5a8ba336be9f7343bcb10

Auto merge of #26637 - servo-wpt-sync:wpt_update_25-05-2020, r=servo-wpt-sync Sync WPT with upstream (25-05-2020) Automated downstream sync of changes from upstream as of 25-05-2020. [no-wpt-sync] r? @servo-wpt-sync

view details

bors-servo

commit sha 599ef5d12c69c0a4e3e215f0d370ff84f1c80d57

Auto merge of #26636 - servo:dependabot/cargo/color_quant-1.0.1, r=jdm Bump color_quant from 1.0.0 to 1.0.1 Bumps [color_quant](https://github.com/PistonDevelopers/color_quant) from 1.0.0 to 1.0.1. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/PistonDevelopers/color_quant/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=color_quant&package-manager=cargo&previous-version=1.0.0&new-version=1.0.1)](https://dependabot.com/compatibility-score/?dependency-name=color_quant&package-manager=cargo&previous-version=1.0.0&new-version=1.0.1) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) </details>

view details

bors-servo

commit sha a3446579ec44a9218e95b09258bf1515073039e9

Auto merge of #26421 - Eijebong:remove-influent, r=jdm Remove influxDB support for profile It's apparently unused. Influent is unmaintained. Let's remove it

view details

push time in 6 days

issue commentservo/servo

Fix improper_ctypes warnings in Rust Nightly

This was an issue because we run CI with RUSTFLAGS="-D warnings", but it’s not anymore because this new warning was reverted in https://github.com/rust-lang/rust/pull/66378.

There is ongoing work at https://github.com/rust-lang/rust/pull/72700 to add it again, but this time:

  • Under a dedicated improper_ctypes_definitions lint name, separate from improper_ctypes, so we could #[allow] it without disabling previously-fine lints.
  • It considers *const T, *mut T, &T and &mut T to be FFI-safe if T: Sized, even if T is not FFI-safe

With the latter change this lint should not be as much of an issue for as the initial version was.

SimonSapin

comment created time in 6 days

Pull request review commentservo/servo

Implement 'vertical-align' for layout 2020

 use style::computed_values::position::T as ComputedPosition; use style::dom::OpaqueNode; use style::logical_geometry::WritingMode; use style::properties::ComputedValues;-use style::values::computed::Length;+use style::values::computed::{Length, VerticalAlign};+use style::values::generics::box_::VerticalAlignKeyword; use style::values::specified::text::TextDecorationLine; use style::Zero; use webrender_api::{FontInstanceKey, ImageKey}; +// CSS 2.1 does not define the position of the line box's baseline.+// The baseline must be placed where ever it needs to be to fulfill+// vertical-align while minimizing the line box's height. In order+// to avoid back and forth and infinite loop situations where an+// inline element moves the baseline upwards or downwards and a+// following element moves the baseline in the opposite direction,+// we make the line box grow based on the previous overflow corrections,+// so all inline elements will eventually fit within the line box.+static BASELINE_CORRECTION_GROWTH_FACTOR: f32 = 0.1;

Nit: since this doesn’t need to have a fixed address in memory, use const instead of static.

Though it’d be best not to need this magic number at all.

ferjm

comment created time in 7 days

Pull request review commentservo/servo

Implement 'vertical-align' for layout 2020

 impl Lines {                 }             },         };-        let move_by = match text_align {+        let inline_offset = match text_align {             TextAlign::Start => Length::zero(),             TextAlign::Center => (containing_block.inline_size - line_content_inline_size) / 2.,             TextAlign::End => containing_block.inline_size - line_content_inline_size,         };-        if move_by > Length::zero() {+        if inline_offset > Length::zero() {             for fragment in &mut line_contents {-                fragment.offset_inline(&move_by);+                fragment.offset_inline(&inline_offset);+            }+        }++        // Vertical alignment.+        let mut baseline = Baseline::of_strut(layout_context, containing_block.style);+        let mut index = 0;+        let mut processed_baselines = vec![false; line_contents.len()];+        let mut accumulated_overflow = Length::zero();+        loop {+            if index >= line_contents.len() {+                break;             }+            let baseline_position_or_line_box_changed = line_contents[index].vertical_align(+                &mut line_block_size,+                &mut baseline,+                &mut processed_baselines[index],+                &mut accumulated_overflow,+            );+            index = if baseline_position_or_line_box_changed {+                // If the baseline position or the line box size changed,+                // we need to start over and realign everything according to+                // the new metrics.+                0

This algorithm looks potentially quadratic, which doesn’t seem right. I’ll comment more in the main thread.

ferjm

comment created time in 6 days

Pull request review commentservo/servo

Implement 'vertical-align' for layout 2020

 pub(crate) struct ImageFragment { }  impl Fragment {+    fn position_mut(&mut self) -> Option<&mut Vec2<Length>> {+        match self {+            Fragment::Box(f) => Some(&mut f.content_rect.start_corner),+            Fragment::AbsoluteOrFixedPositioned(_) => None,+            Fragment::Anonymous(f) => Some(&mut f.rect.start_corner),+            Fragment::Text(f) => Some(&mut f.rect.start_corner),+            Fragment::Image(f) => Some(&mut f.rect.start_corner),+        }+    }+     pub fn offset_inline(&mut self, offset: &Length) {-        let position = match self {-            Fragment::Box(f) => &mut f.content_rect.start_corner,-            Fragment::AbsoluteOrFixedPositioned(_) => return,-            Fragment::Anonymous(f) => &mut f.rect.start_corner,-            Fragment::Text(f) => &mut f.rect.start_corner,-            Fragment::Image(f) => &mut f.rect.start_corner,+        if let Some(position) = self.position_mut() {+            position.inline += *offset;+        }+    }++    pub fn vertical_align(+        &mut self,+        line_block_size: &mut Length,+        baseline: &mut Baseline,+        processed_baseline: &mut bool,+        accumulated_overflow: &mut Length,+    ) -> bool {+        let (vertical_align, vertical_align_metrics, block_size, pbm_block_start, x_height) =+            match self {+                Fragment::Box(f) => (+                    &f.style.get_box().vertical_align,+                    &f.vertical_align_metrics,+                    f.content_rect.size.block ++                        f.padding.block_sum() ++                        f.border.block_sum() ++                        f.margin.block_sum(),+                    f.padding.block_start + f.border.block_start + f.margin.block_start,+                    // XXX(ferjm) we should add this to Box fragments+                    Length::zero(),+                ),+                Fragment::Text(f) => (+                    &f.parent_style.get_box().vertical_align,+                    &f.vertical_align_metrics,+                    f.rect.size.block,+                    Length::zero(),+                    f.font_metrics.x_height,+                ),+                Fragment::Anonymous(f) => (+                    &f.vertical_align,+                    &f.vertical_align_metrics,+                    f.rect.size.block,+                    Length::zero(),+                    Length::zero(),+                ),+                _ => return false,+            };++        // If this is the first time we process this inline element, we may need+        // to modify the line baseline position based on the element's baseline.+        let mut baseline_or_line_size_changed = false;+        if !*processed_baseline {+            let current_baseline = baseline.clone();+            baseline.max_assign(&vertical_align_metrics.baseline);+            baseline_or_line_size_changed |= current_baseline != *baseline;+            *processed_baseline = true;+        }++        // Align, align, align.+        let mut block_position = match vertical_align {+            VerticalAlign::Keyword(keyword) => match keyword {+                VerticalAlignKeyword::Baseline =>+                // "Align the baseline of the box with the+                // baseline of the parent box.+                // If the box does not have a baseline, align+                // the bottom margin edge with the parent's baseline."+                {+                    baseline.space_above - vertical_align_metrics.baseline.space_above+                },+                VerticalAlignKeyword::Middle =>+                // "Align the vertical midpoint of the box with the+                // baseline of the parent box plus half the x-height+                // of the parent."+                {+                    baseline.space_above - (block_size * 0.5) - (x_height * 0.5)+                },+                VerticalAlignKeyword::Sub => Length::zero(),+                VerticalAlignKeyword::Super => Length::zero(),+                VerticalAlignKeyword::TextTop => Length::zero(),+                VerticalAlignKeyword::TextBottom => Length::zero(),

It’s fine to have those not fully implemented yet, but please have at least a FIXME comment.

ferjm

comment created time in 6 days

Pull request review commentservo/servo

Implement 'vertical-align' for layout 2020

 impl<'box_tree> Iterator for InlineBoxChildIter<'box_tree> {         }     } }++fn compute_line_height(+    line_height: LineHeight,+    font_metrics: &FontMetrics,+    font_size: Length,+) -> Length {+    match line_height {+        LineHeight::Normal => font_metrics.line_gap,+        LineHeight::Number(n) => font_size * n.0,+        LineHeight::Length(l) => l.0,+    }+}++fn font_metrics_from_style(layout_context: &LayoutContext, style: &ComputedValues) -> FontMetrics {+    let font_style = style.clone_font();+    with_thread_local_font_context(layout_context, |font_context| {+        let font_group = font_context.font_group(font_style);+        let font = font_group+            .borrow_mut()+            .first(font_context)+            .expect("could not find font");+        let font = font.borrow_mut();+        (&font.metrics).into()+    })+}++/// Baseline metrics. Used for vertical alignment of inline elements.+#[derive(Clone, Copy, Debug, PartialEq, Serialize)]+pub(crate) struct Baseline {+    /// The amount of space above the baseline.+    pub space_above: Length,+    /// The amount of space below the baseline.+    pub space_below: Length,+}++impl Baseline {+    /// https://www.w3.org/TR/CSS2/visudet.html#strut+    fn of_strut(layout_context: &LayoutContext, style: &ComputedValues) -> Baseline {+        let font_style = style.clone_font();+        let font_size = font_style.font_size.size.0;+        let font_metrics = font_metrics_from_style(layout_context, style);+        let line_height = compute_line_height(+            style.get_inherited_text().line_height,+            &font_metrics,+            font_size,+        );+        let vertical_align_metrics = VerticalAlignMetrics::for_text(&font_metrics, line_height);+        vertical_align_metrics.baseline+    }++    pub fn zero() -> Baseline {+        Self {+            space_above: Length::zero(),+            space_below: Length::zero(),+        }+    }++    pub fn max_assign(&mut self, other: &Baseline) {+        self.space_above.max_assign(other.space_above);+        self.space_below.max_assign(other.space_below);+    }+}++/// Ascent and space needed above and below the baseline for a fragment. See CSS 2.1 § 10.8.1.

Nit: please prefer URLs with fragment identifiers over section numbers. CSS 2 doesn’t change a lot at this point, but for other specs that are receiving more changes the section numbers are not stable.

ferjm

comment created time in 7 days

Pull request review commentservo/servo

Implement 'vertical-align' for layout 2020

 impl HoistedAbsolutelyPositionedBox {                     size,                 }; +                let vertical_align_metrics = VerticalAlignMetrics::for_replaced_or_inline_block(

With this being called here, should it be named something like for_independent_formatting_context? https://drafts.csswg.org/css-display-3/#independent-formatting-context

ferjm

comment created time in 7 days

Pull request review commentservo/servo

Implement 'vertical-align' for layout 2020

 pub(crate) struct AnonymousFragment {      /// The scrollable overflow of this anonymous fragment's children.     pub scrollable_overflow: PhysicalRect<Length>,++    #[serde(skip_serializing)]+    pub vertical_align: VerticalAlign,

Why is this field needed? Isn’t this value always baseline, for an anonymous fragment that doesn’t have any specified style, since the vertical-align property in non-inherited?

ferjm

comment created time in 7 days

Pull request review commentservo/servo

Implement 'vertical-align' for layout 2020

 pub(crate) struct ImageFragment { }  impl Fragment {+    fn position_mut(&mut self) -> Option<&mut Vec2<Length>> {+        match self {+            Fragment::Box(f) => Some(&mut f.content_rect.start_corner),+            Fragment::AbsoluteOrFixedPositioned(_) => None,+            Fragment::Anonymous(f) => Some(&mut f.rect.start_corner),+            Fragment::Text(f) => Some(&mut f.rect.start_corner),+            Fragment::Image(f) => Some(&mut f.rect.start_corner),+        }+    }+     pub fn offset_inline(&mut self, offset: &Length) {-        let position = match self {-            Fragment::Box(f) => &mut f.content_rect.start_corner,-            Fragment::AbsoluteOrFixedPositioned(_) => return,-            Fragment::Anonymous(f) => &mut f.rect.start_corner,-            Fragment::Text(f) => &mut f.rect.start_corner,-            Fragment::Image(f) => &mut f.rect.start_corner,+        if let Some(position) = self.position_mut() {+            position.inline += *offset;+        }+    }++    pub fn vertical_align(

Nit: this function seems like it belongs in flow/inline.rs, as vertical-align is not relevant to most layout modes.

ferjm

comment created time in 7 days

Pull request review commentservo/servo

Implement 'vertical-align' for layout 2020

 pub(crate) struct TextFragment {     pub glyphs: Vec<Arc<GlyphStore>>,     /// A flag that represents the _used_ value of the text-decoration property.     pub text_decoration_line: TextDecorationLine,+    pub vertical_align_metrics: VerticalAlignMetrics,

Does this need to be in the fragment tree? Could it instead be part of return types such as formatting_contexts::IndpendentLayout?

ferjm

comment created time in 7 days

pull request commentservo/servo

Implement 'vertical-align' for layout 2020

The general approach seems to be: start with a guess for the baseline’s position and the line’s total height, then position fragments one by one, and if the guess turned out wrong adjust it and start over. There’s also a "correction growth factor" with magic value that I don’t fully understand, but its existence appears to be related to the guessing/adjusting.

Two issues with this approach are:

  • Starting over makes the algorithm potentially take quadratic time, which shouldn’t be necessary
  • With the "correction growth factor", results appear to be approximate. We should be able to find exact results (modulo f32 precision)

I think both can be solved with a two pass algorithm.

During the first pass, the baseline position and the line’s overall height are unknown. Fragments are categorized into three "groups". Within each group, the vertical position of each fragment is computed relative to some reference point (on the vertical/block axis, I wanted to say reference line but that term is overloaded with "a line of text"). But the position of each group relative to other groups is not know yet. The groups are:

  • Fragments with vertical-align: top. The reference point is the top of the line.
  • Fragments with vertical-align: bottom. The reference point is the bottom of the line. Note that the position of the bottom of the line is not known yet. In this first pass we’re only positioning things relative to that unknown.
  • Everything else. The reference point is the baseline of the parent.
    • Inline elements can be nested, so the baseline of the parent box/fragment is not necessarily the same as that of
    • For example, vertical-align: text-top is based on “the top of the parent's content area” whose distance from the baseline is ascent + half-leading

This first pass also computes the height (block size) of every fragment.

Next, compute the respective three heights (block sizes) of the bounding boxes of each group. The height of the line is the largest of those. The "top" and "bottom" groups are positioned accordingly.

If the "everything else" group was the largest, there is only one possible position for that group within the line. If not, then the problem is under-constrained and this is the case that CSS 2 does not specify:

https://drafts.csswg.org/css2/visudet.html#line-height

The inline-level boxes are aligned vertically according to their 'vertical-align' property. In case they are aligned 'top' or 'bottom', they must be aligned so as to minimize the line box height. If such boxes are tall enough, there are multiple solutions and CSS 2 does not define the position of the line box's baseline (i.e., the position of the strut, see below).

Ideally it’d be nice to check what other browsers do, and if there’s interop do the same. But for now it’s fine to pick something and leave a FIXME comment.

Then we get to the second pass: now that we’ve determined the position each group we can go through each fragment again and set its "final" vertical position.


Note that the whole algorithm above needs to be recursive. Each fragment with vertical-align: top and bottom forms a sort of isolation boundary. The spec calls its contents an aligned subtree in https://drafts.csswg.org/css2/visudet.html#propdef-vertical-align. Such fragment are considered as one atomic thing by the algorithm. The same algorithm is applied recursively to each of their contents / aligned subtree.


There is a lot going on in this two-pass, recursive algorithm with three groups. It may be better to stick to a simplified version in this first PR and leave the rest for future PRs.

Namely, not implementing support for vertical-align: top or vertical-align: bottom yet. (They could either be mapped to text-top and text-bottom in the meantime, or be disabled in Stylo.) This removes the need for recursion, and reduces the three groups to just one. (Two passes are still needed though.) I suspect this would involve a lot less tricky details to get right.

ferjm

comment created time in 6 days

more