Commit 57bdd8d3 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize w3c test harness in fast/forms/caret-rtl.html

This patch changes "fast/forms/caret-rtl.html" to utilize w3c test harness
instead of pixel dump for ease of maintenance and help to enable EditingNG.

Bug: 707656
Change-Id: I98e9d889dd843c4802d29997934d0d845cf24d70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2249398
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779194}
parent 9b1ec672
<html> <!doctype html>
<head> <script src="../../resources/ahem.js"></script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div CONTENTEDITABLE id="test" style="direction: rtl; width:200px; font-family: Ahem; font-size:2000%; outline: solid thin"></div>
<script> <script>
if (window.testRunner) { // Click in the div, the caret should be on the right edge of the div.
testRunner.dumpEditingCallbacks(); test(() => {
testRunner.dumpAsLayoutWithPixelResults(); const selection = window.getSelection();
} const target = document.getElementById('test');
target.focus();
function runTest() selection.collapse(target, 0);
{ if (!window.internals)
var e = document.getElementById("test"); throw 'This test requires internals.';
e.focus(); const rect = internals.absoluteCaretBounds();
} assert_equals(`(${rect.left},${rect.top})+${rect.width}x${rect.height}`,
'(207,8)+1x320');
}, 'This tests that clicking in a contenteditable div will set the caret in the right edge of the div');
</script> </script>
</head>
<body>
This tests that clicking in a contenteditable div will set the caret in the right edge of the div
<br>
<p>
Click in the div, the caret should be on the right edge of the div.
</p>
<div CONTENTEDITABLE id="test" style="direction: rtl; width:200px; font-size:2000%; outline: solid thin"></div>
</body>
<script> runTest(); </script>
</html>
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
LayoutBlockFlow (anonymous) at (0,0) size 784x20
LayoutText {#text} at (0,0) size 570x19
text run at (0,0) width 570: "This tests that clicking in a contenteditable div will set the caret in the right edge of the div "
LayoutBR {BR} at (570,15) size 0x0
LayoutBlockFlow {P} at (0,36) size 784x20
LayoutText {#text} at (0,0) size 399x19
text run at (0,0) width 399: "Click in the div, the caret should be on the right edge of the div."
LayoutBlockFlow {DIV} at (0,72) size 200x368
caret: position 0 of child 5 {DIV} 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
LayoutBlockFlow (anonymous) at (0,0) size 784x18
LayoutText {#text} at (0,0) size 586x18
text run at (0,0) width 586: "This tests that clicking in a contenteditable div will set the caret in the right edge of the div "
LayoutBR {BR} at (585,14) size 1x0
LayoutBlockFlow {P} at (0,34) size 784x18
LayoutText {#text} at (0,0) size 407x18
text run at (0,0) width 407: "Click in the div, the caret should be on the right edge of the div."
LayoutBlockFlow {DIV} at (0,68) size 200x368
caret: position 0 of child 5 {DIV} 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
LayoutBlockFlow (anonymous) at (0,0) size 784x20
LayoutText {#text} at (0,0) size 537x19
text run at (0,0) width 537: "This tests that clicking in a contenteditable div will set the caret in the right edge of the div "
LayoutBR {BR} at (537,15) size 0x0
LayoutBlockFlow {P} at (0,36) size 784x20
LayoutText {#text} at (0,0) size 378x19
text run at (0,0) width 378: "Click in the div, the caret should be on the right edge of the div."
LayoutBlockFlow {DIV} at (0,72) size 200x380
caret: position 0 of child 5 {DIV} 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