[XForms] Change @accesskey so it can be fully CSS styled. Bug 331346, r=doronr+smaug

This commit is contained in:
allan%beaufour.dk 2006-05-30 08:41:31 +00:00
parent d8c3b2d7e7
commit f6fdbdd282
2 changed files with 25 additions and 4 deletions

View File

@ -232,12 +232,22 @@
range.setStart(aTextNode, location);
range.setEnd(aTextNode, location + 1);
var u = this._ownerDocument.
createElementNS("http://www.w3.org/1999/xhtml", "u");
range.surroundContents(u);
var span = this._ownerDocument.
createElementNS("http://www.w3.org/1999/xhtml", "span");
span.setAttribute("class", "xf-accesskey-inline");
range.surroundContents(span);
} else {
// if we didn't find the accesskey, append it to the end
aTextNode.nodeValue += "(" + aAccesskey + ")";
var span = this._ownerDocument.
createElementNS("http://www.w3.org/1999/xhtml", "span");
span.setAttribute("class", "xf-accesskey-appended");
span.textContent = aAccesskey;
if (aTextNode.nextSibling) {
aTextNode.parentNode.insertBefore(span,
aTextNode.nextSibling);
} else {
aTextNode.parentNode.appendChild(span);
}
}
}
};

View File

@ -332,6 +332,17 @@ html|*:root upload[accesskey] > label {
-moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-label-accesskey');
}
html|*:root html|span.xf-accesskey-inline {
text-decoration: underline;
}
html|*:root html|span.xf-accesskey-appended:before {
content: "(";
}
html|*:root html|span.xf-accesskey-appended:after {
content: ")";
}
html|*:root label {
-moz-binding: url('chrome://xforms/content/xforms-xhtml.xml#xformswidget-label');
}