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: add support for DOM elements going over the context bridge #26776

Merged
merged 2 commits into from Dec 10, 2020

Conversation

MarshallOfSound
Copy link
Member

As in title and as in notes, uses blink APIs to safely transfer a WebElement reference from one context to another

Notes: Added support for passing DOM elements over the context bridge

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Dec 1, 2020
@MarshallOfSound MarshallOfSound added the semver/minor backwards-compatible functionality label Dec 1, 2020
Copy link
Member

@nornagon nornagon left a comment

Choose a reason for hiding this comment

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

needs docs.

do these tests already include sending WebElements in both directions across the bridge?

@MarshallOfSound
Copy link
Member Author

@nornagon Docs updated, tests go both ways 👍

@MarshallOfSound MarshallOfSound added semver/minor backwards-compatible functionality and removed semver/minor backwards-compatible functionality labels Dec 7, 2020
@@ -106,6 +106,7 @@ has been included below for completeness:
| `Promise` | Complex | ✅ | ✅ | Promises are only proxied if they are the return value or exact parameter. Promises nested in arrays or objects will be dropped. |
| `Function` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending classes or constructors will not work. |
| [Cloneable Types](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) | Simple | ✅ | ✅ | See the linked document on cloneable types |
| `HTMLElement` | Complex | ✅ | ✅ | Prototype modifications are dropped. Sending custom elements will not work. |
Copy link
Member

Choose a reason for hiding this comment

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

I believe this is incorrect, as this supports Element not just HTMLElement. e.g. SVGElement is a child class of Element but not HTMLElement.

Further—should/can we support Node here, so we can additionally pass references to text nodes?

Copy link
Member Author

Choose a reason for hiding this comment

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

@nornagon The "FromV8" part of this comes from WebElement and the "ToV8" comes from WebNode. So I think that means we can't support Node's 🤔

@codebytere codebytere added semver/minor backwards-compatible functionality and removed semver/minor backwards-compatible functionality labels Dec 8, 2020
@MarshallOfSound MarshallOfSound merged commit b9c9e7f into master Dec 10, 2020
@release-clerk
Copy link

release-clerk bot commented Dec 10, 2020

Release Notes Persisted

Added support for passing DOM elements over the context bridge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review/approved ✅ semver/minor backwards-compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants