Object.defineProperty on HTMLObjectElement.prototype misbehaves for data property

NEW
Unassigned

Status

()

P5
normal
7 years ago
2 months ago

People

(Reporter: vincent.cariven, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

7 years ago
Created attachment 563330 [details]
test-objects.html

User Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.107 Safari/535.1

Steps to reproduce:

1 - Define a read/write data property on HTMLObjectElement.prototype by calling :
Object.defineProperty(HTMLObjectElement.prototype, "aTest", {value: "aval", writable: true, enumerable:true, configurable:true});
2 - Get an instance 'instance_1' of HTMLObjectElement : instance_1 = document.getElementById('object_1');
3 - Change the property value of instance_1 : instance_1.aTest = "newval"
4 - Read the property aTest of instance_1 : instance_1.aTest -> returns "newval" : OK
5 - Get another instance 'instance_2' of HTMLObjectElement : instance_2 = document.getElementById('object_2');
6 - Read the property aTest of instance_2 : instance_2.aTest -> returns "newval" : NOK (should return 'aval')

This works a expected on user-defined object (see My on file attached) et other DOM prototypes (ex: HTMLDivElement.prototype)


Actual results:

All instances have aTest property value changed


Expected results:

Only instance_1 should have its aTest property value changed

Updated

7 years ago
Attachment #563330 - Attachment mime type: text/plain → text/html

Updated

7 years ago
Component: General → General
Product: Firefox → Core
QA Contact: general → general
Version: 7 Branch → Trunk
(Reporter)

Comment 1

7 years ago
Created attachment 563686 [details]
Modified previously attachment to have a more visual result without console api
(Reporter)

Updated

7 years ago
Attachment #563686 - Attachment mime type: text/plain → text/html
<object> elements have a class hook that makes property sets of properties found on the direct prototype set the property on the prototype itself.  Presumably this is something to do with the fact that when the plug-in actually has a scriptable object this sits on the proto chain between the element instance and HTMLObjectElement.prototype.

There's a get hook that does similar things.

Presumably both should check for the actual existence of the extra scriptable prototype...

ccing peter, since the new bindings work will just make all this code go away as far as I can tell.
Status: UNCONFIRMED → NEW
Component: General → DOM
Ever confirmed: true
QA Contact: general → general
Summary: Object.defineProperty on HTMLObjectElement.prototype misbehave for data property → Object.defineProperty on HTMLObjectElement.prototype misbehaves for data property
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.