Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebIDL: Use Uint8ClampedArray instead of raw JSObject in bindings #31226

Conversation

Taym95
Copy link
Contributor

@Taym95 Taym95 commented Jan 30, 2024

part #31064


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because there is not behavior change

@Taym95 Taym95 marked this pull request as draft January 30, 2024 15:02
@Taym95 Taym95 changed the title WebIDL: Use Uint8ClampedArray instead of raw JSObject in bindings WebIDL: Use Uint8ClampedArray instead of raw JSObject in bindings Jan 30, 2024
Copy link
Member

@gterzian gterzian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This one is another rather complicated one, so I suggest a few changes.

Uint8ClampedArray::create(*cx, CreateWith::Length(len as usize), array.handle_mut())
.unwrap();
(*imagedata).data.set(array.get());
let typed_array =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this belongs in a new new_initialized method of the heaped array, and you should create it above before imagedata.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you can make new_initialized take an optional JSObject, so that it can be used with new_with_js_object(see below).

@@ -144,23 +147,23 @@ impl ImageData {
width: u32,
opt_height: Option<u32>,
) -> Fallible<DomRoot<Self>> {
Self::new_with_jsobject(global, proto, width, opt_height, jsobject)
// Self::new_with_data(global, proto, width, opt_height, jsobject)
Self::new_without_data(global, proto, width, opt_height.unwrap())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you should keep new_with_jsobject, and create a new new_initialized method on HeapTypedArray that takes an optional jsobject, in this case some.

mrobinson and others added 24 commits February 11, 2024 18:07
The new strategy for dependencies with upstream in Gecko is to manage
them in separate repositories, which will more easily allow rebasing our
changes on top of newer Gecko work.
…SObject` (servo#31189)

* WebIDL use FLoat64Array

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use to_vec to convert array to vec

* avoid allocating a new vec

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Lint layout_2013 with clippy

CARGO_BUILD_RUSTC=rustc cargo clippy --fix -p layout_2013 --broken-code

* ./mach fmt

* Cosmetic adjustments
We upgraded our Python dependency to 3.10, but neglected to update mach.
This change makes sure we error out sooner, rather than later.
This upgrades surfman and webxr. The main benefit to this upgrade is
that surfman (and thus libservo) no longer depends on winit. servoshell
still does, but this should make upgrades a lot easier.
PR servo#31210 avoided the cache for all kinds of reflow, but it's actually
fine to use it for ReflowTriggerCondition::PaintPostponed.
Bumps [profiling](https://github.com/aclysma/profiling) from 1.0.13 to 1.0.14.
- [Changelog](https://github.com/aclysma/profiling/blob/master/CHANGELOG.md)
- [Commits](aclysma/profiling@v1.0.13...v1.0.14)

---
updated-dependencies:
- dependency-name: profiling
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* mach: test-tidy should return 1 for failure

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* fix lint issues

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* mach: tidy should allow spec links with trailing text

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.12.0 to 0.12.1.
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](rust-itertools/itertools@v0.12.0...v0.12.1)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [darling](https://github.com/TedDriggs/darling) from 0.20.3 to 0.20.4.
- [Release notes](https://github.com/TedDriggs/darling/releases)
- [Changelog](https://github.com/TedDriggs/darling/blob/master/CHANGELOG.md)
- [Commits](TedDriggs/darling@v0.20.3...v0.20.4)

---
updated-dependencies:
- dependency-name: darling
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [darling](https://github.com/TedDriggs/darling) from 0.20.4 to 0.20.5.
- [Release notes](https://github.com/TedDriggs/darling/releases)
- [Changelog](https://github.com/TedDriggs/darling/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TedDriggs/darling/commits)

---
updated-dependencies:
- dependency-name: darling
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [synstructure](https://github.com/mystor/synstructure) from 0.13.0 to 0.13.1.
- [Commits](https://github.com/mystor/synstructure/commits)

---
updated-dependencies:
- dependency-name: synstructure
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [webxr](https://github.com/servo/webxr) from `f1cc785` to `614420b`.
- [Commits](servo/webxr@f1cc785...614420b)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [app_units](https://github.com/servo/app_units) from 0.7.3 to 0.7.4.
- [Release notes](https://github.com/servo/app_units/releases)
- [Commits](servo/app_units@v0.7.3...v0.7.4)

---
updated-dependencies:
- dependency-name: app_units
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.35 to 0.5.36.
- [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md)
- [Commits](winnow-rs/winnow@v0.5.35...v0.5.36)

---
updated-dependencies:
- dependency-name: winnow
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.2.1 to 2.2.2.
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](indexmap-rs/indexmap@2.2.1...2.2.2)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Make Android build optional on Nix

I want to build Servo without also installing the entire Android SDK.
This makes it so Android support is only built if `buildAndroid` is
true.

Signed-off-by: syvb <me@iter.ca>

* Add Android support to nix-shell if SERVO_ANDROID_BUILD set

---------

Signed-off-by: syvb <me@iter.ca>
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.152 to 0.2.153.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](rust-lang/libc@0.2.152...0.2.153)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.30 to 0.38.31.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](bytecodealliance/rustix@v0.38.30...v0.38.31)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [webpki-roots](https://github.com/rustls/webpki-roots) from 0.25.3 to 0.25.4.
- [Release notes](https://github.com/rustls/webpki-roots/releases)
- [Commits](rustls/webpki-roots@v/0.25.3...v/0.25.4)

---
updated-dependencies:
- dependency-name: webpki-roots
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [app_units](https://github.com/servo/app_units) from 0.7.4 to 0.7.5.
- [Release notes](https://github.com/servo/app_units/releases)
- [Commits](servo/app_units@v0.7.4...v0.7.5)

---
updated-dependencies:
- dependency-name: app_units
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.35.1 to 1.36.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](tokio-rs/tokio@tokio-1.35.1...tokio-1.36.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot bot and others added 28 commits February 11, 2024 18:09
Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.67 to 0.3.68.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: js-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.14.1 to 1.14.2.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](Lokathor/bytemuck@v1.14.1...v1.14.2)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.18.1 to 0.18.2.
- [Changelog](https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md)
- [Commits](rust-lang/git2-rs@git2-0.18.1...git2-0.18.2)

---
updated-dependencies:
- dependency-name: git2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.5.37 to 0.5.39.
- [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md)
- [Commits](winnow-rs/winnow@v0.5.37...v0.5.39)

---
updated-dependencies:
- dependency-name: winnow
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1288)

Bumps [unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation) from 1.10.1 to 1.11.0.
- [Commits](unicode-rs/unicode-segmentation@v1.10.1...v1.11.0)

---
updated-dependencies:
- dependency-name: unicode-segmentation
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fix issue with precedence due to which the android
environment variables were being added to the output
of mkDerivation instead of the input attribute set.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
I'm fairly certain this file is unused and the bugs linked are now closed.
1. Move `./mach try` to `testing_commands.py which is a bit more
   consistent.
2. Make `./mach try` print out the remote name always and properly
   form the URL for ssh repositories.
3. Print out the try configuration matrix to make it more obvious
   what is being triggered remotely.
4. Better error handling. Print and error and exit if the remote isn't
   on GitHub and also clean up properly if something fails after making
   the temporary commit.
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.67 to 0.3.68.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: web-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [num-integer](https://github.com/rust-num/num-integer) from 0.1.45 to 0.1.46.
- [Changelog](https://github.com/rust-num/num-integer/blob/master/RELEASES.md)
- [Commits](rust-num/num-integer@num-integer-0.1.45...num-integer-0.1.46)

---
updated-dependencies:
- dependency-name: num-integer
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [jobserver](https://github.com/alexcrichton/jobserver-rs) from 0.1.27 to 0.1.28.
- [Commits](https://github.com/alexcrichton/jobserver-rs/commits)

---
updated-dependencies:
- dependency-name: jobserver
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.17 to 0.2.18.
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](rust-num/num-traits@num-traits-0.2.17...num-traits-0.2.18)

---
updated-dependencies:
- dependency-name: num-traits
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ervo#31292)

Instead of using the border widths from the style, use the ones recorded
by the `BoxFragment`. This is necessary because inline layout can
override these border widths during fragmentation. For instance, when a
box is split across two lines only one fragment should have an inline
start border.
Replaced unmaintained `mach` crate with `mach2`, and added support for getting arm registers.
…ues (servo#31299)

For example,

    style.cssText = "margin: 1px 2px 3px 4px";
    [...style];

will now be

    ["margin-top", "margin-right", "margin-bottom", "margin-left"]

instead of

    ["1px", "2px", "3px", "4px"]
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.14.2 to 1.14.3.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](Lokathor/bytemuck@v1.14.2...v1.14.3)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Just return the raw name. This is only relevant for custom properties.
This should fix issues that we have with Float16 support on newer LLVM.
This also updates style, in order to remove the duplicate version of
bindgen. We will soon be able to manage updates to style more
consistently.
Bumps [cfg-expr](https://github.com/EmbarkStudios/cfg-expr) from 0.15.6 to 0.15.7.
- [Release notes](https://github.com/EmbarkStudios/cfg-expr/releases)
- [Changelog](https://github.com/EmbarkStudios/cfg-expr/blob/main/CHANGELOG.md)
- [Commits](EmbarkStudios/cfg-expr@0.15.6...0.15.7)

---
updated-dependencies:
- dependency-name: cfg-expr
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [is-terminal](https://github.com/sunfishcode/is-terminal) from 0.4.10 to 0.4.11.
- [Commits](sunfishcode/is-terminal@v0.4.10...v0.4.11)

---
updated-dependencies:
- dependency-name: is-terminal
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This implements a very naive row height allocation approach. It has just
enough to implement `vertical-align` in table cells. Rowspanned cells
get enough space for their content, with the extra space necessary being
allocated to the last row. There's still a lot missing here, including
proper distribution of row height to rowspanned cells.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
…1297)

* <hr> elements are expected to have a default overflow:hidden
See whatwg/html#2724

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

* Use full defined hr style

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

* update legacy test expectation

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
…o#31277)

* Respond to shorthand property requests with real values

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

* Cleanup formatting and old comments

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

* Update WPT expectations

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

* Refactor out helper fn

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

* Cleanup

Signed-off-by: Sebastian C <sebsebmc@gmail.com>

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
* Update web-platform-tests to revision b'33d11f1db34802fda00e64ddeb0b7ef040cf65be'

* Update expectations

---------

Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
This fixes a warning from Cargo about relying on deprecated behavior:
```
warning: /home/loops/src/servo/servo/components/script/Cargo.toml: dependency (num_cpus) specified without providing a local path, Git repository, version, or workspace dependency to use. This will be considered an error in future versions
warning: /home/loops/src/servo/servo/components/config/Cargo.toml: dependency (num_cpus) specified without providing a local path, Git repository, version, or workspace dependency to use. This will be considered an error in future versions
```
This adds an initial implementation of font fallback, on part with the
one used in legacy layout. There are still issues. For instance, font
matching is done per unicode character rather than based on graphemes or
the shape first approach of Chrome. The idea is that these changes can
be made later.
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
@servo-wpt-sync
Copy link
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@Taym95 Taym95 closed this Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet