cssom.iframe.style.CssSelector_ Extends
Represents a single CSS selector, as described in http://www.w3.org/TR/REC-CSS2/selector.html Currently UNSUPPORTED are the following selector features:
  • pseudo-classes (:hover)
  • child selectors (div > h1)
  • adjacent sibling selectors (div + h1)
  • attribute selectors (input[type=submit])

Inheritance

Constructor

goog.cssom.iframe.style.CssSelector_(opt_selectorString)

Parameters

opt_selectorString : string=
String containing selectors to parse.

Instance Methods

Public Protected Private
matchElementAncestry(elementAncestry) Object
Tests to see what part of a DOM element hierarchy would be matched by this selector, and returns the indexes of the matching element and matching selector part.

For example, given this hierarchy: document > html > body > div.content > div.sidebar > p and this CSS selector: body div.sidebar h1 This would return {elementIndex: 4, selectorPartIndex: 1}, indicating that the element at index 4 matched the css selector at index 1.

Arguments:
elementAncestry : goog.cssom.iframe.style.NodeAncestry_
Object representing an element and its ancestors.
Returns: Object  Object with the properties elementIndex and selectorPartIndex, or null if there was no match.
code »
setPartsFromString_(selectorString)
Parses a selector string into individual parts.
Arguments:
selectorString : string
A string containing a CSS selector.
code »

Instance Properties

ancestryMatchCache_ :
Object to track ancestry matches to speed up repeatedly testing this CssSelector against the same NodeAncestry object.
Code »
parts_ :
Array of CssSelectorPart objects representing the parts of this selector Example: for the selector 'body h1' the parts would be [body, h1].
Code »

Package cssom.iframe.style

Package Reference