using 9/24 trunk build 1) launch netscape 2) launch composer 3) insert some text 4) give this a title and save to desktop 5) insert an image from desktop into that same file 6) make sure the relative URL checkbox is unchecked 7) click OK notice the image doesn't appear to get the image to appear you have to go back into that image props dialog and check the relative URL checkbox and then click OK again. then the image appears.
step 6 should be : make sure the relative URL checkbox is 'checked'
yes make sure it is checked to see the problem... then uncheck it and you'll see the image again.
The problem seems to show up when you start on about:blank then save to a file. If you start already pointing at a file and insert another image from the same directory, it works fine. I think the problem is that layout doesn't know that the base url has changed, so it isn't following the relative link.
happens on Mac also...shrir saw this.
Hey! We discussed this thoroughly, I thought! It has nothing to do with the "Make relative" checkbox! The issues is that inserting an image that is on the desktop into a file on the desktop doesn't appear. I tested this using 6.1, which doesn't have the "Make relative checkbox".
Shri and I reproduced this on linux looking at files in /tmp. Works fine on reloading the file, just not when you start from a blank document and then later save to a filename. Or is that covered by a different bug? Shri? If that is indeed this bug, the summary is misleading.
Akkana is correct: If you open an existing file from the disk and add an image, things are ok. It's only when you create a new document then this problem is seen. Akkana, we do not have another bug for that, pls change the summary to what you feel is correct. Thx!
This summary isn't great, but it's closer. Charley can change it if he wishes.
That sounds fine to me! At least it gets to the real problem.
So I've investigated this and it seems that Composer is at fault. We should be setting the document URL and base URL when the URL for the file changes. The base URL is used to resolve the full path for loading images. So I implemented a fix that calls nsIDocument::SetDocumentURL() and that works fine, but trying to set the base URL using nsIDocument::SetBaseURL() fails because of a security code check. Contacting JST for help.
I figured out the problem -- security code is not an issue.
Created attachment 50939 [details] [diff] [review] Set the document and base URL in Composer document. This is the method nsEditorShell::OnLocationChange() called when the file is saved and URL is changed.
Comment on attachment 50939 [details] [diff] [review] Set the document and base URL in Composer document. This is the method nsEditorShell::OnLocationChange() called when the file is saved and URL is changed. firstname.lastname@example.org With the one NOT_INITIALIZED to FAILURE change we talked about for consistency. By the way, thanks for testing and assuring me this all works fine during the load process.
Comments; + nsCOMPtr<nsIScriptGlobalObject> globalObj = do_QueryReferent(mContentWindow, & rv); + if (NS_FAILED(rv) || !globalObj) + return NS_ERROR_FAILURE; + + nsCOMPtr<nsIDocShell> docShell; + globalObj->GetDocShell(getter_AddRefs(docShell)); + if (!docShell) return NS_ERROR_FAILURE; We do this all over; we should factor it into a protected method ("GetDocShellFromWindow"). + rv = domDoc->GetElementsByTagName(NS_ConvertASCIItoUCS2("base"), getter_AddRefs(nodeList)); Better to use NS_LITERAL_STRING rather than NS_ConvertASCIItoUCS2(). Otherwise, r=sfraser
Created attachment 51312 [details] [diff] [review] Updated patch: Created "GetDocShellFromContentWindow" as requested by sfraser
Comment on attachment 51312 [details] [diff] [review] Updated patch: Created "GetDocShellFromContentWindow" as requested by sfraser r=sfraser
From Bugzilla Helper: User-Agent: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:0.9.4) Gecko/20011001 Netscape6/6.2 BuildID: 20010928 When creating a new document with an image, if the URL is checked the image does not show in document, just the image text. Reproducible: Sometimes Steps to Reproduce: 1.open composer 2.insert image (I got image form hardrive) 3.Place check mark in URL 4.Click OK Actual Results: You have the image box with the image text instead of picture. Expected Results: Picture should be displayed I noticed that this only happens on new pages not on saved pages. I also noticed that part of the time the URL box is greyed out- always getting the image from same location.
Comment on attachment 51312 [details] [diff] [review] Updated patch: Created "GetDocShellFromContentWindow" as requested by sfraser email@example.com What's this change for? - eCantEditOther = 3 + eCantEditFileNotFound = 3, + eCantEditOther = 4
Those enum changes are for bug 9475.
Oops, I meant those enums are for bug 93475
Verified Fixed on 10-03 Trunk Build
removing item for this fixed bug from mozilla 0.9.6 release notes