2014-01-16 06:20:20 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef nsFieldSetFrame_h___
|
|
|
|
#define nsFieldSetFrame_h___
|
|
|
|
|
2014-02-24 18:41:56 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2015-02-10 10:27:40 +03:00
|
|
|
#include "imgIContainer.h"
|
2014-01-16 06:20:20 +04:00
|
|
|
#include "nsContainerFrame.h"
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsFieldSetFrame final : public nsContainerFrame
|
2014-01-16 06:20:20 +04:00
|
|
|
{
|
2015-02-10 10:27:40 +03:00
|
|
|
typedef mozilla::image::DrawResult DrawResult;
|
|
|
|
|
2014-01-16 06:20:20 +04:00
|
|
|
public:
|
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit nsFieldSetFrame(nsStyleContext* aContext);
|
2014-01-16 06:20:20 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
nscoord
|
2014-07-24 21:03:26 +04:00
|
|
|
GetIntrinsicISize(nsRenderingContext* aRenderingContext,
|
|
|
|
nsLayoutUtils::IntrinsicISizeType);
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
|
|
|
|
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override;
|
2014-08-24 18:34:44 +04:00
|
|
|
virtual mozilla::LogicalSize
|
|
|
|
ComputeSize(nsRenderingContext *aRenderingContext,
|
|
|
|
mozilla::WritingMode aWritingMode,
|
|
|
|
const mozilla::LogicalSize& aCBSize,
|
|
|
|
nscoord aAvailableISize,
|
|
|
|
const mozilla::LogicalSize& aMargin,
|
|
|
|
const mozilla::LogicalSize& aBorder,
|
|
|
|
const mozilla::LogicalSize& aPadding,
|
2015-03-21 19:28:04 +03:00
|
|
|
ComputeSizeFlags aFlags) override;
|
|
|
|
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
|
2014-01-16 06:20:20 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The area to paint box-shadows around. It's the border rect except
|
|
|
|
* when there's a <legend> we offset the y-position to the center of it.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsRect VisualBorderRectRelativeToSelf() const override;
|
2014-01-16 06:20:20 +04:00
|
|
|
|
2014-05-13 04:47:52 +04:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsReflowStatus& aStatus) override;
|
2014-01-16 06:20:20 +04:00
|
|
|
|
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsDisplayListSet& aLists) override;
|
2014-01-16 06:20:20 +04:00
|
|
|
|
2015-10-23 05:54:49 +03:00
|
|
|
DrawResult PaintBorderBackground(nsDisplayListBuilder* aBuilder,
|
|
|
|
nsRenderingContext& aRenderingContext,
|
|
|
|
nsPoint aPt, const nsRect& aDirtyRect);
|
2014-01-16 06:20:20 +04:00
|
|
|
|
2014-05-28 23:36:59 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
virtual void SetInitialChildList(ChildListID aListID,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsFrameList& aChildList) override;
|
2014-05-28 23:36:58 +04:00
|
|
|
virtual void AppendFrames(ChildListID aListID,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsFrameList& aFrameList) override;
|
2014-05-28 23:36:58 +04:00
|
|
|
virtual void InsertFrames(ChildListID aListID,
|
2014-05-28 23:36:58 +04:00
|
|
|
nsIFrame* aPrevFrame,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsFrameList& aFrameList) override;
|
2014-05-28 23:36:58 +04:00
|
|
|
virtual void RemoveFrame(ChildListID aListID,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIFrame* aOldFrame) override;
|
2014-05-28 23:36:59 +04:00
|
|
|
#endif
|
2014-01-16 06:20:20 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIAtom* GetType() const override;
|
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const override
|
2014-01-16 06:20:20 +04:00
|
|
|
{
|
|
|
|
return nsContainerFrame::IsFrameOfType(aFlags &
|
|
|
|
~nsIFrame::eCanContainOverflowContainers);
|
|
|
|
}
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIScrollableFrame* GetScrollTargetFrame() override
|
2014-01-16 06:20:20 +04:00
|
|
|
{
|
|
|
|
return do_QueryFrame(GetInner());
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef ACCESSIBILITY
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual mozilla::a11y::AccType AccessibleType() override;
|
2014-01-16 06:20:20 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const override {
|
2014-01-16 06:20:20 +04:00
|
|
|
return MakeFrameName(NS_LITERAL_STRING("FieldSet"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the anonymous frame that contains all descendants except
|
|
|
|
* the legend frame. This is currently always a block frame with
|
|
|
|
* pseudo nsCSSAnonBoxes::fieldsetContent -- this may change in the
|
|
|
|
* future when we add support for CSS overflow for <fieldset>.
|
|
|
|
*/
|
|
|
|
nsIFrame* GetInner() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the frame that represents the legend if any. This may be
|
|
|
|
* a nsLegendFrame or a nsHTMLScrollFrame with the nsLegendFrame as the
|
|
|
|
* scrolled frame (aka content insertion frame).
|
|
|
|
*/
|
|
|
|
nsIFrame* GetLegend() const;
|
|
|
|
|
|
|
|
protected:
|
2015-01-19 14:43:58 +03:00
|
|
|
mozilla::LogicalRect mLegendRect;
|
2014-01-16 06:20:20 +04:00
|
|
|
nscoord mLegendSpace;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsFieldSetFrame_h___
|