[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / fast / backgrounds / selection-background-color.html
1 <!DOCTYPE html>
2 <!--
3 Test for: https://bugs.webkit.org/show_bug.cgi?id=80382
4           (Selection Background Color Error)
5
6 This bug is caused when the selection background is inverted if it
7 is the same as the text color.  However, it should compare against
8 the selected text color instead of the non-selected text color.
9
10 The alpha component must be non-opaque for the bug to get triggered.
11 This is because when the selection background is opaque, it will be
12 blended with white, which prevents the inversion.
13 -->
14 <html>
15 <head>
16     <style>
17         #A {
18             color: rgba(0,0,0,0.85);
19         }
20         #A::selection {
21             background: rgba(0,0,0,0.85);
22             color: white;
23         }
24
25         #B {
26             color: rgba(0,255,0,0.85);
27         }
28         #B::selection {
29             background: rgba(0,255,0,0.85);
30             color: blue;
31         }
32     </style>
33 </head>
34 <body>
35     <div id="A">Test passes if the selection background is black</div>
36     <div id="B">Test passes if the selection background is green</div>
37 </body>
38     <script>
39         var body = document.getElementsByTagName("body")[0];
40         window.getSelection().selectAllChildren(body);
41     </script>
42 </html>