Skip to content

Implementing Element in web-sys #508

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

Merged

Conversation

jonathanKingston
Copy link
Contributor

@jonathanKingston jonathanKingston commented Jul 19, 2018

Open questions:

  • Should we support toggle_attribute it's only in Nightly's of Firefox, Canary Chrome, Webkit.
    • Could toggle_attribute be controlled by a environment var or build flag?
  • Should we support moz_matches_selector it's non standard and Firefox only.

Part of #446 as noted there, many key APIs aren't available still.

@@ -0,0 +1,186 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like git says this was all added, was this copied from the available folder? If so, feel free to delete the version in available!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I only added the top section so I could add the rest and comment it out. I had a few problems with large comment sections so took this approach.

// `DOMString` is not supported yet in other positions.
webidl::ast::TypeKind::DOMString => return None,
webidl::ast::TypeKind::DOMString => {
simple_path_ty(vec![rust_ident("wasm_bindgen"), rust_ident("JsValue")])
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd personally advocate for String here rather than JsValue myself, but others may disagree!

@alexcrichton
Copy link
Contributor

Thanks for the PR @jonathanKingston! I'm personally fine adding standardized APIs even if they're brand new (like toggle_attribute). We may have to do some trickery to test them but I think it's also fine to avoid testing them for now. For Firefox-specific APIs I'd omit them for the time being, we can always add them later!

@jonathanKingston jonathanKingston force-pushed the web-sys/element-support-r branch from 44efd42 to 84de1b2 Compare July 19, 2018 13:22
@jonathanKingston
Copy link
Contributor Author

@alexcrichton I have done your suggestions I think.
I managed to get it to compile with the full IDL, I commented out parts that it breaks the compiler that will likely come soon.
Thanks.

@alexcrichton
Copy link
Contributor

Looks great! If you want to rebase it should get CI green again, and then I think this is probably good to go!

@jonathanKingston jonathanKingston force-pushed the web-sys/element-support-r branch from 84de1b2 to dac3f38 Compare July 19, 2018 15:24
@alexcrichton alexcrichton merged commit 4013fd9 into rustwasm:master Jul 19, 2018
@jonathanKingston jonathanKingston deleted the web-sys/element-support-r branch July 20, 2018 17:13
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.

2 participants