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

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

Issue 1418763003: DevTools: [SSP] treat new rules out of style cascade. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kill-style-rule
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/StylesSectionModel.js ('k') | no next file » | 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 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 WebInspector.BlankStylePropertiesSection = function(stylesPane, cascade, default SelectorText, styleSheetId, ruleLocation, insertAfterStyle) 1663 WebInspector.BlankStylePropertiesSection = function(stylesPane, cascade, default SelectorText, styleSheetId, ruleLocation, insertAfterStyle)
1664 { 1664 {
1665 var rule = WebInspector.CSSRule.createDummyRule(stylesPane._cssModel, defaul tSelectorText); 1665 var rule = WebInspector.CSSRule.createDummyRule(stylesPane._cssModel, defaul tSelectorText);
1666 WebInspector.StylePropertiesSection.call(this, stylesPane, cascade, rule.sty le); 1666 WebInspector.StylePropertiesSection.call(this, stylesPane, cascade, rule.sty le);
1667 this._ruleLocation = ruleLocation; 1667 this._ruleLocation = ruleLocation;
1668 this._styleSheetId = styleSheetId; 1668 this._styleSheetId = styleSheetId;
1669 this._selectorRefElement.removeChildren(); 1669 this._selectorRefElement.removeChildren();
1670 this._selectorRefElement.appendChild(WebInspector.StylePropertiesSection._li nkifyRuleLocation(this._parentPane._cssModel, this._parentPane._linkifier, style SheetId, this._actualRuleLocation())); 1670 this._selectorRefElement.appendChild(WebInspector.StylePropertiesSection._li nkifyRuleLocation(this._parentPane._cssModel, this._parentPane._linkifier, style SheetId, this._actualRuleLocation()));
1671 if (insertAfterStyle && insertAfterStyle.parentRule) 1671 if (insertAfterStyle && insertAfterStyle.parentRule)
1672 this._createMediaList(insertAfterStyle.parentRule.media); 1672 this._createMediaList(insertAfterStyle.parentRule.media);
1673 this._insertAfterStyle = insertAfterStyle;
1674 this.element.classList.add("blank-section"); 1673 this.element.classList.add("blank-section");
1675 } 1674 }
1676 1675
1677 WebInspector.BlankStylePropertiesSection.prototype = { 1676 WebInspector.BlankStylePropertiesSection.prototype = {
1678 /** 1677 /**
1679 * @return {!WebInspector.TextRange} 1678 * @return {!WebInspector.TextRange}
1680 */ 1679 */
1681 _actualRuleLocation: function() 1680 _actualRuleLocation: function()
1682 { 1681 {
1683 var prefix = this._rulePrefix(); 1682 var prefix = this._rulePrefix();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 this._editingSelectorEnded(); 1770 this._editingSelectorEnded();
1772 this._parentPane.removeSection(this); 1771 this._parentPane.removeSection(this);
1773 }, 1772 },
1774 1773
1775 /** 1774 /**
1776 * @param {!WebInspector.CSSRule} newRule 1775 * @param {!WebInspector.CSSRule} newRule
1777 */ 1776 */
1778 _makeNormal: function(newRule) 1777 _makeNormal: function(newRule)
1779 { 1778 {
1780 this.element.classList.remove("blank-section"); 1779 this.element.classList.remove("blank-section");
1781 this._cascade.insertStyle(newRule.style, this._insertAfterStyle);
1782 this._style = newRule.style; 1780 this._style = newRule.style;
1783
1784 // FIXME: replace this instance by a normal WebInspector.StyleProperties Section. 1781 // FIXME: replace this instance by a normal WebInspector.StyleProperties Section.
1785 this._normal = true; 1782 this._normal = true;
1786 }, 1783 },
1787 1784
1788 __proto__: WebInspector.StylePropertiesSection.prototype 1785 __proto__: WebInspector.StylePropertiesSection.prototype
1789 } 1786 }
1790 1787
1791 /** 1788 /**
1792 * @constructor 1789 * @constructor
1793 * @extends {TreeElement} 1790 * @extends {TreeElement}
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
3010 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha nged); 3007 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeCha nged);
3011 onNodeChanged(); 3008 onNodeChanged();
3012 return button; 3009 return button;
3013 3010
3014 function onNodeChanged() 3011 function onNodeChanged()
3015 { 3012 {
3016 var node = WebInspector.context.flavor(WebInspector.DOMNode); 3013 var node = WebInspector.context.flavor(WebInspector.DOMNode);
3017 button.setEnabled(!!node); 3014 button.setEnabled(!!node);
3018 } 3015 }
3019 } 3016 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/elements/StylesSectionModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698