For consistency with Mac DRT, and Chromium DRT (and GTK DRT after bug 58119), layoutTestController.shadowRoot should return undefined, not null, when its argument is not an element.
Created attachment 88779 [details] Patch
Comment on attachment 88779 [details] Patch Clearing flags on attachment: 88779 Committed r83270: <http://trac.webkit.org/changeset/83270>
All reviewed patches have been landed. Closing bug.
fast/dom/HTMLKeygenElement/keygen.html is still failing on WebKit2.
WKBundleNodeHandleCopyElementShadowRoot is returning 0, and LayoutTestController::shadowRoot returns JSValueMakeUndefined in that case.
I mean it returns JSValueMakeNull. But apparently the test wants JSValueMakeUndefined.
It looks like LayoutTestController doesn't have enough information to do the right thing. It's supposed to return undefined if it is passed a non-element node, but it has no way of determining whether a particular node is an element or not.
It's not clear to me that having shadowRoot return different things for non-elements and elements without shadow roots is worthwhile. Why do our tests need that behavior? The tests themselves are quite capable of figuring out what's an element and what isn't.
I will work on a patch to make the ports consistent and always return null.
Created attachment 88851 [details] Patch
Comment on attachment 88851 [details] Patch Clearing flags on attachment: 88851 Committed r83333: <http://trac.webkit.org/changeset/83333>