Last Comment Bug 785472 - The Web IDL parser should not allow inheriting from an interface that is only forward declared
: The Web IDL parser should not allow inheriting from an interface that is only...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla17
Assigned To: :Ehsan Akhgari
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-24 12:24 PDT by :Ehsan Akhgari
Modified: 2012-08-24 20:00 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (v1) (1.79 KB, patch)
2012-08-24 12:24 PDT, :Ehsan Akhgari
khuey: review+
Details | Diff | Splinter Review

Description :Ehsan Akhgari 2012-08-24 12:24:08 PDT

    
Comment 1 :Ehsan Akhgari 2012-08-24 12:24:38 PDT
Created attachment 655093 [details] [diff] [review]
Patch (v1)
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-08-24 12:27:21 PDT
Comment on attachment 655093 [details] [diff] [review]
Patch (v1)

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

::: dom/bindings/parser/WebIDL.py
@@ +426,5 @@
> +            raise WebIDLError("%s inherits from %s which does not have "
> +                              "a definition" %
> +                              (self.identifier.name,
> +                               self.parent.identifier.name),
> +                              [self.location])

I would prefer

if parent and isinstance(parent, IDLExternalInterface):
    raise ...

assert not parent or isinstance(parent, IDLInterface).

If parent somehow becomes an IDLAttribute I want to know!
Comment 4 :Ehsan Akhgari 2012-08-24 13:24:36 PDT
I backed this out since it breaks the build with the existing IDL files:

https://hg.mozilla.org/integration/mozilla-inbound/rev/1bc0e4eac6e5

Traceback (most recent call last):
  File "/media/storage/moz/mozilla-inbound/config/pythonpath.py", line 56, in <module>
    main(sys.argv[1:])
  File "/media/storage/moz/mozilla-inbound/config/pythonpath.py", line 48, in main
    execfile(script, frozenglobals)
  File "/media/storage/moz/mozilla-inbound/dom/bindings/GlobalGen.py", line 80, in <module>
    main()
  File "/media/storage/moz/mozilla-inbound/dom/bindings/GlobalGen.py", line 59, in main
    parserResults = parser.finish()
  File "/media/storage/moz/mozilla-inbound/dom/bindings/parser/WebIDL.py", line 3667, in finish
nsIDOMFileRequest.idl
    production.finish(self.globalScope())
  File "/media/storage/moz/mozilla-inbound/dom/bindings/parser/WebIDL.py", line 430, in finish
    [self.location])
WebIDL.WebIDLError: error: XMLHttpRequest inherits from XMLHttpRequestEventTarget which does not have a definition, XMLHttpRequest.webidl line 55:0
interface XMLHttpRequest : XMLHttpRequestEventTarget {
^

Not sure how we're supposed to fix those...
Comment 5 :Ehsan Akhgari 2012-08-24 13:35:11 PDT
I got the condition wrong!  Re-landed with it fixed:

https://hg.mozilla.org/integration/mozilla-inbound/rev/68a243c559b2
Comment 6 Ryan VanderMeulen [:RyanVM] 2012-08-24 20:00:20 PDT
https://hg.mozilla.org/mozilla-central/rev/68a243c559b2

Note You need to log in before you can comment on or make changes to this bug.