From c65fc9a4e7bbdc4d7083400272e4ee863f8fe3d6 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 25 Apr 2006 19:56:45 +0000 Subject: [PATCH] Give HTMLButtonControlFrames their own frame type. Bug 335419, r+sr=dbaron git-svn-id: svn://10.0.0.236/trunk@195380 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsGkAtomList.h | 1 + mozilla/layout/forms/nsHTMLButtonControlFrame.cpp | 7 +++++++ mozilla/layout/forms/nsHTMLButtonControlFrame.h | 4 +++- mozilla/layout/generic/nsFrame.cpp | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mozilla/content/base/src/nsGkAtomList.h b/mozilla/content/base/src/nsGkAtomList.h index 8d756b47511..44b5608a85b 100755 --- a/mozilla/content/base/src/nsGkAtomList.h +++ b/mozilla/content/base/src/nsGkAtomList.h @@ -1273,6 +1273,7 @@ GK_ATOM(directionalFrame, "DirectionalFrame") GK_ATOM(fieldSetFrame, "FieldSetFrame") GK_ATOM(frameSetFrame, "FrameSetFrame") GK_ATOM(gfxButtonControlFrame, "gfxButtonControlFrame") +GK_ATOM(HTMLButtonControlFrame, "HTMLButtonControlFrame") GK_ATOM(HTMLCanvasFrame, "HTMLCanvasFrame") GK_ATOM(subDocumentFrame, "subDocumentFrame") GK_ATOM(imageBoxFrame, "ImageBoxFrame") diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index aa92a9f4253..356bf0e0331 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -71,6 +71,7 @@ #include "nsIAccessibilityService.h" #endif #include "nsDisplayList.h" +#include "nsLayoutAtoms.h" nsIFrame* NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) @@ -155,6 +156,12 @@ NS_IMETHODIMP nsHTMLButtonControlFrame::GetAccessible(nsIAccessible** aAccessibl } #endif +nsIAtom* +nsHTMLButtonControlFrame::GetType() const +{ + return nsLayoutAtoms::HTMLButtonControlFrame; +} + PRBool nsHTMLButtonControlFrame::IsReset(PRInt32 type) { diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.h b/mozilla/layout/forms/nsHTMLButtonControlFrame.h index fe41304779d..4ffd7bb2980 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.h +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.h @@ -105,9 +105,11 @@ public: NS_IMETHOD GetAccessible(nsIAccessible** aAccessible); #endif + virtual nsIAtom* GetType() const; + #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const { - return MakeFrameName(NS_LITERAL_STRING("ButtonControl"), aResult); + return MakeFrameName(NS_LITERAL_STRING("HTMLButtonControl"), aResult); } #endif diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index d2352001567..5f8732d21d9 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -6588,6 +6588,7 @@ void DR_State::InitFrameTypeTable() AddFrameTypeInfo(nsLayoutAtoms::brFrame, "br", "br"); AddFrameTypeInfo(nsLayoutAtoms::bulletFrame, "bullet", "bullet"); AddFrameTypeInfo(nsLayoutAtoms::gfxButtonControlFrame, "button", "gfxButtonControl"); + AddFrameTypeInfo(nsLayoutAtoms::HTMLButtonControlFrame, "HTMLbutton", "HTMLButtonControl"); AddFrameTypeInfo(nsLayoutAtoms::HTMLCanvasFrame, "HTMLCanvas","HTMLCanvas"); AddFrameTypeInfo(nsLayoutAtoms::subDocumentFrame, "subdoc", "subDocument"); AddFrameTypeInfo(nsLayoutAtoms::imageFrame, "img", "image");