Reviewers: dmazzoni
CL:
https://codereview.chromium.org/2268183006/Description:
Added accessibility notification from Blink when spelling mistakes are detected.
I still have to figure out how to test this properly and also ask for a review
from Yosin@, but please have a first look to tell me if it's in the right
direction.
BUG=640479
R=dmaz...@chromium.orgBase URL:
https://chromium.googlesource.com/chromium/src.git@masterAffected files (+14, -0 lines):
M third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h
M third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
Index: third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
index b37a5d86c095894551447c485c8b0674d710e165..048e6587ff93c5562a9a85a0c4b67ed8a85bec49 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp
@@ -25,6 +25,7 @@
#include "core/editing/spellcheck/SpellCheckRequester.h"
+#include "core/dom/AXObjectCache.h"
#include "core/dom/Document.h"
#include "core/dom/Node.h"
#include "core/editing/EditingUtilities.h"
@@ -284,6 +285,7 @@ void SpellCheckRequester::didCheckSucceed(int sequence, const Vector<TextCheckin
}
}
didCheck(sequence, results);
+ reportDocumentMarkersChangeToAccessibility();
}
void SpellCheckRequester::didCheckCancel(int sequence)
@@ -292,6 +294,17 @@ void SpellCheckRequester::didCheckCancel(int sequence)
didCheck(sequence, results);
}
+void SpellCheckRequester::reportDocumentMarkersChangeToAccessibility() const
+{
+ if (!m_processingRequest || !m_processingRequest->isValid())
+ return;
+
+ AXObjectCache* axObjectCache = frame().document()->existingAXObjectCache();
+ if (!axObjectCache)
+ return;
+ axObjectCache->handleEditableTextContentChanged(m_processingRequest->rootEditableElement());
+}
+
DEFINE_TRACE(SpellCheckRequester)
{
visitor->trace(m_frame);
Index: third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h
index 366713cfe36dcd24713abdf0139b978af3e9f2af..b218c7ba74b33d2ed63e135baa9d76be3365b334 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h
@@ -114,6 +114,7 @@ private:
void didCheckSucceed(int sequence, const Vector<TextCheckingResult>&);
void didCheckCancel(int sequence);
void didCheck(int sequence, const Vector<TextCheckingResult>&);
+ void reportDocumentMarkersChangeToAccessibility() const;
void clearProcessingRequest();