Closed
Bug 7636
Opened 26 years ago
Closed 24 years ago
Image SRC and Link location fields must check for local file format
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
VERIFIED
FIXED
M18
People
(Reporter: cmanske, Assigned: cmanske)
Details
(Whiteboard: [nsbeta3+])
Attachments
(1 file)
(deleted),
text/html
|
Details |
In any dialog containing an edit field where an image or href can be enterred,
we must check to be sure the text is in URL format (http:// or file:///)
Using the "Choose File..." button will do that automatically (in editor only,
not using the INPUT TYPE="FILE" widget). But the user may type something
using local file format.
This is not an easy problem. We need an new method in nsFileSpec code
to detect different platform formats and do the appropriate conversions to
using nsFileURL.
First, let me say once again that an end-user should never have to type these
things (paths and URLs) in order to create a web page. There should be a browse
button, and two radio buttons:
(x) absolute ( ) relative.
The computer should convert these into a URL.
Second, I don't think you should allow "either". The rubric near the edit field
should clearly say what is required. Or else (again) radio buttons:
(x) URL ( ) path: [ ]
That opinion expressed, this is not the job of nsFileSpec. What's wrong with the
following code? You can write a similar function for checking for a native path.
nsresult ValidateFileURL(const char* myTypedInURL)
{
nsFileURL allegedURL(myTypedInURL);
nsFileSpec allegedFileSpec(allegedURL);
if (!allegedFileSpec.Valid() || !allegedFileSpec.Exists())
return NS_ERROR_INVALIDENTRY; // I made this up.
return NS_OK
}
nsresult ValidateFilePath(const char* myTypedInPath)
{
nsFileSpec allegedFileSpec(myTypedInPath);
if (!allegedFileSpec.Valid() || !allegedFileSpec.Exists())
return NS_ERROR_INVALIDENTRY; // I made this up.
return NS_OK
}
Marking invalid, because I think this answer is sufficent. I know you'll reopen
it if you disagree.
Assignee | ||
Updated•26 years ago
|
Status: RESOLVED → REOPENED
Assignee | ||
Updated•26 years ago
|
Status: REOPENED → ASSIGNED
Assignee | ||
Comment 3•26 years ago
|
||
John: I fully understand you comments, but you keep forgetting that these edit
fields are not just for local files, but for remote URLs as well. Unfortunately,
we don't have a good "Browse..." option for that. Thus we will have to allow
editing these fields. Now I am trying to respect the Mac behavior by always
converting the local file picked via a "Choose File..." button to "file:///"
(URL) format before it is put into the edit field. But on a Windows or UNIX
platform, there will be users who enter in local file paths, and I believe
they should be allowed to do that. Thus there is the need for converting them
to URL format. I will use your suggestions to write such a validator.
Assignee | ||
Updated•26 years ago
|
Resolution: INVALID → ---
Assignee | ||
Updated•26 years ago
|
Target Milestone: M8
Assignee | ||
Updated•25 years ago
|
Target Milestone: M8 → M9
Assignee | ||
Updated•25 years ago
|
Target Milestone: M9 → M11
Assignee | ||
Comment 4•25 years ago
|
||
Changing for a later milestone.
Assignee | ||
Updated•25 years ago
|
Target Milestone: M11 → M12
Assignee | ||
Comment 5•25 years ago
|
||
Changing target
Updated•25 years ago
|
Target Milestone: M12 → M17
Comment 6•25 years ago
|
||
moving to post beta, setting to M17
Assignee | ||
Updated•25 years ago
|
Target Milestone: M17 → M14
Assignee | ||
Comment 7•25 years ago
|
||
Changing to M14.
Assignee | ||
Updated•25 years ago
|
Target Milestone: M14 → M15
Assignee | ||
Comment 8•25 years ago
|
||
Moving to M15
Assignee | ||
Comment 9•25 years ago
|
||
Assignee | ||
Comment 10•25 years ago
|
||
The attached test file works, although there is an ugly drawing problem when
the scrollbar first appears.
Assignee | ||
Comment 11•25 years ago
|
||
Damn. Attached file to wrong bug. Ignore it and last comment.
Assignee | ||
Comment 13•25 years ago
|
||
Moving bugs to M17 to concentrate on features in M16
Target Milestone: M16 → M17
Updated•24 years ago
|
Keywords: correctness,
nsbeta3
Target Milestone: M17 → M18
Updated•24 years ago
|
Whiteboard: [nsbeta3+]
Assignee | ||
Comment 14•24 years ago
|
||
Do a quick check for "file:" That's about all we can do for now.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago → 24 years ago
Resolution: --- → FIXED
Comment 15•24 years ago
|
||
verified in 8/31 build.
You need to log in
before you can comment on or make changes to this bug.
Description
•