WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 76085
IETC audio-interface-inherit.129 claims NETWORK_NO_SOURCE should not be overrideable
https://bugs.webkit.org/show_bug.cgi?id=76085
Summary
IETC audio-interface-inherit.129 claims NETWORK_NO_SOURCE should not be overr...
Eric Seidel (no email)
Reported
2012-01-11 11:47:11 PST
IETC audio-interface-inherit.129 claims NETWORK_NO_SOURCE should not be overrideable
http://samples.msdn.microsoft.com/ietestcenter/html5/MediaElements/audio-interface-inherit.129.htm
I'm not sure there is a bug here. We define NETWORK_NO_SOURCE on HTMLMediaElement, per the spec:
http://www.whatwg.org/specs/web-apps/current-work/#media-elements
Even though that value is constant, it seems any object instance which has HTMLMediaElement can still set its own NETWORK_NO_SOURCE, no?
Attachments
Patch
(2.74 KB, patch)
2012-01-11 14:19 PST
,
Adam Barth
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Eric Seidel (no email)
Comment 1
2012-01-11 13:00:22 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
Eric Seidel (no email)
Comment 2
2012-01-11 13:02:22 PST
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 },
Eric Seidel (no email)
Comment 3
2012-01-11 13:13:59 PST
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.
Eric Seidel (no email)
Comment 4
2012-01-11 13:15:17 PST
> audio = document.createElement("audio")
<audio></audio>
> audio.__proto__
HTMLAudioElement
> audio.NETWORK_NO_SOURCE
3
> audio.__proto__ = null
null
> audio.NETWORK_NO_SOURCE
undefined
Adam Barth
Comment 5
2012-01-11 13:19:10 PST
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.
Adam Barth
Comment 6
2012-01-11 14:19:30 PST
Created
attachment 122097
[details]
Patch
WebKit Review Bot
Comment 7
2012-01-11 16:08:21 PST
Comment on
attachment 122097
[details]
Patch Clearing flags on attachment: 122097 Committed
r104761
: <
http://trac.webkit.org/changeset/104761
>
WebKit Review Bot
Comment 8
2012-01-11 16:08:26 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug