Bug 705932 - Inspector should allow copying the current element's id/classes; f=jwalker; r=dao

This commit is contained in:
Paul Rouget 2011-11-29 10:18:42 +01:00
parent 4605e05208
commit 0b35c239c2
3 changed files with 16 additions and 13 deletions

View File

@ -63,6 +63,17 @@
direction: ltr;
}
#highlighter-nodeinfobar-container[locked] > #highlighter-nodeinfobar {
pointer-events: auto;
}
#highlighter-nodeinfobar-id,
.highlighter-nodeinfobar-class,
#highlighter-nodeinfobar-tagname {
-moz-user-select: text;
cursor: text;
}
.highlighter-nodeinfobar-arrow {
display: none;
}
@ -83,14 +94,6 @@
display: none;
}
#highlighter-nodeinfobar-id::before {
content: "#";
}
.highlighter-nodeinfobar-class::before {
content: ".";
}
#highlighter-nodeinfobar-tagname {
text-transform: lowercase;
}

View File

@ -487,7 +487,7 @@ Highlighter.prototype = {
this.nodeInfo.tagNameLabel.textContent = this.node.tagName;
// ID
this.nodeInfo.idLabel.textContent = this.node.id;
this.nodeInfo.idLabel.textContent = this.node.id ? "#" + this.node.id : "";
// Classes
let classes = this.nodeInfo.classesBox;
@ -500,7 +500,7 @@ Highlighter.prototype = {
for (let i = 0; i < this.node.classList.length; i++) {
let classLabel = this.chromeDoc.createElement("label");
classLabel.className = "highlighter-nodeinfobar-class plain";
classLabel.textContent = this.node.classList[i];
classLabel.textContent = "." + this.node.classList[i];
fragment.appendChild(classLabel);
}
classes.appendChild(fragment);

View File

@ -24,9 +24,9 @@ function test()
function setupInfobarTest()
{
nodes = [
{node: doc.querySelector("#top"), position: "bottom", tag: "DIV", id: "top", classes: "class1 class2"},
{node: doc.querySelector("#vertical"), position: "overlap", tag: "DIV", id: "vertical", classes: ""},
{node: doc.querySelector("#bottom"), position: "top", tag: "DIV", id: "bottom", classes: ""},
{node: doc.querySelector("#top"), position: "bottom", tag: "DIV", id: "#top", classes: ".class1 .class2"},
{node: doc.querySelector("#vertical"), position: "overlap", tag: "DIV", id: "#vertical", classes: ""},
{node: doc.querySelector("#bottom"), position: "top", tag: "DIV", id: "#bottom", classes: ""},
{node: doc.querySelector("body"), position: "overlap", tag: "BODY", id: "", classes: ""},
]