Chromium Code Reviews

Unified Diff: Source/core/html/HTMLTextAreaElement.cpp

Issue 21694005: Spell check whole content of an editable element when it gets focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase & review comments. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: Source/core/html/HTMLTextAreaElement.cpp
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp
index 03dd058004c659b8d34719330bf2d35c4a0b1346..296fe6e844d8391cfd14dd89aa58c1ed9e2b36c9 100644
--- a/Source/core/html/HTMLTextAreaElement.cpp
+++ b/Source/core/html/HTMLTextAreaElement.cpp
@@ -37,6 +37,7 @@
#include "core/dom/ExceptionCode.h"
#include "core/dom/Text.h"
#include "core/dom/shadow/ShadowRoot.h"
+#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
#include "core/editing/TextIterator.h"
#include "core/html/FormController.h"
@@ -266,6 +267,12 @@ void HTMLTextAreaElement::defaultEventHandler(Event* event)
HTMLTextFormControlElement::defaultEventHandler(event);
}
+void HTMLTextAreaElement::handleFocusEvent(Element* oldFocusedNode, FocusDirection direction)
+{
+ if (Frame* frame = document()->frame())
+ frame->editor()->textAreaOrTextFieldDidBeginEditing(this);
+}
+
void HTMLTextAreaElement::subtreeHasChanged()
{
setChangedSinceLastFormControlChangeEvent(true);

Powered by Google App Engine