symfony/symfony — pull request #7463 by jfsimon (2013-03-23 18:08:56+00:00)
Title: [CssSelector] fully rewritted component

The `CssSelector` component is a port of the Python https://github.com/SimonSapin/cssselect library. Previous implementation was a port of the `v0.1` tag, this implementation is a port of the `v0.7.1` tag. As Python and PHP have different philosophies, this is not a simple language-to-language translation, I needed to re-architecture the lib.

**Note about BC:** This new version introduces some changes making fail legacy tests.
New XPath should be equivalents, these changes are:
- When having a condition on an class, legacy condition is prefixed with a test of class existence. Example: `[contains(@class, 'foo')]` is transformed to `[@class and contains(@class, 'foo')]`.
- When having conditions on descendants, `/descendant::*` is transformed to `/descendant-or-self::*/*`.

I updated legacy tests (stored in `CssSelectorTest` class) accordingly.

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | yes
| BC breaks? | see above
| Deprecations? | no
| Tests pass? | yes