Test chromium/chrome/editing/selection/click-before-and-after-table.html Detail
- id
- chromium/chrome/editing/selection/click-before-and-after-table.html
- type
- layouttest
- version
- 0
- enabled
- 1
- tags
- flags
- layouttests
- sections
-
- url
- http://localhost:8888/chromium/chrome/editing/selection/click-before-and-after-table.html
- file
- chromium/chrome/editing/selection/click-before-and-after-table.html
- results
-
Layouttest detail
expected:
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 7 of BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of BODY > HTML > #document to 1 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of BODY > HTML > #document to 1 of BODY > HTML > #document toDOMRange:range from 8 of #text > TD > TR > TBODY > TABLE > BODY > HTML > #document to 8 of #text > TD > TR > TBODY > TABLE > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > TD > TR > TBODY > TABLE > BODY > HTML > #document to 8 of #text > TD > TR > TBODY > TABLE > BODY > HTML > #document toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 0 of TD > TR > TBODY > TABLE > BODY > HTML > #document to 0 of TD > TR > TBODY > TABLE > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
cell one cell two
file:
<script>
if (window.layoutTestController)
layoutTestController.dumpEditingCallbacks();
</script>
<style>
td {
border: 1px solid #aaa;
}
</style>
<body onload="runTest()" style="border: 1px solid red;" contenteditable="true"><table id="table" style="margin: 25px; border:10px solid #ccc; padding: 10px;"><tr><td>cell one</td><td>cell two</td></tr></table>
<ul id="console"></ul>
<script>
function log(message) {
var console = document.getElementById("console");
var li = document.createElement("li");
var text = document.createTextNode(message);
console.appendChild(li);
li.appendChild(text);
}
function runTest() {
if (!window.layoutTestController)
log("This test uses the eventSender to do mouse clicks. To run it manually, click after the table, the caret should appear there (and not inside the table). Then click inside the table. The caret should appear inside it.");
else {
window.layoutTestController.dumpAsText();
var s, x, y, e, top, bottom, left, right;
table = document.getElementById("table");
top = table.offsetTop;
left = table.offsetLeft;
bottom = top + table.offsetHeight;
right = left + table.offsetWidth;
x = right + 5;
y = (top + bottom) / 2;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
s = window.getSelection();
if (!(s.anchorNode == document.body && s.anchorOffset == 1))
log("Failure: Clicking after the table didn't put the caret after it.");
x = right - 5;
y = (top + bottom) / 2;
eventSender.leapForward(1000);
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
s = window.getSelection();
if (s.anchorNode == document.body)
log("Failure: Clicking inside the table put the caret before or after it.");
x = left - 5;
y = (top + bottom) / 2;
eventSender.leapForward(1000);
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
s = window.getSelection();
if (s.anchorNode != table || s.anchorOffset != 0)
if (!(s.anchorNode == document.body && s.anchorOffset == 0))
log("Failure: Clicking before the table should be the caret before it.");
x = left + 5;
y = (top + bottom) / 2;
eventSender.leapForward(1000);
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
s = window.getSelection();
if (s.anchorNode == document.body)
log("Failure: Clicking inside the table put the caret before or after it.");
}
}
</script>
</body>
file frame
show/hide: