Handle mstyle defaults properly for attribute input/output.
This commit is contained in:
parent
2ea8bf10d5
commit
519ff32aae
|
@ -140,10 +140,11 @@
|
|||
if (name.match(/^_moz-math-((column|row)(align|line)|font-style)$/)) continue;
|
||||
var value = node.attributes[i].value;
|
||||
value = this.filterAttribute(name,value);
|
||||
var defaults = (mml.type === "mstyle" ? MML.math.prototype.defaults : mml.defaults);
|
||||
if (value != null) {
|
||||
if (value.toLowerCase() === "true") {value = true}
|
||||
else if (value.toLowerCase() === "false") {value = false}
|
||||
if (mml.defaults[name] != null || MML.copyAttributes[name])
|
||||
if (defaults[name] != null || MML.copyAttributes[name])
|
||||
{mml[name] = value} else {mml.attr[name] = value}
|
||||
mml.attrNames.push(name);
|
||||
}
|
||||
|
|
|
@ -490,10 +490,9 @@
|
|||
// and set those in the tag's attribute list
|
||||
//
|
||||
NativeMMLattributes: function (tag) {
|
||||
var defaults = this.defaults;
|
||||
var defaults = (this.type === "mstyle" ? MML.math.prototype.defaults : this.defaults);
|
||||
var copy = (this.attrNames||MML.copyAttributeNames), skip = MML.skipAttributes;
|
||||
if (!this.attrNames) {
|
||||
if (this.type === "mstyle") {defaults = MML.math.prototype.defaults}
|
||||
for (var id in defaults) {if (!skip[id] && defaults.hasOwnProperty(id)) {
|
||||
if (this[id] != null && this[id] !== defaults[id]) {tag.setAttribute(id,this.NativeMMLattribute(this[id]))}
|
||||
}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user