InspectorTest.selectNodeAndWaitForStyles(idValue, stylesCallback);
}
+InspectorTest.firstElementsTreeOutline = function()
+{
+ return WebInspector.panels.elements._treeOutlines[0];
+}
+
InspectorTest.dumpSelectedElementStyles = function(excludeComputed, excludeMatched, omitLonghands, includeSelectorGroupMarks)
{
function extractText(element)
if (section.element.previousSibling && section.element.previousSibling.className === "sidebar-separator")
InspectorTest.addResult("======== " + section.element.previousSibling.textContent + " ========");
InspectorTest.addResult((section.expanded ? "[expanded] " : "[collapsed] ") + (section.noAffect ? "[no-affect] " : ""));
- var chainEntries = section.titleElement.children;
+ var chainEntries = section.titleElement.querySelectorAll(".media-list .media");
+ chainEntries = Array.prototype.slice.call(chainEntries);
+ if (section.titleElement.children[1])
+ chainEntries.push(section.titleElement.children[1]);
+
for (var j = 0; j < chainEntries.length; ++j) {
var chainEntry = chainEntries[j];
var entryLine = includeSelectorGroupMarks ? buildMarkedSelectors(chainEntry.children[1]) : chainEntry.children[1].textContent;
}
}
- var treeOutline = WebInspector.panels.elements.treeOutline;
+ var treeOutline = InspectorTest.firstElementsTreeOutline();
treeOutline._updateModifiedNodes();
print(rootNode ? treeOutline.findTreeElement(rootNode) : treeOutline, "", depth || 10000);
};
function onAllNodesAvailable()
{
- WebInspector.panels.elements.treeOutline._updateModifiedNodes();
- expand(WebInspector.panels.elements.treeOutline);
+ InspectorTest.firstElementsTreeOutline()._updateModifiedNodes();
+ expand(InspectorTest.firstElementsTreeOutline());
callback();
}
WebInspector.inspectorView.showPanel("elements");
InspectorTest.addSniffer(WebInspector.BlankStylePropertiesSection.prototype, "makeNormal", callback);
}
-};
+InspectorTest.dumpInspectorHighlight = function(node, callback)
+{
+ node.boxModel(function(boxModel) {
+ var rectNames = ["margin", "border", "padding", "content"];
+ for (var i = 0; i < rectNames.length; i++) {
+ var rect = boxModel[rectNames[i]];
+ InspectorTest.addResult(rectNames[i] + " rect is " + (rect[4] - rect[0]) + " x " + (rect[5] - rect[1]) + " at (" + rect[0] + ", " + rect[1] + ")");
+ }
+ callback();
+ });
+}
-function dumpInspectorHighlightRects()
+InspectorTest.dumpInspectorHighlightShape = function(node, callback)
{
- var rectNames = ["margin", "border", "padding", "content"];
- var rects = window.internals.inspectorHighlightRects(document);
- for (var i = 0; i < rects.length; i++)
- {
- var rectName = (i < rectNames.length ? rectNames[i] : "untitled");
- var rect = rects.item(i);
- output(rectName + " rect is " + rect.width + " x " + rect.height + " at (" + rect.left + ", " + rect.top + ")");
- }
+ node.boxModel(function(shapes) {
+ InspectorTest.addResult(JSON.stringify(shapes.shapeOutside.shape));
+ callback();
+ });
}
+
+};