Closed Bug 409310 Opened 17 years ago Closed 17 years ago

Bug 315010 introduced broken page info code

Categories

(Firefox :: Page Info Window, defect)

x86
macOS
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: longsonr)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

See bug 315010 comment 17 (and bug 315010 comment 16). In brief, the code in question can throw, but the caller doesn't catch the exception. This can lead to a busted page info window on some pages. I should further note that this code should never have passed sr, if this were a component with sr...
Flags: blocking-firefox3?
Attached patch patch (obsolete) — Splinter Review
Attachment #294186 - Flags: superreview?(bzbarsky)
Attachment #294186 - Flags: review?(mano)
Can you add add a note either here (pageInfo.js) or in makeURLAbsolute on when it could throw? Are the browser.js callers safe?
Something like this? // note: IO.newURI(aUri) will throw if aUri is not a valid URI I suspect the nsContextMenu.js and browser.js callers are not safe but it's a bit beyond my level of javascript knowledge to tell for sure. That should be another bug though.
I thought it's makeURLAbsolute that could throw in this context.
Yes, but it throws because it's internal parts throw. I would have put that note inside makeURLAbsolute. If you want one for pageInfo.js how about // note: makeURLAbsolute will throw if either the baseURI is not a valid URI // or the URI formed from the baseURI and the URL is not a valid URI
Comment on attachment 294186 [details] [diff] [review] patch This is ok, but I'd still like the resolve() silliness in makeURLAbsolute go away... It's just slowing this code down, for no good reason.
Attachment #294186 - Flags: superreview?(bzbarsky) → superreview+
Is there a difference between: IO.newURI(aUrl, null, IO.newURI(aBase)).spec; and IO.newURI(aBase).resolve(aUrl); ?
I belive there can be for some URI implementations, yes. Really, you want to just call newURI with the right base and not be calling resolve() at all. And I'm not sure why the base URI is being carted about as a string here instead of a URI object; presumably carryover from gecko 1.8?
Attached patch address review comments (obsolete) — Splinter Review
Boris, is IO.newURI(aUrl, null, IO.newURI(aBase)).spec; the right thing to do then?
Attachment #294186 - Attachment is obsolete: true
Attachment #294279 - Flags: review?(mano)
Attachment #294186 - Flags: review?(mano)
Yes, exactly.
Attachment #294279 - Attachment is obsolete: true
Attachment #294279 - Flags: review?(mano)
Attached patch exactlySplinter Review
Attachment #294286 - Flags: review?(mano)
Comment on attachment 294286 [details] [diff] [review] exactly exactly.
Attachment #294286 - Flags: review?(mano) → review+
Attachment #294286 - Flags: approval1.9?
Attachment #294286 - Flags: approval1.9? → approval1.9+
checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: blocking-firefox3?
Flags: blocking-firefox3?
Flags: blocking-firefox3? → blocking-firefox3+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: