This refactoring is necessary to implement bug 41414 and looks like a task of its own.
Created attachment 77005 [details] [PATCH] Suggested solution
Comment on attachment 77005 [details] [PATCH] Suggested solution View in context: https://bugs.webkit.org/attachment.cgi?id=77005&action=review > WebCore/inspector/front-end/CSSCompletions.js:133 > +WebInspector.CSSCompletions.prototype.__proto__ = Array.prototype; What's the reason for this class to be a descendant of Array? Can you change it to keep an array of properties in a private field instead? I would also recommend passing array of property names to the CSSCompletion constructor. > WebCore/inspector/front-end/inspector.js:618 > + InspectorBackend.getSupportedCSSProperties(WebInspector.cssNameCompletions._load.bind(WebInspector.cssNameCompletions)); Method _load should be public, also it would be better to instantiate CSSCompletions only when the property names are available.
Created attachment 77008 [details] [PATCH] Comments addressed
Comment on attachment 77008 [details] [PATCH] Comments addressed View in context: https://bugs.webkit.org/attachment.cgi?id=77008&action=review > WebCore/inspector/front-end/CSSCompletions.js:36 > + for (var i = 0; i < values.length; ++i) Just use this._values = values.slice()
Landed with the suggested change. Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/inspector/front-end/CSSCompletions.js M WebCore/inspector/front-end/SourceCSSTokenizer.js M WebCore/inspector/front-end/SourceCSSTokenizer.re2js M WebCore/inspector/front-end/StylesSidebarPane.js M WebCore/inspector/front-end/inspector.js Committed r74352
Thanks for making this separate!