WebKit Bugzilla
Attachment 356567 Details for
Bug 192390
: Web Inspector: SelectionController should not extend the selection when allowsMultipleSelection is false
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192390-20181204182138.patch (text/plain), 5.50 KB, created by
Matt Baker
on 2018-12-04 18:21:46 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Matt Baker
Created:
2018-12-04 18:21:46 PST
Size:
5.50 KB
patch
obsolete
>Subversion Revision: 238877 >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 9271caa8a2edab6b000f0e46c3c0d9f4824a98a0..85f351851caa6f71bb0fd1019760f6264c9d971e 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,14 @@ >+2018-12-04 Matt Baker <mattbaker@apple.com> >+ >+ Web Inspector: SelectionController should not extend the selection when allowsMultipleSelection is false >+ https://bugs.webkit.org/show_bug.cgi?id=192390 >+ <rdar://problem/46473624> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Controllers/SelectionController.js: >+ (WI.SelectionController.prototype.selectItem): >+ > 2018-12-04 Matt Baker <mattbaker@apple.com> > > Web Inspector: REGRESSION(r238602): Elements: changing selection no longer highlights the selected node >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js b/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js >index ea9e3bff5a4fc2e91c57a735ea858862498ae308..725ec3e6e8cdfef222721c9add3d5ee9b3256de5 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/SelectionController.js >@@ -87,6 +87,9 @@ WI.SelectionController = class SelectionController extends WI.Object > console.assert(!extendSelection || this._allowsMultipleSelection, "Cannot extend selection with multiple selection disabled."); > console.assert(index >= 0 && index < this.numberOfItems); > >+ if (!this._allowsMultipleSelection) >+ extendSelection = false; >+ > if (this.hasSelectedItem(index)) { > if (!extendSelection) > this._deselectAllAndSelect(index); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b9c902bcf41b5f730cc441dd2d7f658b10c4f6e1..b788d7935564b048e3884eebe8064929a1525087 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-04 Matt Baker <mattbaker@apple.com> >+ >+ Web Inspector: SelectionController should not extend the selection when allowsMultipleSelection is false >+ https://bugs.webkit.org/show_bug.cgi?id=192390 >+ <rdar://problem/46473624> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/table/table-selection-expected.txt: >+ * inspector/table/table-selection.html: >+ Drive-by fix: removed `allowsMultipleSelection` check from test case >+ Table.SelectMultipleRows.ExtendSelection since it is tested in Table.AllowsMultipleSelection. >+ > 2018-11-30 Jiewen Tan <jiewen_tan@apple.com> > > Don't report resource timing to parent frame for history items >diff --git a/LayoutTests/inspector/table/table-selection-expected.txt b/LayoutTests/inspector/table/table-selection-expected.txt >index 58dccf2ab409c75e43b9d88a18b6dce5cbf91cf0..85b31f501aa2ba1f9e1773dcddf21b0d579b7c6c 100644 >--- a/LayoutTests/inspector/table/table-selection-expected.txt >+++ b/LayoutTests/inspector/table/table-selection-expected.txt >@@ -31,7 +31,6 @@ PASS: allowsMultipleSelection enabled. > PASS: allowsMultipleSelection disabled. > > -- Running test case: Table.SelectMultipleRows.ExtendSelection >-PASS: allowsMultipleSelection enabled. > Selecting row 0. > PASS: Table selection changed. > PASS: selectedRow should be 0. >@@ -43,6 +42,15 @@ PASS: Table selection changed. > PASS: selectedRow should be 9. > PASS: selectedRows should be [0, 1, 9]. > >+-- Running test case: Table.SelectMultipleRows.ExtendSelection.MultipleSelectionDisabled >+Selecting row 0. >+PASS: Table selection changed. >+PASS: selectedRow should be 0. >+Selecting row 1. >+PASS: Table selection changed. >+PASS: selectedRow should be 1. >+PASS: selectedRows should be [1]. >+ > -- Running test case: Table.SelectMultipleRows.SelectTheSameRowTwice.ExtendSelection > Selecting row 0. > PASS: Table selection changed. >diff --git a/LayoutTests/inspector/table/table-selection.html b/LayoutTests/inspector/table/table-selection.html >index 27ae7baca1dbfccaa0036805b221ddb28048a0b9..ddd7a38a1f18a2866edf14302719495799f98009 100644 >--- a/LayoutTests/inspector/table/table-selection.html >+++ b/LayoutTests/inspector/table/table-selection.html >@@ -78,13 +78,13 @@ function test() > return true; > } > }); >+ > suite.addTestCase({ > name: "Table.SelectMultipleRows.ExtendSelection", > description: "Select multiple rows, extending the selection.", > test() { > let table = InspectorTest.createTable(); > table.allowsMultipleSelection = true; >- InspectorTest.expectThat(table.allowsMultipleSelection, "allowsMultipleSelection enabled."); > > const extendSelection = true; > >@@ -97,6 +97,23 @@ function test() > } > }); > >+ suite.addTestCase({ >+ name: "Table.SelectMultipleRows.ExtendSelection.MultipleSelectionDisabled", >+ description: "Attempt to extend the selection when multiple selection is disabled.", >+ test() { >+ let table = InspectorTest.createTable(); >+ table.allowsMultipleSelection = false; >+ >+ const extendSelection = true; >+ >+ triggerSelectRow(table, 0, extendSelection); >+ triggerSelectRow(table, 1, extendSelection); >+ InspectorTest.expectShallowEqual(table.selectedRows, [1], "selectedRows should be [1]."); >+ >+ return true; >+ } >+ }); >+ > suite.addTestCase({ > name: "Table.SelectMultipleRows.SelectTheSameRowTwice.ExtendSelection", > description: "Select an already selected row, and extend the selection.",
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192390
: 356567