Public Member Functions | |
ResourceTagScanner (HtmlParse *html_parse) | |
HtmlElement::Attribute * | ScanElement (HtmlElement *element, bool *is_hyperlink) const |
void | set_find_a_tags (bool val) |
void | set_find_form_tags (bool val) |
HtmlElement::Attribute* net_instaweb::ResourceTagScanner::ScanElement | ( | HtmlElement * | element, | |
bool * | is_hyperlink | |||
) | const |
Examines an HTML element to determine if it's a link to any sort of resource, extracting out the HREF or SRC. In this scanner, we don't care about the type of resource; we are just looking for anything that matches the pattern "<script src=...>", "<img src=...>", or "<link rel="stylesheet" href=...>", without worrying about what the other attributes are.
Sets *is_hyperlink to true for , <form>, and <area> tags, false otherwise. These are of interest because we generally want to apply domain-sharding for resources, but not hyperlinks.
void net_instaweb::ResourceTagScanner::set_find_a_tags | ( | bool | val | ) | [inline] |
Note: set_find_a_tags also finds "area" tags, as those are a different visualization for an anchor. If we need to split this functionality in the future we add a new bool.