| 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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 * @param {!SDK.CSSMatchedStyles} matchedStyles | 641 * @param {!SDK.CSSMatchedStyles} matchedStyles |
| 642 * @param {!Components.Linkifier} linkifier | 642 * @param {!Components.Linkifier} linkifier |
| 643 * @param {?SDK.CSSRule} rule | 643 * @param {?SDK.CSSRule} rule |
| 644 * @return {!Node} | 644 * @return {!Node} |
| 645 */ | 645 */ |
| 646 static createRuleOriginNode(matchedStyles, linkifier, rule) { | 646 static createRuleOriginNode(matchedStyles, linkifier, rule) { |
| 647 if (!rule) | 647 if (!rule) |
| 648 return createTextNode(''); | 648 return createTextNode(''); |
| 649 | 649 |
| 650 var ruleLocation; | 650 var ruleLocation; |
| 651 if (rule instanceof SDK.CSSStyleRule) { | 651 if (rule instanceof SDK.CSSStyleRule) |
| 652 var matchingSelectors = matchedStyles.matchingSelectors(rule); | 652 ruleLocation = rule.style.range; |
| 653 var firstMatchingIndex = matchingSelectors.length ? matchingSelectors[0] :
0; | 653 else if (rule instanceof SDK.CSSKeyframeRule) |
| 654 ruleLocation = rule.selectors[firstMatchingIndex].range; | |
| 655 } else if (rule instanceof SDK.CSSKeyframeRule) { | |
| 656 ruleLocation = rule.key().range; | 654 ruleLocation = rule.key().range; |
| 657 } | |
| 658 | 655 |
| 659 var header = rule.styleSheetId ? matchedStyles.cssModel().styleSheetHeaderFo
rId(rule.styleSheetId) : null; | 656 var header = rule.styleSheetId ? matchedStyles.cssModel().styleSheetHeaderFo
rId(rule.styleSheetId) : null; |
| 660 if (ruleLocation && rule.styleSheetId && header && !header.isAnonymousInline
StyleSheet()) { | 657 if (ruleLocation && rule.styleSheetId && header && !header.isAnonymousInline
StyleSheet()) { |
| 661 return Elements.StylePropertiesSection._linkifyRuleLocation( | 658 return Elements.StylePropertiesSection._linkifyRuleLocation( |
| 662 matchedStyles.cssModel(), linkifier, rule.styleSheetId, ruleLocation); | 659 matchedStyles.cssModel(), linkifier, rule.styleSheetId, ruleLocation); |
| 663 } | 660 } |
| 664 | 661 |
| 665 if (rule.isUserAgent()) | 662 if (rule.isUserAgent()) |
| 666 return createTextNode(Common.UIString('user agent stylesheet')); | 663 return createTextNode(Common.UIString('user agent stylesheet')); |
| 667 if (rule.isInjected()) | 664 if (rule.isInjected()) |
| (...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3049 } | 3046 } |
| 3050 | 3047 |
| 3051 /** | 3048 /** |
| 3052 * @override | 3049 * @override |
| 3053 * @return {!UI.ToolbarItem} | 3050 * @return {!UI.ToolbarItem} |
| 3054 */ | 3051 */ |
| 3055 item() { | 3052 item() { |
| 3056 return this._button; | 3053 return this._button; |
| 3057 } | 3054 } |
| 3058 }; | 3055 }; |
| OLD | NEW |