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

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

Issue 2421983002: [DevTools] Remove layout editor experiment. (Closed)
Patch Set: rebased 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 29 matching lines...) Expand all
40 40
41 this._sectionsContainer = this.element.createChild('div'); 41 this._sectionsContainer = this.element.createChild('div');
42 this._swatchPopoverHelper = new UI.SwatchPopoverHelper(); 42 this._swatchPopoverHelper = new UI.SwatchPopoverHelper();
43 this._linkifier = new Components.Linkifier(Elements.StylesSidebarPane._maxLi nkLength, /* useLinkDecorator */ true); 43 this._linkifier = new Components.Linkifier(Elements.StylesSidebarPane._maxLi nkLength, /* useLinkDecorator */ true);
44 44
45 this.element.classList.add('styles-pane'); 45 this.element.classList.add('styles-pane');
46 46
47 /** @type {!Array<!Elements.SectionBlock>} */ 47 /** @type {!Array<!Elements.SectionBlock>} */
48 this._sectionBlocks = []; 48 this._sectionBlocks = [];
49 Elements.StylesSidebarPane._instance = this; 49 Elements.StylesSidebarPane._instance = this;
50
51 SDK.targetManager.addModelListener(
52 SDK.CSSModel, SDK.CSSModel.Events.LayoutEditorChange, this._onLayoutEdit orChange, this);
53 UI.context.addFlavorChangeListener(SDK.DOMNode, this.forceUpdate, this); 50 UI.context.addFlavorChangeListener(SDK.DOMNode, this.forceUpdate, this);
54 } 51 }
55 52
56 /** 53 /**
57 * @param {!SDK.CSSProperty} property 54 * @param {!SDK.CSSProperty} property
58 * @return {!Element} 55 * @return {!Element}
59 */ 56 */
60 static createExclamationMark(property) { 57 static createExclamationMark(property) {
61 var exclamationElement = createElement('label', 'dt-icon-label'); 58 var exclamationElement = createElement('label', 'dt-icon-label');
62 exclamationElement.className = 'exclamation-mark'; 59 exclamationElement.className = 'exclamation-mark';
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 function setFilterValue(value) { 141 function setFilterValue(value) {
145 input.value = value; 142 input.value = value;
146 input.focus(); 143 input.focus();
147 searchHandler(); 144 searchHandler();
148 } 145 }
149 146
150 return input; 147 return input;
151 } 148 }
152 149
153 /** 150 /**
154 * @param {!Common.Event} event
155 */
156 _onLayoutEditorChange(event) {
157 var cssModel = /** @type {!SDK.CSSModel} */ (event.target);
158 var styleSheetId = event.data['id'];
159 var sourceRange = /** @type {!Protocol.CSS.SourceRange} */ (event.data['rang e']);
160 var range = Common.TextRange.fromObject(sourceRange);
161 this._decorator = new Elements.PropertyChangeHighlighter(this, cssModel, sty leSheetId, range);
162 this.update();
163 }
164
165 /**
166 * @param {!SDK.CSSProperty} cssProperty 151 * @param {!SDK.CSSProperty} cssProperty
167 */ 152 */
168 revealProperty(cssProperty) { 153 revealProperty(cssProperty) {
169 this._decorator = new Elements.PropertyRevealHighlighter(this, cssProperty); 154 this._decorator = new Elements.StylePropertyHighlighter(this, cssProperty);
170 this._decorator.perform(); 155 this._decorator.perform();
171 this.update(); 156 this.update();
172 } 157 }
173 158
174 forceUpdate() { 159 forceUpdate() {
175 this._swatchPopoverHelper.hide(); 160 this._swatchPopoverHelper.hide();
176 this._resetCache(); 161 this._resetCache();
177 this.update(); 162 this.update();
178 } 163 }
179 164
(...skipping 2876 matching lines...) Expand 10 before | Expand all | Expand 10 after
3056 } 3041 }
3057 3042
3058 /** 3043 /**
3059 * @override 3044 * @override
3060 * @return {!UI.ToolbarItem} 3045 * @return {!UI.ToolbarItem}
3061 */ 3046 */
3062 item() { 3047 item() {
3063 return this._button; 3048 return this._button;
3064 } 3049 }
3065 }; 3050 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698