static bool getElementImpl(NPObject* object, WebElement* webElement, v8::Isolate* isolate) { if (!object) return false; V8NPObject* v8NPObject = npObjectToV8NPObject(object); if (!v8NPObject) return false; v8::HandleScope handleScope(isolate); v8::Handle<v8::Object> v8Object = v8::Local<v8::Object>::New(isolate, v8NPObject->v8Object); if (v8Object.IsEmpty()) return false; Element* native = V8Element::hasInstance(v8Object, isolate) ? V8Element::toNative(v8Object) : 0; if (!native) return false; *webElement = WebElement(native); return true; }
WebElement WebNode::rootEditableElement() const { return WebElement(m_private->rootEditableElement()); }
WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) const { return WebElement(m_private->querySelector(tag, ec)); }
WebElement WebDocument::getElementById(const WebString& id) const { return WebElement(constUnwrap<Document>()->getElementById(id)); }
WebElement WebDocument::head() { return WebElement(unwrap<Document>()->head()); }
WebElement WebDocument::body() const { return WebElement(constUnwrap<Document>()->body()); }
WebElement WebDocument::documentElement() const { return WebElement(constUnwrap<Document>()->documentElement()); }
WebElement WebDocument::focusedElement() const { return WebElement(constUnwrap<Document>()->focusedElement()); }
WebElement WebLabelElement::correspondingControl() { return WebElement(unwrap<HTMLLabelElement>()->control()); }
WebElement WebDocument::fullScreenElement() const { Element* fullScreenElement = 0; fullScreenElement = constUnwrap<Document>()->webkitCurrentFullScreenElement(); return WebElement(fullScreenElement); }
WebElement WebHitTestResult::urlElement() const { return WebElement(m_private->URLElement()); }
WebElement WebElementTest::testElement() { Element* element = document().getElementById("testElement"); ASSERT(element); return WebElement(element); }