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

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

Issue 2545883005: DevTools: support sourceMappingURL for the inline stylesheets (Closed)
Patch Set: address comments Created 4 years 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
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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 this.element.addEventListener('click', this._handleEmptySpaceClick.bind(this ), false); 618 this.element.addEventListener('click', this._handleEmptySpaceClick.bind(this ), false);
619 this.element.addEventListener('mousemove', this._onMouseMove.bind(this), fal se); 619 this.element.addEventListener('mousemove', this._onMouseMove.bind(this), fal se);
620 this.element.addEventListener('mouseleave', this._setSectionHovered.bind(thi s, false), false); 620 this.element.addEventListener('mouseleave', this._setSectionHovered.bind(thi s, false), false);
621 621
622 if (rule) { 622 if (rule) {
623 // Prevent editing the user agent and user rules. 623 // Prevent editing the user agent and user rules.
624 if (rule.isUserAgent() || rule.isInjected()) { 624 if (rule.isUserAgent() || rule.isInjected()) {
625 this.editable = false; 625 this.editable = false;
626 } else { 626 } else {
627 // Check this is a real CSSRule, not a bogus object coming from Elements .BlankStylePropertiesSection. 627 // Check this is a real CSSRule, not a bogus object coming from Elements .BlankStylePropertiesSection.
628 if (rule.styleSheetId) 628 if (rule.styleSheetId) {
629 this.navigable = !!rule.resourceURL(); 629 var header = rule.cssModel().styleSheetHeaderForId(rule.styleSheetId);
630 this.navigable = !header.isAnonymousInlineStyleSheet();
631 }
630 } 632 }
631 } 633 }
632 634
633 this._mediaListElement = this._titleElement.createChild('div', 'media-list m edia-matches'); 635 this._mediaListElement = this._titleElement.createChild('div', 'media-list m edia-matches');
634 this._selectorRefElement = this._titleElement.createChild('div', 'styles-sec tion-subtitle'); 636 this._selectorRefElement = this._titleElement.createChild('div', 'styles-sec tion-subtitle');
635 this._updateMediaList(); 637 this._updateMediaList();
636 this._updateRuleOrigin(); 638 this._updateRuleOrigin();
637 this._titleElement.appendChild(selectorContainer); 639 this._titleElement.appendChild(selectorContainer);
638 this._selectorContainer = selectorContainer; 640 this._selectorContainer = selectorContainer;
639 641
(...skipping 23 matching lines...) Expand all
663 var ruleLocation; 665 var ruleLocation;
664 if (rule instanceof SDK.CSSStyleRule) { 666 if (rule instanceof SDK.CSSStyleRule) {
665 var matchingSelectors = matchedStyles.matchingSelectors(rule); 667 var matchingSelectors = matchedStyles.matchingSelectors(rule);
666 var firstMatchingIndex = matchingSelectors.length ? matchingSelectors[0] : 0; 668 var firstMatchingIndex = matchingSelectors.length ? matchingSelectors[0] : 0;
667 ruleLocation = rule.selectors[firstMatchingIndex].range; 669 ruleLocation = rule.selectors[firstMatchingIndex].range;
668 } else if (rule instanceof SDK.CSSKeyframeRule) { 670 } else if (rule instanceof SDK.CSSKeyframeRule) {
669 ruleLocation = rule.key().range; 671 ruleLocation = rule.key().range;
670 } 672 }
671 673
672 var header = rule.styleSheetId ? matchedStyles.cssModel().styleSheetHeaderFo rId(rule.styleSheetId) : null; 674 var header = rule.styleSheetId ? matchedStyles.cssModel().styleSheetHeaderFo rId(rule.styleSheetId) : null;
673 if (ruleLocation && rule.styleSheetId && header && header.resourceURL()) { 675 if (ruleLocation && rule.styleSheetId && header && !header.isAnonymousInline StyleSheet()) {
674 return Elements.StylePropertiesSection._linkifyRuleLocation( 676 return Elements.StylePropertiesSection._linkifyRuleLocation(
675 matchedStyles.cssModel(), linkifier, rule.styleSheetId, ruleLocation); 677 matchedStyles.cssModel(), linkifier, rule.styleSheetId, ruleLocation);
676 } 678 }
677 679
678 if (rule.isUserAgent()) 680 if (rule.isUserAgent())
679 return createTextNode(Common.UIString('user agent stylesheet')); 681 return createTextNode(Common.UIString('user agent stylesheet'));
680 if (rule.isInjected()) 682 if (rule.isInjected())
681 return createTextNode(Common.UIString('injected stylesheet')); 683 return createTextNode(Common.UIString('injected stylesheet'));
682 if (rule.isViaInspector()) 684 if (rule.isViaInspector())
683 return createTextNode(Common.UIString('via inspector')); 685 return createTextNode(Common.UIString('via inspector'));
(...skipping 2375 matching lines...) Expand 10 before | Expand all | Expand 10 after
3059 } 3061 }
3060 3062
3061 /** 3063 /**
3062 * @override 3064 * @override
3063 * @return {!UI.ToolbarItem} 3065 * @return {!UI.ToolbarItem}
3064 */ 3066 */
3065 item() { 3067 item() {
3066 return this._button; 3068 return this._button;
3067 } 3069 }
3068 }; 3070 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698