Subscript and Superscript combine in Format >Text Style pulldown menu

ASSIGNED
Assigned to

Status

()

ASSIGNED
18 years ago
7 years ago

People

(Reporter: TucsonTester2, Assigned: neil)

Tracking

Trunk
Future
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

18 years ago
Product: Browser and Composer

Component: Composer

Platform: PC  

Operating System: Windows 95 - OSR1 

Build ID:  2001091303

URL: Not Applicable  

Desciption:
I dont know too much about superscript or subscript,but i didn't think you 
could use a combination of both at the same time.  Is this a bug or a new 
feature?--I checked in 4.7 and you can't do this. In 4.7 it has to be one or 
the other. But in this version if you select both in the Format >Text Style 
pulldown menu it will make the text smaller and it will be slightly lower and 
higher than normal text.

Reproducibility: Every time 

Steps to Reproduce: 
1.  Open a new blank page to edit in Composer

2.  Type in "NORM".

3.  Tap the spacebar twice, type in "SUPER".

4.  Tap the spacebar twice, type in "SUB".

5.  Tap the spacebar twice, type in "BOTH".

6.  Highlight "SUPER"

7.  At the top click on FORMAT, select TEXT STYLE, then click on SUPERSCRIPT.
(This will place a checkmark next to the superscript selection in the Text 
Style menu, and make "SUPER" smaller and raised up)

8.  Highlight "SUB"

9.  At the top click on FORMAT, select TEXT STYLE, then click on SUBSCRIPT.
(This will place a checkmark next to the superscript selection in the Text 
Style menu, and make "SUB" smaller and dropped down)

10.  Highlight "BOTH"

11.  At the top click on FORMAT, select TEXT STYLE, then click on SUBSCRIPT.
(There will now be a checkmark next to the superscript and the subscript 
selection in the Text Style menu, and will make "BOTH" smaller 
than "NORM", "SUPER",and "SUB", and "BOTH will be positioned between raised and 
dropped.)  
NOTE:  I have also tried selecting subscript first, and than selecting 
superscript, and have gotten the same end result.

Actual Results: 
HTML Source Tab:
<html>
<head>
</head>
<body>
NORMAL &nbsp;<sup>SUPER</sup> &nbsp;<sub>SUB</sub> 
&nbsp;<sub><sup>BOTH</sup></sub>
</body>
</html>

Expected Results: 
I would expect that if you selected subscript it would automatically cancel out 
your previous superscipt selection.  It is possible to de-select any previous 
selections and take out the checkmark where it was no longer needed.  However, 
I don't know of any type of documentation that require a hybrid-combination of 
both superscript and subscript.  So this would just require way too many mouse 
clicks for someone who just changed their mind, and wanted subscript instead of 
superscript.
(Reporter)

Comment 1

18 years ago
This bug is also occurring on Windows 95 - OSR1.5.
(Reporter)

Comment 2

18 years ago
Bug 100825 is also occurring on Windows 95 - OSR2.

Comment 3

17 years ago
Confirmed on Win 2k using QA build 20011001, Win 98 using QA build 20010927, and
Mac OSX using Mozilla build 20010930. 
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 4

17 years ago
-->cmanske
is this a dup?
Assignee: syd → cmanske

Comment 5

17 years ago
We made superscript and subsctipt mutually exclusive in 4.7 as a convenience, 
since obviously it doesn't make sense to have both, but I don't think it's 
technically invalid HTML. If we want to enforce this again, it would have to be 
done in rules code.
Assignee: cmanske → jfrancis

Comment 6

17 years ago
I dOnT gEt It WhAtS tHe PrObLeM?

oh, ok.
Status: NEW → ASSIGNED
Whiteboard: EDITORBASE 3 days
Target Milestone: --- → mozilla1.0

Updated

17 years ago
Whiteboard: EDITORBASE 3 days → EDITORBASE; 3 days

Updated

17 years ago
Component: Editor: Composer → Editor: Core

Updated

17 years ago
Whiteboard: EDITORBASE; 3 days → EDITORBASE-; 3 days

Comment 7

17 years ago
Joe: Isn't this simply a matter of calling RemoveStyle("sup") whenever we set
"sub" and vice versa? That shouldn't be too hard, no?
Or maybe the simple fix is to do this in JS?
Assignee: jfrancis → cmanske
Status: ASSIGNED → NEW
Whiteboard: EDITORBASE-; 3 days
Target Milestone: mozilla1.0 → mozilla0.9.8

Comment 8

17 years ago
Created attachment 63849 [details] [diff] [review]
Fix.

Detect "sup" and "sub" in command code and remove opposite when setting style.

Updated

17 years ago
Status: NEW → ASSIGNED
Keywords: patch, review
OS: Windows 95 → All
Hardware: PC → All
Whiteboard: FIX IN HAND, need r=,sr=

Comment 9

17 years ago
Comment on attachment 63849 [details] [diff] [review]
Fix.

