The previous implementation took the parent of the element to begin the check, which was wrong when the initial element was the html root. This commit changes the method to a recursive implementation, which is clearer.
The previous implementation took the parent of the element to begin the check, which was wrong when the initial element was the html root. This commit changes the method to a recursive implementation, which is clearer.