Closed
Bug 409310
Opened 17 years ago
Closed 17 years ago
Bug 315010 introduced broken page info code
Categories
(Firefox :: Page Info Window, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: longsonr)
References
Details
(Keywords: regression)
Attachments
(1 file, 2 obsolete files)
2.47 KB,
patch
|
asaf
:
review+
mconnor
:
approval1.9+
|
Details | Diff | Splinter Review |
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?
Assignee | ||
Comment 1•17 years ago
|
||
Attachment #294186 -
Flags: superreview?(bzbarsky)
Attachment #294186 -
Flags: review?(mano)
Comment 2•17 years ago
|
||
Can you add add a note either here (pageInfo.js) or in makeURLAbsolute on when it could throw? Are the browser.js callers safe?
Assignee | ||
Comment 3•17 years ago
|
||
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.
Comment 4•17 years ago
|
||
I thought it's makeURLAbsolute that could throw in this context.
Assignee | ||
Comment 5•17 years ago
|
||
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
Reporter | ||
Comment 6•17 years ago
|
||
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+
Comment 7•17 years ago
|
||
Is there a difference between:
IO.newURI(aUrl, null, IO.newURI(aBase)).spec;
and
IO.newURI(aBase).resolve(aUrl);
?
Reporter | ||
Comment 8•17 years ago
|
||
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?
Assignee | ||
Comment 9•17 years ago
|
||
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)
Reporter | ||
Comment 10•17 years ago
|
||
Yes, exactly.
Assignee | ||
Updated•17 years ago
|
Attachment #294279 -
Attachment is obsolete: true
Attachment #294279 -
Flags: review?(mano)
Assignee | ||
Comment 11•17 years ago
|
||
Attachment #294286 -
Flags: review?(mano)
Comment 12•17 years ago
|
||
Comment on attachment 294286 [details] [diff] [review]
exactly
exactly.
Attachment #294286 -
Flags: review?(mano) → review+
Assignee | ||
Updated•17 years ago
|
Attachment #294286 -
Flags: approval1.9?
Updated•17 years ago
|
Attachment #294286 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 13•17 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: blocking-firefox3?
Updated•17 years ago
|
Flags: blocking-firefox3?
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
You need to log in
before you can comment on or make changes to this bug.
Description
•