r=jfrancis.  Thanks Charlie!
Attachment #63849 - Flags: review+

Comment 11

17 years ago
checked in
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Keywords: patch, review
Resolution: --- → FIXED
Whiteboard: FIX IN HAND, need r=,sr=

Comment 12

17 years ago
I am still seeing this problem on Win 2k and Mac OSX both using trunk build 01-24.

I am reopening this bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 13

17 years ago
Moving to mozilla1.1
Status: REOPENED → ASSIGNED
Target Milestone: mozilla0.9.8 → mozilla1.1

Comment 14

17 years ago
Created attachment 91420 [details] [diff] [review]
patch v2

doh!
Attachment #63849 - Attachment is obsolete: true

Updated

17 years ago
Keywords: nsbeta1, patch, review
Whiteboard: FIX IN HAND, need r=,sr=

Comment 15

17 years ago
Comment on attachment 91420 [details] [diff] [review]
patch v2

r=jfrancis
Attachment #91420 - Flags: review+

Updated

17 years ago
Whiteboard: FIX IN HAND, need r=,sr= → FIX IN HAND, need sr=

Comment 16

17 years ago
Comment on attachment 91420 [details] [diff] [review]
patch v2

sr=kin@netscape.com

Side note: I thought we were trying to get rid of all AssignWithConversion()
calls in editor code?
Attachment #91420 - Flags: superreview+

Updated

17 years ago
Whiteboard: FIX IN HAND, need sr= → FIX IN HAND
Comment on attachment 91420 [details] [diff] [review]
patch v2

a=asa (on behalf of drivers) for checkin to 1.1
Attachment #91420 - Flags: approval+

Comment 18

17 years ago
Checked into 1.1 trunk
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago17 years ago
Keywords: patch, review
Resolution: --- → FIXED
Whiteboard: FIX IN HAND
i think this is still a problem, when using 2003.04.10 comm bits.

1. enter some text and select it.
2. select Format - Text Style - Superscript.
3. select Format - Text Style -Subscript.

results: the formatted text appears subscripted, but the source still applies
both tags:

<body>
<sub><sup>some text</sup></sub> and no formatting<br>
</body>

if i reverse steps 2 and 3, the formatted text doesn't even look superscripted
--it's smaller, but its height is somewhere in btwn. sample source:

<body>
and here is <sup><sub>some text</sub></sup> again<br>
</body>

reopening, and assigning to default owner (but reassign as needed).
Status: RESOLVED → REOPENED
QA Contact: sujay → sairuh
Resolution: FIXED → ---
over to joe this time, really.
Assignee: cmanske → jfrancis
Status: REOPENED → NEW

Comment 21

16 years ago
Should this really be a bug? Super/Subscripts should be allowed to have
superscript and subscript content shouldn't they?

  x<sup>y<sub>0</sub></sup>

Comment 22

16 years ago
adt: nsbeta1-
Keywords: nsbeta1 → nsbeta1-

Comment 23

15 years ago
retargeting
Target Milestone: mozilla1.1alpha → Future
(Assignee)

Comment 24

15 years ago
Created attachment 138876 [details] [diff] [review]
Final part of fix

The existing code removed the applied sup/sub style, instead of the reverse
sub/sup style. While I was fixing this I noticed that the code used unicode
atoms; they have since changed to UTF-8 so I rewrote the atom handling code.
(Assignee)

Updated

15 years ago
Attachment #138876 - Flags: review?(daniel)

Comment 25

15 years ago
Comment on attachment 138876 [details] [diff] [review]
Final part of fix

Does it really make sense to have SetTextProperty if no one else uses it?
Comment on attachment 138876 [details] [diff] [review]
Final part of fix

r=daniel@glazman.org
Attachment #138876 - Flags: review?(daniel) → review+
(Assignee)

Updated

15 years ago
Attachment #138876 - Flags: superreview?(sspitzer)
(Assignee)

Comment 27

15 years ago
Created attachment 140257 [details] [diff] [review]
Inlined at brade's request

Also used jst's new EmptyString().
Assignee: mozeditor → neil.parkwaycc.co.uk
Attachment #138876 - Attachment is obsolete: true
Status: NEW → ASSIGNED
(Assignee)

Updated

15 years ago
Attachment #140257 - Flags: superreview?(alecf)
Attachment #140257 - Flags: review?(daniel)

Comment 28

15 years ago
Comment on attachment 140257 [details] [diff] [review]
Inlined at brade's request

looks good, its just too bad you have to get both atoms first.. but sr=alecf
assuming glazman is ok with it... I wonder how much other stuff there is like
this to clean up in composer...
Attachment #140257 - Flags: superreview?(alecf) → superreview+

Comment 29

15 years ago
This is not a bug.  Subscripts on superscripts and superscripts on subscripts
appear in mathematical formulas all the time.

Comment 30

15 years ago
Suggest invalid.
QA Contact: bugzilla → editor
You need to log in before you can comment on or make changes to this bug.