lib/hatemile/util/css/rcp/rcp_parser.rb
##
# Load the stylesheets of page.
#
# @param html_parser [Hatemile::Util::Html::HTMLDOMParser] The HTML
#   parser.
# @param current_url [String] The current URL of page.
Load the stylesheets of page.
Load the stylesheets of page .
def load_stylesheets(html_parser, current_url)
            elements = html_parser.find(
              'style,link[rel="stylesheet"]'
            ).list_results
            elements.each do |element|
              if element.get_tag_name == 'STYLE'
                @css_parser.load_string!(element.get_text_content)
              else
                @css_parser.load_uri!(
                  URI.join(current_url, element.get_attribute('href'))
                )
              end
            end
          end
def load_stylesheets ( html_parser , current_url ) elements = html_parser . find ( 'style,link[rel="stylesheet"]' ) . list_results elements . each do | element | if element . get_tag_name == 'STYLE' @css_parser . load_string! ( element . get_text_content ) else @css_parser . load_uri! ( URI . join ( current_url , element . get_attribute ( 'href' ) ) ) end end end
Load the stylesheets of page.
Load the stylesheets of page .
html_parser
The HTML parser.
The HTML parser .
current_url
The current URL of page.
The current URL of page .