Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Web Inspector: CSS autocomplete: suggestion hint should be the most c…
…ommonly used property and not the alphabetically first one https://bugs.webkit.org/show_bug.cgi?id=156271 <rdar://problem/25588888> Reviewed by Patrick Angle. * Source/WebInspectorUI/UserInterface/Models/CSSProperty.js: (WI.CSSProperty): (WI.CSSProperty.sortByPropertyNameUsageCount): Added. (WI.CSSProperty._initializePropertyNameCounts): Added. (WI.CSSProperty.prototype.update): (WI.CSSProperty.prototype.remove): (WI.CSSProperty.prototype.set name): (WI.CSSProperty.prototype._updateName): Added. Every time a `WI.CSSProperty` is created/updated, increment/decrement the count of that property's name in the global map of property name counts. When showing CSS completions for property names, initially focus the property with the highest count (but only if the count is over 100). * Source/WebInspectorUI/UserInterface/Base/ObjectStore.js: (WI.ObjectStore._open): (WI.ObjectStore.async getAllKeys): Added. Increment the `version` to add a new `WI.ObjectStore` for CSS property name counts. * Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldInitialCompletionIndex): Added. * Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js: (WI.SpreadsheetTextField.prototype._updateCompletions): Add `delegate` methods to adjust the initial `selectedIndex` whenever completions are updated. * Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js: (WI.CompletionSuggestionsView.prototype.set selectedIndex): (WI.CompletionSuggestionsView.prototype.selectNext): (WI.CompletionSuggestionsView.prototype.selectPrevious): Make sure the `delegate` is informed whenever the `selectedIndex` changes, not just when selecting the next/previous item. * Source/WebInspectorUI/UserInterface/Base/Setting.js: * Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createExperimentalSettingsView): * Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js: Add an experimental setting to control this behavior. * Source/WebInspectorUI/UserInterface/Base/Utilities.js: (Array.prototype.minIndex): Added. Add a utility method for finding the index of the smallest item in an array. * LayoutTests/inspector/css/css-property.html: * LayoutTests/inspector/css/css-property-expected.txt: * LayoutTests/inspector/unit-tests/array-utilities.html: * LayoutTests/inspector/unit-tests/array-utilities-expected.txt: Canonical link: https://commits.webkit.org/250994@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
13 changed files
with
222 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.