Sorry for the late chime in.
I would agree with Ken after looking at what our current proposal[1]
creates! Just hanging it off WebElement and then searching from there
with just a call to get all the shadow roots which returns a list of
WebElements and element[<index>].find_element('<type>', '<identifier of
node>').
Marc and Ken, do you want to take a bash at updating the spec to contain
what we have discussed here and uploading a patch to the W3C Bug[2] ?
David
[1] https://groups.google.com/forum/#!topic/selenium-developers/Dad2KZsXNKo
[2]
https://www.w3.org/Bugs/Public/show_bug.cgi?id=22987
On 20/08/2013 21:07, Ken Kania wrote:
> You understand correctly. I thought most stuff would work fine since
> I think we allow the Document to be treated as a WebElement, but there
> might be some stuff that needs to be fixed or perhaps throw an error for.
>
>
> On Mon, Aug 19, 2013 at 2:05 PM, Marc Fisher <fisherii@google.com
> <mailto:fisherii@google.com>> wrote:
>
>
> They would be scoped based on the element id you give to
> search under
>
>
> So the command to get the shadow roots from a WebElement would
> return a list of WebElements? Shadow roots aren't actually HTML
> element objects, but I suppose from the POV of WebDriver that that
> doesn't actually matter very much. It does probably mean that most
> of the element/:elementId/... commands will fail if the :elementId
> corresponds to a shadow root (or they could be redirected to the
> owning HTML element I suppose).
>
> I would be fine with this suggestion, assuming I understand it
> correctly.
>
> Marc
>
>