Public Types | |
enum | ScriptClassification { kNonScript, kUnknownScript, kJavaScript } |
enum | ExecutionModeFlags { kExecuteSync = 0, kExecuteDefer = 1, kExecuteAsync = 2, kExecuteForEvent = 4 } |
Bit flags that specify when the script is to be run. More... | |
Public Member Functions | |
ScriptTagScanner (HtmlParse *html_parse) | |
ScriptClassification | ParseScriptElement (HtmlElement *element, HtmlElement::Attribute **src) |
int | ExecutionMode (const HtmlElement *element) const |
int net_instaweb::ScriptTagScanner::ExecutionMode | ( | const HtmlElement * | element | ) | const |
Returns which execution model attributes are set. Keep in mind, however, that HTML5 browsers will ignore kExecuteDefer and kExecuteAsync on elements without src=''
ScriptClassification net_instaweb::ScriptTagScanner::ParseScriptElement | ( | HtmlElement * | element, | |
HtmlElement::Attribute ** | src | |||
) |
Examines an HTML element and determine if it is a script. If it's not, it returns kNonScript and doesn't touch *src. If it is a script, it returns whether it is JavaScript or not, and sets *src to the src attribute (perhaps NULL)