void HTMLTextFieldAccessible::Value(nsString& aValue) const { aValue.Truncate(); if (NativeState() & states::PROTECTED) // Don't return password text! return; HTMLTextAreaElement* textArea = HTMLTextAreaElement::FromNode(mContent); if (textArea) { textArea->GetValue(aValue); return; } HTMLInputElement* input = HTMLInputElement::FromNode(mContent); if (input) { // Pass NonSystem as the caller type, to be safe. We don't expect to have a // file input here. input->GetValue(aValue, CallerType::NonSystem); } }
already_AddRefed<nsIController> nsXBLPrototypeHandler::GetController(EventTarget* aTarget) { // XXX Fix this so there's a generic interface that describes controllers, // This code should have no special knowledge of what objects might have controllers. nsCOMPtr<nsIControllers> controllers; nsCOMPtr<nsIContent> targetContent(do_QueryInterface(aTarget)); RefPtr<nsXULElement> xulElement = nsXULElement::FromContentOrNull(targetContent); if (xulElement) { controllers = xulElement->GetControllers(IgnoreErrors()); } if (!controllers) { HTMLTextAreaElement* htmlTextArea = HTMLTextAreaElement::FromContent(targetContent); if (htmlTextArea) htmlTextArea->GetControllers(getter_AddRefs(controllers)); } if (!controllers) { nsCOMPtr<nsIDOMHTMLInputElement> htmlInputElement(do_QueryInterface(aTarget)); if (htmlInputElement) htmlInputElement->GetControllers(getter_AddRefs(controllers)); } if (!controllers) { nsCOMPtr<nsPIDOMWindowOuter> domWindow(do_QueryInterface(aTarget)); if (domWindow) { domWindow->GetControllers(getter_AddRefs(controllers)); } } // Return the first controller. // XXX This code should be checking the command name and using supportscommand and // iscommandenabled. nsCOMPtr<nsIController> controller; if (controllers) { controllers->GetControllerAt(0, getter_AddRefs(controller)); } return controller.forget(); }
static v8::Handle<v8::Value> requiredAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.HTMLTextAreaElement.required._get"); HTMLTextAreaElement* imp = V8HTMLTextAreaElement::toNative(info.Holder()); return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::requiredAttr)); }
void JSHTMLTextAreaElement::putValueProperty(ExecState* exec, int token, JSValue* value) { switch (token) { case DefaultValueAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setDefaultValue(valueToStringWithNullCheck(exec, value)); break; } case AccessKeyAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setAccessKey(valueToStringWithNullCheck(exec, value)); break; } case ColsAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setCols(value->toInt32(exec)); break; } case DisabledAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setDisabled(value->toBoolean(exec)); break; } case AutofocusAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setAutofocus(value->toBoolean(exec)); break; } case NameAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setName(valueToStringWithNullCheck(exec, value)); break; } case ReadOnlyAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setReadOnly(value->toBoolean(exec)); break; } case RowsAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setRows(value->toInt32(exec)); break; } case ValueAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setValue(valueToStringWithNullCheck(exec, value)); break; } case SelectionStartAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setSelectionStart(value->toInt32(exec)); break; } case SelectionEndAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); imp->setSelectionEnd(value->toInt32(exec)); break; } } }
void DOMHTMLTextAreaElement::setValue(WebCore::String value) { ASSERT(m_element && m_element->hasTagName(textareaTag)); HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); textareaElement->setValue(value); }
HTMLTextAreaElement* HTMLTextAreaElement::create(Document& document, HTMLFormElement* form) { HTMLTextAreaElement* textArea = new HTMLTextAreaElement(document, form); textArea->ensureUserAgentShadowRoot(); return textArea; }
static v8::Handle<v8::Value> validityAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.HTMLTextAreaElement.validity._get"); HTMLTextAreaElement* imp = V8HTMLTextAreaElement::toNative(info.Holder()); return toV8(imp->validity()); }
static v8::Handle<v8::Value> checkValidityCallback(const v8::Arguments& args) { INC_STATS("DOM.HTMLTextAreaElement.checkValidity"); HTMLTextAreaElement* imp = V8HTMLTextAreaElement::toNative(args.Holder()); return v8Boolean(imp->checkValidity()); }
void setJSHTMLTextAreaElementSelectionEnd(ExecState* exec, JSObject* thisObject, JSValue value) { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(static_cast<JSHTMLTextAreaElement*>(thisObject)->impl()); imp->setSelectionEnd(value.toInt32(exec)); }
void setJSHTMLTextAreaElementValue(ExecState* exec, JSObject* thisObject, JSValue value) { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(static_cast<JSHTMLTextAreaElement*>(thisObject)->impl()); imp->setValue(valueToStringWithNullCheck(exec, value)); }
void setJSHTMLTextAreaElementReadOnly(ExecState* exec, JSObject* thisObject, JSValue value) { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(static_cast<JSHTMLTextAreaElement*>(thisObject)->impl()); imp->setReadOnly(value.toBoolean(exec)); }
JSValue jsHTMLTextAreaElementSelectionEnd(ExecState* exec, const Identifier&, const PropertySlot& slot) { UNUSED_PARAM(exec); HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(static_cast<JSHTMLTextAreaElement*>(asObject(slot.slotBase()))->impl()); return jsNumber(exec, imp->selectionEnd()); }
JSValue jsHTMLTextAreaElementWillValidate(ExecState* exec, const Identifier&, const PropertySlot& slot) { UNUSED_PARAM(exec); HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(static_cast<JSHTMLTextAreaElement*>(asObject(slot.slotBase()))->impl()); return jsBoolean(imp->willValidate()); }
JSValue jsHTMLTextAreaElementType(ExecState* exec, const Identifier&, const PropertySlot& slot) { UNUSED_PARAM(exec); HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(static_cast<JSHTMLTextAreaElement*>(asObject(slot.slotBase()))->impl()); return jsString(exec, imp->type()); }
static v8::Handle<v8::Value> textLengthAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.HTMLTextAreaElement.textLength._get"); HTMLTextAreaElement* imp = V8HTMLTextAreaElement::toNative(info.Holder()); return v8::Integer::NewFromUnsigned(imp->textLength()); }
static v8::Handle<v8::Value> willValidateAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.HTMLTextAreaElement.willValidate._get"); HTMLTextAreaElement* imp = V8HTMLTextAreaElement::toNative(info.Holder()); return v8Boolean(imp->willValidate()); }
const char* DOMHTMLTextAreaElement::value() { ASSERT(m_element && m_element->hasTagName(textareaTag)); HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); return strdup(textareaElement->value().utf8().data()); }
static v8::Handle<v8::Value> defaultValueAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.HTMLTextAreaElement.defaultValue._get"); HTMLTextAreaElement* imp = V8HTMLTextAreaElement::toNative(info.Holder()); return v8String(imp->defaultValue()); }
void DOMHTMLTextAreaElement::setValue(const char* value) { ASSERT(m_element && m_element->hasTagName(textareaTag)); HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); textareaElement->setValue(value); }
static v8::Handle<v8::Value> colsAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.HTMLTextAreaElement.cols._get"); HTMLTextAreaElement* imp = V8HTMLTextAreaElement::toNative(info.Holder()); return v8::Integer::New(imp->cols()); }
void DOMHTMLTextAreaElement::select() { ASSERT(m_element && m_element->hasTagName(textareaTag)); HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); textareaElement->select(); }
JSValue* JSHTMLTextAreaElement::getValueProperty(ExecState* exec, int token) const { switch (token) { case DefaultValueAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsString(exec, imp->defaultValue()); } case FormAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return toJS(exec, WTF::getPtr(imp->form())); } case AccessKeyAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsString(exec, imp->accessKey()); } case ColsAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsNumber(exec, imp->cols()); } case DisabledAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsBoolean(imp->disabled()); } case AutofocusAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsBoolean(imp->autofocus()); } case NameAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsString(exec, imp->name()); } case ReadOnlyAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsBoolean(imp->readOnly()); } case RowsAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsNumber(exec, imp->rows()); } case TypeAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsString(exec, imp->type()); } case ValueAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsString(exec, imp->value()); } case SelectionStartAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsNumber(exec, imp->selectionStart()); } case SelectionEndAttrNum: { HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl()); return jsNumber(exec, imp->selectionEnd()); } case ConstructorAttrNum: return getConstructor(exec); } return 0; }
WebCore::String DOMHTMLTextAreaElement::value() { ASSERT(m_element && m_element->hasTagName(textareaTag)); HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); return textareaElement->value(); }