Bug 78721 - Rename DOMWindow to Window in the bindings
: Rename DOMWindow to Window in the bindings
Status: RESOLVED FIXED
: WebKit
HTML DOM
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To:
: http://www.whatwg.org/specs/web-apps/...
:
: 79384
:
  Show dependency treegraph
 
Reported: 2012-02-15 10:15 PST by
Modified: 2012-02-23 22:21 PST (History)


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


Note

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


Description From 2012-02-15 10:15:15 PST
We name our interface DOMWindow when it should be called Window:

assertTrue(window.Window !== undefined)
------- Comment #1 From 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 From 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 From 2012-02-21 16:45:11 PST -------
Created an attachment (id=128083) [details]
WIP
------- Comment #4 From 2012-02-21 16:51:05 PST -------
(From update of attachment 128083 [details])
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 From 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 From 2012-02-21 16:51:59 PST -------
(From update of attachment 128083 [details])
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 From 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 From 2012-02-22 11:40:45 PST -------
Created an attachment (id=128256) [details]
Patch
------- Comment #9 From 2012-02-22 12:35:55 PST -------
(From update of attachment 128256 [details])
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 From 2012-02-22 13:36:03 PST -------
Created an attachment (id=128276) [details]
Patch
------- Comment #11 From 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 From 2012-02-22 15:24:27 PST -------
Thanks Adam. That makes sense. I will split it into 2 patches.
------- Comment #13 From 2012-02-23 15:17:40 PST -------
Created an attachment (id=128565) [details]
Patch for landing
------- Comment #14 From 2012-02-23 15:18:34 PST -------
(From update of attachment 128565 [details])
Missing ChangeLogs
------- Comment #15 From 2012-02-23 15:20:20 PST -------
Created an attachment (id=128566) [details]
Patch for landing
------- Comment #16 From 2012-02-23 22:21:20 PST -------
(From update of attachment 128566 [details])
Clearing flags on attachment: 128566

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