lib/hatemile/implementation/accessible_css_implementation.rb
##
# Isolate text nodes of element nodes.
#
# @param element [Hatemile::Util::Html::HTMLDOMElement] The element.
Isolate text nodes of element nodes.
Isolate text nodes of element nodes .
def isolate_text_node(element)
        unless element.has_children_elements? && is_valid_element?(element)
          return
        end
        element.get_children.each do |child_node|
          next unless child_node.is_a?(Hatemile::Util::Html::HTMLDOMTextNode)
          span = @html_parser.create_element('span')
          span.set_attribute(DATA_ISOLATOR_ELEMENT, 'true')
          span.append_text(child_node.get_text_content)
          child_node.replace_node(span)
        end
        element.get_children_elements.each do |child|
          isolate_text_node(child)
        end
      end
def isolate_text_node ( element ) unless element . has_children_elements? && is_valid_element? ( element ) return end element . get_children . each do | child_node | next unless child_node . is_a? ( Hatemile :: Util :: Html :: HTMLDOMTextNode ) span = @html_parser . create_element ( 'span' ) span . set_attribute ( DATA_ISOLATOR_ELEMENT , 'true' ) span . append_text ( child_node . get_text_content ) child_node . replace_node ( span ) end element . get_children_elements . each do | child | isolate_text_node ( child ) end end
Isolate text nodes of element nodes.
Isolate text nodes of element nodes .
element
None