https://bugs.webkit.org/show_bug.cgi?id=188534
<rdar://problem/
43253335>
Reviewed by Joseph Pecoraro.
Row selection should be implemented by Table, rather than its delegate.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.tableShouldSelectRow):
(WI.NetworkTableContentView.prototype.tableCellMouseDown): Deleted.
Prevent selection unless the clicked cell belongs to the name column.
* UserInterface/Views/ResourceCookiesContentView.js:
(WI.ResourceCookiesContentView.prototype.tableShouldSelectRow):
Always prevent selection.
* UserInterface/Views/Table.js:
(WI.Table):
(WI.Table.prototype._handleMouseDown):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234822
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-08-13 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Table should handle row selection instead of the table delegate
+ https://bugs.webkit.org/show_bug.cgi?id=188534
+ <rdar://problem/43253335>
+
+ Reviewed by Joseph Pecoraro.
+
+ Row selection should be implemented by Table, rather than its delegate.
+
+ * UserInterface/Views/NetworkTableContentView.js:
+ (WI.NetworkTableContentView.prototype.tableShouldSelectRow):
+ (WI.NetworkTableContentView.prototype.tableCellMouseDown): Deleted.
+ Prevent selection unless the clicked cell belongs to the name column.
+
+ * UserInterface/Views/ResourceCookiesContentView.js:
+ (WI.ResourceCookiesContentView.prototype.tableShouldSelectRow):
+ Always prevent selection.
+
+ * UserInterface/Views/Table.js:
+ (WI.Table):
+ (WI.Table.prototype._handleMouseDown):
+
2018-08-12 Aditya Keerthi <akeerthi@apple.com>
[macOS] Color wells should appear pressed when presenting a color picker
// Table delegate
- tableCellMouseDown(table, cell, column, rowIndex, event)
- {
- if (column !== this._nameColumn)
- return;
-
- this._table.selectRow(rowIndex);
- }
-
tableCellContextMenuClicked(table, cell, column, rowIndex, event)
{
if (column !== this._nameColumn)
contextMenu.appendItem(WI.UIString("Export HAR"), () => { this._exportHAR(); });
}
+ tableShouldSelectRow(table, cell, column, rowIndex)
+ {
+ return column === this._nameColumn;
+ }
+
tableSelectedRowChanged(table, rowIndex)
{
if (isNaN(rowIndex)) {
// Table delegate
+ tableShouldSelectRow(table, cell, column, rowIndex)
+ {
+ return false;
+ }
+
tablePopulateCell(table, cell, column, rowIndex)
{
let cookie = this._dataSourceForTable(table)[rowIndex];
/*
- * Copyright (C) 2008-2017 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008-2018 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
this._scrollContainerElement.className = "data-container";
this._scrollContainerElement.addEventListener("scroll", scrollHandler);
this._scrollContainerElement.addEventListener("mousewheel", scrollHandler);
- if (this._delegate.tableCellMouseDown)
- this._scrollContainerElement.addEventListener("mousedown", this._handleMouseDown.bind(this));
+ this._scrollContainerElement.addEventListener("mousedown", this._handleMouseDown.bind(this));
if (this._delegate.tableCellContextMenuClicked)
this._scrollContainerElement.addEventListener("contextmenu", this._handleContextMenu.bind(this));
let column = this._visibleColumns[columnIndex];
let rowIndex = row.__index;
- this._delegate.tableCellMouseDown(this, cell, column, rowIndex, event);
+ if (this._delegate.tableShouldSelectRow && !this._delegate.tableShouldSelectRow(this, cell, column, rowIndex))
+ return;
+
+ this.selectRow(rowIndex);
}
_handleContextMenu(event)