Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: LayoutTests/editing/spelling/spellcheck-async-mutation.html

Issue 21024004: Add/remove spell checking markers in text inputs depending on focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clean up in the test & the new expected file. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/editing/spelling/resources/util.js ('k') | Source/core/editing/Editor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/spelling/spellcheck-async-mutation.html
diff --git a/LayoutTests/editing/spelling/spellcheck-async-mutation.html b/LayoutTests/editing/spelling/spellcheck-async-mutation.html
index 6f2c0d88fa25780c1cdac78e908043f7b2f05e7a..ee16d2126f06beebde0b2bf5291e8e0213e5c603 100644
--- a/LayoutTests/editing/spelling/spellcheck-async-mutation.html
+++ b/LayoutTests/editing/spelling/spellcheck-async-mutation.html
@@ -4,6 +4,7 @@
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
<script src="../editing.js"></script>
+<script src="resources/util.js"></script>
<style>
.editing {
border: 2px solid red;
@@ -180,29 +181,6 @@ function waitForSpellCheckRequestDone(requestId, destination, tweakKind, restTry
setTimeout(doTestIfAny, 0);
}
-function findFirstTextNode(node)
-{
- function iterToFindFirstTextNode(node)
- {
- if (node instanceof Text)
- return node;
-
- var childNodes = node.childNodes;
- for (var i = 0; i < childNodes.length; ++i) {
- var n = iterToFindFirstTextNode(childNodes[i]);
- if (n)
- return n;
- }
-
- return null;
- }
-
- if (node instanceof HTMLInputElement || node instanceof HTMLTextAreaElement)
- return iterToFindFirstTextNode(internals.shadowRoot(node));
- else
- return iterToFindFirstTextNode(node);
-}
-
function verifyExistenceOfMarkers(elem, tweakKind) {
if (!window.internals)
return true;
@@ -211,7 +189,10 @@ function verifyExistenceOfMarkers(elem, tweakKind) {
case 'delete':
return true;
case 'move':
- // In move, marker should be there.
+ // In move, marker should be there. However since markers are removed when unfocusing
+ // an input if it's the input what's moved and it's not focused return true right away.
+ if (elem instanceof HTMLInputElement && elem != document.activeElement)
+ return true;
var markerNum = internals.markerCountForNode(findFirstTextNode(elem), "spelling");
if (markerNum != 3)
return false;
« no previous file with comments | « LayoutTests/editing/spelling/resources/util.js ('k') | Source/core/editing/Editor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698