Bug 1237428 - Don't cap number of attributes on DOM nodes in console;r=jryans

This commit is contained in:
Brian Grinstead 2016-01-07 14:30:23 -08:00
parent 8042ee4fec
commit 8f8c999fcd
3 changed files with 15 additions and 4 deletions

View File

@ -56,7 +56,7 @@ var inputTests = [
{
input: "testNodeList()",
output: "NodeList [ <html>, <head>, <meta>, <title>, " +
"<body#body-id.body-class>, <p>, <iframe>, " +
"<body#body-id.body-class>, <p>, <p#lots-of-attributes>, <iframe>, " +
"<div.some.classname.here.with.more.classnames.here>, <script> ]",
printOutput: "[object NodeList]",
inspectable: true,
@ -98,6 +98,15 @@ var inputTests = [
inspectable: true,
noClick: true,
inspectorIcon: false
},
{
input: "testLotsOfAttributes()",
output: '<p n="" m="" l="" k="" j="" i="" h="" g="" f="" e="" d="" c="" b="" a="" id="lots-of-attributes">',
printOutput: "[object HTMLParagraphElement]",
inspectable: true,
noClick: true,
inspectorIcon: true
}
];

View File

@ -10,6 +10,7 @@
</head>
<body class="body-class" id="body-id">
<p some-attribute="some-value">hello world!</p>
<p id="lots-of-attributes" a b c d e f g h i j k l m n></p>
<iframe src="data:text/html,<p>hello from iframe</p>"></iframe>
<div class="some classname here with more classnames here"></div>
<script type="text/javascript">
@ -21,6 +22,10 @@ function testDocumentElement() {
return document.documentElement;
}
function testLotsOfAttributes() {
return document.querySelector("#lots-of-attributes");
}
function testDocument() {
return document;
}

View File

@ -1496,9 +1496,6 @@ DebuggerServer.ObjectActorPreviewers.Object = [
preview.attributesLength = rawObj.attributes.length;
for (let attr of rawObj.attributes) {
preview.attributes[attr.nodeName] = hooks.createValueGrip(attr.value);
if (++i == OBJECT_PREVIEW_MAX_ITEMS) {
break;
}
}
} else if (rawObj instanceof Ci.nsIDOMAttr) {
preview.value = hooks.createValueGrip(rawObj.value);