Restrict use of pseudo elements within compound.

Start dropping selectors whose compound have pseudo elements followed
by other simple selectors with the exception of simple selectors which
are actually allowed to follow certain pseudo elements.

The exceptions are:

- User action pseudo classes and their negations for custom pseudo
  elements.

  Matching other simple selectors on custom elements worked before, but
  that revealed the inner structure of the UA shadow DOM for form
  elements, which I believe was not intentional.

  According to the latest ED of Selectors Level 4, user action pseudo
  classes are allowed after pseudo elements in general, but we don't
  support that, so the selector should be dropped. Gecko also drops
  those selectors.

- A restricted set of pseudo classes, in addition to the user action
  pseudo classes, which apply to custom scrollbar pseudo elements.

The new restrictions do not yet apply to UA stylesheets as we rely on
invalid selectors in the UA stylesheet for media controls.

Fixed a couple of range-based iterations in the unit test.

This CL does not address the fact that pseudo elements, in most cases,
only may be present in rightmost compound selectors. That will be fixed
in another CL.

R=timloh@chromium.org
BUG=489481,577404

Review URL: https://codereview.chromium.org/1587643004

Cr-Commit-Position: refs/heads/master@{#369760}
5 files changed