summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/port/bindings/v8/v8_custom.cpp27
-rw-r--r--webkit/port/bindings/v8/v8_custom.h6
-rw-r--r--webkit/tools/layout_tests/test_lists/tests_fixable.txt9
3 files changed, 19 insertions, 23 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)
diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt
index 0cf97f5..c5ddf0a 100644
--- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt
+++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt
@@ -1013,15 +1013,6 @@ LayoutTests/fast/js/function-dot-arguments.html = FAIL
LayoutTests/fast/js/primitive-method-this.html = FAIL
LayoutTests/http/tests/plugins/local-geturl-from-remote.html = CRASH FAIL
-// The handling of the selection functions on HTMLInputElements differ
-// from the Firefox behavior. We should follow Firefox and I believe
-// that WebKit should as well. I have submitted a patch to fix this
-// upstream after which it will be easy to fix in the v8 bindings as
-// well.
-//
-// https://bugs.webkit.org/show_bug.cgi?id=23300
-LayoutTests/fast/forms/selection-functions.html = FAIL
-
// MERGE REGRESSIONS 36102:37604
LINUX : LayoutTests/fast/events/mouse-click-events.html = FAIL