diff options
Diffstat (limited to 'dom/chrome-webidl/InspectorUtils.webidl')
-rw-r--r-- | dom/chrome-webidl/InspectorUtils.webidl | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/dom/chrome-webidl/InspectorUtils.webidl b/dom/chrome-webidl/InspectorUtils.webidl index b379118e8a..40c57182d3 100644 --- a/dom/chrome-webidl/InspectorUtils.webidl +++ b/dom/chrome-webidl/InspectorUtils.webidl @@ -227,3 +227,53 @@ interface InspectorFontFace { readonly attribute DOMString format; // as per http://www.w3.org/TR/css3-webfonts/#referencing readonly attribute DOMString metadata; // XML metadata from WOFF file (if any) }; + +dictionary InspectorCSSToken { + // The token type. + required UTF8String tokenType; + + // Text associated with the token. + required UTF8String text; + + // Value of the token. Might differ from `text`: + // - for `Function` tokens, text contains the opening paren, `value` does not (e.g. `var(` vs `var`) + // - for `AtKeyword` tokens, text contains the leading `@`, `value` does not (e.g. `@media` vs `media`) + // - for `Hash` and `IDHash` tokens, text contains the leading `#`, `value` does not (e.g. `#myid` vs `myid`) + // - for `UnquotedUrl` tokens, text contains the `url(` parts, `value` only holds the url (e.g. `url(test.jpg)` vs `test.jpg`) + // - for `QuotedString` tokens, text contains the wrapping quotes, `value` does not (e.g. `"hello"` vs `hello`) + // - for `Comment` tokens, text contains leading `/*` and trailing `*/`, `value` does not (e.g. `/* yo */` vs ` yo `) + required UTF8String? value; + + // Unit for Dimension tokens + required UTF8String? unit; + + // Float value for Dimension, Number and Percentage tokens + double? number = null; +}; + +/** + * InspectorCSSParser is an interface to the CSS lexer. It tokenizes an + * input stream and returns CSS tokens. + */ +[Func="nsContentUtils::IsCallerChromeOrFuzzingEnabled", + Exposed=Window] +interface InspectorCSSParser { + constructor(UTF8String text); + + /** + * The line number of the most recently returned token. Line + * numbers are 0-based. + */ + readonly attribute unsigned long lineNumber; + + /** + * The column number of the most recently returned token. Column + * numbers are 1-based. + */ + readonly attribute unsigned long columnNumber; + + /** + * Return the next token, or null at EOF. + */ + InspectorCSSToken? nextToken(); +}; |