http://trac.webkit.org/changeset/57292 I think we need to expose bool WebBindings::getElement(NPObject* range, WebElement* webElement) in order for TestShell's LayoutTestController to be able to get an Element out of the CPPArgumentList. Then it's just a matter of returning RefPtr<CSSComputedStyleDeclaration> style = computedStyle(element, true) as a V8Object.
Nate, any chance I can convince you to take this on? You're much more familiar with V8 and bindings-related code than I am.
I can't promise a solution by end of week, but otherwise, yes, you can convince me.
Instead of getElement, how about getNode since that will be more generically useful? Then, we can use WebNode::isElementNode to determine if a downcast to WebElement is safe.
Is it possible to have test-specific Node JS API? It looks like: interface Node ...{ ... [LayoutTest] String computedStyleIncludingVisitedInfo() ... } Using Node or Element with LayoutTestController is tedious especially for Qt because Qt uses QObject reflection to bind LayoutTestController into JS. Other possible way to move part of LayoutTestController inside WebCore. My last attempt didn't get enough attention though? https://bugs.webkit.org/show_bug.cgi?id=42612
This could be of interest to you: https://bugs.webkit.org/show_bug.cgi?id=109772 One more thing to fix and that should work for Chromium.
*** This bug has been marked as a duplicate of bug 109772 ***