static v8::Handle<v8::Value> compactAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.HTMLMenuElement.compact._get"); HTMLMenuElement* imp = V8HTMLMenuElement::toNative(info.Holder()); if (!R_check(imp)) return v8::Handle<v8::Value>(v8::Undefined()); return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::compactAttr)); }
static void compactAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { INC_STATS("DOM.HTMLMenuElement.compact._set"); HTMLMenuElement* imp = V8HTMLMenuElement::toNative(info.Holder()); bool v = value->BooleanValue(); imp->setCompact(v); return; }
void JSHTMLMenuElement::putValueProperty(ExecState* exec, int token, JSValue* value) { switch (token) { case CompactAttrNum: { HTMLMenuElement* imp = static_cast<HTMLMenuElement*>(impl()); imp->setCompact(value->toBoolean(exec)); break; } } }
JSValue* JSHTMLMenuElement::getValueProperty(ExecState* exec, int token) const { switch (token) { case CompactAttrNum: { HTMLMenuElement* imp = static_cast<HTMLMenuElement*>(impl()); return jsBoolean(imp->compact()); } case ConstructorAttrNum: return getConstructor(exec); } return 0; }
void ContextMenuController::populateCustomContextMenu(const Event& event) { if (!RuntimeEnabledFeatures::contextMenuEnabled()) return; Node* node = event.target()->toNode(); if (!node || !node->isHTMLElement()) return; HTMLElement& element = toHTMLElement(*node); HTMLMenuElement* menuElement = element.assignedContextMenu(); if (!menuElement || !equalIgnoringCase(menuElement->fastGetAttribute(typeAttr), "context")) return; RelatedEvent* relatedEvent = RelatedEvent::create(EventTypeNames::show, true, true, node); if (menuElement->dispatchEvent(relatedEvent) != DispatchEventResult::NotCanceled) return; if (menuElement != element.assignedContextMenu()) return; m_menuProvider = CustomContextMenuProvider::create(*menuElement, element); m_menuProvider->populateContextMenu(m_contextMenu.get()); }
static v8::Handle<v8::Value> compactAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.HTMLMenuElement.compact._get"); HTMLMenuElement* imp = V8HTMLMenuElement::toNative(info.Holder()); return v8Boolean(imp->compact()); }