file
|
This file contains a full implementation of the EventHandler interface.
The tools in this package initiate a CSS selector parsing routine and then
handle all of the callbacks.
The implementation provided herein adheres to the CSS 3 Selector specification
with the following caveats:
- The negation (:not()) and containment (:has()) pseudo-classes allow full
selectors and not just simple selectors.
- There are a variety of additional pseudo-classes supported by this
implementation that are not part of the spec. Most of the jQuery
pseudo-classes are supported. The :x-root pseudo-class is also supported.
- Pseudo-classes that require a User Agent to function have been disabled.
Thus there is no :hover pseudo-class.
- All pseudo-elements require the double-colon (::) notation. This breaks
backward compatibility with the 2.1 spec, but it makes visible the issue
that pseudo-elements cannot be effectively used with most of the present
library. They return stdClass objects with a text property (QP > 1.3)
instead of elements.
- The pseudo-classes first-of-type, nth-of-type and last-of-type may or may
not conform to the specification. The spec is unclear.
- pseudo-class filters of the form -an+b do not function as described in the
specification. However, they do behave the same way here as they do in
jQuery.
- This library DOES provide XML namespace aware tools. Selectors can use
namespaces to increase specificity.
- This library does nothing with the CSS 3 Selector specificity rating. Of
course specificity is preserved (to the best of our abilities), but there
is no calculation done.
For detailed examples of how the code works and what selectors are supported,
see the CssEventTests file, which contains the unit tests used for
testing this implementation.
|