1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 05:37:58 +01:00

Isolate hint nodes from page styles.

This commit is contained in:
Kris Maglione
2010-12-10 09:40:35 -05:00
parent 2f79dc44b7
commit 1c734e6709
4 changed files with 41 additions and 29 deletions

View File

@@ -287,7 +287,7 @@ const Hints = Module("hints", {
return true;
}
let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc);
let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint" dactyl:class="magic" xmlns:dactyl={NS}/>, doc);
let mode = this._hintMode;
let res = util.evaluateXPath(mode.xpath, doc, null, true);
@@ -371,11 +371,11 @@ const Hints = Module("hints", {
* @param {boolean} active Whether it is the currently active hint or not.
*/
_setClass: function _setClass(elem, active) {
let prefix = (elem.getAttributeNS(NS, "class") || "") + " ";
let prefix = (elem.getAttributeNS(NS, "hl") || "") + " ";
if (active)
elem.setAttributeNS(NS, "highlight", prefix + "HintActive");
highlight.highlightNode(elem, prefix + "HintActive");
else if (active != null)
elem.setAttributeNS(NS, "highlight", prefix + "HintElem");
highlight.highlightNode(elem, prefix + "HintElem");
else
elem.removeAttributeNS(NS, "highlight");
},
@@ -412,7 +412,7 @@ const Hints = Module("hints", {
if (!rect)
continue;
hint.imgSpan = util.xmlToDom(<span highlight="Hint" dactyl:class="HintImage" xmlns:dactyl={NS}/>, doc);
hint.imgSpan = util.xmlToDom(<span dactyl:class="magic" dactyl:hl="Hint" dactyl:hl="HintImage" xmlns:dactyl={NS}/>, doc);
hint.imgSpan.style.left = (rect.left + offsetX) + "px";
hint.imgSpan.style.top = (rect.top + offsetY) + "px";
hint.imgSpan.style.width = (rect.right - rect.left) + "px";