Closed Bug 1333117 Opened 8 years ago Closed 8 years ago

partial interface definitions in files other than the file that declares the interface are a footgun

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox53 --- affected
firefox54 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We have no documentation saying not to do this, nor do we have anything enforcing people don't do it.  But it doesn't work correctly, because of build dependency issues.

Specifically, if I do a build, then add "partial interface Navigator { void foo(); };" to Window.webidl, then do a dep build I will NOT get a "foo()" method on Navigator.  That's because NavigatorBinding.cpp had no previous dependency on Window.webidl, and we have no idea that there is now such a dependency and we need to regenerate NavigatorBinding.cpp.  So we don't regenerate it.

This is similar to the issue described in bug 1071490, where we removed the footgun in bug 1071615.  We should probably do something similar here...
Of course NavigatorProperty does just this.  I'll have to whitelist it; I also added notes about it needing a clobber on https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8829521 [details] [diff] [review]
We should ensure, at build-time, that partial interfaces are defined in the same file as the interface they extend, since our build system doesn't really support correct dep builds if they're placed in a different file

Review of attachment 8829521 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good. Worth throwing a test in to continue confirming this fails?
Attachment #8829521 - Flags: review?(kyle) → review+
We don't really have any infrastructure I know of for testing this, unfortunately.  That is, we don't have infra for testing that codegen failures (unlike parser failures) happen when they should.
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a0974b1960a9
We should ensure, at build-time, that partial interfaces are defined in the same file as the interface they extend, since our build system doesn't really support correct dep builds if they're placed in a different file.  r=qdot
https://hg.mozilla.org/mozilla-central/rev/a0974b1960a9
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: