Bug 1335337 - Restrict special <button type="menu"> theming to XUL <button> elements. r=Enn
authorMarkus Stange <mstange@themasta.com>
Fri, 10 Feb 2017 13:20:19 -0500
changeset 342661 370de9349dd0c822e4361cd36e6150b8bd5ec229
parent 342609 7a0bdc9f6c1d118c3274157dc6359d50b7aca4e3
child 342662 45dd83a63162363fe69af8e65e8a79b24827ce38
push id31360
push usercbook@mozilla.com
push dateTue, 14 Feb 2017 12:38:32 +0000
treeherdermozilla-central@47391e531350 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEnn
bugs1335337
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1335337 - Restrict special <button type="menu"> theming to XUL <button> elements. r=Enn MozReview-Commit-ID: 8qqsQMroTS
widget/nsNativeTheme.cpp
--- a/widget/nsNativeTheme.cpp
+++ b/widget/nsNativeTheme.cpp
@@ -219,17 +219,18 @@ nsNativeTheme::GetCheckedOrSelected(nsIF
 
 bool
 nsNativeTheme::IsButtonTypeMenu(nsIFrame* aFrame)
 {
   if (!aFrame)
     return false;
 
   nsIContent* content = aFrame->GetContent();
-  return content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+  return content->IsXULElement(nsGkAtoms::button) &&
+         content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                               NS_LITERAL_STRING("menu"), eCaseMatters);
 }
 
 bool
 nsNativeTheme::IsPressedButton(nsIFrame* aFrame)
 {
   EventStates eventState = GetContentState(aFrame, NS_THEME_TOOLBARBUTTON);
   if (IsDisabled(aFrame, eventState))