Closed Bug 342490 Opened 18 years ago Closed 18 years ago

window.navigator isn't really readonly

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mrbkap, Assigned: mrbkap)

References

Details

Attachments

(3 files, 2 obsolete files)

In nsIDOMWindowInternal.idl, we have: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/dom/public/idl/base/nsIDOMWindowInternal.idl&rev=1.32&root=/cvsroot&mark=54#54 However, XPConnect always asks the scriptable helpers to resolve a property before falling back onto asking the set if the property exists. As a result, we fall into this code in nsDOMClassInfo.cpp: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/dom/src/base/nsDOMClassInfo.cpp&rev=1.393&root=/cvsroot&mark=6289-6291#6276 and since we resolve it there, we never ask the IDL about the property, and we lose. I'm not sure why we have the DOMClassInfo code there at all (why don't we just resolve the navigator property in from the IDL?) but if there is a need for it, then I think we should use JSPROP_READONLY and JSPROP_PERMANENT for it.
This patch is good for all branches. It fixes this bug by making the 'navigator' property permanent and readonly.
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #226849 - Flags: superreview?(jst)
Attachment #226849 - Flags: review?(jst)
Comment on attachment 226849 [details] [diff] [review] Fix for all branches r+sr=jst
Attachment #226849 - Flags: superreview?(jst)
Attachment #226849 - Flags: superreview+
Attachment #226849 - Flags: review?(jst)
Attachment #226849 - Flags: review+
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
window.navigator is still writable if you refresh attachment 244036 [details].
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached file set window.navigator = document; (obsolete) —
Attachment #244036 - Attachment is obsolete: true
Attachment #244039 - Attachment is obsolete: true
Flags: blocking1.9?
Flags: in-testsuite?
Attachment #244254 - Flags: superreview?(bugmail)
Attachment #244254 - Flags: review?(mrbkap)
Comment on attachment 244254 [details] [diff] [review] Additional change needed... Ah, drat.
Attachment #244254 - Flags: review?(mrbkap) → review+
Attachment #244254 - Flags: superreview?(bugmail) → superreview+
Fixed on the trunk.
Status: REOPENED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
Flags: blocking1.9?
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: