Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / test / data / browser_plugin_dragging.html
1 <html>
2 <head></head>
3 <body>
4
5 <textarea id='id_message'>
6 </textarea>
7
8 <object id="plugin"
9     tabindex="0"
10     type="application/browser-plugin"
11     width="240"
12     height="120"
13     style='border: solid 1px red'
14     >
15 </object>
16
17 <script>
18 function dragLocation() {
19   return [id_message.offsetLeft + id_message.offsetWidth / 2,
20           id_message.offsetTop + id_message.offsetHeight / 2];
21 }
22
23 function dropLocation() {
24   return [plugin.offsetLeft + plugin.offsetWidth / 2,
25           plugin.offsetTop + plugin.offsetHeight / 2];
26 }
27
28 function SetSrc(src) {
29   plugin = document.getElementById('plugin');
30   plugin.src = src;
31 }
32
33 var plugin = document.getElementById('plugin');
34 plugin.addEventListener('-internal-instanceid-allocated', function(e) {
35   var detail = e.detail ? JSON.parse(e.detail) : {};
36   plugin['-internal-attach'](detail.windowId, {});
37 });
38 </script>
39
40 </body>
41 </html>