Add tests to ensure spelling error dots are drawn in the correct place for overlappin...
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Oct 2017 17:49:22 +0000 (17:49 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Oct 2017 17:49:22 +0000 (17:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178611
<rdar://problem/35105805>

Reviewed by Zalan Bujtas.

Add tests to ensure that we paint the spelling error dots in the correct place for
overlapping lines.

* editing/spelling/spelling-markers-in-overlapping-lines-expected.html: Added.
* editing/spelling/spelling-markers-in-overlapping-lines-large-font-expected.html: Added.
* editing/spelling/spelling-markers-in-overlapping-lines-large-font.html: Added.
* editing/spelling/spelling-markers-in-overlapping-lines.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: http://svn.webkit.org/repository/webkit/trunk@223842 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines-expected.html [new file with mode: 0644]
LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines-large-font-expected.html [new file with mode: 0644]
LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines-large-font.html [new file with mode: 0644]
LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations

index ee358d3..d1c30a7 100644 (file)
@@ -1,3 +1,22 @@
+2017-10-23  Daniel Bates  <dabates@apple.com>
+
+        Add tests to ensure spelling error dots are drawn in the correct place for overlapping lines
+        https://bugs.webkit.org/show_bug.cgi?id=178611
+        <rdar://problem/35105805>
+
+        Reviewed by Zalan Bujtas.
+
+        Add tests to ensure that we paint the spelling error dots in the correct place for
+        overlapping lines.
+
+        * editing/spelling/spelling-markers-in-overlapping-lines-expected.html: Added.
+        * editing/spelling/spelling-markers-in-overlapping-lines-large-font-expected.html: Added.
+        * editing/spelling/spelling-markers-in-overlapping-lines-large-font.html: Added.
+        * editing/spelling/spelling-markers-in-overlapping-lines.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-23  Zan Dobersek  <zdobersek@igalia.com>
 
         Unreviewed WPE gardening. Unskip the SVG tests and generate the
diff --git a/LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines-expected.html b/LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines-expected.html
new file mode 100644 (file)
index 0000000..7ffb16c
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: Ahem;
+    src: url("../../resources/Ahem.ttf");
+}
+
+body {
+    margin: 0;
+    padding: 0;
+    font: 20px/1 Ahem;
+}
+
+#first {
+    position: relative;
+    top: -5px;
+}
+
+#second {
+    position: relative;
+    top: -10px;
+}
+</style>
+</head>
+<body>
+<div id="first" contenteditable="true"></div>
+<div id="second" contenteditable="true"></div>
+<script>
+var first = document.getElementById("first");
+var second = document.getElementById("second");
+
+for (var element of [first, second]) {
+    element.focus();
+    document.execCommand("InsertText", false, "mispelled");
+    document.execCommand("InsertText", false, " "); // Trigger spell checking
+    element.blur();
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines-large-font-expected.html b/LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines-large-font-expected.html
new file mode 100644 (file)
index 0000000..53aa4f1
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: Ahem;
+    src: url("../../resources/Ahem.ttf");
+}
+
+body {
+    margin: 0;
+    padding: 0;
+    font: 40px/1 Ahem;
+}
+
+#first {
+    position: relative;
+    top: -10px;
+}
+
+#second {
+    position: relative;
+    top: -20px;
+}
+</style>
+</head>
+<body>
+<div id="first" contenteditable="true"></div>
+<div id="second" contenteditable="true"></div>
+<script>
+var first = document.getElementById("first");
+var second = document.getElementById("second");
+
+for (var element of [first, second]) {
+    element.focus();
+    document.execCommand("InsertText", false, "mispelled");
+    document.execCommand("InsertText", false, " "); // Trigger spell checking
+    element.blur();
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines-large-font.html b/LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines-large-font.html
new file mode 100644 (file)
index 0000000..adf4c72
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: Ahem;
+    src: url("../../resources/Ahem.ttf");
+}
+
+body {
+    margin: 0;
+    padding: 0;
+    font: 40px/1 Ahem;
+}
+
+#first {
+    line-height: 20px;
+}
+</style>
+</head>
+<body>
+<div id="first" contenteditable="true"></div>
+<div id="second" contenteditable="true"></div>
+<script>
+var first = document.getElementById("first");
+var second = document.getElementById("second");
+
+for (var element of [first, second]) {
+    element.focus();
+    document.execCommand("InsertText", false, "mispelled");
+    document.execCommand("InsertText", false, " "); // Trigger spell checking
+    element.blur();
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines.html b/LayoutTests/editing/spelling/spelling-markers-in-overlapping-lines.html
new file mode 100644 (file)
index 0000000..99e66e9
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: Ahem;
+    src: url("../../resources/Ahem.ttf");
+}
+
+body {
+    margin: 0;
+    padding: 0;
+    font: 20px/1 Ahem;
+}
+
+#first {
+    line-height: 10px;
+}
+</style>
+</head>
+<body>
+<div id="first" contenteditable="true"></div>
+<div id="second" contenteditable="true"></div>
+<script>
+var first = document.getElementById("first");
+var second = document.getElementById("second");
+
+for (var element of [first, second]) {
+    element.focus();
+    document.execCommand("InsertText", false, "mispelled");
+    document.execCommand("InsertText", false, " "); // Trigger spell checking
+    element.blur();
+}
+</script>
+</body>
+</html>
index 82d5278..1259811 100644 (file)
@@ -95,7 +95,9 @@ mhtml
 fast/forms/file/file-input-capture.html
 
 # Spelling and grammar markers are not supported
-webkit.org/b/105616 editing/spelling/spelling-marker-includes-hyphen.html [ WontFix ]
+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 ]
 
 # Plugins are not supported on iOS
 plugins
index d7f4b80..b6b4d22 100644 (file)
@@ -209,6 +209,8 @@ webkit.org/b/105616 editing/mac/spelling/removing-underline-after-accepting-auto
 webkit.org/b/105616 editing/mac/spelling/accept-candidate-allows-autocorrect-on-next-word.html [ Failure ]
 webkit.org/b/105616 editing/mac/spelling/accept-unseen-candidate-records-acceptance.html [ Failure ]
 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 ]
 
 # [WK2] [Mac] Support drag in mouse events for WebKit2 EventSender
 # <https://bugs.webkit.org/show_bug.cgi?id=68552>