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 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 | 1101 |
1102 _markSelectorMatches() { | 1102 _markSelectorMatches() { |
1103 var rule = this._style.parentRule; | 1103 var rule = this._style.parentRule; |
1104 if (!rule) | 1104 if (!rule) |
1105 return; | 1105 return; |
1106 | 1106 |
1107 this._mediaListElement.classList.toggle('media-matches', this._matchedStyles
.mediaMatches(this._style)); | 1107 this._mediaListElement.classList.toggle('media-matches', this._matchedStyles
.mediaMatches(this._style)); |
1108 | 1108 |
1109 var selectorTexts = rule.selectors.map(selector => selector.text); | 1109 var selectorTexts = rule.selectors.map(selector => selector.text); |
1110 var matchingSelectorIndexes = this._matchedStyles.matchingSelectors(/** @typ
e {!SDK.CSSStyleRule} */ (rule)); | 1110 var matchingSelectorIndexes = this._matchedStyles.matchingSelectors(/** @typ
e {!SDK.CSSStyleRule} */ (rule)); |
1111 var matchingSelectors = new Array(selectorTexts.length).fill(false); | 1111 var matchingSelectors = /** @type {!Array<boolean>} */ (new Array(selectorTe
xts.length).fill(false)); |
1112 for (var matchingIndex of matchingSelectorIndexes) | 1112 for (var matchingIndex of matchingSelectorIndexes) |
1113 matchingSelectors[matchingIndex] = true; | 1113 matchingSelectors[matchingIndex] = true; |
1114 | 1114 |
1115 if (this._parentPane._isEditingStyle) | 1115 if (this._parentPane._isEditingStyle) |
1116 return; | 1116 return; |
1117 | 1117 |
1118 var fragment = this._hoverableSelectorsMode ? this._renderHoverableSelectors
(selectorTexts, matchingSelectors) : | 1118 var fragment = this._hoverableSelectorsMode ? this._renderHoverableSelectors
(selectorTexts, matchingSelectors) : |
1119 this._renderSimplifiedSelector
s(selectorTexts, matchingSelectors); | 1119 this._renderSimplifiedSelector
s(selectorTexts, matchingSelectors); |
1120 this._selectorElement.removeChildren(); | 1120 this._selectorElement.removeChildren(); |
1121 this._selectorElement.appendChild(fragment); | 1121 this._selectorElement.appendChild(fragment); |
(...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3046 } | 3046 } |
3047 | 3047 |
3048 /** | 3048 /** |
3049 * @override | 3049 * @override |
3050 * @return {!UI.ToolbarItem} | 3050 * @return {!UI.ToolbarItem} |
3051 */ | 3051 */ |
3052 item() { | 3052 item() { |
3053 return this._button; | 3053 return this._button; |
3054 } | 3054 } |
3055 }; | 3055 }; |
OLD | NEW |