Closed Bug 266373 Opened 20 years ago Closed 4 years ago

"Deprecated property window.title used. Please use document.title instead." has no source information

Categories

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

x86
Windows 2000
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: bugzilla-mozilla-20000923, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [firebug-p3])

Attachments

(1 file, 1 obsolete file)

When code uses window.title, the message "Deprecated property window.title used. Please use document.title instead." spews to the JS Console, but negelects to give any hints as to where this came from. This can be fixed at least for the JS case.
Attached patch Gets the source location via JS Stack service (obsolete) (deleted) — Splinter Review
Some things I'm not sure about here: |const nsAFlatString msg| -- should this be a different type? Is it a good idea to loop through the entire JS stack to find a non-native source? I found when I called window.title, the top of the stack was native, but the next one down was not (and was the actual JS source point). On the plus side, it does actually seem to work. :)
Attached patch Updated patch (deleted) — Splinter Review
This version uses a much nicer macro (thanks timeless), and only checks the top and next stack entries to non-native sources. This is all that's needed to pick up JS usage of window.title.
Attachment #163646 - Attachment is obsolete: true
Attachment #163687 - Flags: superreview?(peterv)
Attachment #163687 - Flags: review?(gf.mozilla.jst)
Attachment #163687 - Flags: review?(gf.mozilla.jst) → review?(jst)
Comment on attachment 163687 [details] [diff] [review] Updated patch Two problems, this should ideally use a string from a string bundle to be localizable, and this duplicates a lot of existing code. I'd suggest making PrintWarningOnConsole() in nsDOMClassInfo.cpp accessable to more code, and calling that in stead with a new string property.
Attachment #163687 - Flags: superreview?(peterv)
Attachment #163687 - Flags: superreview-
Attachment #163687 - Flags: review?(jst)
Attachment #163687 - Flags: review-
(In reply to comment #3) > (From update of attachment 163687 [details] [diff] [review]) > Two problems, this should ideally use a string from a string bundle to be > localizable, Hey, not my code - /you/ reviewed the inclusion of this string literal... > and this duplicates a lot of existing code. > > I'd suggest making PrintWarningOnConsole() in nsDOMClassInfo.cpp accessable to > more code, and calling that in stead with a new string property. *sigh*
I don't have time to go around making other people's code perfect, sorry.
Assignee: silver → general
could some of this line detection be used over in bug 261337 ?
To debug Firebug I have to dump every error message. Since this warning has no line information I cannot find out where it comes from.
Whiteboard: [firebug-p3]
Blocks: 435025
Assignee: general → nobody
QA Contact: ian → general
does this warning still throw? Can we close this?
Component: DOM: Mozilla Extensions → DOM
I tested this and the warning is not thrown anymore. This should be closed.
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
Component: DOM → DOM: Core & HTML
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: