Bug 78721 - Rename DOMWindow to Window in the bindings
Summary: Rename DOMWindow to Window in the bindings
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Erik Arvidsson
URL: http://www.whatwg.org/specs/web-apps/...
Keywords:
Depends on: 79384
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-15 10:15 PST by Erik Arvidsson
Modified: 2012-02-23 22:21 PST (History)
7 users (show)

See Also:


Attachments
WIP (98.17 KB, patch)
2012-02-21 16:45 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch (153.93 KB, patch)
2012-02-22 11:40 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch (157.58 KB, patch)
2012-02-22 13:36 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch for landing (88.01 KB, patch)
2012-02-23 15:17 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch for landing (94.82 KB, patch)
2012-02-23 15:20 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Arvidsson 2012-02-15 10:15:15 PST
We name our interface DOMWindow when it should be called Window:

assertTrue(window.Window !== undefined)
Comment 1 Erik Arvidsson 2012-02-15 12:26:06 PST
That assert was not so useful. Here are better test

assertTrue(String(Window) === 'function Window() { [native code] }') // V8
assertTrue(String(Window) === '[object WindowConstructor]') // JSC
Comment 2 Erik Arvidsson 2012-02-17 12:32:42 PST
Haraken, do you have any suggestions how to do this? Right now the interface name must match the file name as far as I can tell.
Comment 3 Erik Arvidsson 2012-02-21 16:45:11 PST
Created attachment 128083 [details]
WIP
Comment 4 Kentaro Hara 2012-02-21 16:51:05 PST
Comment on attachment 128083 [details]
WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=128083&action=review

The approach looks good to me.

> Source/WebCore/ChangeLog:8
> +        No new tests. (OOPS!)

Please add run-bindings-tests.

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:-3782
> -sub GetVisibleInterfaceName

Maybe you can remove GetVisibleInterfaceName() from CodeGeneratorJS.pm too?

> Source/WebCore/bindings/scripts/IDLAttributes.txt:55
> +InterfaceName=*

Thanks for using IDLAttributes.txt, which was introduced today:-)
Comment 5 Erik Arvidsson 2012-02-21 16:51:57 PST
This adds a new extended attribute to the interface section called InterfaceName

interface [
  InterfaceName=Window
] DOMWindow {

}

This is kind of backwards. A better outcome would be to use ImplementedAs on the interface and update all the IDL files to use the real interface name as spec'ed.

interface [
  ImplementedAs=DOMWindow
] Window {

}

However, making this change would require a lot more work. I'm tempted to say that we should do that since forcing us to use non standard interface names in our IDL files suck.

WDYT?
Comment 6 Adam Barth 2012-02-21 16:51:59 PST
Comment on attachment 128083 [details]
WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=128083&action=review

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1326
> -    my $visibleClassName = GetVisibleClassName($interfaceName);
> +    my $visibleClassName = $codeGenerator->GetVisibleInterfaceName($dataNode);

Should we rename $visibleClassName to $visibleInterfaceName ?

Can we remove GetVisibleClassName from CodeGeneratorJS.pm too?

> Source/WebCore/bindings/scripts/IDLAttributes.txt:55
> +InterfaceName=*

Please add a test to Source/WebCore/bindings/scripts/tests for this IDL attribute.

> LayoutTests/fast/dom/Window/atob-btoa-expected.txt:18
> -PASS window.btoa(window) is "W29iamVjdCBET01XaW5kb3dd"
> +FAIL window.btoa(window) should be W29iamVjdCBET01XaW5kb3dd. Was W29iamVjdCBXaW5kb3dd.

Please update the test so that this says "PASS"
Comment 7 Adam Barth 2012-02-21 16:53:07 PST
> However, making this change would require a lot more work. I'm tempted to say that we should do that since forcing us to use non standard interface names in our IDL files suck.

I would add a FIXME near the GetVisibleInterfaceName function that says something to that effect.
Comment 8 Erik Arvidsson 2012-02-22 11:40:45 PST
Created attachment 128256 [details]
Patch
Comment 9 WebKit Review Bot 2012-02-22 12:35:55 PST
Comment on attachment 128256 [details]
Patch

Attachment 128256 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11560582

New failing tests:
inspector/profiler/heap-snapshot.html
Comment 10 Erik Arvidsson 2012-02-22 13:36:03 PST
Created attachment 128276 [details]
Patch
Comment 11 Adam Barth 2012-02-22 15:17:58 PST
Please consider landing the patch in stages.  For example, you could land the code generator infrastructure/tests first with attributes for the current whitelisted interfaces and then change DOMWindow in a separate patch.  That will make our lives easier if we have to roll back the DOMWindow change do to compat issues.
Comment 12 Erik Arvidsson 2012-02-22 15:24:27 PST
Thanks Adam. That makes sense. I will split it into 2 patches.
Comment 13 Erik Arvidsson 2012-02-23 15:17:40 PST
Created attachment 128565 [details]
Patch for landing
Comment 14 Erik Arvidsson 2012-02-23 15:18:34 PST
Comment on attachment 128565 [details]
Patch for landing

Missing ChangeLogs
Comment 15 Erik Arvidsson 2012-02-23 15:20:20 PST
Created attachment 128566 [details]
Patch for landing
Comment 16 WebKit Review Bot 2012-02-23 22:21:20 PST
Comment on attachment 128566 [details]
Patch for landing

Clearing flags on attachment: 128566

Committed r108729: <http://trac.webkit.org/changeset/108729>
Comment 17 WebKit Review Bot 2012-02-23 22:21:28 PST
All reviewed patches have been landed.  Closing bug.