, "div.rocks") → true
slick.matches(
, "div.rocks") → false
slick.matches(
,
) → false
context contains node?
Does this context contain this node? Is the context a parent of this node?
Expects:
* context: document or node
* node: node
Returns: true or false
slick.contains(
, - ) → true
slick.contains(, ) → false
The Parser
Parse a CSS selector string into a JavaScript object
parse selector into object
Parse a CSS Selector String into a Selector Object.
Expects: String
Returns: SelectorObject
slick.parse("#foo > bar.baz") → SelectorObject
format
#foo > bar.baz
[[
{ "combinator":" ", "tag":"*", "id":"foo" },
{ "combinator":">", "tag":"bar", "classList": ["baz"], "classes": [{"value":"baz", "match": RegExp }]}
]]
h1, h2, ul > li, .things
[
[{ "combinator":" ", "tag": "h1" }],
[{ "combinator":" ", "tag": "h2" }],
[{ "combinator":" ", "tag": "ul" }, { "combinator": ">", "tag": "li" }],
[{ "combinator":" ", "tag": "*", "classList": ["things"], "classes": [{"value": "things", "match": RegExp }] }]
]