summaryrefslogtreecommitdiffstats
path: root/webkit/port
diff options
context:
space:
mode:
authorager@google.com <ager@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 08:42:48 +0000
committerager@google.com <ager@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 08:42:48 +0000
commitfe353520ea60183a44c4e8374ab21687df7744c1 (patch)
tree5ceb94d6be5981af5fd11d608f7b05f7f3a40bb8 /webkit/port
parentbf9e07ed58fcdf285376a0583de21caecdb7e52e (diff)
downloadchromium_src-fe353520ea60183a44c4e8374ab21687df7744c1.zip
chromium_src-fe353520ea60183a44c4e8374ab21687df7744c1.tar.gz
chromium_src-fe353520ea60183a44c4e8374ab21687df7744c1.tar.bz2
Add missing returns in setters for selectionStart and selectionEnd.
Added error messages to exceptions. Remove passing test from test list. Review URL: http://codereview.chromium.org/19421 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r--webkit/port/bindings/v8/v8_custom.cpp27
-rw-r--r--webkit/port/bindings/v8/v8_custom.h6
2 files changed, 19 insertions, 14 deletions
diff --git a/webkit/port/bindings/v8/v8_custom.cpp b/webkit/port/bindings/v8/v8_custom.cpp
index 52d9469..c9c9980 100644
--- a/webkit/port/bindings/v8/v8_custom.cpp
+++ b/webkit/port/bindings/v8/v8_custom.cpp
@@ -3263,8 +3263,9 @@ ACCESSOR_GETTER(HTMLInputElementSelectionStart) {
HTMLInputElement* imp = V8Proxy::DOMWrapperToNode<HTMLInputElement>(holder);
if (!imp->canHaveSelection()) {
- // TODO(playmobil): Add a proper error string.
- V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "");
+ V8Proxy::ThrowError(V8Proxy::TYPE_ERROR,
+ "Accessing selectionStart on an input element that "
+ "cannot have a selection.");
return v8::Undefined();
}
@@ -3278,8 +3279,10 @@ ACCESSOR_SETTER(HTMLInputElementSelectionStart) {
HTMLInputElement* imp = V8Proxy::DOMWrapperToNode<HTMLInputElement>(holder);
if (!imp->canHaveSelection()) {
- // TODO(playmobil): Add a proper error string.
- V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "");
+ V8Proxy::ThrowError(V8Proxy::TYPE_ERROR,
+ "Accessing selectionStart on an input element that "
+ "cannot have a selection.");
+ return;
}
imp->setSelectionStart(value->Int32Value());
}
@@ -3290,8 +3293,9 @@ ACCESSOR_GETTER(HTMLInputElementSelectionEnd) {
HTMLInputElement* imp = V8Proxy::DOMWrapperToNode<HTMLInputElement>(holder);
if (!imp->canHaveSelection()) {
- // TODO(playmobil): Add a proper error string.
- V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "");
+ V8Proxy::ThrowError(V8Proxy::TYPE_ERROR,
+ "Accessing selectionEnd on an input element that "
+ "cannot have a selection.");
return v8::Undefined();
}
@@ -3305,8 +3309,10 @@ ACCESSOR_SETTER(HTMLInputElementSelectionEnd) {
HTMLInputElement* imp = V8Proxy::DOMWrapperToNode<HTMLInputElement>(holder);
if (!imp->canHaveSelection()) {
- // TODO(playmobil): Add a proper error string.
- V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "");
+ V8Proxy::ThrowError(V8Proxy::TYPE_ERROR,
+ "Accessing selectionEnd on an input element that "
+ "cannot have a selection.");
+ return;
}
imp->setSelectionEnd(value->Int32Value());
}
@@ -3317,8 +3323,9 @@ CALLBACK_FUNC_DECL(HTMLInputElementSetSelectionRange) {
HTMLInputElement* imp = V8Proxy::DOMWrapperToNode<HTMLInputElement>(holder);
if (!imp->canHaveSelection()) {
- // TODO(playmobil): Add a proper error string.
- V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "");
+ V8Proxy::ThrowError(V8Proxy::TYPE_ERROR,
+ "Calling setSelectionRange on an input element that "
+ "cannot have a selection.");
return v8::Undefined();
}
int start = args[0]->Int32Value();
diff --git a/webkit/port/bindings/v8/v8_custom.h b/webkit/port/bindings/v8/v8_custom.h
index 9dcbc41..125db8e 100644
--- a/webkit/port/bindings/v8/v8_custom.h
+++ b/webkit/port/bindings/v8/v8_custom.h
@@ -211,10 +211,8 @@ DECLARE_PROPERTY_ACCESSOR(HTMLOptionsCollectionLength)
DECLARE_CALLBACK(HTMLInputElementSetSelectionRange)
// Customized accessors for HTMLInputElement
-DECLARE_PROPERTY_ACCESSOR_GETTER(HTMLInputElementSelectionStart)
-DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLInputElementSelectionStart)
-DECLARE_PROPERTY_ACCESSOR_GETTER(HTMLInputElementSelectionEnd)
-DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLInputElementSelectionEnd)
+DECLARE_PROPERTY_ACCESSOR(HTMLInputElementSelectionStart)
+DECLARE_PROPERTY_ACCESSOR(HTMLInputElementSelectionEnd)
DECLARE_NAMED_ACCESS_CHECK(Location)
DECLARE_INDEXED_ACCESS_CHECK(History)