https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 6c6f6b0206180f8a1899e827474c486024a124b9 authored by Emilio Cobos Álvarez on 11 April 2018, 13:23:42 UTC
followup: Remove a explicit testharness.css link to appease wptlint. on a CLOSED TREE
Tip revision: 6c6f6b0
css3-modsel-164.xml-removed
<csstest def=":focus with ::selection" module="W3C Selectors" modulename="css3-modsel" number="164" rev="1.0" date="21-november-2001" xmlns="http://www.example.org/css3tests">

<author>Ian Hickson</author>

<userinteraction/>

<cssrules>
  textarea { border: solid thick gray; }
  textarea:focus { border: solid thick green; }
  textarea::selection { background: silver; color: black; }
  textarea:focus::selection { background: lime; color: black; }
</cssrules>

<code>
   <p xmlns="http://www.w3.org/1999/xhtml"><textarea rows="5" cols="70"
>Select some of this text, then change the focus around. While this
text is focussed, the selection should be green. While the focus is
elsewhere, the selection should be silver. The border should at all
times be a darker colour than the selection's background. Repeat the
test with everything selected.</textarea></p>

   <p xmlns="http://www.w3.org/1999/xhtml">CONFORMANCE NOTE: If the UA
   removes the selection when the focus leaves the text, which is also
   valid behaviour, then the description above is inaccurate. In these
   cases, the selection should disappear completely when the focus is
   moved, and when the focus is returned, the selection should not be
   in the same place as when focus was removed (typically, either the
   selection will be non-existent, or everything will be selected --
   but what is selected is independent of what was selected when the
   focus was removed).</p>

   <p xmlns="http://www.w3.org/1999/xhtml">If the selection is
   preserved, then the selection should NOT disappear when focus is
   removed, it should instead turn silver as described.</p>

</code>

</csstest>
back to top