mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
[XForms] Change @accesskey so it can be fully CSS styled. Bug 331346, r=doronr+smaug
This commit is contained in:
parent
d8c3b2d7e7
commit
f6fdbdd282
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -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');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user