blob: 64a753a08032623d10db9d6134233e9452bb2d5c [file] [log] [blame]
Blink Reformat4c46d092018-04-07 15:32:371/*
2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14 * its contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
Tim van der Lippe97611c92020-02-12 16:56:5828
29import * as Common from '../common/common.js';
30import * as HostModule from '../host/host.js';
31import * as SDK from '../sdk/sdk.js';
32import * as UI from '../ui/ui.js';
33
Tim van der Lippeaabc8302019-12-10 15:34:4534import {ElementsSidebarPane} from './ElementsSidebarPane.js';
Blink Reformat4c46d092018-04-07 15:32:3735
36/**
37 * @unrestricted
38 */
Tim van der Lippeaabc8302019-12-10 15:34:4539export class MetricsSidebarPane extends ElementsSidebarPane {
Blink Reformat4c46d092018-04-07 15:32:3740 constructor() {
41 super();
42 this.registerRequiredCSS('elements/metricsSidebarPane.css');
43
Tim van der Lippe97611c92020-02-12 16:56:5844 /** @type {?SDK.CSSStyleDeclaration.CSSStyleDeclaration} */
Blink Reformat4c46d092018-04-07 15:32:3745 this._inlineStyle = null;
46 }
47
48 /**
49 * @override
50 * @protected
51 * @return {!Promise.<?>}
52 */
53 doUpdate() {
54 // "style" attribute might have changed. Update metrics unless they are being edited
55 // (if a CSS property is added, a StyleSheetChanged event is dispatched).
Tim van der Lippe1d6e57a2019-09-30 11:55:3456 if (this._isEditingMetrics) {
Blink Reformat4c46d092018-04-07 15:32:3757 return Promise.resolve();
Tim van der Lippe1d6e57a2019-09-30 11:55:3458 }
Blink Reformat4c46d092018-04-07 15:32:3759
60 // FIXME: avoid updates of a collapsed pane.
61 const node = this.node();
62 const cssModel = this.cssModel();
63 if (!node || node.nodeType() !== Node.ELEMENT_NODE || !cssModel) {
64 this.contentElement.removeChildren();
65 return Promise.resolve();
66 }
67
68 /**
69 * @param {?Map.<string, string>} style
Tim van der Lippe13f71fb2019-11-29 11:17:3970 * @this {MetricsSidebarPane}
Blink Reformat4c46d092018-04-07 15:32:3771 */
72 function callback(style) {
Tim van der Lippe1d6e57a2019-09-30 11:55:3473 if (!style || this.node() !== node) {
Blink Reformat4c46d092018-04-07 15:32:3774 return;
Tim van der Lippe1d6e57a2019-09-30 11:55:3475 }
Blink Reformat4c46d092018-04-07 15:32:3776 this._updateMetrics(style);
77 }
78 /**
79 * @param {?SDK.CSSModel.InlineStyleResult} inlineStyleResult
Tim van der Lippe13f71fb2019-11-29 11:17:3980 * @this {MetricsSidebarPane}
Blink Reformat4c46d092018-04-07 15:32:3781 */
82 function inlineStyleCallback(inlineStyleResult) {
Tim van der Lippe1d6e57a2019-09-30 11:55:3483 if (inlineStyleResult && this.node() === node) {
Blink Reformat4c46d092018-04-07 15:32:3784 this._inlineStyle = inlineStyleResult.inlineStyle;
Tim van der Lippe1d6e57a2019-09-30 11:55:3485 }
Blink Reformat4c46d092018-04-07 15:32:3786 }
87
88 const promises = [
89 cssModel.computedStylePromise(node.id).then(callback.bind(this)),
90 cssModel.inlineStylesPromise(node.id).then(inlineStyleCallback.bind(this))
91 ];
92 return Promise.all(promises);
93 }
94
95 /**
96 * @override
97 */
98 onCSSModelChanged() {
99 this.update();
100 }
101
102 /**
103 * @param {!Map.<string, string>} style
104 * @param {string} propertyName
105 * @return {number}
106 */
107 _getPropertyValueAsPx(style, propertyName) {
108 return Number(style.get(propertyName).replace(/px$/, '') || 0);
109 }
110
111 /**
112 * @param {!Map.<string, string>} computedStyle
113 * @param {string} componentName
114 */
115 _getBox(computedStyle, componentName) {
116 const suffix = componentName === 'border' ? '-width' : '';
117 const left = this._getPropertyValueAsPx(computedStyle, componentName + '-left' + suffix);
118 const top = this._getPropertyValueAsPx(computedStyle, componentName + '-top' + suffix);
119 const right = this._getPropertyValueAsPx(computedStyle, componentName + '-right' + suffix);
120 const bottom = this._getPropertyValueAsPx(computedStyle, componentName + '-bottom' + suffix);
121 return {left: left, top: top, right: right, bottom: bottom};
122 }
123
124 /**
125 * @param {boolean} showHighlight
126 * @param {string} mode
127 * @param {!Event} event
128 */
129 _highlightDOMNode(showHighlight, mode, event) {
130 event.consume();
131 if (showHighlight && this.node()) {
Tim van der Lippe1d6e57a2019-09-30 11:55:34132 if (this._highlightMode === mode) {
Blink Reformat4c46d092018-04-07 15:32:37133 return;
Tim van der Lippe1d6e57a2019-09-30 11:55:34134 }
Blink Reformat4c46d092018-04-07 15:32:37135 this._highlightMode = mode;
136 this.node().highlight(mode);
137 } else {
138 delete this._highlightMode;
Tim van der Lippe97611c92020-02-12 16:56:58139 SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight();
Blink Reformat4c46d092018-04-07 15:32:37140 }
141
142 for (let i = 0; this._boxElements && i < this._boxElements.length; ++i) {
143 const element = this._boxElements[i];
Tim van der Lippe1d6e57a2019-09-30 11:55:34144 if (!this.node() || mode === 'all' || element._name === mode) {
Blink Reformat4c46d092018-04-07 15:32:37145 element.style.backgroundColor = element._backgroundColor;
Tim van der Lippe1d6e57a2019-09-30 11:55:34146 } else {
Blink Reformat4c46d092018-04-07 15:32:37147 element.style.backgroundColor = '';
Tim van der Lippe1d6e57a2019-09-30 11:55:34148 }
Blink Reformat4c46d092018-04-07 15:32:37149 }
150 }
151
152 /**
153 * @param {!Map.<string, string>} style
154 */
155 _updateMetrics(style) {
156 // Updating with computed style.
157 const metricsElement = createElement('div');
158 metricsElement.className = 'metrics';
159 const self = this;
160
161 /**
162 * @param {!Map.<string, string>} style
163 * @param {string} name
164 * @param {string} side
165 * @param {string} suffix
Tim van der Lippe13f71fb2019-11-29 11:17:39166 * @this {MetricsSidebarPane}
Blink Reformat4c46d092018-04-07 15:32:37167 */
168 function createBoxPartElement(style, name, side, suffix) {
169 const propertyName = (name !== 'position' ? name + '-' : '') + side + suffix;
170 let value = style.get(propertyName);
Tim van der Lippe1d6e57a2019-09-30 11:55:34171 if (value === '' || (name !== 'position' && value === '0px')) {
Blink Reformat4c46d092018-04-07 15:32:37172 value = '\u2012';
Tim van der Lippe1d6e57a2019-09-30 11:55:34173 } else if (name === 'position' && value === 'auto') {
Blink Reformat4c46d092018-04-07 15:32:37174 value = '\u2012';
Tim van der Lippe1d6e57a2019-09-30 11:55:34175 }
Blink Reformat4c46d092018-04-07 15:32:37176 value = value.replace(/px$/, '');
177 value = Number.toFixedIfFloating(value);
178
179 const element = createElement('div');
180 element.className = side;
181 element.textContent = value;
182 element.addEventListener('dblclick', this.startEditing.bind(this, element, name, propertyName, style), false);
183 return element;
184 }
185
186 /**
187 * @param {!Map.<string, string>} style
188 * @return {string}
189 */
190 function getContentAreaWidthPx(style) {
191 let width = style.get('width').replace(/px$/, '');
192 if (!isNaN(width) && style.get('box-sizing') === 'border-box') {
193 const borderBox = self._getBox(style, 'border');
194 const paddingBox = self._getBox(style, 'padding');
195
196 width = width - borderBox.left - borderBox.right - paddingBox.left - paddingBox.right;
197 }
198
199 return Number.toFixedIfFloating(width.toString());
200 }
201
202 /**
203 * @param {!Map.<string, string>} style
204 * @return {string}
205 */
206 function getContentAreaHeightPx(style) {
207 let height = style.get('height').replace(/px$/, '');
208 if (!isNaN(height) && style.get('box-sizing') === 'border-box') {
209 const borderBox = self._getBox(style, 'border');
210 const paddingBox = self._getBox(style, 'padding');
211
212 height = height - borderBox.top - borderBox.bottom - paddingBox.top - paddingBox.bottom;
213 }
214
215 return Number.toFixedIfFloating(height.toString());
216 }
217
218 // Display types for which margin is ignored.
219 const noMarginDisplayType = {
220 'table-cell': true,
221 'table-column': true,
222 'table-column-group': true,
223 'table-footer-group': true,
224 'table-header-group': true,
225 'table-row': true,
226 'table-row-group': true
227 };
228
229 // Display types for which padding is ignored.
230 const noPaddingDisplayType = {
231 'table-column': true,
232 'table-column-group': true,
233 'table-footer-group': true,
234 'table-header-group': true,
235 'table-row': true,
236 'table-row-group': true
237 };
238
239 // Position types for which top, left, bottom and right are ignored.
240 const noPositionType = {'static': true};
241
242 const boxes = ['content', 'padding', 'border', 'margin', 'position'];
243 const boxColors = [
244 Common.Color.PageHighlight.Content, Common.Color.PageHighlight.Padding, Common.Color.PageHighlight.Border,
Tim van der Lippe97611c92020-02-12 16:56:58245 Common.Color.PageHighlight.Margin, Common.Color.Color.fromRGBA([0, 0, 0, 0])
Blink Reformat4c46d092018-04-07 15:32:37246 ];
247 const boxLabels = [
Tim van der Lippe97611c92020-02-12 16:56:58248 Common.UIString.UIString('content'), Common.UIString.UIString('padding'), Common.UIString.UIString('border'),
249 Common.UIString.UIString('margin'), Common.UIString.UIString('position')
Blink Reformat4c46d092018-04-07 15:32:37250 ];
251 let previousBox = null;
252 this._boxElements = [];
253 for (let i = 0; i < boxes.length; ++i) {
254 const name = boxes[i];
255
Tim van der Lippe1d6e57a2019-09-30 11:55:34256 if (name === 'margin' && noMarginDisplayType[style.get('display')]) {
Blink Reformat4c46d092018-04-07 15:32:37257 continue;
Tim van der Lippe1d6e57a2019-09-30 11:55:34258 }
259 if (name === 'padding' && noPaddingDisplayType[style.get('display')]) {
Blink Reformat4c46d092018-04-07 15:32:37260 continue;
Tim van der Lippe1d6e57a2019-09-30 11:55:34261 }
262 if (name === 'position' && noPositionType[style.get('position')]) {
Blink Reformat4c46d092018-04-07 15:32:37263 continue;
Tim van der Lippe1d6e57a2019-09-30 11:55:34264 }
Blink Reformat4c46d092018-04-07 15:32:37265
266 const boxElement = createElement('div');
267 boxElement.className = name;
268 boxElement._backgroundColor = boxColors[i].asString(Common.Color.Format.RGBA);
269 boxElement._name = name;
270 boxElement.style.backgroundColor = boxElement._backgroundColor;
271 boxElement.addEventListener(
272 'mouseover', this._highlightDOMNode.bind(this, true, name === 'position' ? 'all' : name), false);
273 this._boxElements.push(boxElement);
274
275 if (name === 'content') {
276 const widthElement = createElement('span');
277 widthElement.textContent = getContentAreaWidthPx(style);
278 widthElement.addEventListener(
279 'dblclick', this.startEditing.bind(this, widthElement, 'width', 'width', style), false);
280
281 const heightElement = createElement('span');
282 heightElement.textContent = getContentAreaHeightPx(style);
283 heightElement.addEventListener(
284 'dblclick', this.startEditing.bind(this, heightElement, 'height', 'height', style), false);
285
286 boxElement.appendChild(widthElement);
287 boxElement.createTextChild(' \u00D7 ');
288 boxElement.appendChild(heightElement);
289 } else {
290 const suffix = (name === 'border' ? '-width' : '');
291
292 const labelElement = createElement('div');
293 labelElement.className = 'label';
294 labelElement.textContent = boxLabels[i];
295 boxElement.appendChild(labelElement);
296
297 boxElement.appendChild(createBoxPartElement.call(this, style, name, 'top', suffix));
298 boxElement.appendChild(createElement('br'));
299 boxElement.appendChild(createBoxPartElement.call(this, style, name, 'left', suffix));
300
Tim van der Lippe1d6e57a2019-09-30 11:55:34301 if (previousBox) {
Blink Reformat4c46d092018-04-07 15:32:37302 boxElement.appendChild(previousBox);
Tim van der Lippe1d6e57a2019-09-30 11:55:34303 }
Blink Reformat4c46d092018-04-07 15:32:37304
305 boxElement.appendChild(createBoxPartElement.call(this, style, name, 'right', suffix));
306 boxElement.appendChild(createElement('br'));
307 boxElement.appendChild(createBoxPartElement.call(this, style, name, 'bottom', suffix));
308 }
309
310 previousBox = boxElement;
311 }
312
313 metricsElement.appendChild(previousBox);
314 metricsElement.addEventListener('mouseover', this._highlightDOMNode.bind(this, false, 'all'), false);
315 this.contentElement.removeChildren();
316 this.contentElement.appendChild(metricsElement);
James Lissiakd2f1a2f2019-03-26 17:36:51317
318 // Record the elements tool load time after the sidepane has loaded.
Tim van der Lippe97611c92020-02-12 16:56:58319 HostModule.userMetrics.panelLoaded('elements', 'DevTools.Launch.Elements');
Blink Reformat4c46d092018-04-07 15:32:37320 }
321
322 /**
323 * @param {!Element} targetElement
324 * @param {string} box
325 * @param {string} styleProperty
326 * @param {!Map.<string, string>} computedStyle
327 */
328 startEditing(targetElement, box, styleProperty, computedStyle) {
Tim van der Lippe97611c92020-02-12 16:56:58329 if (UI.UIUtils.isBeingEdited(targetElement)) {
Blink Reformat4c46d092018-04-07 15:32:37330 return;
Tim van der Lippe1d6e57a2019-09-30 11:55:34331 }
Blink Reformat4c46d092018-04-07 15:32:37332
333 const context = {box: box, styleProperty: styleProperty, computedStyle: computedStyle};
334 const boundKeyDown = this._handleKeyDown.bind(this, context, styleProperty);
335 context.keyDownHandler = boundKeyDown;
336 targetElement.addEventListener('keydown', boundKeyDown, false);
337
338 this._isEditingMetrics = true;
339
340 const config =
341 new UI.InplaceEditor.Config(this._editingCommitted.bind(this), this.editingCancelled.bind(this), context);
Tim van der Lippe97611c92020-02-12 16:56:58342 UI.InplaceEditor.InplaceEditor.startEditing(targetElement, config);
Blink Reformat4c46d092018-04-07 15:32:37343
344 targetElement.getComponentSelection().selectAllChildren(targetElement);
345 }
346
347 _handleKeyDown(context, styleProperty, event) {
348 const element = event.currentTarget;
349
350 /**
351 * @param {string} originalValue
352 * @param {string} replacementString
Tim van der Lippe13f71fb2019-11-29 11:17:39353 * @this {MetricsSidebarPane}
Blink Reformat4c46d092018-04-07 15:32:37354 */
355 function finishHandler(originalValue, replacementString) {
356 this._applyUserInput(element, replacementString, originalValue, context, false);
357 }
358
359 /**
360 * @param {string} prefix
361 * @param {number} number
362 * @param {string} suffix
363 * @return {string}
364 */
365 function customNumberHandler(prefix, number, suffix) {
Tim van der Lippe1d6e57a2019-09-30 11:55:34366 if (styleProperty !== 'margin' && number < 0) {
Blink Reformat4c46d092018-04-07 15:32:37367 number = 0;
Tim van der Lippe1d6e57a2019-09-30 11:55:34368 }
Blink Reformat4c46d092018-04-07 15:32:37369 return prefix + number + suffix;
370 }
371
Tim van der Lippe97611c92020-02-12 16:56:58372 UI.UIUtils.handleElementValueModifications(
373 event, element, finishHandler.bind(this), undefined, customNumberHandler);
Blink Reformat4c46d092018-04-07 15:32:37374 }
375
376 editingEnded(element, context) {
377 delete this.originalPropertyData;
378 delete this.previousPropertyDataCandidate;
379 element.removeEventListener('keydown', context.keyDownHandler, false);
380 delete this._isEditingMetrics;
381 }
382
383 editingCancelled(element, context) {
384 if ('originalPropertyData' in this && this._inlineStyle) {
385 if (!this.originalPropertyData) {
386 // An added property, remove the last property in the style.
387 const pastLastSourcePropertyIndex = this._inlineStyle.pastLastSourcePropertyIndex();
Tim van der Lippe1d6e57a2019-09-30 11:55:34388 if (pastLastSourcePropertyIndex) {
Blink Reformat4c46d092018-04-07 15:32:37389 this._inlineStyle.allProperties()[pastLastSourcePropertyIndex - 1].setText('', false);
Tim van der Lippe1d6e57a2019-09-30 11:55:34390 }
Blink Reformat4c46d092018-04-07 15:32:37391 } else {
392 this._inlineStyle.allProperties()[this.originalPropertyData.index].setText(
393 this.originalPropertyData.propertyText, false);
394 }
395 }
396 this.editingEnded(element, context);
397 this.update();
398 }
399
400 _applyUserInput(element, userInput, previousContent, context, commitEditor) {
401 if (!this._inlineStyle) {
402 // Element has no renderer.
403 return this.editingCancelled(element, context); // nothing changed, so cancel
404 }
405
Tim van der Lippe1d6e57a2019-09-30 11:55:34406 if (commitEditor && userInput === previousContent) {
407 return this.editingCancelled(element, context);
408 } // nothing changed, so cancel
Blink Reformat4c46d092018-04-07 15:32:37409
Tim van der Lippe1d6e57a2019-09-30 11:55:34410 if (context.box !== 'position' && (!userInput || userInput === '\u2012')) {
Blink Reformat4c46d092018-04-07 15:32:37411 userInput = '0px';
Tim van der Lippe1d6e57a2019-09-30 11:55:34412 } else if (context.box === 'position' && (!userInput || userInput === '\u2012')) {
Blink Reformat4c46d092018-04-07 15:32:37413 userInput = 'auto';
Tim van der Lippe1d6e57a2019-09-30 11:55:34414 }
Blink Reformat4c46d092018-04-07 15:32:37415
416 userInput = userInput.toLowerCase();
417 // Append a "px" unit if the user input was just a number.
Tim van der Lippe1d6e57a2019-09-30 11:55:34418 if (/^\d+$/.test(userInput)) {
Blink Reformat4c46d092018-04-07 15:32:37419 userInput += 'px';
Tim van der Lippe1d6e57a2019-09-30 11:55:34420 }
Blink Reformat4c46d092018-04-07 15:32:37421
422 const styleProperty = context.styleProperty;
423 const computedStyle = context.computedStyle;
424
425 if (computedStyle.get('box-sizing') === 'border-box' && (styleProperty === 'width' || styleProperty === 'height')) {
426 if (!userInput.match(/px$/)) {
Paul Lewis04ccecc2020-01-22 17:15:14427 self.Common.console.error(
Blink Reformat4c46d092018-04-07 15:32:37428 'For elements with box-sizing: border-box, only absolute content area dimensions can be applied');
429 return;
430 }
431
432 const borderBox = this._getBox(computedStyle, 'border');
433 const paddingBox = this._getBox(computedStyle, 'padding');
434 let userValuePx = Number(userInput.replace(/px$/, ''));
Tim van der Lippe1d6e57a2019-09-30 11:55:34435 if (isNaN(userValuePx)) {
Blink Reformat4c46d092018-04-07 15:32:37436 return;
Tim van der Lippe1d6e57a2019-09-30 11:55:34437 }
438 if (styleProperty === 'width') {
Blink Reformat4c46d092018-04-07 15:32:37439 userValuePx += borderBox.left + borderBox.right + paddingBox.left + paddingBox.right;
Tim van der Lippe1d6e57a2019-09-30 11:55:34440 } else {
Blink Reformat4c46d092018-04-07 15:32:37441 userValuePx += borderBox.top + borderBox.bottom + paddingBox.top + paddingBox.bottom;
Tim van der Lippe1d6e57a2019-09-30 11:55:34442 }
Blink Reformat4c46d092018-04-07 15:32:37443
444 userInput = userValuePx + 'px';
445 }
446
447 this.previousPropertyDataCandidate = null;
448
449 const allProperties = this._inlineStyle.allProperties();
450 for (let i = 0; i < allProperties.length; ++i) {
451 const property = allProperties[i];
Tim van der Lippe1d6e57a2019-09-30 11:55:34452 if (property.name !== context.styleProperty || !property.activeInStyle()) {
Blink Reformat4c46d092018-04-07 15:32:37453 continue;
Tim van der Lippe1d6e57a2019-09-30 11:55:34454 }
Blink Reformat4c46d092018-04-07 15:32:37455
456 this.previousPropertyDataCandidate = property;
457 property.setValue(userInput, commitEditor, true, callback.bind(this));
458 return;
459 }
460
461 this._inlineStyle.appendProperty(context.styleProperty, userInput, callback.bind(this));
462
463 /**
464 * @param {boolean} success
Tim van der Lippe13f71fb2019-11-29 11:17:39465 * @this {MetricsSidebarPane}
Blink Reformat4c46d092018-04-07 15:32:37466 */
467 function callback(success) {
Tim van der Lippe1d6e57a2019-09-30 11:55:34468 if (!success) {
Blink Reformat4c46d092018-04-07 15:32:37469 return;
Tim van der Lippe1d6e57a2019-09-30 11:55:34470 }
471 if (!('originalPropertyData' in this)) {
Blink Reformat4c46d092018-04-07 15:32:37472 this.originalPropertyData = this.previousPropertyDataCandidate;
Tim van der Lippe1d6e57a2019-09-30 11:55:34473 }
Blink Reformat4c46d092018-04-07 15:32:37474
Tim van der Lippe1d6e57a2019-09-30 11:55:34475 if (typeof this._highlightMode !== 'undefined') {
Blink Reformat4c46d092018-04-07 15:32:37476 this.node().highlight(this._highlightMode);
Tim van der Lippe1d6e57a2019-09-30 11:55:34477 }
Blink Reformat4c46d092018-04-07 15:32:37478
Tim van der Lippe1d6e57a2019-09-30 11:55:34479 if (commitEditor) {
Blink Reformat4c46d092018-04-07 15:32:37480 this.update();
Tim van der Lippe1d6e57a2019-09-30 11:55:34481 }
Blink Reformat4c46d092018-04-07 15:32:37482 }
483 }
484
485 _editingCommitted(element, userInput, previousContent, context) {
486 this.editingEnded(element, context);
487 this._applyUserInput(element, userInput, previousContent, context, true);
488 }
Tim van der Lippe13f71fb2019-11-29 11:17:39489}