Commit 89bb78e3 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() in editing/editing/style/block-style-00{1,2}.html

This patch changes "block-style-00{1,2}.html" to utilize |selection_test()| and
integrates into "block-style-001.html" for ease of maintenance and help to
implementing EditingNG.

Bug: 707656, 679977
Change-Id: Ic2ae843b078ab9d85d6a7cb47337458fe3b031eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214584
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771480}
parent a1e66183
<html> <!doctype html>
<head> <script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style> <script src="../assert_selection.js"></script>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
</style>
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script> <script>
selection_test(
function editingTest() { [
justifyCenterCommand(); '<div contenteditable>',
} '<div>|abc</div>',
'<div>def</div>',
'</div>',
],
'justifyCenter',
[
'<div contenteditable>',
'<div style="text-align: center;">|abc</div>',
'<div>def</div>',
'</div>',
], 'left to center');
selection_test(
[
'<div contenteditable>',
'<div style="text-align: right;">|abc</div>',
'<div>def</div>',
'</div>',
],
'justifyCenter',
[
'<div contenteditable>',
'<div style="text-align: center;">|abc</div>',
'<div>def</div>',
'</div>',
], 'right to center');
</script> </script>
<title>Editing Test</title>
</head>
<body id="root" contenteditable>
<div id="test" class="editing">
Here is some text. Should be <b>centered</b>.
</div>
<div id="test" class="editing">
Here is some text. Should be <b>flush left</b>.
</div>
<script>
runEditingTest();
</script>
</body>
</html>
<html>
<head>
<style>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
</style>
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script>
function editingTest() {
justifyCenterCommand();
}
</script>
<title>Editing Test</title>
</head>
<body id="root" contenteditable>
<div style="test-align: right;" id="test" class="editing">
Here is some text. Should be <b>centered</b>.
</div>
<div id="test" class="editing">
Here is some text. Should be <b>flush left</b>.
</div>
<script>
runEditingTest();
</script>
</body>
</html>
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (202,14) size 285x27
text run at (202,14) width 285: "Here is some text. Should be "
LayoutInline {B} at (486,14) size 90x26
LayoutText {#text} at (486,14) size 90x26
text run at (486,14) width 90: "centered"
LayoutText {#text} at (575,14) size 7x27
text run at (575,14) width 7: "."
LayoutBlockFlow {DIV} at (0,56) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (14,14) size 284x27
text run at (14,14) width 284: "Here is some text. Should be "
LayoutInline {B} at (298,14) size 90x26
LayoutText {#text} at (298,14) size 90x26
text run at (298,14) width 90: "flush left"
LayoutText {#text} at (388,14) size 6x27
text run at (388,14) width 6: "."
caret: position 1 of child 0 {#text} of child 1 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (202,14) size 285x27
text run at (202,14) width 285: "Here is some text. Should be "
LayoutInline {B} at (486,14) size 90x26
LayoutText {#text} at (486,14) size 90x26
text run at (486,14) width 90: "centered"
LayoutText {#text} at (575,14) size 7x27
text run at (575,14) width 7: "."
LayoutBlockFlow {DIV} at (0,56) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (14,14) size 284x27
text run at (14,14) width 284: "Here is some text. Should be "
LayoutInline {B} at (298,14) size 90x26
LayoutText {#text} at (298,14) size 90x26
text run at (298,14) width 90: "flush left"
LayoutText {#text} at (388,14) size 6x27
text run at (388,14) width 6: "."
caret: position 1 of child 0 {#text} of child 1 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (204,14) size 283x28
text run at (204,14) width 283: "Here is some text. Should be "
LayoutInline {B} at (486,14) size 88x28
LayoutText {#text} at (486,14) size 88x28
text run at (486,14) width 88: "centered"
LayoutText {#text} at (573,14) size 7x28
text run at (573,14) width 7: "."
LayoutBlockFlow {DIV} at (0,56) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (14,14) size 282x28
text run at (14,14) width 282: "Here is some text. Should be "
LayoutInline {B} at (295,14) size 90x28
LayoutText {#text} at (295,14) size 90x28
text run at (295,14) width 90: "flush left"
LayoutText {#text} at (384,14) size 7x28
text run at (384,14) width 7: "."
caret: position 1 of child 0 {#text} of child 1 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (204,14) size 283x28
text run at (204,14) width 283: "Here is some text. Should be "
LayoutInline {B} at (486,14) size 88x28
LayoutText {#text} at (486,14) size 88x28
text run at (486,14) width 88: "centered"
LayoutText {#text} at (573,14) size 7x28
text run at (573,14) width 7: "."
LayoutBlockFlow {DIV} at (0,56) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (14,14) size 282x28
text run at (14,14) width 282: "Here is some text. Should be "
LayoutInline {B} at (295,14) size 90x28
LayoutText {#text} at (295,14) size 90x28
text run at (295,14) width 90: "flush left"
LayoutText {#text} at (384,14) size 7x28
text run at (384,14) width 7: "."
caret: position 1 of child 0 {#text} of child 1 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (204,14) size 281x27
text run at (204,14) width 281: "Here is some text. Should be "
LayoutInline {B} at (484,14) size 90x26
LayoutText {#text} at (484,14) size 90x26
text run at (484,14) width 90: "centered"
LayoutText {#text} at (573,14) size 7x27
text run at (573,14) width 7: "."
LayoutBlockFlow {DIV} at (0,56) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (14,14) size 280x27
text run at (14,14) width 280: "Here is some text. Should be "
LayoutInline {B} at (294,14) size 88x26
LayoutText {#text} at (294,14) size 88x26
text run at (294,14) width 88: "flush left"
LayoutText {#text} at (382,14) size 6x27
text run at (382,14) width 6: "."
caret: position 1 of child 0 {#text} of child 1 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (204,14) size 281x27
text run at (204,14) width 281: "Here is some text. Should be "
LayoutInline {B} at (484,14) size 90x26
LayoutText {#text} at (484,14) size 90x26
text run at (484,14) width 90: "centered"
LayoutText {#text} at (573,14) size 7x27
text run at (573,14) width 7: "."
LayoutBlockFlow {DIV} at (0,56) size 784x56 [border: (2px solid #FF0000)]
LayoutText {#text} at (14,14) size 280x27
text run at (14,14) width 280: "Here is some text. Should be "
LayoutInline {B} at (294,14) size 88x26
LayoutText {#text} at (294,14) size 88x26
text run at (294,14) width 88: "flush left"
LayoutText {#text} at (382,14) size 6x27
text run at (382,14) width 6: "."
caret: position 1 of child 0 {#text} of child 1 {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