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

Side by Side Diff: Source/devtools/front_end/ElementsPanel.js

Issue 143323014: *** DO NOT LAND *** Attempt to understand Regions complexity Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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
« no previous file with comments | « Source/devtools/front_end/CSSStyleModel.js ('k') | Source/devtools/front_end/cssNamedFlows.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 10 matching lines...) Expand all
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 22 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 importScript("CSSNamedFlowCollectionsView.js");
32 importScript("CSSNamedFlowView.js");
33 importScript("EventListenersSidebarPane.js"); 31 importScript("EventListenersSidebarPane.js");
34 importScript("MetricsSidebarPane.js"); 32 importScript("MetricsSidebarPane.js");
35 importScript("OverridesView.js"); 33 importScript("OverridesView.js");
36 importScript("PlatformFontsSidebarPane.js"); 34 importScript("PlatformFontsSidebarPane.js");
37 importScript("PropertiesSidebarPane.js"); 35 importScript("PropertiesSidebarPane.js");
38 importScript("RenderingOptionsView.js"); 36 importScript("RenderingOptionsView.js");
39 importScript("StylesSidebarPane.js"); 37 importScript("StylesSidebarPane.js");
40 38
41 /** 39 /**
42 * @constructor 40 * @constructor
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 _contextMenuEventFired: function(event) 370 _contextMenuEventFired: function(event)
373 { 371 {
374 function toggleWordWrap() 372 function toggleWordWrap()
375 { 373 {
376 WebInspector.settings.domWordWrap.set(!WebInspector.settings.domWord Wrap.get()); 374 WebInspector.settings.domWordWrap.set(!WebInspector.settings.domWord Wrap.get());
377 } 375 }
378 376
379 var contextMenu = new WebInspector.ContextMenu(event); 377 var contextMenu = new WebInspector.ContextMenu(event);
380 this.treeOutline.populateContextMenu(contextMenu, event); 378 this.treeOutline.populateContextMenu(contextMenu, event);
381 379
382 if (WebInspector.experimentsSettings.cssRegions.isEnabled()) {
383 contextMenu.appendSeparator();
384 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCa seMenuTitles() ? "CSS named flows\u2026" : "CSS Named Flows\u2026"), this._showN amedFlowCollections.bind(this));
385 }
386
387 contextMenu.appendSeparator(); 380 contextMenu.appendSeparator();
388 contextMenu.appendCheckboxItem(WebInspector.UIString(WebInspector.useLow erCaseMenuTitles() ? "Word wrap" : "Word Wrap"), toggleWordWrap.bind(this), WebI nspector.settings.domWordWrap.get()); 381 contextMenu.appendCheckboxItem(WebInspector.UIString(WebInspector.useLow erCaseMenuTitles() ? "Word wrap" : "Word Wrap"), toggleWordWrap.bind(this), WebI nspector.settings.domWordWrap.get());
389 382
390 contextMenu.show(); 383 contextMenu.show();
391 }, 384 },
392 385
393 _showNamedFlowCollections: function()
394 {
395 if (!WebInspector.cssNamedFlowCollectionsView)
396 WebInspector.cssNamedFlowCollectionsView = new WebInspector.CSSNamed FlowCollectionsView();
397 WebInspector.cssNamedFlowCollectionsView.showInDrawer();
398 },
399
400 _domWordWrapSettingChanged: function(event) 386 _domWordWrapSettingChanged: function(event)
401 { 387 {
402 if (event.data) 388 if (event.data)
403 this.contentElement.classList.remove("nowrap"); 389 this.contentElement.classList.remove("nowrap");
404 else 390 else
405 this.contentElement.classList.add("nowrap"); 391 this.contentElement.classList.add("nowrap");
406 392
407 var selectedNode = this.selectedDOMNode(); 393 var selectedNode = this.selectedDOMNode();
408 if (!selectedNode) 394 if (!selectedNode)
409 return; 395 return;
(...skipping 27 matching lines...) Expand all
437 return null; 423 return null;
438 424
439 var resource = WebInspector.resourceTreeModel.resourceForURL(anchor. href); 425 var resource = WebInspector.resourceTreeModel.resourceForURL(anchor. href);
440 if (!resource || resource.type !== WebInspector.resourceTypes.Image) 426 if (!resource || resource.type !== WebInspector.resourceTypes.Image)
441 return null; 427 return null;
442 428
443 anchor.removeAttribute("title"); 429 anchor.removeAttribute("title");
444 } 430 }
445 return anchor; 431 return anchor;
446 }, 432 },
447 433
448 _loadDimensionsForNode: function(treeElement, callback) 434 _loadDimensionsForNode: function(treeElement, callback)
449 { 435 {
450 // We get here for CSS properties, too, so bail out early for non-DOM tr eeElements. 436 // We get here for CSS properties, too, so bail out early for non-DOM tr eeElements.
451 if (treeElement.treeOutline !== this.treeOutline) { 437 if (treeElement.treeOutline !== this.treeOutline) {
452 callback(); 438 callback();
453 return; 439 return;
454 } 440 }
455 441
456 var node = /** @type {!WebInspector.DOMNode} */ (treeElement.represented Object); 442 var node = /** @type {!WebInspector.DOMNode} */ (treeElement.represented Object);
457 443
458 if (!node.nodeName() || node.nodeName().toLowerCase() !== "img") { 444 if (!node.nodeName() || node.nodeName().toLowerCase() !== "img") {
459 callback(); 445 callback();
460 return; 446 return;
461 } 447 }
462 448
463 WebInspector.RemoteObject.resolveNode(node, "", resolvedNode); 449 WebInspector.RemoteObject.resolveNode(node, "", resolvedNode);
464 450
465 function resolvedNode(object) 451 function resolvedNode(object)
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 if (!node) 1115 if (!node)
1130 return; 1116 return;
1131 1117
1132 while (!WebInspector.ElementsTreeOutline.showShadowDOM() && node && node .isInShadowTree()) 1118 while (!WebInspector.ElementsTreeOutline.showShadowDOM() && node && node .isInShadowTree())
1133 node = node.parentNode; 1119 node = node.parentNode;
1134 1120
1135 WebInspector.domAgent.highlightDOMNodeForTwoSeconds(nodeId); 1121 WebInspector.domAgent.highlightDOMNodeForTwoSeconds(nodeId);
1136 this.selectDOMNode(node, true); 1122 this.selectDOMNode(node, true);
1137 }, 1123 },
1138 1124
1139 /** 1125 /**
1140 * @param {!WebInspector.ContextMenu} contextMenu 1126 * @param {!WebInspector.ContextMenu} contextMenu
1141 * @param {!Object} target 1127 * @param {!Object} target
1142 */ 1128 */
1143 appendApplicableItems: function(event, contextMenu, target) 1129 appendApplicableItems: function(event, contextMenu, target)
1144 { 1130 {
1145 /** 1131 /**
1146 * @param {?DOMAgent.NodeId} nodeId 1132 * @param {?DOMAgent.NodeId} nodeId
1147 */ 1133 */
1148 function selectNode(nodeId) 1134 function selectNode(nodeId)
1149 { 1135 {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 * @extends {WebInspector.Drawer.SingletonViewFactory} 1337 * @extends {WebInspector.Drawer.SingletonViewFactory}
1352 */ 1338 */
1353 WebInspector.ElementsPanel.RenderingViewFactory = function() 1339 WebInspector.ElementsPanel.RenderingViewFactory = function()
1354 { 1340 {
1355 WebInspector.Drawer.SingletonViewFactory.call(this, WebInspector.RenderingOp tionsView); 1341 WebInspector.Drawer.SingletonViewFactory.call(this, WebInspector.RenderingOp tionsView);
1356 } 1342 }
1357 1343
1358 WebInspector.ElementsPanel.RenderingViewFactory.prototype = { 1344 WebInspector.ElementsPanel.RenderingViewFactory.prototype = {
1359 __proto__: WebInspector.Drawer.SingletonViewFactory.prototype 1345 __proto__: WebInspector.Drawer.SingletonViewFactory.prototype
1360 } 1346 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/CSSStyleModel.js ('k') | Source/devtools/front_end/cssNamedFlows.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698