Closed
Bug 6178
Opened 25 years ago
Closed 25 years ago
changing text attributes add null="null">
Categories
(Core :: DOM: Editor, defect, P3)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
M8
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.
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M6
Comment 1•25 years ago
|
||
Accepting bug, setting milestone to M6
Updated•25 years ago
|
Assignee: kostello → buster
Status: ASSIGNED → NEW
Target Milestone: M6 → M7
Comment 2•25 years ago
|
||
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?
Updated•25 years ago
|
Assignee: buster → sfraser
Comment 3•25 years ago
|
||
This is simply the wrong values being passed down from JS. Assigning to self.
Updated•25 years ago
|
Status: NEW → ASSIGNED
Comment 4•25 years ago
|
||
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?
Updated•25 years ago
|
OS: Linux → All
Hardware: PC → All
Target Milestone: M7 → M8
Comment 6•25 years ago
|
||
move to M8 per 6/15/99 meeting
Reporter | ||
Comment 7•25 years ago
|
||
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 ...
Updated•25 years ago
|
Assignee: sfraser → buster
Status: ASSIGNED → NEW
Comment 8•25 years ago
|
||
I fixed the JS to pass in empty strings. Now the editor needs to handle them.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•