Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Side by Side Diff: LayoutTests/http/tests/inspector/elements-test.js

Issue 177963004: DevTools: Split creating inspector stylesheet and adding a new rule into stylesheet in protocol. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 var initialize_ElementTest = function() { 1 var initialize_ElementTest = function() {
2 2
3 InspectorTest.findNode = function(matchFunction, callback) 3 InspectorTest.findNode = function(matchFunction, callback)
4 { 4 {
5 callback = InspectorTest.safeWrap(callback); 5 callback = InspectorTest.safeWrap(callback);
6 var result = null; 6 var result = null;
7 var pendingRequests = 0; 7 var pendingRequests = 0;
8 function processChildren(node) 8 function processChildren(node)
9 { 9 {
10 try { 10 try {
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 } 662 }
663 663
664 InspectorTest.matchingSelectors = function(rule) 664 InspectorTest.matchingSelectors = function(rule)
665 { 665 {
666 var selectors = []; 666 var selectors = [];
667 for (var i = 0; i < rule.matchingSelectors.length; ++i) 667 for (var i = 0; i < rule.matchingSelectors.length; ++i)
668 selectors.push(rule.selectors[rule.matchingSelectors[i]].value); 668 selectors.push(rule.selectors[rule.matchingSelectors[i]].value);
669 return "[" + selectors.join(", ") + "]"; 669 return "[" + selectors.join(", ") + "]";
670 } 670 }
671 671
672 InspectorTest.addNewRule = function(selector, callback)
673 {
674 // Click "Add new rule".
675 document.getElementById("add-style-button-test-id").click();
676 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2 ];
677 if (typeof selector === "string")
678 section._selectorElement.textContent = selector;
679 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter") );
680 InspectorTest.addSniffer(WebInspector.BlankStylePropertiesSection.prototype, "makeNormal", callback);
681 }
682
672 }; 683 };
673 684
674 function dumpInspectorHighlightRects() 685 function dumpInspectorHighlightRects()
675 { 686 {
676 var rectNames = ["margin", "border", "padding", "content"]; 687 var rectNames = ["margin", "border", "padding", "content"];
677 var rects = window.internals.inspectorHighlightRects(document); 688 var rects = window.internals.inspectorHighlightRects(document);
678 for (var i = 0; i < rects.length; i++) 689 for (var i = 0; i < rects.length; i++)
679 { 690 {
680 var rectName = (i < rectNames.length ? rectNames[i] : "untitled"); 691 var rectName = (i < rectNames.length ? rectNames[i] : "untitled");
681 var rect = rects.item(i); 692 var rect = rects.item(i);
682 output(rectName + " rect is " + rect.width + " x " + rect.height + " at (" + rect.left + ", " + rect.top + ")"); 693 output(rectName + " rect is " + rect.width + " x " + rect.height + " at (" + rect.left + ", " + rect.top + ")");
683 } 694 }
684 } 695 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698