2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2014-01-16 06:20:20 +04: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/. */
|
|
|
|
|
|
|
|
#ifndef nsFieldSetFrame_h___
|
|
|
|
#define nsFieldSetFrame_h___
|
|
|
|
|
2014-02-24 18:41:56 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2017-12-11 18:37:59 +03:00
|
|
|
#include "ImgDrawResult.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 {
|
2017-12-11 18:37:59 +03:00
|
|
|
typedef mozilla::image::ImgDrawResult ImgDrawResult;
|
2015-02-10 10:27:40 +03:00
|
|
|
|
2014-01-16 06:20:20 +04:00
|
|
|
public:
|
2017-05-26 13:11:11 +03:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS(nsFieldSetFrame)
|
2014-01-16 06:20:20 +04:00
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
explicit nsFieldSetFrame(ComputedStyle* aStyle);
|
2014-01-16 06:20:20 +04:00
|
|
|
|
2017-06-09 22:14:53 +03:00
|
|
|
nscoord GetIntrinsicISize(gfxContext* aRenderingContext,
|
2014-07-24 21:03:26 +04:00
|
|
|
nsLayoutUtils::IntrinsicISizeType);
|
2017-06-09 22:14:53 +03:00
|
|
|
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
|
|
|
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) 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
|
|
|
|
2017-04-30 18:30:08 +03:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
2016-07-21 13:36:39 +03:00
|
|
|
const ReflowInput& aReflowInput,
|
2017-04-30 18:30:08 +03:00
|
|
|
nsReflowStatus& aStatus) override;
|
|
|
|
|
2017-01-28 04:34:14 +03:00
|
|
|
nscoord GetLogicalBaseline(mozilla::WritingMode aWM) const override;
|
|
|
|
bool GetVerticalAlignBaseline(mozilla::WritingMode aWM,
|
|
|
|
nscoord* aBaseline) const override;
|
|
|
|
bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
|
|
|
|
BaselineSharingGroup aBaselineGroup,
|
|
|
|
nscoord* aBaseline) const override;
|
|
|
|
|
2014-01-16 06:20:20 +04:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsDisplayListSet& aLists) override;
|
2014-01-16 06:20:20 +04:00
|
|
|
|
2017-12-11 18:37:59 +03:00
|
|
|
ImgDrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
|
2017-06-09 22:14:53 +03:00
|
|
|
gfxContext& aRenderingContext, nsPoint aPt,
|
2016-04-28 21:09:06 +03:00
|
|
|
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, 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, 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 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());
|
|
|
|
}
|
|
|
|
|
2017-06-16 12:22:33 +03:00
|
|
|
// Return the block wrapper around our kids.
|
|
|
|
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
2017-03-15 21:00:43 +03:00
|
|
|
|
2017-07-06 15:00:35 +03:00
|
|
|
#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
|
2018-08-15 08:46:39 +03:00
|
|
|
* pseudo nsCSSAnonBoxes::fieldsetContent() -- this may change in the
|
2017-03-15 21:00:43 +03:00
|
|
|
* future when we add support for CSS overflow for <fieldset>. This really
|
|
|
|
* can't return null, though callers seem to feel that it can.
|
2014-01-16 06:20:20 +04:00
|
|
|
*/
|
|
|
|
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___
|