summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2015-09-16 19:05:02 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2015-09-17 13:11:53 +0000
commit330c0ae2dcb9f99f380ceedb37ba02b891507613 (patch)
treeb42b6bbe4ce5f38917fed8da3516cb3d10db0561
parent62dd2add32c7c4d5d409d457c818ac88c952e7f6 (diff)
downloadqtwebkit-330c0ae2dcb9f99f380ceedb37ba02b891507613.tar.gz
Return correct surroundingText for HTMLTextFormControlElement.
Element::innerText() is always empty for <input> and <textarea> elements, so HTMLTextFormControlElement::innerTextValue() is used. NB: HTMLTextFormControlElement::value() should not be used because it is updated asynchronously after text input. Change-Id: I10eca4137236cfbef4c422cc935dd1c38a875301 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index a94b8c50a..3496083e2 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -680,7 +680,11 @@ EditorState WebPage::editorState() const
// FIXME: We should only transfer innerText when it changes and do this on the UI side.
if (result.isContentEditable && !result.isInPasswordField) {
- result.surroundingText = scope->innerText();
+ if (isHTMLTextFormControlElement(scope))
+ result.surroundingText = toHTMLTextFormControlElement(scope)->innerTextValue();
+ else
+ result.surroundingText = scope->innerText();
+
if (result.hasComposition) {
// The anchor is always the left position when they represent a composition.
result.surroundingText.remove(result.anchorPosition, result.cursorPosition - result.anchorPosition);