2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
#ifndef nsHTMLButtonControlFrame_h___
|
|
|
|
#define nsHTMLButtonControlFrame_h___
|
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2011-12-27 20:18:48 +00:00
|
|
|
#include "nsContainerFrame.h"
|
1999-04-21 22:46:15 +00:00
|
|
|
#include "nsIFormControlFrame.h"
|
|
|
|
#include "nsButtonFrameRenderer.h"
|
|
|
|
|
2011-04-08 01:04:40 +00:00
|
|
|
class nsRenderingContext;
|
2010-04-10 20:10:12 +00:00
|
|
|
class nsPresContext;
|
2004-10-14 18:48:42 +00:00
|
|
|
|
2011-12-27 20:18:48 +00:00
|
|
|
class nsHTMLButtonControlFrame : public nsContainerFrame,
|
1999-04-21 22:46:15 +00:00
|
|
|
public nsIFormControlFrame
|
|
|
|
{
|
|
|
|
public:
|
2014-09-01 03:36:37 +00:00
|
|
|
explicit nsHTMLButtonControlFrame(nsStyleContext* aContext);
|
1999-11-04 23:16:47 +00:00
|
|
|
~nsHTMLButtonControlFrame();
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2013-02-14 11:12:27 +00:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
2015-03-21 16:28:04 +00:00
|
|
|
const nsDisplayListSet& aLists) override;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
2014-05-13 00:47:52 +00:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsReflowStatus& aStatus) override;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2014-02-18 07:47:48 +00:00
|
|
|
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
2014-02-18 08:36:33 +00:00
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsEventStatus* aEventStatus) override;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2014-05-24 22:20:40 +00:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsContainerFrame* aParent,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIFrame* aPrevInFlow) override;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsStyleContext* GetAdditionalStyleContext(int32_t aIndex) const override;
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual void SetAdditionalStyleContext(int32_t aIndex,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsStyleContext* aStyleContext) override;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2014-05-28 19:36:59 +00:00
|
|
|
#ifdef DEBUG
|
2014-05-28 19:36:58 +00:00
|
|
|
virtual void AppendFrames(ChildListID aListID,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsFrameList& aFrameList) override;
|
2014-05-28 19:36:58 +00:00
|
|
|
virtual void InsertFrames(ChildListID aListID,
|
2014-05-28 19:36:58 +00:00
|
|
|
nsIFrame* aPrevFrame,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsFrameList& aFrameList) override;
|
2014-05-28 19:36:58 +00:00
|
|
|
virtual void RemoveFrame(ChildListID aListID,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIFrame* aOldFrame) override;
|
2014-05-28 19:36:59 +00:00
|
|
|
#endif
|
2003-11-18 02:12:24 +00:00
|
|
|
|
2001-08-17 03:13:07 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual mozilla::a11y::AccType AccessibleType() override;
|
2001-08-17 03:13:07 +00:00
|
|
|
#endif
|
2001-05-17 23:52:32 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsIAtom* GetType() const override;
|
2006-04-25 19:56:45 +00:00
|
|
|
|
2014-01-05 23:31:14 +00:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const override {
|
2006-04-25 19:56:45 +00:00
|
|
|
return MakeFrameName(NS_LITERAL_STRING("HTMLButtonControl"), aResult);
|
1999-04-21 22:46:15 +00:00
|
|
|
}
|
1999-11-01 22:12:45 +00:00
|
|
|
#endif
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool HonorPrintBackgroundSettings() override { return false; }
|
2009-05-28 05:01:42 +00:00
|
|
|
|
2002-09-16 06:23:52 +00:00
|
|
|
// nsIFormControlFrame
|
2015-03-21 16:28:04 +00:00
|
|
|
void SetFocus(bool aOn, bool aRepaint) override;
|
|
|
|
virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue) override;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2005-03-07 19:08:26 +00:00
|
|
|
// Inserted child content gets its frames parented by our child block
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual nsContainerFrame* GetContentInsertionFrame() override {
|
2016-01-29 14:42:14 +00:00
|
|
|
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
|
2005-03-07 19:08:26 +00:00
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const override
|
2007-02-24 18:33:33 +00:00
|
|
|
{
|
2011-12-27 20:18:48 +00:00
|
|
|
return nsContainerFrame::IsFrameOfType(aFlags &
|
2007-02-24 18:33:33 +00:00
|
|
|
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
|
|
}
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
1999-04-21 22:46:15 +00:00
|
|
|
protected:
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool IsInput() { return false; }
|
2013-09-27 06:43:16 +00:00
|
|
|
// Reflows the button's sole child frame, and computes the desired size
|
|
|
|
// of the button itself from the results.
|
2004-07-31 23:15:21 +00:00
|
|
|
void ReflowButtonContents(nsPresContext* aPresContext,
|
2013-09-27 06:43:16 +00:00
|
|
|
nsHTMLReflowMetrics& aButtonDesiredSize,
|
2013-09-27 06:43:15 +00:00
|
|
|
const nsHTMLReflowState& aButtonReflowState,
|
2013-09-27 06:43:16 +00:00
|
|
|
nsIFrame* aFirstKid);
|
2006-01-13 07:58:12 +00:00
|
|
|
|
1999-04-21 22:46:15 +00:00
|
|
|
nsButtonFrameRenderer mRenderer;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|