Bug 77966 - Remove the [ExtendsDOMGlobalObject] IDL attribute
Summary: Remove the [ExtendsDOMGlobalObject] IDL attribute
Status: RESOLVED DUPLICATE of bug 118191
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 77393
  Show dependency treegraph
 
Reported: 2012-02-07 04:42 PST by Kentaro Hara
Modified: 2013-11-20 03:01 PST (History)
6 users (show)

See Also:


Attachments
Patch (4.71 KB, patch)
2012-02-07 04:47 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2012-02-07 04:42:36 PST
The [ExtendsDOMGlobalObject] attribute might be verbose. It is used only by DOMWindow.idl and IDL files with [IsWorkerContext] attribute.

(Note: It would be OK to handle DOMWindow.idl specially in code generators (rather than introducing a new IDL attribute just for DOMWindow.idl), since DOMWindow.idl is already handled specially here and there.)
Comment 1 Kentaro Hara 2012-02-07 04:47:47 PST
Created attachment 125818 [details]
Patch
Comment 2 Alexey Proskuryakov 2012-02-07 09:44:08 PST
I agree with what Darin said in webkit-deb thread - adding more special cases to code generating scripts is a step in the wrong direction.
Comment 3 Darin Adler 2012-02-07 12:07:07 PST
I do not think removing this keyword is an improvement. It’s probably the best-named one of the DOMWindow-related keywords.

I think the other special cases of DOMWindow should be merged into this keyword or possibly one of the others if the concerns are really orthogonal. Hardcoding the actual name DOMWindow in the scripts is not nearly as good; we should work instead to wipe that out. Especially if features like workers eventually lead us to wanting to refactor this.
Comment 4 Eric Seidel (no email) 2012-02-07 16:03:26 PST
Comment on attachment 125818 [details]
Patch

Hmmm... Seems like someone was trying to make the idl more general.  This seems to be used in more places than just DOMWindow.idl?
Comment 5 Kentaro Hara 2012-02-07 16:16:44 PST
> Hardcoding the actual name DOMWindow in the scripts is not nearly as good;

OK.

> I think the other special cases of DOMWindow should be merged into this keyword or possibly one of the others if the concerns are really orthogonal.

There are 18 hard-coded "DOMWindow" in CodeGeneratorJS.pm and 25 hard-coded "DOMWindow" in CodeGeneratorV8.pm. At least, removing these hard-coded "DOMWindow"s by introducing many new IDL attributes would not be desirable. Maybe we can introduce [IsDOMWindow] attribute? Although this just replaces hard-coded "DOMWindow" to [IsDOMWindow] attribute, but code generators would be more readable than introducing many IDL attributes. (I do agree that we should avoid hard-coding in code generators, but it would be also important to make code generators more readable by reducing the number of IDL attributes, and prevent people from using "don't know" IDL attributes.)

Then, [ExtendsDOMGlobalObject] can be replaced with "[IsDOMWindow] or [IsWorkerContext]".

WDYT?
Comment 6 Darin Adler 2012-02-07 17:17:13 PST
(In reply to comment #5)
> removing these hard-coded "DOMWindow"s by introducing many new IDL attributes would not be desirable

Yes, I’d want to use existing IDL attributes or add a small number. I don’t think IsDOMWindow is the attribute I’d add, though. We could look at the 18 to find out what the pattern is of why DOMWindow is special.
Comment 7 Kentaro Hara 2012-04-10 05:22:23 PDT
Comment on attachment 125818 [details]
Patch

For now, let me invalidate r?. Sooner or later, I'd like to work on removing DOMWindow-specific IDL attributes.
Comment 8 Zan Dobersek 2013-11-20 03:01:38 PST
This attribute was removed in r152168 (bug #118191).
http://trac.webkit.org/changeset/152168

Marking this bug as a duplicate of that one.

*** This bug has been marked as a duplicate of bug 118191 ***