This test confirms that the number of elements having Shadow in a shadow subtree is correctly counted. See Bug 100922 also.
Initial count should be 0
PASS internals.countElementShadow(shadowRoot) is 0
Inserted into / removed from an element having shadow
PASS internals.countElementShadow(shadowRoot) is 1
PASS internals.countElementShadow(shadowRoot) is 0
Should be counted by each shadow root (nested shadow root case)
PASS internals.countElementShadow(shadowRoot) is 1
PASS internals.countElementShadow(nestedShadowRoot) is 0
PASS internals.countElementShadow(shadowRoot) is 1
PASS internals.countElementShadow(nestedShadowRoot) is 1
PASS internals.countElementShadow(shadowRoot) is 2
PASS internals.countElementShadow(nestedShadowRoot) is 1
PASS internals.countElementShadow(shadowRoot) is 2
PASS internals.countElementShadow(nestedShadowRoot) is 2
Should be counted by each shadow root (deep nested shadow root case)
PASS internals.countElementShadow(shadowRoot) is 1
PASS internals.countElementShadow(nestedShadowRoot) is 0
PASS internals.countElementShadow(deepNestedShadowRoot) is 0
PASS internals.countElementShadow(shadowRoot) is 1
PASS internals.countElementShadow(nestedShadowRoot) is 1
PASS internals.countElementShadow(deepNestedShadowRoot) is 1
PASS internals.countElementShadow(shadowRoot) is 0
PASS internals.countElementShadow(nestedShadowRoot) is 0
PASS internals.countElementShadow(deepNestedShadowRoot) is 0
PASS successfullyParsed is true
TEST COMPLETE