Commit 311527e5 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[devtools] Remove title option from combo box entries

The title is not showing anyway, because <option> elements are not
supposed to have a title property as per spec, and the browser
discards the property.

Bug: chromium:1005142
Change-Id: I89f24cd159a5cdbdbeadf71bc31a88abc00076ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1815876Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698842}
parent 3ee19b68
......@@ -63,7 +63,7 @@ Elements.EventListenersWidget = class extends UI.ThrottledWidget {
* @this {Elements.EventListenersWidget}
*/
function addDispatchFilterOption(name, value) {
const option = dispatchFilter.createOption(name, '', value);
const option = dispatchFilter.createOption(name, value);
if (value === this._dispatchFilterBySetting.get())
dispatchFilter.select(option);
}
......
......@@ -43,7 +43,7 @@ Network.BinaryResourceView = class extends UI.VBox {
this._binaryViewTypeCombobox = new UI.ToolbarComboBox(this._binaryViewTypeChanged.bind(this));
for (const viewObject of this._binaryViewObjects) {
this._binaryViewTypeCombobox.addOption(
this._binaryViewTypeCombobox.createOption(viewObject.label, viewObject.label, viewObject.type));
this._binaryViewTypeCombobox.createOption(viewObject.label, viewObject.type));
}
this._toolbar.appendToolbarItem(this._binaryViewTypeCombobox);
......
......@@ -66,7 +66,7 @@ Network.ResourceWebSocketFrameView = class extends UI.VBox {
this._filterTypeCombobox = new UI.ToolbarComboBox(this._updateFilterSetting.bind(this));
for (const filterItem of Network.ResourceWebSocketFrameView._filterTypes) {
const option = this._filterTypeCombobox.createOption(filterItem.label, filterItem.label, filterItem.name);
const option = this._filterTypeCombobox.createOption(filterItem.label, filterItem.name);
this._filterTypeCombobox.addOption(option);
}
this._mainToolbar.appendToolbarItem(this._filterTypeCombobox);
......
......@@ -657,7 +657,7 @@ Profiler.HeapSnapshotView = class extends UI.SimpleView {
this._perspectiveSelect.removeOptions();
this._perspectives.forEach((perspective, index) => {
if (multipleSnapshots || perspective !== this._comparisonPerspective)
this._perspectiveSelect.createOption(perspective.title(), '', String(index));
this._perspectiveSelect.createOption(perspective.title(), String(index));
});
}
......
......@@ -103,7 +103,7 @@ Profiler.ProfileView = class extends UI.SimpleView {
]);
const options =
new Map(viewTypes.map(type => [type, this.viewSelectComboBox.createOption(optionNames.get(type), '', type)]));
new Map(viewTypes.map(type => [type, this.viewSelectComboBox.createOption(optionNames.get(type), type)]));
const optionName = this._viewType.get() || viewTypes[0];
const option = options.get(optionName) || options.get(viewTypes[0]);
this.viewSelectComboBox.select(option);
......
......@@ -32,11 +32,11 @@ Sources.BreakpointEditDialog = class extends UI.Widget {
toolbar.appendText(`Line ${editorLineNumber + 1}:`);
this._typeSelector = new UI.ToolbarComboBox(this._onTypeChanged.bind(this));
this._typeSelector.createOption(ls`Breakpoint`, '', Sources.BreakpointEditDialog.BreakpointType.Breakpoint);
this._typeSelector.createOption(ls`Breakpoint`, Sources.BreakpointEditDialog.BreakpointType.Breakpoint);
const conditionalOption = this._typeSelector.createOption(
ls`Conditional breakpoint`, '', Sources.BreakpointEditDialog.BreakpointType.Conditional);
ls`Conditional breakpoint`, Sources.BreakpointEditDialog.BreakpointType.Conditional);
const logpointOption =
this._typeSelector.createOption(ls`Logpoint`, '', Sources.BreakpointEditDialog.BreakpointType.Logpoint);
this._typeSelector.createOption(ls`Logpoint`, Sources.BreakpointEditDialog.BreakpointType.Logpoint);
this._typeSelector.select(this._isLogpoint ? logpointOption : conditionalOption);
toolbar.appendToolbarItem(this._typeSelector);
......
......@@ -163,8 +163,6 @@ Timeline.EventsTimelineTreeView.Filters = class extends Common.Object {
for (const durationMs of Timeline.EventsTimelineTreeView.Filters._durationFilterPresetsMs) {
durationFilterUI.addOption(durationFilterUI.createOption(
durationMs ? Common.UIString('\u2265 %d\xa0ms', durationMs) : Common.UIString('All'),
durationMs ? Common.UIString('Hide records shorter than %d\xa0ms', durationMs) :
Common.UIString('Show all records'),
String(durationMs)));
}
UI.ARIAUtils.setAccessibleName(durationFilterUI.selectElement(), ls`Duration filter`);
......
......@@ -436,9 +436,6 @@ Click the reload button <ph name="RELOADBUTTON">$3s<ex>reload</ex></ph> or hit <
<message name="IDS_DEVTOOLS_6a389f626da11df07508bf251de59c23" desc="Text in Timeline UIUtils of the Performance panel">
Frame Start
</message>
<message name="IDS_DEVTOOLS_6aafe894685594a908a8996d68e88028" desc="Text in Events Timeline Tree View of the Performance panel">
Hide records shorter than <ph name="DURATIONMS">$1d<ex>2</ex></ph> ms
</message>
<message name="IDS_DEVTOOLS_6c906c5f560faeb38f51683bc22fb212" desc="Text in Timeline Tree View of the Performance panel">
Group by Subdomain
</message>
......@@ -843,9 +840,6 @@ Then, zoom and pan the timeline with the mousewheel or <ph name="NAVIGATENODE">$
<message name="IDS_DEVTOOLS_dc16531c312e4d4c024ffd577d123887" desc="Text in Counters Graph of the Performance panel">
Listeners
</message>
<message name="IDS_DEVTOOLS_dc63e2b8b0f6f66d3dd2dc5d49483eec" desc="Text in Events Timeline Tree View of the Performance panel">
Show all records
</message>
<message name="IDS_DEVTOOLS_dd694dc279a5fbefed6a8323c15f4e67" desc="Text in Timeline UIUtils of the Performance panel">
Cancel Idle Callback
</message>
......
......@@ -887,15 +887,12 @@ UI.ToolbarComboBox = class extends UI.ToolbarItem {
/**
* @param {string} label
* @param {string=} title
* @param {string=} value
* @return {!Element}
*/
createOption(label, title, value) {
createOption(label, value) {
const option = this._selectElement.createChild('option');
option.text = label;
if (title)
option.title = title;
if (typeof value !== 'undefined')
option.value = value;
return option;
......@@ -971,7 +968,7 @@ UI.ToolbarComboBox = class extends UI.ToolbarItem {
*/
UI.ToolbarSettingComboBox = class extends UI.ToolbarComboBox {
/**
* @param {!Array<!{value: string, label: string, title: string}>} options
* @param {!Array<!{value: string, label: string}>} options
* @param {!Common.Setting} setting
* @param {string=} optGroup
*/
......@@ -992,14 +989,14 @@ UI.ToolbarSettingComboBox = class extends UI.ToolbarComboBox {
}
/**
* @param {!Array<!{value: string, label: string, title: string}>} options
* @param {!Array<!{value: string, label: string}>} options
*/
setOptions(options) {
this._options = options;
this._optionContainer.removeChildren();
for (let i = 0; i < options.length; ++i) {
const dataOption = options[i];
const option = this.createOption(dataOption.label, dataOption.title, dataOption.value);
const option = this.createOption(dataOption.label, dataOption.value);
this._optionContainer.appendChild(option);
if (this._setting.get() === dataOption.value)
this.setSelectedIndex(i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment