Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / 4895428-2.html
blob6bf1cda1d6d8517fe8641ae891128be5c4341a05
1 <p>This tests to see if a mouse click inside an editable, focusable node focuses that node. Normally, we focus a node on mouse down, but to make it easier to drag selections containing editable pieces we delay focus until mouse up. The editable table cell should be focused and you should see a 'Success' message below.</p>
2 <div id="div" contenteditable="true" onblur="handleBlur();"><table contenteditable="false" border="1"><tr><td>non-editable</td><td id="cell" contenteditable="true" onfocus="log('Success');">editable</td></tr></table></div>
3 <div id="destination" contenteditable="true"><br></div>
4 <ul id="console"></ul>
5 <script>
6 function log(str) {
7 var text = document.createTextNode(str);
8 var li = document.createElement("li");
9 var console = document.getElementById("console");
10 console.appendChild(li);
11 li.appendChild(text);
13 function handleBlur() {
14 blurred = true;
16 function runTest() {
17 var blurred = false;
18 if (!window.testRunner)
19 return;
20 var cell = document.getElementById("cell");
21 cell.addEventListener(handleBlur, "DOMBlurEvent");
22 var div = document.getElementById("div");
23 div.focus();
24 document.execCommand("SelectAll");
26 var x, y;
27 x = cell.offsetParent.offsetLeft + cell.offsetLeft + cell.offsetWidth / 2;
28 y = cell.offsetParent.offsetTop + cell.offsetTop + cell.offsetHeight / 2;
29 eventSender.mouseMoveTo(x, y);
30 eventSender.mouseDown();
31 if (blurred == true)
32 log("Error, focus changed too early.")
33 eventSender.mouseUp();
36 runTest();
37 </script>