Web Inspector: Convert DatabaseContentView to use View base class
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Nov 2015 18:43:26 +0000 (18:43 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Nov 2015 18:43:26 +0000 (18:43 +0000)
commit632b88df82594202be074790add3bcfcd21dabe6
treefa99c294e04d58c7ae38d126bea6bc9be33c6944
parent7cbea974f0f66a4c48dccde116b57734defb32a4
Web Inspector: Convert DatabaseContentView to use View base class
https://bugs.webkit.org/show_bug.cgi?id=150959

Reviewed by Timothy Hatcher.

Update DatabaseContentView to inherit from View. This required that query results be
promoted to a first-class view object, and that ConsolePrompt's DOM element not be wrapped
inside a container element.

Two new query result view classes (and their base class) wrap up DOM element creation
which was being performed by DatabaseContentView.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Main.html:
New files.

* UserInterface/Views/ConsolePrompt.js:
(WebInspector.ConsolePrompt):
Removed unused parameter.

* UserInterface/Views/DatabaseContentView.css:
(.storage-view):
(.storage-view > .console-prompt):
(.storage-view > .console-prompt::before):
(:matches(.database-user-query, .database-query-result)::before):
(.database-query-result.no-results):
(.database-query-prompt): Deleted.
(:matches(.database-user-query, .database-query-prompt, .database-query-result)::before): Deleted.
(.database-query-prompt::before): Deleted.
Modified styles to create prompt without needing a wrapper element.

* UserInterface/Views/DatabaseContentView.js:
(WebInspector.DatabaseContentView):
(WebInspector.DatabaseContentView.prototype.shown):
(WebInspector.DatabaseContentView.prototype.consolePromptCompletionsNeeded.accumulateMatches):
(WebInspector.DatabaseContentView.prototype.consolePromptCompletionsNeeded.tableNamesCallback):
(WebInspector.DatabaseContentView.prototype.consolePromptCompletionsNeeded):
(WebInspector.DatabaseContentView.prototype._messagesClicked):
(WebInspector.DatabaseContentView.prototype._queryFinished):
(WebInspector.DatabaseContentView.prototype._queryError):
(WebInspector.DatabaseContentView.prototype.updateLayout): Deleted.
No longer needed.
(WebInspector.DatabaseContentView.prototype._appendViewQueryResult): Deleted.
(WebInspector.DatabaseContentView.prototype._appendErrorQueryResult): Deleted.
(WebInspector.DatabaseContentView.prototype._appendQueryResult): Deleted.
Removed methods subsumed under DatabaseUserQueryView.

* UserInterface/Views/DatabaseUserQueryErrorView.js: Added.
(WebInspector.DatabaseUserQueryErrorView):
Displays supplied error message.

* UserInterface/Views/DatabaseUserQuerySuccessView.js: Added.
(WebInspector.DatabaseUserQuerySuccessView):
Creates data grid if results exist, otherwise displays "no results" message.
(WebInspector.DatabaseUserQuerySuccessView.prototype.get dataGrid):
External access to view's data grid for autosizing columns, etc.
(WebInspector.DatabaseUserQuerySuccessView.prototype.layout):
Update grid layout manually, since the grid's parent in the DOM isn't the view's root element.

* UserInterface/Views/DatabaseUserQueryViewBase.js: Added.
Base class for success and error message views.
(WebInspector.DatabaseUserQueryViewBase):
Creates DOM common to subclasses.
(WebInspector.DatabaseUserQueryViewBase.prototype.get resultElement):
Protected getter exposing the content root for both subclasses.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Views/ConsolePrompt.js
Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.css
Source/WebInspectorUI/UserInterface/Views/DatabaseContentView.js
Source/WebInspectorUI/UserInterface/Views/DatabaseUserQueryErrorView.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Views/DatabaseUserQuerySuccessView.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Views/DatabaseUserQueryViewBase.js [new file with mode: 0644]