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

Side by Side Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 1351413002: DevTools: remove padding before pseudo-element matched styles. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | « no previous file | Source/devtools/front_end/elements/elementsPanel.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 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 for (var pseudoId of pseudoIds) { 447 for (var pseudoId of pseudoIds) {
448 var block = WebInspector.SectionBlock.createPseudoIdBlock(pseudoId); 448 var block = WebInspector.SectionBlock.createPseudoIdBlock(pseudoId);
449 var cascade = cascades.pseudo.get(pseudoId); 449 var cascade = cascades.pseudo.get(pseudoId);
450 for (var sectionModel of cascade.sectionModels()) { 450 for (var sectionModel of cascade.sectionModels()) {
451 var section = new WebInspector.StylePropertiesSection(this, sect ionModel); 451 var section = new WebInspector.StylePropertiesSection(this, sect ionModel);
452 block.sections.push(section); 452 block.sections.push(section);
453 } 453 }
454 this._sectionBlocks.push(block); 454 this._sectionBlocks.push(block);
455 } 455 }
456 456
457 if (!!node.pseudoType())
458 this._appendTopPadding();
459
460 for (var block of this._sectionBlocks) { 457 for (var block of this._sectionBlocks) {
461 var titleElement = block.titleElement(); 458 var titleElement = block.titleElement();
462 if (titleElement) 459 if (titleElement)
463 this._sectionsContainer.appendChild(titleElement); 460 this._sectionsContainer.appendChild(titleElement);
464 for (var section of block.sections) 461 for (var section of block.sections)
465 this._sectionsContainer.appendChild(section.element); 462 this._sectionsContainer.appendChild(section.element);
466 } 463 }
467 464
468 if (this._filterRegex) 465 if (this._filterRegex)
469 this._updateFilter(); 466 this._updateFilter();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 var rulePayload = parentStyles.matchedCSSRules[i]; 548 var rulePayload = parentStyles.matchedCSSRules[i];
552 if (!this._containsInherited(rulePayload.style)) 549 if (!this._containsInherited(rulePayload.style))
553 continue; 550 continue;
554 cascade.appendModelFromRule(rulePayload, parentNode); 551 cascade.appendModelFromRule(rulePayload, parentNode);
555 } 552 }
556 parentNode = parentNode.parentNode; 553 parentNode = parentNode.parentNode;
557 } 554 }
558 return cascade; 555 return cascade;
559 }, 556 },
560 557
561 _appendTopPadding: function()
562 {
563 var separatorElement = createElement("div");
564 separatorElement.className = "styles-sidebar-placeholder";
565 this._sectionsContainer.appendChild(separatorElement);
566 },
567
568 /** 558 /**
569 * @param {!WebInspector.SectionCascade} matchedCascade 559 * @param {!WebInspector.SectionCascade} matchedCascade
570 * @return {!Array.<!WebInspector.SectionBlock>} 560 * @return {!Array.<!WebInspector.SectionBlock>}
571 */ 561 */
572 _rebuildSectionsForMatchedStyleRules: function(matchedCascade) 562 _rebuildSectionsForMatchedStyleRules: function(matchedCascade)
573 { 563 {
574 var blocks = [new WebInspector.SectionBlock(null)]; 564 var blocks = [new WebInspector.SectionBlock(null)];
575 var lastParentNode = null; 565 var lastParentNode = null;
576 for (var sectionModel of matchedCascade.sectionModels()) { 566 for (var sectionModel of matchedCascade.sectionModels()) {
577 var parentNode = sectionModel.parentNode(); 567 var parentNode = sectionModel.parentNode();
(...skipping 2557 matching lines...) Expand 10 before | Expand all | Expand 10 after
3135 3125
3136 /** 3126 /**
3137 * @override 3127 * @override
3138 * @return {?WebInspector.ToolbarItem} 3128 * @return {?WebInspector.ToolbarItem}
3139 */ 3129 */
3140 item: function() 3130 item: function()
3141 { 3131 {
3142 return this._button; 3132 return this._button;
3143 } 3133 }
3144 } 3134 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/elements/elementsPanel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698