Commit 555d7cce authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() for "editing/execCommand/5138441.html"

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

Following patch will rename "5138441.html" to "indent_before_blockquote.html".

Note: "5138441.html" is failed on layout_ng bot due by pixel test.

Bug: 679977, 636993
Change-Id: Id82a24a4b2c742fe729b1696ad428085965ee300
Reviewed-on: https://chromium-review.googlesource.com/991697Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547898}
parent ee5e69df
<html>
<head>
<style>
blockquote {
border: 1px dashed #aaa;
padding: 0.5em;
margin: 0.5em;
}
</style>
</head>
<body>
<p>This tests for a bug where indented text would appear quoted in GoogleDocs. Google docs uses blockquotes and FormatBlock to implement a "Quote Text" feature, and style rules for blockquotes appeared on the blockquotes that we use to implement indenting.</p>
<div contenteditable="true">
<div id="div">This should be indented, not quoted.</div>
<blockquote>This text should be Quoted.</blockquote>
</div>
<!doctype HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
var selection = window.getSelection();
var div = document.getElementById("div");
selection.collapse(div, 0);
document.execCommand("Indent");
// This tests for a bug where indented text would appear quoted in GoogleDocs.
// Google docs uses blockquotes and FormatBlock to implement a "Quote Text"
// feature, and style rules for blockquotes appeared on the blockquotes that we
// use to implement indenting.
selection_test(
[
'<div contenteditable>',
'<div>|ab</div>',
'<blockquote>CD</blockquote>',
'</div>',
],
'indent',
[
'<div contenteditable>',
'<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">',
'<div>|ab</div>',
'</blockquote>',
'<blockquote>CD</blockquote>',
'</div>',
],
'Indent before BLOCKQUOTE');
</script>
</body>
</html>
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 {P} at (0,0) size 784x60
LayoutText {#text} at (0,0) size 774x59
text run at (0,0) width 493: "This tests for a bug where indented text would appear quoted in GoogleDocs. "
text run at (493,0) width 218: "Google docs uses blockquotes and"
text run at (0,20) width 774: "FormatBlock to implement a \"Quote Text\" feature, and style rules for blockquotes appeared on the blockquotes that we use"
text run at (0,40) width 149: "to implement indenting."
LayoutBlockFlow {DIV} at (0,76) size 784x66
LayoutBlockFlow {BLOCKQUOTE} at (40,0) size 744x20
LayoutBlockFlow {DIV} at (0,0) size 744x20
LayoutText {#text} at (0,0) size 230x19
text run at (0,0) width 230: "This should be indented, not quoted."
LayoutBlockFlow {BLOCKQUOTE} at (8,28) size 768x38 [border: (1px dashed #AAAAAA)]
LayoutText {#text} at (9,9) size 175x19
text run at (9,9) width 175: "This text should be Quoted."
caret: position 0 of child 0 {#text} of child 0 {DIV} of child 1 {BLOCKQUOTE} of child 3 {DIV} of body
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 {P} at (0,0) size 784x54
LayoutText {#text} at (0,0) size 763x54
text run at (0,0) width 500: "This tests for a bug where indented text would appear quoted in GoogleDocs. "
text run at (499,0) width 221: "Google docs uses blockquotes and"
text run at (0,18) width 763: "FormatBlock to implement a \"Quote Text\" feature, and style rules for blockquotes appeared on the blockquotes that we"
text run at (0,36) width 179: "use to implement indenting."
LayoutBlockFlow {DIV} at (0,70) size 784x62
LayoutBlockFlow {BLOCKQUOTE} at (40,0) size 744x18
LayoutBlockFlow {DIV} at (0,0) size 744x18
LayoutText {#text} at (0,0) size 234x18
text run at (0,0) width 234: "This should be indented, not quoted."
LayoutBlockFlow {BLOCKQUOTE} at (8,26) size 768x36 [border: (1px dashed #AAAAAA)]
LayoutText {#text} at (9,9) size 178x18
text run at (9,9) width 178: "This text should be Quoted."
caret: position 0 of child 0 {#text} of child 0 {DIV} of child 1 {BLOCKQUOTE} of child 3 {DIV} of body
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 {P} at (0,0) size 784x60
LayoutText {#text} at (0,0) size 782x59
text run at (0,0) width 471: "This tests for a bug where indented text would appear quoted in GoogleDocs. "
text run at (471,0) width 311: "Google docs uses blockquotes and FormatBlock to"
text run at (0,20) width 724: "implement a \"Quote Text\" feature, and style rules for blockquotes appeared on the blockquotes that we use to implement"
text run at (0,40) width 57: "indenting."
LayoutBlockFlow {DIV} at (0,76) size 784x66
LayoutBlockFlow {BLOCKQUOTE} at (40,0) size 744x20
LayoutBlockFlow {DIV} at (0,0) size 744x20
LayoutText {#text} at (0,0) size 219x19
text run at (0,0) width 219: "This should be indented, not quoted."
LayoutBlockFlow {BLOCKQUOTE} at (8,28) size 768x38 [border: (1px dashed #AAAAAA)]
LayoutText {#text} at (9,9) size 167x19
text run at (9,9) width 167: "This text should be Quoted."
caret: position 0 of child 0 {#text} of child 0 {DIV} of child 1 {BLOCKQUOTE} of child 3 {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