[Webkit-unassigned] [Bug 44518] Web Inspector: add audits support to extension API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 25 06:57:26 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=44518





--- Comment #3 from Andrey Kosyakov <caseq at chromium.org>  2010-08-25 06:57:25 PST ---
(In reply to comment #2)

> LayoutTests/inspector/extensions-audits.html:24
>  +              type: webInspector.audits.nodeType.text,
> I'd suggest that we use the following form text parameters:
> ["Foo bar %h", "http://link"].
> "children" should still be there in order to organize a very common tree structure.
> We could come up with more formatters as we go:
> %s for string
> %t for tree
> %T for table and such...

I realize this may be handy, but still don't like this: it's not readable, is not localizable (unless we add parameter numbering there), not quite extensible and does not quite suit to a case when rendering one entity requires multiple values (e.g. URL could have two: a href value and a text within the tag).

I suggest we either define named formatter classes, e.g.

webInspector.audit.formatters.url(href, text)
webInspector.audit.formatters.snippet(text)
webInspector.audit.formatters.subtree(expanded, root, children) etc.

or go for imperative interface, e.g.

results.addChild(webInspector.audit.resultNodes.url(href, text))

The latter is pretty close to the way we have it in Audits now, but keeps type away from method names (i.e. we don't have AddFoo for every type Foo -- rather have Foo constructors and generic AddChild method).

What do you think?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list