OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |