Permalink
Browse files

Support "email", "search" and "url" as text input types.

  • Loading branch information...
1 parent caf9ca2 commit 1c8fe9bf0f71604e589df30d316a9bcaee448c8e @tristandunn committed Dec 15, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/webkit_server.js
View
@@ -102,9 +102,10 @@ window.WebKitServer = {
set: function(index, value) {
var node = this.nodes[index],
- type = (node.type || node.tagName).toLowerCase();
+ type = (node.type || node.tagName).toLowerCase(),
+ textTypes = ["email", "password", "search", "text", "textarea", "url"];
- if (type == "text" || type == "textarea" || type == "password") {
+ if (textTypes.indexOf(type) !== -1) {
this.trigger(index, "focus");
node.value = "";
@@ -126,12 +127,12 @@ window.WebKitServer = {
this.trigger(index, "change");
this.trigger(index, "blur");
- } else if(type == "checkbox" || type == "radio") {
+ } else if (type == "checkbox" || type == "radio") {
node.checked = (value == "true");
this.trigger(index, "click");
this.trigger(index, "change");
- } else if(type == "file") {
+ } else if (type == "file") {
this.lastAttachedFile = value;
this.trigger(index, "click");
} else {

0 comments on commit 1c8fe9b

Please sign in to comment.