Summary: | IETC audio-interface-inherit.129 claims NETWORK_NO_SOURCE should not be overrideable | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> | ||||
Component: | Media | Assignee: | Adam Barth <abarth> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | abarth, eric.carlson, webkit.review.bot | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 76198 | ||||||
Attachments: |
|
Description
Eric Seidel (no email)
2012-01-11 11:47:11 PST
Actually, my understanding was incorrect. This is a bug in our code generator, not implying readonly from const: http://www.w3.org/TR/WebIDL/#es-constants Nope, that's wrong too. It's already being generated readonly: { "NETWORK_NO_SOURCE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMediaElementNETWORK_NO_SOURCE), (intptr_t)0, NoIntrinsic }, I'm unclear from the WebIDL spec. http://www.w3.org/TR/WebIDL/#es-constants 4.5.4. Constants For each constant defined on an interface A, there must be a corresponding property on the interface object, if it exists. The property has the following characteristics: The name of the property is the identifier of the constant. The value of the property is that which is obtained by converting the constant’s IDL value to an ECMAScript value. The property has attributes { [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: false }. In addition, a property with the same characteristics must exist on the interface prototype object. Does that mean that each instance of an HTMLAudioElement has to have NETWORK_NO_SOURCE defined readonly? Currently it appears we just define this on the prototype. > audio = document.createElement("audio") <audio></audio> > audio.__proto__ HTMLAudioElement > audio.NETWORK_NO_SOURCE 3 > audio.__proto__ = null null > audio.NETWORK_NO_SOURCE undefined I'm pretty sure the test is wrong. The constant is supposed to appear in the interface and the interface prototype, not the instance. Assigning to the property on the instance creates a new property on the instance that shadows the readonly property on the prototype. Created attachment 122097 [details]
Patch
Comment on attachment 122097 [details] Patch Clearing flags on attachment: 122097 Committed r104761: <http://trac.webkit.org/changeset/104761> All reviewed patches have been landed. Closing bug. |