Chromium Code Reviews| Index: Source/web/WebFormControlElement.cpp |
| diff --git a/Source/web/WebFormControlElement.cpp b/Source/web/WebFormControlElement.cpp |
| index d833087906325288ae0a1ca59221e875b3841718..94c0c1fa423b41ed225b3388fc7027a670ea655e 100644 |
| --- a/Source/web/WebFormControlElement.cpp |
| +++ b/Source/web/WebFormControlElement.cpp |
| @@ -33,6 +33,9 @@ |
| #include "core/html/HTMLFormControlElement.h" |
| #include "core/html/HTMLFormElement.h" |
| +#include "core/html/HTMLInputElement.h" |
| +#include "core/html/HTMLTextAreaElement.h" |
| + |
| #include "wtf/PassRefPtr.h" |
| using namespace WebCore; |
| @@ -79,6 +82,27 @@ WebString WebFormControlElement::nameForAutofill() const |
| return constUnwrap<HTMLFormControlElement>()->nameForAutofill(); |
| } |
| +WebString WebFormControlElement::editingValue() const |
| +{ |
| + if (m_private->hasTagName(HTMLNames::inputTag)) |
| + return constUnwrap<HTMLInputElement>()->innerTextValue(); |
| + return constUnwrap<HTMLTextAreaElement>()->innerTextValue(); |
|
tkent
2014/03/04 00:15:56
Need to check hasTagName(textareaTag) too.
ziran.sun
2014/03/04 12:12:40
Done.
|
| +} |
| + |
| +int WebFormControlElement::selectionStart() const |
| +{ |
| + if (m_private->hasTagName(HTMLNames::inputTag)) |
| + return constUnwrap<HTMLInputElement>()->selectionStart(); |
| + return constUnwrap<HTMLTextAreaElement>()->selectionStart(); |
|
tkent
2014/03/04 00:15:56
ditto.
ziran.sun
2014/03/04 12:12:40
Done.
|
| +} |
| + |
| +int WebFormControlElement::selectionEnd() const |
| +{ |
| + if (m_private->hasTagName(HTMLNames::inputTag)) |
| + return constUnwrap<HTMLInputElement>()->selectionEnd(); |
| + return constUnwrap<HTMLTextAreaElement>()->selectionEnd(); |
|
tkent
2014/03/04 00:15:56
ditto.
ziran.sun
2014/03/04 12:12:40
Done.
|
| +} |
| + |
| WebFormElement WebFormControlElement::form() const |
| { |
| return WebFormElement(constUnwrap<HTMLFormControlElement>()->form()); |