static Element* elementFromCenter(Element& element) { ClientRect* clientRect = element.getBoundingClientRect(); int centerX = static_cast<int>((clientRect->left() + clientRect->right()) / 2); int centerY = static_cast<int>((clientRect->top() + clientRect->bottom()) / 2); return element.document().elementFromPoint(centerX , centerY); }
JSValue jsClientRectRight(ExecState* exec, JSValue slotBase, const Identifier&) { JSClientRect* castedThis = static_cast<JSClientRect*>(asObject(slotBase)); UNUSED_PARAM(exec); ClientRect* imp = static_cast<ClientRect*>(castedThis->impl()); JSValue result = jsNumber(exec, imp->right()); return result; }
static v8::Handle<v8::Value> rightAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.ClientRect.right._get"); ClientRect* imp = V8ClientRect::toNative(info.Holder()); return v8::Number::New(imp->right()); }