def transform_dom(dom)
      # Use only a single loop to do this
      dom.css(
        "a[href]:not([data-roadie-ignore]), " \
          "img[src]:not([data-roadie-ignore]), " \
          "*[style]:not([data-roadie-ignore])",
      ).each do |element|
        transform_element_style element if element.has_attribute?('style')
        transform_element element
      end
      nil
    end
def transform_dom(dom)
      # Use only a single loop to do this
      dom.css(
        "a[href]:not([data-roadie-ignore]), " \
          "img[src]:not([data-roadie-ignore]), " \
          "*[style]:not([data-roadie-ignore])",
      ).each do |element|
        transform_element_style element if element.has_attribute?('style')
        transform_element element
      end
      nil
    end
@param [UrlGenerator] generator
 Mutates the passed DOM tree, rewriting certain element's attributes.

 This will make all a[href] and img[src] into absolute URLs, as well as
 all "url()" directives inside style-attributes.

 [nil] is returned so no one can misunderstand that this method mutates
 the passed instance.

 @param [Nokogiri::HTML::Document] dom
 @return [nil] DOM tree is mutated