Commit ea3d1c58 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() for "editing/selection/focus-body.html"

This patch changes "focus-body.html" to utilize |selection_test()| for ease of
maintenance.

Note: "focus-body.html" is failed on layout_ng bot du by pixel test.

Bug: 679977, 636993
Change-Id: I6c3be17a3b92aab4fff714fc7798a2b323d97d52
Reviewed-on: https://chromium-review.googlesource.com/992076Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547894}
parent 071f9d76
<!doctype HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
if (window.testRunner)
testRunner.dumpEditingCallbacks();
selection_test(
'ab',
selection => {
const body = selection.document.body;
body.setAttribute('contenteditable', 'true');
body.focus();
},
'|ab',
'Focus to editable body should set caret instead of selecting body contents');
</script>
<body contenteditable="true">This test focuses an editable body. Its contents should not be selected.
<script>
document.body.focus();
</script>
</body>
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584
LayoutText {#text} at (0,0) size 436x19
text run at (0,0) width 218: "This test focuses an editable body. "
text run at (218,0) width 218: "Its contents should not be selected."
caret: position 0 of child 0 {#text} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584
LayoutText {#text} at (0,0) size 447x18
text run at (0,0) width 224: "This test focuses an editable body. "
text run at (223,0) width 224: "Its contents should not be selected."
caret: position 0 of child 0 {#text} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584
LayoutText {#text} at (0,0) size 421x19
text run at (0,0) width 210: "This test focuses an editable body. "
text run at (210,0) width 211: "Its contents should not be selected."
caret: position 0 of child 0 {#text} of body
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment