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

feat(ext/geometry): Geometry Interfaces Module Level 1 #22054

Open
wants to merge 90 commits into
base: main
Choose a base branch
from

Conversation

petamoriken
Copy link
Contributor

closes #21608

@petamoriken petamoriken force-pushed the feat/geometry branch 3 times, most recently from 3343fa4 to 4206e6c Compare February 1, 2024 18:14
@petamoriken petamoriken force-pushed the feat/geometry branch 3 times, most recently from b53a1a1 to 7d33171 Compare February 7, 2024 10:30
@bartlomieju bartlomieju added this to the 1.42 milestone Mar 11, 2024
crowlKats
crowlKats previously approved these changes Mar 24, 2024
@crowlKats crowlKats dismissed their stale review March 24, 2024 04:26

unintentional approval

"css": {
"geometry": {
"DOMMatrix-001.html": [
"new DOMMatrix(\"none\")",
Copy link
Member

Choose a reason for hiding this comment

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

These are failing because we don't support using CSS transform strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, currently only unitless matrix and matrix3d functions are supported

"DOMPointReadOnly interface: existence and properties of interface object",
"DOMPoint interface: existence and properties of interface object",
"DOMRectReadOnly interface: existence and properties of interface object",
"DOMRect interface: existence and properties of interface object",
Copy link
Member

Choose a reason for hiding this comment

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

Why is this failing? It shouldn't fail if we implement DOMRect.

Copy link
Contributor

Choose a reason for hiding this comment

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

These tests fail because Web IDL requires the interface objects to be defined as data properties but here they are implemented as getters to support lazy loading.

@crowlKats
Copy link
Member

@petamoriken could you fix the conflicts?

@bartlomieju
Copy link
Member

bartlomieju commented Mar 27, 2024

@petamoriken sorry, but I'm gonna bump this one to Deno v1.43. I discussed this PR with @crowlKats and @littledivy and I have some reservations seeing the amount of JS code this contains.

I know it's lazy loaded and shouldn't impact startup time, but we believe this is a good opportunity to finally get the ball rolling and try this API to be implemented using more native code - in particular a lot of work in the APIs is a combination of WebIDL validation and calling an op. We do know from the benchmarks that WebIDL is rather slow and we devised a tentative plan how we can start moving WebIDL validation to Rust code.

I think it would be beneficial if we could try to integrate this approach in your PR and its surface area is rather significant and should help us establish if making WebIDL part of ops is feasible. I will open an issue about it soon with some explanations how we want to tackle that and we will get ~10 validators ported to Rust (we'll try to target the validators you are using in this PR).

Thank you for the hard work on this and we'll make sure it doesn't rot and gets landed.

@@ -5076,7 +5076,7 @@ fn lsp_jsr_auto_import_completion() {
json!({ "triggerKind": 1 }),
);
assert!(!list.is_incomplete);
assert_eq!(list.items.len(), 261);
assert_eq!(list.items.len(), 268);
Copy link
Member

Choose a reason for hiding this comment

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

Yikes, this is a bit concerning that adding new globals requires changes in seemingly unrelated tests for the LSP. I've opened #23102 to tackle that.

Copy link
Member

Choose a reason for hiding this comment

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

General question: why do we need both WPT and unit tests for these APIs? Are WPT tests not thorough enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. One example is that WPT doesn't have tests for mutable transform functions such as multiplySelf.

Comment on lines +4 to +6
name = "deno_geometry"
version = "0.1.0"
authors.workspace = true
Copy link
Member

Choose a reason for hiding this comment

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

Note to self: I already claimed https://crates.io/crates/deno_geometry to avoid problems during publishing when this PR lands

@bartlomieju
Copy link
Member

@petamoriken I spoke with @littledivy earlier today and he's close to landing all necessary changes to cppgc op2++ (yes, the name is confusing) that would make it possible to write most of this API in native code. We'll keep you updated as these changes land.

@bartlomieju bartlomieju modified the milestones: 1.43, 1.44 May 5, 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.

Feature Request: Geometry Interfaces Module Level 1
5 participants