Bug 1316661 part 4. Eliminate IsCallerChrome callers in HTMLMenuElement. r=smaug
This commit is contained in:
@@ -58,7 +58,7 @@ HTMLMenuElement::~HTMLMenuElement()
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED(HTMLMenuElement, nsGenericHTMLElement,
|
||||
nsIDOMHTMLMenuElement, nsIHTMLMenu)
|
||||
nsIDOMHTMLMenuElement)
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(HTMLMenuElement)
|
||||
|
||||
@@ -68,14 +68,12 @@ NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLMenuElement, Type, type,
|
||||
NS_IMPL_STRING_ATTR(HTMLMenuElement, Label, label)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
HTMLMenuElement::SendShowEvent()
|
||||
{
|
||||
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
|
||||
|
||||
nsCOMPtr<nsIDocument> document = GetComposedDoc();
|
||||
if (!document) {
|
||||
return NS_ERROR_FAILURE;
|
||||
return;
|
||||
}
|
||||
|
||||
WidgetEvent event(true, eShow);
|
||||
@@ -84,25 +82,13 @@ HTMLMenuElement::SendShowEvent()
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell = document->GetShell();
|
||||
if (!shell) {
|
||||
return NS_ERROR_FAILURE;
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<nsPresContext> presContext = shell->GetPresContext();
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
EventDispatcher::Dispatch(static_cast<nsIContent*>(this), presContext,
|
||||
&event, nullptr, &status);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLMenuElement::CreateBuilder(nsIMenuBuilder** _retval)
|
||||
{
|
||||
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
|
||||
|
||||
nsCOMPtr<nsIMenuBuilder> builder = CreateBuilder();
|
||||
builder.swap(*_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIMenuBuilder>
|
||||
@@ -117,18 +103,14 @@ HTMLMenuElement::CreateBuilder()
|
||||
return builder.forget();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
HTMLMenuElement::Build(nsIMenuBuilder* aBuilder)
|
||||
{
|
||||
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
|
||||
|
||||
if (!aBuilder) {
|
||||
return NS_OK;
|
||||
return;
|
||||
}
|
||||
|
||||
BuildSubmenu(EmptyString(), this, aBuilder);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user