Closed
Bug 182152
Opened 23 years ago
Closed 22 years ago
File picker should always offer a *.* filter
Categories
(Core Graveyard :: File Handling, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla1.3beta
People
(Reporter: caillon, Assigned: caillon)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
7.95 KB,
patch
|
timeless
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
Assignee | ||
Comment 1•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #107566 -
Flags: superreview?(bryner)
Attachment #107566 -
Flags: review?(bzbarsky)
![]() |
||
Comment 2•23 years ago
|
||
Comment on attachment 107566 [details] [diff] [review]
Patch
Is this correctly handled by the code that comes later on that determines the
save format based on which filter was selected?
![]() |
||
Comment 3•23 years ago
|
||
Comment on attachment 107566 [details] [diff] [review]
Patch
Oh, bah. Bug 116951
And the code to watch out for is
http://lxr.mozilla.org/mozilla/source/xpfe/communicator/resources/content/conte
ntAreaUtils.js#317 and
http://lxr.mozilla.org/mozilla/source/xpfe/communicator/resources/content/conte
ntAreaUtils.js#320 and
http://lxr.mozilla.org/mozilla/source/xpfe/communicator/resources/content/conte
ntAreaUtils.js#342 (yes, this code is incredibly fragile...)
Attachment #107566 -
Flags: review?(bzbarsky) → review-
Assignee | ||
Comment 4•23 years ago
|
||
Okay, so why was this code so broken to begin with? This sucks. Here's a new
patch which should fare much better.
Attachment #107566 -
Attachment is obsolete: true
Assignee | ||
Comment 5•23 years ago
|
||
Comment on attachment 107566 [details] [diff] [review]
Patch
Nevermind, bryner. For now anyway.... Apparantly this code was so horrible
before, that this patch exposed a few other bugs. They are fixed in my newest
patch, but I'll get an r before I ask for your sr.
Attachment #107566 -
Flags: superreview?(bryner)
Assignee | ||
Comment 6•23 years ago
|
||
Comment on attachment 107573 [details] [diff] [review]
Ummm, new patch
Let's try this again, shall we? :)
Attachment #107573 -
Flags: review?(bzbarsky)
![]() |
||
Comment 7•22 years ago
|
||
Comment on attachment 107573 [details] [diff] [review]
Ummm, new patch
>-
>- appendFiltersForContentType(fp, contentType,
>- isDocument ? MODE_COMPLETE : MODE_FILEONLY);
>+
>+ appendFiltersForContentType(fp, contentType, saveMode);
This change is wrong. If isDocument is false, the mode _must_ be
MODE_FILEONLY. For example, "save link as" should not offer things like "web
page complete" and "text" -- it should just offer MODE_FILEONLY.
>+ // XXX We depend on this holding true in appendFiltersForContentType():
>+ // If we can save the DOM as complete, it's index is 0.
"If we should save as a complete page, the filterIndex is 0."
>+ // If we can save the text as complete, it's index is 2.
"If we should save as text, the filterIndex is 2."
>+ var isSaveComplete = isDocument &&
I'd call this var "useSaveDocument", maybe....
>+const MODE_FILEONLY = 0x00;
>+const MODE_COMPLETE_TEXT = 0x01;
const MODE_TEXT = 0x01;
>+const MODE_COMPLETE_DOM = 0x10;
const MODE_COMPLETE_PAGE = 0x02;
> function appendFiltersForContentType(aFilePicker, aContentType, aSaveMode)
Add a comment here that references that other XXX comment you added (or just
state the invariant that must be observed up front).
The rest looks nice. ;)
Attachment #107573 -
Flags: review?(bzbarsky) → review-
Assignee | ||
Comment 8•22 years ago
|
||
/me teaches his brain to not think in different bases than his fingers
Attachment #107573 -
Attachment is obsolete: true
![]() |
||
Comment 9•22 years ago
|
||
Comment on attachment 111017 [details] [diff] [review]
Using hex, not binary this time.
Since I am in nitpick mode....
1) Do you need the isDocument boolean? It looks like aData.document and
useSaveDocument are what you really need and there is no need for isDocument.
2) GetSaveModeForContentType should not be adding SAVEMODE_COMPLETE_TEXT for
XML, should it? (the case order needs to be switched....
Attachment #111017 -
Flags: review-
Assignee | ||
Comment 10•22 years ago
|
||
Attachment #111017 -
Attachment is obsolete: true
![]() |
||
Comment 11•22 years ago
|
||
Comment on attachment 111021 [details] [diff] [review]
:)
OK, I suck. You _do_ need isDocument; a lot of those places really care about
"aData.document && saveMode"....
Please revert that change, and r/sr=bzbarsky
Attachment #111021 -
Flags: superreview+
Assignee | ||
Comment 12•22 years ago
|
||
I only found one thing that cared about it, but there are three that bz pointed
out. For the record:
<caillon> why? what cares about the saveMode?
<bz> + if (!aData.document && !shouldDecode && contentEncodingType) {
<bz> that needs to look at saveMode
<caillon> right that's the one place I found
<bz> fp.filterIndex = prefs.getIntPref("save_converter_index");
<bz> there too...
<bz> since we don't want to save the *.* thing or anything....
<caillon> ah
<bz> and more to the point, in cases when we have a doc but are _not_ doing
saveMode games (eg a js doc)
<bz> we don't want to be restoring that pref
<bz> those three places are it
isDocument is now back in. :)
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla1.3beta
Attachment #111021 -
Flags: review+
Assignee | ||
Comment 13•22 years ago
|
||
Tested without any regressions on HTML, XML, XHTML, MathML, plaintext, and PNG,
GIF, and JPG image files.
I then landed this.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 14•22 years ago
|
||
Verified in the Linux 2003-01-23-05 trunk build
Status: RESOLVED → VERIFIED
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•