[Shadow DOM]: Some named elements in ShadowTree visible on nesting document level
https://bugs.webkit.org/show_bug.cgi?id=105617

Reviewed by Dimitri Glazkov.

Source/WebCore:

According to the shadow dom spec, the nodes and named elements are not
accessible using shadow host's document DOM tree accessors or with
Window object named properties. c.f.
https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#upper-boundary-encapsulation

Test: fast/dom/shadow/element-name-in-shadow.html

* dom/Element.h:
(WebCore::Element::updateName):
Check whether the given element is in a shadow dom tree or not. If in
a shadow dom tree, don't register the name.
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::insertedInto):
(WebCore::HTMLIFrameElement::removedFrom):
(WebCore::HTMLIFrameElement::parseAttribute):
HTMLIFrameElement doesn't use updateName. Instead the element uses
addExtraNamedItem and removeExtraNameItem in HTMLIFrameElement.cpp.

LayoutTests:

* fast/dom/shadow/element-name-in-shadow-expected.txt: Added.
* fast/dom/shadow/element-name-in-shadow.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138897 268f45cc-cd09-0410-ab3c-d52691b4dbfc