Bug 110573 - Global constructors should be configurable and not enumerable
: Global constructors should be configurable and not enumerable
Status: RESOLVED FIXED
: WebKit
WebCore Misc.
: 528+ (Nightly build)
: All Unspecified
: P2 Normal
Assigned To:
: http://dev.w3.org/cvsweb/~checkout~/2...
: WebExposed
:
: 115235
  Show dependency treegraph
 
Reported: 2013-02-22 01:44 PST by
Modified: 2013-04-26 01:32 PST (History)


Attachments
Patch (201.68 KB, patch)
2013-04-17 10:36 PST, Christophe Dumez
buildbot: commit‑queue-
Review Patch | Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion (525.43 KB, application/zip)
2013-04-17 11:57 PST, Build Bot
no flags Details
Patch (208.60 KB, patch)
2013-04-17 12:37 PST, Christophe Dumez
no flags Review Patch | Details | Formatted Diff | Diff
Patch (208.63 KB, patch)
2013-04-17 14:02 PST, Christophe Dumez
ggaren: review+
Review Patch | Details | Formatted Diff | Diff
Patch for landing (208.55 KB, patch)
2013-04-23 14:36 PST, Christophe Dumez
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 2013-02-22 01:44:50 PST
Steps to reproduce:

ProgressEvent CR (http://www.w3.org/TR/progress-events/) test
- Test wiki: http://www.w3.org/wiki/Webapps/Interop/ProgressEvents
- Test suite: http://w3c-test.org/webapps/ProgressEvents/tests/
- Test case: http://w3c-test.org/webapps/ProgressEvents/tests/submissions/Ms2ger/interface.html
(6) Interface objects properties should not be Enumerable


Actual results:

Test case failed: 

for (var p in window) {
  assert_not_equals(p, "ProgressEvent")
}
this assertion fails.


Expected results:

ProgressEvent is not enumerable in window object. Hence, the above assertion passes.
(See 4.4. Interfaces of WebIDL: http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces)
------- Comment #1 From 2013-04-17 07:46:21 PST -------
*** Bug 110574 has been marked as a duplicate of this bug. ***
------- Comment #2 From 2013-04-17 10:36:07 PST -------
Created an attachment (id=198584) [details]
Patch
------- Comment #3 From 2013-04-17 10:40:36 PST -------
I'll be great if we can make this change and make our engine more spec. compliant (or rather interoperate well other other browsers) but I'm a little concerned that there could be some websites that depend on our current behavior.  What do other browsers do here?  Also, it seems worthwhile to discuss it on webkit-dev.
------- Comment #4 From 2013-04-17 10:42:33 PST -------
I believe Gecko should match the spec.
------- Comment #5 From 2013-04-17 10:42:45 PST -------
(From update of attachment 198584 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=198584&action=review

> LayoutTests/ChangeLog:14
> +        http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces

Please cite or refer to the particular spec language that applies here.
------- Comment #6 From 2013-04-17 10:43:21 PST -------
(In reply to comment #3)
> I'll be great if we can make this change and make our engine more spec. compliant (or rather interoperate well other other browsers) but I'm a little concerned that there could be some websites that depend on our current behavior.  What do other browsers do here?  Also, it seems worthwhile to discuss it on webkit-dev.

- Firefox follows the spec
- Chromium does not follow the spec
------- Comment #7 From 2013-04-17 10:43:56 PST -------
(In reply to comment #5)
> (From update of attachment 198584 [details] [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=198584&action=review
> 
> > LayoutTests/ChangeLog:14
> > +        http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces
> 
> Please cite or refer to the particular spec language that applies here.

From 4.4:
"""
a corresponding property must exist on the ECMAScript global object. The name of the property is the identifier of the interface, and its value is an object called the interface object.

The property has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }. The characteristics of an interface object are described in section 4.4.1 below.
"""
------- Comment #8 From 2013-04-17 10:47:08 PST -------
(In reply to comment #6)
> (In reply to comment #3)
> > I'll be great if we can make this change and make our engine more spec. compliant (or rather interoperate well other other browsers) but I'm a little concerned that there could be some websites that depend on our current behavior.  What do other browsers do here?  Also, it seems worthwhile to discuss it on webkit-dev.
> 
> - Firefox follows the spec
> - Chromium does not follow the spec

How about IE?  Also, it would be great to refer to a specific version of the spec. you used so that we'll be able to see which spec you've implemented should the spec change in the future ever so slightly.
------- Comment #9 From 2013-04-17 10:48:15 PST -------
(In reply to comment #7)
> (In reply to comment #5)
> > (From update of attachment 198584 [details] [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=198584&action=review
> > 
> > > LayoutTests/ChangeLog:14
> > > +        http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces
> > 
> > Please cite or refer to the particular spec language that applies here.
> 
> From 4.4:
> """
> a corresponding property must exist on the ECMAScript global object. The name of the property is the identifier of the interface, and its value is an object called the interface object.
> 
> The property has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }. The characteristics of an interface object are described in section 4.4.1 below.
> """

Thanks. I also wonder if you should test the attributes on the prototype object for these non-callback interfaces:

"""
Note
Since an interface object for a non-callback interface is a function object, it will have a “prototype” property with attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
"""
------- Comment #10 From 2013-04-17 10:50:56 PST -------
(In reply to comment #8)
> (In reply to comment #6)
> > (In reply to comment #3)
> > > I'll be great if we can make this change and make our engine more spec. compliant (or rather interoperate well other other browsers) but I'm a little concerned that there could be some websites that depend on our current behavior.  What do other browsers do here?  Also, it seems worthwhile to discuss it on webkit-dev.
> > 
> > - Firefox follows the spec
> > - Chromium does not follow the spec
> 
> How about IE?  Also, it would be great to refer to a specific version of the spec. you used so that we'll be able to see which spec you've implemented should the spec change in the future ever so slightly.

IE9 follows partly the spec:
- The constructors are not enumerable (OK)
- The constructors are not deletable (Not OK)

I actually implemented the Editor Draft as the last TR is becoming a bit old. However, this part of the spec has not changed since last publication:
http://www.w3.org/TR/2012/CR-WebIDL-20120419/#es-interfaces
------- Comment #11 From 2013-04-17 10:52:35 PST -------
(In reply to comment #9)
> (In reply to comment #7)
> > (In reply to comment #5)
> > > (From update of attachment 198584 [details] [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=198584&action=review
> > > 
> > > > LayoutTests/ChangeLog:14
> > > > +        http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces
> > > 
> > > Please cite or refer to the particular spec language that applies here.
> > 
> > From 4.4:
> > """
> > a corresponding property must exist on the ECMAScript global object. The name of the property is the identifier of the interface, and its value is an object called the interface object.
> > 
> > The property has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }. The characteristics of an interface object are described in section 4.4.1 below.
> > """
> 
> Thanks. I also wonder if you should test the attributes on the prototype object for these non-callback interfaces:
> 
> """
> Note
> Since an interface object for a non-callback interface is a function object, it will have a “prototype” property with attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
> """

For now, I'm trying to get the following test cases to pass:
http://w3c-test.org/webapps/ProgressEvents/tests/submissions/Ms2ger/interface.html

I think it is a good idea to go incrementally.
------- Comment #12 From 2013-04-17 11:12:56 PST -------
Please don't reference the TR draft, it's almost a year out of date. If you want a particular revision, you can use <http://dev.w3.org/cvsweb/~checkout~/2006/webapi/WebIDL/Overview.html?rev=1.617;content-type=text%2Fhtml>.
------- Comment #13 From 2013-04-17 11:34:41 PST -------
(In reply to comment #3)
> I'll be great if we can make this change and make our engine more spec. compliant (or rather interoperate well other other browsers) but I'm a little concerned that there could be some websites that depend on our current behavior.  What do other browsers do here?  Also, it seems worthwhile to discuss it on webkit-dev.

Agreed. I sent an email to the webkit-dev mailing list.
------- Comment #14 From 2013-04-17 11:57:34 PST -------
(From update of attachment 198584 [details])
Attachment 198584 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/69334

New failing tests:
canvas/philip/tests/type.delete.html
fast/js/global-constructors-attributes.html
fast/js/global-constructors-deletable.html
------- Comment #15 From 2013-04-17 11:57:37 PST -------
Created an attachment (id=198592) [details]
Archive of layout-test-results from webkit-ews-05 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-05  Port: mac-mountainlion  Platform: Mac OS X 10.8.2
------- Comment #16 From 2013-04-17 12:37:42 PST -------
Created an attachment (id=198595) [details]
Patch

Should make ews happy.
------- Comment #17 From 2013-04-17 14:02:57 PST -------
Created an attachment (id=198607) [details]
Patch

Fix Web IDL spec URL in the Changelog to point to the right section.
------- Comment #18 From 2013-04-23 12:23:09 PST -------
ping review?
------- Comment #19 From 2013-04-23 12:36:13 PST -------
(From update of attachment 198607 [details])
r=me
------- Comment #20 From 2013-04-23 14:36:07 PST -------
Created an attachment (id=199327) [details]
Patch for landing
------- Comment #21 From 2013-04-23 15:33:38 PST -------
(From update of attachment 199327 [details])
Clearing flags on attachment: 199327

Committed r149001: <http://trac.webkit.org/changeset/149001>
------- Comment #22 From 2013-04-23 15:33:43 PST -------
All reviewed patches have been landed.  Closing bug.
------- Comment #23 From 2013-04-24 15:05:41 PST -------
Removed fast/js/global-constructors.html from TestExpectations in <http://trac.webkit.org/changeset/149068>.