Add tests to ensure spelling error dots are drawn in the correct place in bottom...
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Oct 2017 18:10:15 +0000 (18:10 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Oct 2017 18:10:15 +0000 (18:10 +0000)
and right-to-left writing modes
https://bugs.webkit.org/show_bug.cgi?id=178671

Reviewed by Simon Fraser.

* fast/writing-mode/english-bt-text-with-spelling-marker-expected.html: Added.
* fast/writing-mode/english-bt-text-with-spelling-marker.html: Added.
* fast/writing-mode/english-rl-text-with-spelling-marker-expected.html: Added.
* fast/writing-mode/english-rl-text-with-spelling-marker.html: Added.
* platform/ios/TestExpectations: Skip the test on iOS as it does not support spelling and grammar
marker painting.
* platform/mac-wk2/TestExpectations: Mark the test as an image failure until we fix <https://bugs.webkit.org/show_bug.cgi?id=105616>.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223845 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/writing-mode/english-bt-text-with-spelling-marker-expected.html [new file with mode: 0644]
LayoutTests/fast/writing-mode/english-bt-text-with-spelling-marker.html [new file with mode: 0644]
LayoutTests/fast/writing-mode/english-rl-text-with-spelling-marker-expected.html [new file with mode: 0644]
LayoutTests/fast/writing-mode/english-rl-text-with-spelling-marker.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations

index fc6480c..dd19429 100644 (file)
@@ -1,3 +1,19 @@
+2017-10-23  Daniel Bates  <dabates@apple.com>
+
+        Add tests to ensure spelling error dots are drawn in the correct place in bottom-to-top
+        and right-to-left writing modes
+        https://bugs.webkit.org/show_bug.cgi?id=178671
+
+        Reviewed by Simon Fraser.
+
+        * fast/writing-mode/english-bt-text-with-spelling-marker-expected.html: Added.
+        * fast/writing-mode/english-bt-text-with-spelling-marker.html: Added.
+        * fast/writing-mode/english-rl-text-with-spelling-marker-expected.html: Added.
+        * fast/writing-mode/english-rl-text-with-spelling-marker.html: Added.
+        * platform/ios/TestExpectations: Skip the test on iOS as it does not support spelling and grammar
+        marker painting.
+        * platform/mac-wk2/TestExpectations: Mark the test as an image failure until we fix <https://bugs.webkit.org/show_bug.cgi?id=105616>.
+
 2017-10-22  Dean Jackson  <dino@apple.com>
 
         Implement drawImage(ImageBitmap) on 2d canvas
diff --git a/LayoutTests/fast/writing-mode/english-bt-text-with-spelling-marker-expected.html b/LayoutTests/fast/writing-mode/english-bt-text-with-spelling-marker-expected.html
new file mode 100644 (file)
index 0000000..c0e1364
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: Ahem;
+    src: url("../../resources/Ahem.ttf");
+}
+
+#expected {
+    display: inline-block;
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 200px;
+    font: 20px/1 Ahem;
+}
+</style>
+</head>
+<body>
+<div id="expected" contenteditable="true"></div>
+<script>
+var expected = document.getElementById("expected");
+
+// When inserting multiple words we need to type each character in order for the spell checker to be triggered.
+typeText("mispelled a", expected);
+
+function typeText(text, element)
+{
+    element.focus();
+    for (var i = 0; i < text.length; ++i)
+        document.execCommand("InsertText", false, text[i]);
+    element.blur();
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/writing-mode/english-bt-text-with-spelling-marker.html b/LayoutTests/fast/writing-mode/english-bt-text-with-spelling-marker.html
new file mode 100644 (file)
index 0000000..6b9da45
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: Ahem;
+    src: url("../../resources/Ahem.ttf");
+}
+
+body {
+    -webkit-writing-mode: horizontal-bt;
+    font: 20px/1 Ahem;
+}
+
+#test {
+    display: inline-block;
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 200px;
+}
+</style>
+</head>
+<body>
+<div id="test" contenteditable="true"></div>
+<script>
+var test = document.getElementById("test");
+
+// When inserting multiple words we need to type each character in order for the spell checker to be triggered.
+typeText("a mispelled", test);
+
+function typeText(text, element)
+{
+    element.focus();
+    for (var i = 0; i < text.length; ++i)
+        document.execCommand("InsertText", false, text[i]);
+    element.blur();
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/writing-mode/english-rl-text-with-spelling-marker-expected.html b/LayoutTests/fast/writing-mode/english-rl-text-with-spelling-marker-expected.html
new file mode 100644 (file)
index 0000000..6e71dca
--- /dev/null
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: Ahem;
+    src: url("../../resources/Ahem.ttf");
+}
+
+#expected {
+    display: inline-block;
+    position: absolute;
+    left: 0;
+    top: 0;
+    font: 20px/1 Ahem;
+    width: 200px;
+    transform: translate(-90px, 90px) rotate(90deg);
+}
+</style>
+</head>
+<body>
+<div id="expected" contenteditable="true"></div>
+<script>
+var expected = document.getElementById("expected");
+expected.focus();
+document.execCommand("InsertText", false, "mispelled");
+document.execCommand("InsertText", false, " "); // Trigger spell checking
+expected.blur();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/writing-mode/english-rl-text-with-spelling-marker.html b/LayoutTests/fast/writing-mode/english-rl-text-with-spelling-marker.html
new file mode 100644 (file)
index 0000000..6691509
--- /dev/null
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: Ahem;
+    src: url("../../resources/Ahem.ttf");
+}
+
+body {
+    -webkit-writing-mode: vertical-rl;
+    font: 20px/1 Ahem;
+}
+
+#test {
+    display: inline-block;
+    position: absolute;
+    left: 0;
+    top: 0;
+    height: 200px;
+}
+</style>
+</head>
+<body>
+<div id="test" contenteditable="true"></div>
+<script>
+var test = document.getElementById("test");
+test.focus();
+document.execCommand("InsertText", false, "mispelled");
+document.execCommand("InsertText", false, " "); // Trigger spell checking
+test.blur();
+</script>
+</body>
+</html>
index 1259811..71843ea 100644 (file)
@@ -98,6 +98,8 @@ fast/forms/file/file-input-capture.html
 editing/spelling/spelling-marker-includes-hyphen.html [ WontFix ]
 editing/spelling/spelling-markers-in-overlapping-lines.html [ WontFix ]
 editing/spelling/spelling-markers-in-overlapping-lines-large-font.html [ WontFix ]
+fast/writing-mode/english-bt-text-with-spelling-marker.html [ WontFix ]
+fast/writing-mode/english-rl-text-with-spelling-marker.html [ WontFix ]
 
 # Plugins are not supported on iOS
 plugins
index b6b4d22..7212611 100644 (file)
@@ -211,6 +211,8 @@ webkit.org/b/105616 editing/mac/spelling/accept-unseen-candidate-records-accepta
 webkit.org/b/105616 editing/spelling/spelling-marker-includes-hyphen.html [ ImageOnlyFailure ]
 webkit.org/b/105616 editing/spelling/spelling-markers-in-overlapping-lines.html [ ImageOnlyFailure ]
 webkit.org/b/105616 editing/spelling/spelling-markers-in-overlapping-lines-large-font.html [ ImageOnlyFailure ]
+webkit.org/b/105616 fast/writing-mode/english-bt-text-with-spelling-marker.html [ ImageOnlyFailure ]
+webkit.org/b/105616 fast/writing-mode/english-rl-text-with-spelling-marker.html [ ImageOnlyFailure ]
 
 # [WK2] [Mac] Support drag in mouse events for WebKit2 EventSender
 # <https://bugs.webkit.org/show_bug.cgi?id=68552>