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

Find a better way to hide interfaces from content #3688

Open
kmcallister opened this issue Oct 15, 2014 · 2 comments
Open

Find a better way to hide interfaces from content #3688

kmcallister opened this issue Oct 15, 2014 · 2 comments

Comments

@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented Oct 15, 2014

@Ms2ger is unhappy with [NoInterfaceObject] (could you elaborate on why?)

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Oct 15, 2014

It's kind of an antipattern, and there's about one place in the platform where it's used (excluding mixins, which might get dedicated syntax), so it's possible we'll remove NoInterfaceObject from the platform, and in that case it'd be nice not to have to support it for our own implementation details.

@kmcallister kmcallister changed the title Find a better way to avoid exposing interfaces to content Find a better way to hide interfaces from content Oct 15, 2014
@ChrisParis
Copy link
Contributor

@ChrisParis ChrisParis commented Apr 9, 2015

I count two instances where NoInterfaceObject is used in Servo outside of a mixin context: DOMRectList and ServoHTMLParser. In these two instances, Servo's codegen does generate code to create interface objects, despite the NoInterfaceObject attribute in the IDL files (DefineDOMInterface is not generated, but CreateInterfaceObjects is generated and used).

This presents a challenge to one proposal to replace an assert not isCallback() with an assert hasInterfaceObject(). The problem is that the interface objects method is created unconditionally. If that call is made conditional on hasInterfaceObject(), then the definition of CreateInterfaceObjects is omitted, but the call to it is still present in GetProtoObject. GetProtoObject is still used by Wrap.

I'm not proposing a solution at this time, but rather elaborating on one instance of where the current situation is a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.