OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright (C) 2012 Google Inc. All rights reserved. | 2 Copyright (C) 2012 Google Inc. All rights reserved. |
3 | 3 |
4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
6 are met: | 6 are met: |
7 | 7 |
8 1. Redistributions of source code must retain the above copyright | 8 1. Redistributions of source code must retain the above copyright |
9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
10 2. Redistributions in binary form must reproduce the above copyright | 10 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 337 |
338 function _drawElementTitle(highlight) | 338 function _drawElementTitle(highlight) |
339 { | 339 { |
340 var elementInfo = highlight.elementInfo; | 340 var elementInfo = highlight.elementInfo; |
341 if (!highlight.elementInfo) | 341 if (!highlight.elementInfo) |
342 return; | 342 return; |
343 | 343 |
344 document.getElementById("tag-name").textContent = elementInfo.tagName; | 344 document.getElementById("tag-name").textContent = elementInfo.tagName; |
345 document.getElementById("node-id").textContent = elementInfo.idValue ? "#" +
elementInfo.idValue : ""; | 345 document.getElementById("node-id").textContent = elementInfo.idValue ? "#" +
elementInfo.idValue : ""; |
346 var className = elementInfo.className; | 346 var className = elementInfo.className; |
347 if (className.length > 50) | 347 if (className && className.length > 50) |
348 className = className.substring(0, 50) + "\u2026"; | 348 className = className.substring(0, 50) + "\u2026"; |
349 document.getElementById("class-name").textContent = className; | 349 document.getElementById("class-name").textContent = className || ""; |
350 document.getElementById("node-width").textContent = elementInfo.nodeWidth; | 350 document.getElementById("node-width").textContent = elementInfo.nodeWidth; |
351 document.getElementById("node-height").textContent = elementInfo.nodeHeight; | 351 document.getElementById("node-height").textContent = elementInfo.nodeHeight; |
352 var elementTitle = document.getElementById("element-title"); | 352 var elementTitle = document.getElementById("element-title"); |
353 | 353 |
354 var marginQuad = highlight.quads[0]; | 354 var marginQuad = highlight.quads[0]; |
355 | 355 |
356 var titleWidth = elementTitle.offsetWidth + 6; | 356 var titleWidth = elementTitle.offsetWidth + 6; |
357 var titleHeight = elementTitle.offsetHeight + 4; | 357 var titleHeight = elementTitle.offsetHeight + 4; |
358 | 358 |
359 var anchorTop = marginQuad[0].y; | 359 var anchorTop = marginQuad[0].y; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 </body> | 573 </body> |
574 <canvas id="canvas" class="fill"></canvas> | 574 <canvas id="canvas" class="fill"></canvas> |
575 <div id="element-title"> | 575 <div id="element-title"> |
576 <span id="tag-name"></span><span id="node-id"></span><span id="class-name"></s
pan> | 576 <span id="tag-name"></span><span id="node-id"></span><span id="class-name"></s
pan> |
577 <span id="node-width"></span><span class="px">px</span><span class="px"> ×
; </span><span id="node-height"></span><span class="px">px</span> | 577 <span id="node-width"></span><span class="px">px</span><span class="px"> ×
; </span><span id="node-height"></span><span class="px">px</span> |
578 </div> | 578 </div> |
579 <div id="right-gutter"></div> | 579 <div id="right-gutter"></div> |
580 <div id="bottom-gutter"></div> | 580 <div id="bottom-gutter"></div> |
581 <div id="log"></div> | 581 <div id="log"></div> |
582 </html> | 582 </html> |
OLD | NEW |