Moved attributeTest to inside nodeIterator + removed redundant code in getVisibleBoundingRect function