Extract has_element state to your own file
Merge pull request #3954 from marcioj/extract_has_element

Extract has_element state to your own file