summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/repaint/selected-replaced.html
blob: 7b74e35f6ee0d393dbe4450a6144a464aa683d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Selection on replaced element</title>
  <style type="text/css">
    img {
      position: relative;
      top: 80px;
    }
    img.moved {
      top: 0px;
    }
  </style>
  <script src="resources/text-based-repaint.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
    function loaded()
    {
      var selection = window.getSelection();
      var image = document.getElementById('test');
      selection.setBaseAndExtent(image, 0, image, 1);
      runRepaintTest();
    }
    function repaintTest()
    {
       document.getElementById('test').className = 'moved';
    }
  </script>
</head>
<body onload="loaded()">
  <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=22472">https://bugs.webkit.org/show_bug.cgi?id=22472</a>
    <i>Selection is not completely erased when a replaced element moves</i>
  </p>
  <img id="test" src="resources/apple.jpg" width="214" height="232" alt="Apple">
</body>
</html>