Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
net_instaweb::ScriptTagScanner Class Reference

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

Member Enumeration Documentation

Bit flags that specify when the script is to be run.


IE extension. If this is set, script will not run in browsers following HTML5, and will run at hard-to-describe time in IE.

Member Function Documentation

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)

The documentation for this class was generated from the following file: