title: How does ::selection's specificity work against type selectors?
body: <p>Some questions about using CSS to specify the color of selected text:</p>
  <p>Imagine that a rule like the following exists in the default CSS that's implemented by the browser:</p>
  <pre><code>::selection { background-color: Highlight; color: HighlightText; }
  </code></pre>
  <p>Further imagine that a rule like the following is defined in any site-specific authored stylesheet:</p>
  <pre><code>body { background-color: white }
  </code></pre>
  <ol>
  <li><p>Given these rules, what would the <code>background-color</code> of the selected body text be? Would it be <code>white</code>, or <code>Highlight</code>?</p>
  <p>Perhaps the rule in the author stylesheet should override the default rule: because according to specificity, <code>body</code> is just as specific as <code>::selection</code> and is specified later (and should therefore override the previous entry).</p>
  <p>On the other hand, that would result in text being invisible when it's selected (because if <code>Highlight</code> is blue and <code>HighlightText</code> is white so that selected text is white-on-blue, then overriding the <code>background-color</code> of selected text so that it's white would result in its being white-on-white).</p>
  </li>
  <li><p>Assuming that the behaviour in step 2 is undesirable, how to avoid it?</p>
  </li>
  </ol>
  <ul>
  <li><p>Say that it's a bug in the user stylesheet, which shouldn't ever specify <code>background-color</code> without also specifying <code>color</code>?</p>
  </li>
  <li><p>Say that <code>body</code> isn't a match for selected body text except when the <code>::selection</code> pseudo-element is specified as part of the selector?</p>
  </li>
  </ul>