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: */
|
2012-05-21 15:12:37 +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/. */
|
2011-05-10 16:59:07 +04:00
|
|
|
|
|
|
|
#ifndef nsProgressFrame_h___
|
|
|
|
#define nsProgressFrame_h___
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2011-12-28 00:18:48 +04:00
|
|
|
#include "nsContainerFrame.h"
|
2011-05-10 16:59:07 +04:00
|
|
|
#include "nsIAnonymousContentCreator.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
2016-02-17 23:37:00 +03:00
|
|
|
namespace mozilla {
|
2019-02-19 16:44:33 +03:00
|
|
|
enum class PseudoStyleType : uint8_t;
|
2016-02-17 23:37:00 +03:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2017-04-30 18:30:08 +03:00
|
|
|
class nsProgressFrame final : public nsContainerFrame,
|
|
|
|
public nsIAnonymousContentCreator {
|
2019-02-19 16:44:33 +03:00
|
|
|
typedef mozilla::PseudoStyleType PseudoStyleType;
|
2013-12-03 08:49:03 +04:00
|
|
|
typedef mozilla::dom::Element Element;
|
|
|
|
|
2011-05-10 16:59:07 +04:00
|
|
|
public:
|
|
|
|
NS_DECL_QUERYFRAME
|
2017-05-26 13:11:11 +03:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS(nsProgressFrame)
|
2011-05-10 16:59:07 +04:00
|
|
|
|
2019-02-05 19:45:54 +03:00
|
|
|
explicit nsProgressFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
|
2011-05-10 16:59:07 +04:00
|
|
|
virtual ~nsProgressFrame();
|
|
|
|
|
2017-11-07 03:20:33 +03:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot,
|
|
|
|
PostDestroyData& aPostDestroyData) override;
|
2011-05-10 16:59:07 +04:00
|
|
|
|
2013-02-14 15:12:27 +04:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsDisplayListSet& aLists) override;
|
2011-12-28 00:18:48 +04:00
|
|
|
|
2014-05-13 04:47:52 +04:00
|
|
|
virtual void Reflow(nsPresContext* aCX, ReflowOutput& aDesiredSize,
|
2016-07-21 13:36:39 +03:00
|
|
|
const ReflowInput& aReflowInput,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsReflowStatus& aStatus) override;
|
2011-05-10 16:59:07 +04:00
|
|
|
|
2014-01-06 03:31:14 +04:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const override {
|
2011-05-10 16:59:07 +04:00
|
|
|
return MakeFrameName(NS_LITERAL_STRING("Progress"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// nsIAnonymousContentCreator
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult CreateAnonymousContent(
|
|
|
|
nsTArray<ContentInfo>& aElements) override;
|
2014-07-16 22:41:57 +04:00
|
|
|
virtual void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aFilter) override;
|
2011-05-10 16:59:07 +04:00
|
|
|
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
2015-03-21 19:28:04 +03:00
|
|
|
int32_t aModType) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2014-08-24 18:34:51 +04:00
|
|
|
virtual mozilla::LogicalSize ComputeAutoSize(
|
2017-06-09 22:14:53 +03:00
|
|
|
gfxContext* aRenderingContext, mozilla::WritingMode aWM,
|
2014-08-24 18:34:51 +04:00
|
|
|
const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize,
|
|
|
|
const mozilla::LogicalSize& aMargin, const mozilla::LogicalSize& aBorder,
|
|
|
|
const mozilla::LogicalSize& aPadding, ComputeSizeFlags aFlags) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2017-06-09 22:14:53 +03:00
|
|
|
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
|
|
|
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
2011-12-28 00:18:48 +04:00
|
|
|
return nsContainerFrame::IsFrameOfType(
|
2011-05-10 16:59:07 +04:00
|
|
|
aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
|
|
}
|
|
|
|
|
2011-05-06 14:00:30 +04:00
|
|
|
/**
|
|
|
|
* Returns whether the frame and its child should use the native style.
|
|
|
|
*/
|
|
|
|
bool ShouldUseNativeStyle() const;
|
|
|
|
|
2011-05-10 16:59:07 +04:00
|
|
|
protected:
|
2016-11-29 01:00:20 +03:00
|
|
|
// Helper function to reflow a child frame.
|
|
|
|
void ReflowChildFrame(nsIFrame* aChild, nsPresContext* aPresContext,
|
|
|
|
const ReflowInput& aReflowInput,
|
|
|
|
nsReflowStatus& aStatus);
|
2011-05-10 16:59:07 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The div used to show the progress bar.
|
|
|
|
* @see nsProgressFrame::CreateAnonymousContent
|
|
|
|
*/
|
2013-12-03 08:49:03 +04:00
|
|
|
nsCOMPtr<Element> mBarDiv;
|
2011-05-10 16:59:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|