Closed
Bug 69911
Opened 24 years ago
Closed 13 years ago
"Save" not enabled when just change an existing file character coding (charset)
Categories
(SeaMonkey :: Composer, defect, P3)
SeaMonkey
Composer
Tracking
(Not tracked)
RESOLVED
WONTFIX
mozilla1.3beta
People
(Reporter: amyy, Unassigned)
References
Details
(Keywords: intl, polish)
Attachments
(4 obsolete files)
Wrong feature of "Save" on N6/6.01 and recently Mtrunk build when just change an
existing file character coding.
Steps to reproduce:
1. Launch N6/N6.5 and open Composer.
2. Open an exists html file, no matter it has meta-tag or not.
3. Change character coding by going View | Character Coding.
4. Save the file by click "Save" icon or go File | Save.
Result:
"Save" icon and menu item "Save" under File are disable, the changes can't be
saved by "Save".
Note:
On N4.75, if you go same steps will pop-up a warning message dialog box after
you "Save", and then overrride the charset and set the changed charset into
meta-tag no matter whether it has meta-tag or not in original html file.
Reporter | ||
Comment 1•24 years ago
|
||
Reassign to Roy and change the QA contact.
Assignee: nhotta → yokoyama
QA Contact: teruko → ylong
Summary: Wrong feature of "Save" when just change an existing file character coding → Wrong feature of "Save" when just change an existing file character coding
Updated•24 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
Reporter | ||
Updated•24 years ago
|
Summary: Wrong feature of "Save" when just change an existing file character coding → "Save" not functional when just change an existing file character coding
Comment 2•24 years ago
|
||
Roy - Please accept this one for nsbeta1 and set target milestone to M0.9.1
Keywords: nsbeta1
Reporter | ||
Updated•24 years ago
|
QA Contact: ylong → marina
Updated•24 years ago
|
Target Milestone: mozilla1.0 → mozilla0.9.1
Updated•24 years ago
|
Priority: -- → P3
Comment 4•24 years ago
|
||
jbetak: can you take a look at this? This bug seems in your area.
Please assign back to me if it's not the case. Thanks
Assignee: yokoyama → jbetak
Status: ASSIGNED → NEW
Comment 5•24 years ago
|
||
if there's a cheap user workaround for this please set the target milestone to
0.9.2.
Comment 6•24 years ago
|
||
OK, this is essentially the same problem as bug 56195. Note that Teruko
referred to "Save As" in bug 56195, since "Save" was most likely disabled when
she tested.
The "Save" menu item gets enabled as soon as the page content changes. When
changing the viewing charset via "View|Character Coding->", the meta tag within
the page doesn't change although it should. Hence the page content remains
unchanged and the "Save" menu item continues to be grayed out.
Since bug 56195 has been marked nsbeta1-, I'm futuring this also...
Reporter | ||
Comment 7•24 years ago
|
||
Another case "Save" keep grey-out:
1. Open an existing file with meta-charset in Composer - better to have a
double byte charset document, e.g. shift-jis.
2. Change the charset to something else(e.g. EUC-JP) by going: View | Character
Coding | More.
You will see the character are missed up, that means the charset has been
changed. Then check the HTML source, the meta-charset still keep the old value.
So, even the document has been changed, but the "Save" menu and meta-charset
won't get changed here.
Comment 8•24 years ago
|
||
Comment 9•24 years ago
|
||
Comment 10•24 years ago
|
||
cmanske:
although the proposed solution is not ideal, I think it's pretty self-contained
and robust. Extending the nsIDocumentStateListener interface would be probably
cleaner, but I don't think it's desirable in this context.
We are attempting to remedy the fact that a manual charset override in the
composer will result in a document reload, which in turn negates all changes to
the document's META charset. There is quite a number of mislabeled pages and
it's quite sensible to correct the META charset, if it was deemed to be wrong
by the user. I propose registering a dedicated document state listener, so we
can reinsert the META charset changes into the document upon reload.
This scenario is a borderline case and I don't expect it to surface very often,
if at all. The only reason for its visibility visible is bug 79735. Typically
wrong charset labeling is corrected manually when viewing the document and not
during the edit stage. Nevertheless we do offer the "Character Encoding" menu
in the composer and should handle this correctly.
Whiteboard: have fix, need r/sr
Comment 11•24 years ago
|
||
Seems reasonable to me
r=cmanske
Comment 12•24 years ago
|
||
thanks Charlie! Updating whiteboard status and adding blizzard as i18n
super-reviewer.
Whiteboard: have fix, need r/sr → have fix, need sr
Comment 13•24 years ago
|
||
oh, apparently I did not cc blizzard for possible sr the last time. Adding him
to the cc list now ...
Comment 14•24 years ago
|
||
sr=blizzard
Comment 15•24 years ago
|
||
thanks a lot Chris! Updating whiteboard summary.
Whiteboard: have fix, need sr → ready to checkin
Comment 16•24 years ago
|
||
patch checked in - thanks everyone!
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: ready to checkin → fixed on the trunk
Comment 17•24 years ago
|
||
*** Bug 56195 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 18•24 years ago
|
||
I checked it on 08-22 trunk build on all 3 platforms:
"Save" still not work - if you close the file after "Save" with a changed
charset, and re-open it again, or after "Save" the browse the page, the charset
still keep the old charset value. Although the charset has been changed in
Composer HTML source once set charset to another one.
Re-opening it.
Comment 19•24 years ago
|
||
Comment 20•24 years ago
|
||
cmanske would you help me out with yet another review? THis bugfix was
unfortunately not complete and has been reopened...
Comment 21•24 years ago
|
||
I realize that setting "gHTMLSourceChanged" will have the desired effect, but
that isn't technically the correct thing to do. I also realize that we don't
have an interface to force the internal "document modified" flag to "modified".
I'll look into this more tomorrow.
Comment 22•24 years ago
|
||
minusing, too late for 0.9.4. Juraj, remove the minus if you disagree
Comment 23•24 years ago
|
||
I'm going to take this bug since the fix I have is to add support for setting
"dirty flag" in composer code.
Assignee: jbetak → cmanske
Status: REOPENED → NEW
Target Milestone: Future → mozilla0.9.6
Updated•24 years ago
|
Attachment #44208 -
Attachment is obsolete: true
Comment 24•24 years ago
|
||
I'll attach a patch with new Composer code required to fix this.
No longer blocks: 99171
Status: NEW → ASSIGNED
Comment 25•24 years ago
|
||
tweaking summary to make it easier to searc for this.
Summary: "Save" not functional when just change an existing file character coding → "Save" not enabed when just change an existing file character coding (charset)
Comment 26•24 years ago
|
||
cmanske, thanks for taking this! I look forward to seeing this resolved in a
more elegant way.
Comment 27•24 years ago
|
||
Updated•24 years ago
|
Attachment #48511 -
Attachment is obsolete: true
Comment 28•24 years ago
|
||
jbetak: Could you please review the editor patch. Thanks.
After changing the charset, the "Save" button is now enabled, but I am noticing
one problem: After using "Undo", the charset is changed back to what it was
before (looking at the meta tag in HTML Source reveals this), but then all of
the submenus under "Character Encoding" are disabled.
Is that a separate problem?
Comment 29•24 years ago
|
||
Comment on attachment 44841 [details] [diff] [review]
Patch #2 (cvs diff -u -w -b)
This patch is already
checked in.
Attachment #44841 -
Attachment is obsolete: true
Comment 30•24 years ago
|
||
looks great: r=jbetak
BTW the problem you are seeing is both "a bug and a feature". Please see bug
42837, where Shanjian wanted to avoid document reloaded to preserve
any meaningful document editing work. Attachment 10861 [details] [diff] shows how he did it.
Since changing the charset is now considered a document change itself, users
would have only one shot at changing it. I don't think this reflects real-life
usage and we should probably reopen bug 42837 or file a new one. Since "Undo"
can tell what changes have been done to the document, could we use it to make
sure the charset menu doesn't get disabled when only the charset has changed?
cc'ing shanjian, momoi-san
Updated•24 years ago
|
Attachment #51739 -
Flags: review+
Comment 31•24 years ago
|
||
> Since changing the charset is now considered a document change itself,
> users would have only one shot at changing it. I don't think this
> reflects real-life usage
Our UE spec does not disallow character coding menu changes (any number
of them) on a new, existing, or just saved dsocuments as long as no input
has been entered. So the suggested change is OK as far as that is concerned.
You might however not want to allow infinite Undo's and might place
some arbitrary limit on Undo's while allowing unlimited number of
menu changes on qualified documents.
Comment 32•24 years ago
|
||
cmanske:
I think I have an idea how to comply with the i18n UE spec and also limit the
undo functionality Momoi-san mentioned in his comment. Could we simply disable
undo via EnableUndo(false) at the beginning of NotifyDocumentStateChanged
listener and re-enable it at the end? In the function updateCharsetPopupMenu we
would check for documentModified and see if there are any undoable editing
changes, the charset menu would get disabled only when both conditions are true.
If this sounds reasonable I could come up with an ammendment to your patch or
file a new bug and take it from there.
Updated•24 years ago
|
Whiteboard: FIX IN HAND need r=, sr= → FIX IN HAND need sr=
Comment 33•24 years ago
|
||
I'm a little wary about allowing things other than the editor's transaction
manager listener to modify the DocModCount ... if you are modifying the doc by
adding a charset tag, you should be using a transaction which is undoable.
If we allowed the patch in, we could never get back to an unmodified state via undo.
Cc'ing sfraser for comment.
Comment 34•24 years ago
|
||
I agree, the approach in the patch of 10/02/01 is probably not the right thing
to do.
Whiteboard: FIX IN HAND need sr=
Comment 35•24 years ago
|
||
I don't like this either. The doc mod count should be incremented as the result
of a transaction occurring, and not twiddled any other way. Is setting the doc
charset an undoable transaction? Should it be?
Comment 36•24 years ago
|
||
>Is setting the doc charset an undoable transaction? Should it be?
I think it should be undoable. Making it undoable would also help us to
determine an appropriate moment to disable the charset menu (bug 42837).
Momoi-san please correct me if I'm wrong, but most users don't expect or don't
care about the meta charset change in the document. They'll be tweaking the
presentation layer through the charset menu to make a document appear readable,
not to change it. I don't think they are expecting a document change to occur
and it wouldn't make sense to present it as such. We are overwriting the charset
to correct a mislabeled document and make it easier for us to preserve manually
adjusted presenation settings.
Comment 37•24 years ago
|
||
Comment on attachment 51739 [details] [diff] [review]
Allow editor's "documentModified" flag to be writable so we can set it "true" when charset is changed.
Wrong way to do this.
Attachment #51739 -
Attachment is obsolete: true
Updated•24 years ago
|
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Comment 39•24 years ago
|
||
Moving to 0.9.8
Comment 41•24 years ago
|
||
Resetting milestone, only nsbeta1+ bugs can have a milestone on them, these are
niminated, but not yet plussed.
Target Milestone: mozilla0.9.9 → ---
Comment 43•23 years ago
|
||
*** Bug 131064 has been marked as a duplicate of this bug. ***
Comment 44•23 years ago
|
||
I doubt this will happen for next release.
Comment 45•23 years ago
|
||
Changing component to editor composer.
Component: Internationalization → Editor: Composer
Updated•23 years ago
|
Keywords: polish
Hardware: PC → All
Summary: "Save" not enabed when just change an existing file character coding (charset) → "Save" not enabled when just change an existing file character coding (charset)
Updated•23 years ago
|
Target Milestone: mozilla1.2beta → mozilla1.3beta
Updated•21 years ago
|
Product: Browser → Seamonkey
Comment 47•17 years ago
|
||
Charles,
Are you still working on this ?
Comment 48•13 years ago
|
||
Incorrect bug, View settings should only affect page representation in browser, not edit it, anyway, for code page changing now "Save and Change Character Encoding" menu item present, so wontfix
Assignee: cmanske → nobody
Status: ASSIGNED → RESOLVED
Closed: 24 years ago → 13 years ago
QA Contact: amyy
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•