Closed Bug 6178 Opened 26 years ago Closed 26 years ago

changing text attributes add null="null">

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: akkzilla, Assigned: buster)

Details

In the editor, highlight some text and make it bold or italic. Now view the source (with save or Output HTML). The bold attribute comes through as <b null="null">text</b>, and similarly for italic.
Status: NEW → ASSIGNED
Target Milestone: M6
Accepting bug, setting milestone to M6
Assignee: kostello → buster
Status: ASSIGNED → NEW
Target Milestone: M6 → M7
Setting milestone to M7, Assigned to buster. Bug 4214 basically says that when you use the BOLD command, the resulting HTML output looks like this <b null="null">some content</b> So in my investigation, I looked in the XIF data and found that an attribute named "null" with the same value was being set in the content model. It turns out that the call to nsIHTMLEditor.SetTextProperty was begin called with the following values ("b", "null", "null") instead of ("b", 0, 0). And the reason for this is that, although the javascript passes in null values, the nsJSEditorAppCore SetTextProperty method translates those zero values to a string whose value is "null". So, a couple of solutions come to mind, but I'm wondering if this is the way JavaScript is designed to work? Is this a bug in the autogenerated nsJSEditorAppCore? Will this be fixed in when we move to XPIDL?
Assignee: buster → sfraser
This is simply the wrong values being passed down from JS. Assigning to self.
Status: NEW → ASSIGNED
So it turns out that the JS glue converts either null or 0 arguments into strings "null". So I'll have to pass in empty strings here instead. Steve, your code should be smart, and not set attributes if either the attribute or value is an empty string.
Simon: I agree that the code should be smart and not set an attribute that is a 0-length string. However, 0-length attributes are perfectly legal. <TABLE BORDER> for example. So if I add code to ignore 0-length attributes, is that sufficient?
OS: Linux → All
Hardware: PC → All
Target Milestone: M7 → M8
move to M8 per 6/15/99 meeting
Minor note: the '="null"' part of this was due to a XIF bug, on attributes with no value appearing in the output with their names as values, which I fixed yesterday. So you'll probably see something like "<b null>" now instead of <b null="null">. Which doesn't affect wanting to make the first null go away ...
Assignee: sfraser → buster
Status: ASSIGNED → NEW
I fixed the JS to pass in empty strings. Now the editor needs to handle them.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
verified in 7/8 build
You need to log in before you can comment on or make changes to this bug.