Closed
Bug 83335
Opened 23 years ago
Closed 23 years ago
hrule align attribute defaults to left not center
Categories
(Core :: DOM: Editor, defect, P3)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
mozilla0.9.3
People
(Reporter: Brade, Assigned: cmanske)
References
Details
Attachments
(4 files)
3.26 KB,
patch
|
Details | Diff | Splinter Review | |
3.68 KB,
patch
|
Details | Diff | Splinter Review | |
3.68 KB,
patch
|
Details | Diff | Splinter Review | |
2.69 KB,
patch
|
Details | Diff | Splinter Review |
The hrule align attribute is always written out. We shouldn't write it out if it's the default value (center).
Assignee | ||
Comment 1•23 years ago
|
||
easy.
Status: NEW → ASSIGNED
Hardware: Macintosh → All
Target Milestone: --- → mozilla0.9.2
Assignee | ||
Comment 2•23 years ago
|
||
To simplify, I'm going to fix all simple HLine problems with this bug. This is another simple problem: Start Composer Insert a Horizontal Line from H.Line toolbar button. Double click on it to edit properties. You can set the alignmen via radio button. Set "Center" Click on Advanced Edit button and change alignment to "right". Click OK. When you return to H.Line dialog, both "Center" and "Right" are checked. Simple fix -- just clear all 3 buttons before getting current align state.
Assignee | ||
Comment 4•23 years ago
|
||
Assignee | ||
Comment 5•23 years ago
|
||
Note that patch also fixes other places where we were writing the "align" attribute as "center" when we don't need to.
Whiteboard: FIX IN HAND need r=, sr=
Assignee | ||
Comment 6•23 years ago
|
||
Reporter | ||
Comment 7•23 years ago
|
||
* why did you remove the ';' from the end of this line in ComposerCommands.js: hLine.setAttribute("align", "right") * in nsHTMLEditor.cpp, I don't understand why you removed that line and not the others; maybe add a comment in there so someone doesn't add it back in? * I don't understand why we need to set all of the radio buttons' checked to false. Do we need to do that anywhere else? * why change the code that sets checked to true? * can we remove all or most of the dumps in this file?
Assignee | ||
Comment 8•23 years ago
|
||
* why did you remove the ';' from the end of this line in ComposerCommands.js: hLine.setAttribute("align", "right") An accident! Fixed. * in nsHTMLEditor.cpp, I don't understand why you removed that line and not the others; maybe add a comment in there so someone doesn't add it back in? We set attributes (not many now) that we really want, but as you observed, it isn't necessary to set "center" for HLine, since it's default. * I don't understand why we need to set all of the radio buttons' checked to false. Do we need to do that anywhere else? I wondered about that too. The only other example I could find using radio buttons for an element props dialog that accessed Advanced Edit was in Image dialog, and setting checks is done correctly there. This seems to be only example with 3 radio buttons. * why change the code that sets checked to true? Diff is confusing. Changed to was use "center" as default * can we remove all or most of the dumps in this file? Sure. Done.
Assignee | ||
Comment 9•23 years ago
|
||
Comment 10•23 years ago
|
||
Changes look good to me ... sr=kin@netscape.com Not required: Would it be better to do the following instead of clearing the checked values first then checking which is set? dialog.centerAlign.checked = (align == "center"); dialog.rightAlign.checked = (align == "right"); dialog.leftAlign.checked = (align == "left");
Whiteboard: FIX IN HAND need r=, sr= → FIX IN HAND need r=
Assignee | ||
Comment 11•23 years ago
|
||
Kin's suggestion was good, but must also check null: dialog.centerAlign.checked = (align == "center" || !align); dialog.rightAlign.checked = (align == "right"); dialog.leftAlign.checked = (align == "left"); This is the new version. sr=kin
Assignee | ||
Comment 13•23 years ago
|
||
Comment 14•23 years ago
|
||
a= asa@mozilla.org for checkin to the trunk. (on behalf of drivers)
Updated•23 years ago
|
Whiteboard: FIX IN HAND → fixed, reviewed, a=asa
Assignee | ||
Comment 15•23 years ago
|
||
checked in.
Comment 16•23 years ago
|
||
updated summary to reflect the remaining issue from this bug, when insert an hrule, the default align value being set is left, the default should be center, and should be written out for correctness. See section 15.3
Status: RESOLVED → REOPENED
OS: Mac System 9.x → All
Resolution: FIXED → ---
Summary: hrule align attribute problems → hrule align attribute defaults to left not center
Updated•23 years ago
|
Severity: normal → minor
Priority: -- → P3
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Comment 17•23 years ago
|
||
trivial to fix, one line correction, and the horizontal rule will insert correctly reviewed and approved
Keywords: nsBranch
Whiteboard: fixed
Assignee | ||
Comment 18•23 years ago
|
||
The point of the orginal bug was to *not* explicitly write the 'center' attribute in the <hrule> tag. I don't think there's a bug here. The default value is saved in preferences, so if you ever used align = "left" and clicked on the "Use as default" button in the H.Line properties dialog, the pref would be saved and used as new default. If no "align" attribute is set, layout will default to center. So insert a new H.Line, click on "center" radio button, then click on "Use as default" to clear the pref. The next line you insert should have no "align" set on the <hrule>, and should display centered. Close the app and restart, then insert a new line in Composer to see if you are still getting the default "center" behavior.
Status: REOPENED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 19•23 years ago
|
||
reopen bug for different resolution
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Reporter | ||
Comment 20•23 years ago
|
||
original bug reported is fixed
Status: REOPENED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → FIXED
Comment 21•23 years ago
|
||
Okay two issues here that I see now after inserting an H. Line: 1) H. Line default = Left. 2) after changing alignment to Center when you look at the source, we don't write out the alignment for Center. If the above are correct, then I am marking this VERIFIED-FIXED. otherwise REOPEN.
Status: RESOLVED → VERIFIED
Assignee | ||
Comment 22•23 years ago
|
||
Are you sure the H.Line default is "left"? Did you delete your prefs first? The default should be to not put any "align" value, thus layout will center it.
Comment 23•23 years ago
|
||
I"m seeing an alignment value of "left". What do you mean by delete my prefs? my prefs.js file?
Assignee | ||
Comment 24•23 years ago
|
||
Yes, delete prefs.js
Comment 25•23 years ago
|
||
Leaving this bug as closed out... Charley recommends filing a new bug on the default align = left issue.
You need to log in
before you can comment on or make changes to this bug.
Description
•