This tests that the removeChild method of the
Node interface works correctly.
The test has three sub-tests, for different removeChild
behavior, which consist of a paired rectangle and circle:
-
The first is a test of successfully removing a single element
from the document. Initially, a red rectangle occludes a blue
rectangle. This red rectangle should then be removed by the
removeChild call, which results in the blue rectangle
becoming visible. The circle beneath it represents whether
removeChild returned the correct value (i.e., a reference
to the same red rectangle that was removed). If this return
value is incorrect, the circle will remain red. If it was
correct, the circle is changed to be blue.
-
The second is a test of successfully removing a subtree
from the document. The subtree is simply a g element
with a red rect as a child, which initially occludes
a blue rectangle. The group with the red rectangle should then be
removed by the removeChild call, which results in the blue
rectangle becoming visible. The circle beneath it represents
whether removeChild returned the correct value (i.e., a
reference to the g element that was removed). If this
return value is incorrect, the circle will remain red. If it was
correct, the circle is changed to be blue.
-
The third is a test of removeChild throwing a NOT_FOUND_ERR
DOMException when passed an element that is not a child of
the element on which the method was called. If the blue rectangle
remains, the implementation correctly did not remove it. The circle
indicates whether the exception was thrown as expected. If the
exception was not thrown, or the wrong is exception is thrown,
the circle will remain red. Otherwise, the circle will be changed
to be blue.
The test has been passed if the top row shows three blue rectangles
and the bottom row shows three blue circles.