shadow dom: add code confirm activeElement is readonly and refactor the ...

...code